aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32l0
diff options
context:
space:
mode:
authorThales Fragoso <[email protected]>2021-06-25 17:32:24 -0300
committerThales Fragoso <[email protected]>2021-06-25 18:16:43 -0300
commit0eaadfc1253285c04340e32f14efa1133cb30dbe (patch)
treeb84c3ac128e1126f9b9c4a7b31f236b46ed8f172 /examples/stm32l0
parenta3f0aa02a4cf12df9ce7b7bda02a56b74bf028ab (diff)
stm32: Update gpio examples
Diffstat (limited to 'examples/stm32l0')
-rw-r--r--examples/stm32l0/src/bin/blinky.rs4
-rw-r--r--examples/stm32l0/src/bin/button.rs6
-rw-r--r--examples/stm32l0/src/bin/spi.rs4
3 files changed, 7 insertions, 7 deletions
diff --git a/examples/stm32l0/src/bin/blinky.rs b/examples/stm32l0/src/bin/blinky.rs
index ab0a2bdb2..833c14fbf 100644
--- a/examples/stm32l0/src/bin/blinky.rs
+++ b/examples/stm32l0/src/bin/blinky.rs
@@ -9,7 +9,7 @@
9#[path = "../example_common.rs"] 9#[path = "../example_common.rs"]
10mod example_common; 10mod example_common;
11use embassy_stm32::{ 11use embassy_stm32::{
12 gpio::{Level, Output}, 12 gpio::{Level, Output, Speed},
13 rcc::*, 13 rcc::*,
14}; 14};
15use embedded_hal::digital::v2::OutputPin; 15use embedded_hal::digital::v2::OutputPin;
@@ -25,7 +25,7 @@ fn main() -> ! {
25 25
26 Rcc::new(p.RCC).enable_debug_wfe(&mut p.DBGMCU, true); 26 Rcc::new(p.RCC).enable_debug_wfe(&mut p.DBGMCU, true);
27 27
28 let mut led = Output::new(p.PB5, Level::High); 28 let mut led = Output::new(p.PB5, Level::High, Speed::Low);
29 29
30 loop { 30 loop {
31 info!("high"); 31 info!("high");
diff --git a/examples/stm32l0/src/bin/button.rs b/examples/stm32l0/src/bin/button.rs
index 04c48112a..5f46ec794 100644
--- a/examples/stm32l0/src/bin/button.rs
+++ b/examples/stm32l0/src/bin/button.rs
@@ -9,7 +9,7 @@
9#[path = "../example_common.rs"] 9#[path = "../example_common.rs"]
10mod example_common; 10mod example_common;
11use embassy_stm32::{ 11use embassy_stm32::{
12 gpio::{Input, Level, Output, Pull}, 12 gpio::{Input, Level, Output, Pull, Speed},
13 rcc::*, 13 rcc::*,
14}; 14};
15use embedded_hal::digital::v2::{InputPin, OutputPin}; 15use embedded_hal::digital::v2::{InputPin, OutputPin};
@@ -25,8 +25,8 @@ fn main() -> ! {
25 Rcc::new(p.RCC).enable_debug_wfe(&mut p.DBGMCU, true); 25 Rcc::new(p.RCC).enable_debug_wfe(&mut p.DBGMCU, true);
26 26
27 let button = Input::new(p.PB2, Pull::Up); 27 let button = Input::new(p.PB2, Pull::Up);
28 let mut led1 = Output::new(p.PA5, Level::High); 28 let mut led1 = Output::new(p.PA5, Level::High, Speed::Low);
29 let mut led2 = Output::new(p.PB5, Level::High); 29 let mut led2 = Output::new(p.PB5, Level::High, Speed::Low);
30 30
31 loop { 31 loop {
32 if button.is_high().unwrap() { 32 if button.is_high().unwrap() {
diff --git a/examples/stm32l0/src/bin/spi.rs b/examples/stm32l0/src/bin/spi.rs
index 0e828c436..9bb9b741e 100644
--- a/examples/stm32l0/src/bin/spi.rs
+++ b/examples/stm32l0/src/bin/spi.rs
@@ -9,7 +9,7 @@
9#[path = "../example_common.rs"] 9#[path = "../example_common.rs"]
10mod example_common; 10mod example_common;
11 11
12use embassy_stm32::gpio::{Level, Output}; 12use embassy_stm32::gpio::{Level, Output, Speed};
13use embedded_hal::digital::v2::OutputPin; 13use embedded_hal::digital::v2::OutputPin;
14use example_common::*; 14use example_common::*;
15 15
@@ -36,7 +36,7 @@ fn main() -> ! {
36 Config::default(), 36 Config::default(),
37 ); 37 );
38 38
39 let mut cs = Output::new(p.PA15, Level::High); 39 let mut cs = Output::new(p.PA15, Level::High, Speed::VeryHigh);
40 40
41 loop { 41 loop {
42 let mut buf = [0x0A; 4]; 42 let mut buf = [0x0A; 4];