aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob McWhirter <[email protected]>2021-05-06 09:20:09 -0400
committerBob McWhirter <[email protected]>2021-05-06 09:20:20 -0400
commit1eb70a7e5d8157041e28caf2c176ac4dde78e4c2 (patch)
tree2f9628bceb63f88a007e28e9f6c826950b84d514
parent386e4bf0de6369a3338f56877a779e1e05b4dcc2 (diff)
Checkpoint.
-rw-r--r--embassy-stm32-examples/.cargo/config8
-rw-r--r--embassy-stm32-examples/Cargo.toml6
-rw-r--r--embassy-stm32-examples/src/bin/blinky.rs23
-rw-r--r--embassy-stm32-examples/src/bin/button_exti.rs24
4 files changed, 35 insertions, 26 deletions
diff --git a/embassy-stm32-examples/.cargo/config b/embassy-stm32-examples/.cargo/config
index 7c1d4dfb6..8713fbae9 100644
--- a/embassy-stm32-examples/.cargo/config
+++ b/embassy-stm32-examples/.cargo/config
@@ -1,5 +1,8 @@
1[target.'cfg(all(target_arch = "arm", target_os = "none"))'] 1[target.'cfg(all(target_arch = "arm", target_os = "none"))']
2runner = "probe-run --chip STM32F401CCUx" 2#runner = "probe-run --chip STM32F401CCUx"
3#runner = "probe-run --chip STM32L4S5VITx"
4#runner = "probe-run --chip ${PROBE_RUN_CHIP}"
5runner = "probe-run"
3 6
4rustflags = [ 7rustflags = [
5 # LLD (shipped with the Rust toolchain) is used as the default linker 8 # LLD (shipped with the Rust toolchain) is used as the default linker
@@ -25,4 +28,5 @@ rustflags = [
25] 28]
26 29
27[build] 30[build]
28target = "thumbv7em-none-eabihf" 31#target = "thumbv7em-none-eabihf"
32target = "thumbv7em-none-eabi"
diff --git a/embassy-stm32-examples/Cargo.toml b/embassy-stm32-examples/Cargo.toml
index ab6fc6c14..dbc537381 100644
--- a/embassy-stm32-examples/Cargo.toml
+++ b/embassy-stm32-examples/Cargo.toml
@@ -18,9 +18,11 @@ defmt-error = []
18[dependencies] 18[dependencies]
19embassy = { version = "0.1.0", path = "../embassy", features = ["defmt", "defmt-trace"] } 19embassy = { version = "0.1.0", path = "../embassy", features = ["defmt", "defmt-trace"] }
20embassy-traits = { version = "0.1.0", path = "../embassy-traits", features = ["defmt"] } 20embassy-traits = { version = "0.1.0", path = "../embassy-traits", features = ["defmt"] }
21embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", features = ["defmt", "defmt-trace", "stm32f429zi"] } 21#embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", features = ["defmt", "defmt-trace", "stm32f429zi"] }
22embassy-stm32 = { version = "0.1.0", path = "../embassy-stm32", features = ["defmt", "defmt-trace", "stm32l4s5vi"] }
22embassy-extras = {version = "0.1.0", path = "../embassy-extras" } 23embassy-extras = {version = "0.1.0", path = "../embassy-extras" }
23stm32f4 = { version = "0.13", features = ["stm32f429"] } 24#stm32f4 = { version = "0.13", features = ["stm32f429"] }
25stm32l4 = { version = "0.13", features = ["stm32l4x5" ] }
24 26
25defmt = "0.2.0" 27defmt = "0.2.0"
26defmt-rtt = "0.2.0" 28defmt-rtt = "0.2.0"
diff --git a/embassy-stm32-examples/src/bin/blinky.rs b/embassy-stm32-examples/src/bin/blinky.rs
index 9ccd6c01e..deee52368 100644
--- a/embassy-stm32-examples/src/bin/blinky.rs
+++ b/embassy-stm32-examples/src/bin/blinky.rs
@@ -12,7 +12,8 @@ use embedded_hal::digital::v2::OutputPin;
12use example_common::*; 12use example_common::*;
13 13
14use cortex_m_rt::entry; 14use cortex_m_rt::entry;
15use stm32f4::stm32f429 as pac; 15//use stm32f4::stm32f429 as pac;
16use stm32l4::stm32l4x5 as pac;
16 17
17#[entry] 18#[entry]
18fn main() -> ! { 19fn main() -> ! {
@@ -25,21 +26,21 @@ fn main() -> ! {
25 w.dbg_standby().set_bit(); 26 w.dbg_standby().set_bit();
26 w.dbg_stop().set_bit() 27 w.dbg_stop().set_bit()
27 }); 28 });
28 pp.RCC.ahb1enr.modify(|_, w| w.dma1en().enabled()); 29 pp.RCC.ahb1enr.modify(|_, w| w.dma1en().set_bit());
29 30
30 pp.RCC.ahb1enr.modify(|_, w| { 31 pp.RCC.ahb2enr.modify(|_, w| {
31 w.gpioaen().enabled(); 32 w.gpioaen().set_bit();
32 w.gpioben().enabled(); 33 w.gpioben().set_bit();
33 w.gpiocen().enabled(); 34 w.gpiocen().set_bit();
34 w.gpioden().enabled(); 35 w.gpioden().set_bit();
35 w.gpioeen().enabled(); 36 w.gpioeen().set_bit();
36 w.gpiofen().enabled(); 37 w.gpiofen().set_bit();
37 w 38 w
38 }); 39 });
39 40
40 let p = embassy_stm32::init(Default::default()); 41 let p = embassy_stm32::init(Default::default());
41 42
42 let mut led = Output::new(p.PB7, Level::High); 43 let mut led = Output::new(p.PA5, Level::High);
43 44
44 loop { 45 loop {
45 info!("high"); 46 info!("high");
diff --git a/embassy-stm32-examples/src/bin/button_exti.rs b/embassy-stm32-examples/src/bin/button_exti.rs
index d6f545fa4..6b7acdca0 100644
--- a/embassy-stm32-examples/src/bin/button_exti.rs
+++ b/embassy-stm32-examples/src/bin/button_exti.rs
@@ -16,7 +16,8 @@ use embassy_traits::gpio::{WaitForFallingEdge, WaitForRisingEdge};
16use example_common::*; 16use example_common::*;
17 17
18use cortex_m_rt::entry; 18use cortex_m_rt::entry;
19use stm32f4::stm32f429 as pac; 19//use stm32f4::stm32f429 as pac;
20use stm32l4::stm32l4x5 as pac;
20 21
21#[embassy::task] 22#[embassy::task]
22async fn main_task() { 23async fn main_task() {
@@ -56,19 +57,20 @@ fn main() -> ! {
56 w.dbg_standby().set_bit(); 57 w.dbg_standby().set_bit();
57 w.dbg_stop().set_bit() 58 w.dbg_stop().set_bit()
58 }); 59 });
59 pp.RCC.ahb1enr.modify(|_, w| w.dma1en().enabled()); 60
60 61 pp.RCC.ahb1enr.modify(|_, w| w.dma1en().set_bit());
61 pp.RCC.ahb1enr.modify(|_, w| { 62
62 w.gpioaen().enabled(); 63 pp.RCC.ahb2enr.modify(|_, w| {
63 w.gpioben().enabled(); 64 w.gpioaen().set_bit();
64 w.gpiocen().enabled(); 65 w.gpioben().set_bit();
65 w.gpioden().enabled(); 66 w.gpiocen().set_bit();
66 w.gpioeen().enabled(); 67 w.gpioden().set_bit();
67 w.gpiofen().enabled(); 68 w.gpioeen().set_bit();
69 w.gpiofen().set_bit();
68 w 70 w
69 }); 71 });
70 pp.RCC.apb2enr.modify(|_, w| { 72 pp.RCC.apb2enr.modify(|_, w| {
71 w.syscfgen().enabled(); 73 w.syscfgen().set_bit();
72 w 74 w
73 }); 75 });
74 76