6 Commits

Author SHA1 Message Date
b9d4d7214c Merge branch 'main' of https://egit.irs.uni-stuttgart.de/rust/va108xx-hal
Some checks failed
Rust/va108xx-hal/pipeline/head There was a failure building this commit
2021-12-16 11:26:53 +01:00
0bc7e0f341 new blinky example, cargo.toml update 2021-12-16 11:26:26 +01:00
59463fbaba try without use-cross in CI
All checks were successful
Rust/va108xx-hal/pipeline/head This commit looks good
2021-12-13 00:04:09 +01:00
439e1d43e7 update link 2021-12-12 23:51:47 +01:00
2abf35bb6e simplified ci files
All checks were successful
Rust/va108xx-hal/pipeline/head This commit looks good
2021-12-12 23:49:44 +01:00
a1c0fb90e0 update example link
All checks were successful
Rust/va108xx-hal/pipeline/head This commit looks good
2021-12-12 23:04:21 +01:00
5 changed files with 58 additions and 9 deletions

View File

@@ -16,14 +16,11 @@ jobs:
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: check
args: --target thumbv6m-none-eabi
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: check
args: --examples --target thumbv6m-none-eabi
args: --examples
fmt:
name: Rustfmt
@@ -55,9 +52,8 @@ jobs:
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: clippy
args: --target thumbv6m-none-eabi -- -D warnings
args: -- -D warnings
ci:
if: ${{ success() }}

View File

@@ -36,10 +36,15 @@ debug = true
lto = false
[profile.release]
lto = true
# Problematic because RTT won't work
lto = false
debug = true
opt-level = "s"
[profile.release-lto]
inherits = "release"
lto = true
[[example]]
name = "timer-ticks"
required-features = ["rt"]

View File

@@ -85,4 +85,4 @@ is contained within the
7. Flashing the board might work differently for different boards and there is usually
more than one way. You can find example instructions for the REB1 development board
[here](https://github.com/robamu-org/vorago-reb1-rs).
[here](https://egit.irs.uni-stuttgart.de/rust/vorago-reb1).

48
examples/blinky-pac.rs Normal file
View File

@@ -0,0 +1,48 @@
//! Blinky examples using only the PAC
//!
//! Additional note on LEDs:
//! Pulling the GPIOs low makes the LEDs blink. See REB1
//! schematic for more details.
#![no_main]
#![no_std]
use cortex_m_rt::entry;
use panic_halt as _;
use va108xx as pac;
// REB LED pin definitions. All on port A
const LED_D2: u32 = 1 << 10;
const LED_D3: u32 = 1 << 7;
const LED_D4: u32 = 1 << 6;
#[entry]
fn main() -> ! {
let dp = pac::Peripherals::take().unwrap();
// Enable all peripheral clocks
dp.SYSCONFIG
.peripheral_clk_enable
.modify(|_, w| unsafe { w.bits(0xffffffff) });
dp.PORTA
.dir()
.modify(|_, w| unsafe { w.bits(LED_D2 | LED_D3 | LED_D4) });
dp.PORTA
.datamask()
.modify(|_, w| unsafe { w.bits(LED_D2 | LED_D3 | LED_D4) });
for _ in 0..10 {
dp.PORTA
.clrout()
.write(|w| unsafe { w.bits(LED_D2 | LED_D3 | LED_D4) });
cortex_m::asm::delay(5_000_000);
dp.PORTA
.setout()
.write(|w| unsafe { w.bits(LED_D2 | LED_D3 | LED_D4) });
cortex_m::asm::delay(5_000_000);
}
loop {
dp.PORTA
.togout()
.write(|w| unsafe { w.bits(LED_D2 | LED_D3 | LED_D4) });
cortex_m::asm::delay(25_000_000);
}
}

View File

@@ -2,7 +2,7 @@
//!
//! ## Examples
//!
//! - [REB1 I2C temperature sensor example](https://github.com/robamu-org/vorago-reb1-rs/blob/main/examples/temp-sensor.rs)
//! - [REB1 I2C temperature sensor example](https://egit.irs.uni-stuttgart.de/rust/vorago-reb1/src/branch/main/examples/adt75-temp-sensor.rs)
use crate::{
clock::{enable_peripheral_clock, PeripheralClocks},
pac::{I2CA, I2CB, SYSCONFIG},