aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32l4/src
diff options
context:
space:
mode:
authorDario Nieuwenhuis <[email protected]>2024-01-09 23:58:26 +0100
committerDario Nieuwenhuis <[email protected]>2024-01-10 00:00:10 +0100
commit495b8b739aaba3d1fe7e105559c830496fabb1d7 (patch)
tree6cc6597e9dfa6ac75736ebd4be4a63ca4b546771 /examples/stm32l4/src
parent67ed134479886023ec133a3a95074972e6d83236 (diff)
Change GPIO inherent methods back to `&self`.
With the embedded-hal rc3 update I changed them to require `&mut self`, but in retrospect I think `&self` is better, for extra flexibility. This PR reverts the changes from the rc3 update to inherent methods.
Diffstat (limited to 'examples/stm32l4/src')
-rw-r--r--examples/stm32l4/src/bin/button.rs2
-rw-r--r--examples/stm32l4/src/bin/spe_adin1110_http_server.rs8
-rw-r--r--examples/stm32l4/src/bin/spi_blocking_async.rs2
-rw-r--r--examples/stm32l4/src/bin/spi_dma.rs2
4 files changed, 7 insertions, 7 deletions
diff --git a/examples/stm32l4/src/bin/button.rs b/examples/stm32l4/src/bin/button.rs
index 15288c61e..1f3270214 100644
--- a/examples/stm32l4/src/bin/button.rs
+++ b/examples/stm32l4/src/bin/button.rs
@@ -11,7 +11,7 @@ fn main() -> ! {
11 11
12 let p = embassy_stm32::init(Default::default()); 12 let p = embassy_stm32::init(Default::default());
13 13
14 let mut button = Input::new(p.PC13, Pull::Up); 14 let button = Input::new(p.PC13, Pull::Up);
15 15
16 loop { 16 loop {
17 if button.is_high() { 17 if button.is_high() {
diff --git a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs
index 9565ae168..5b4cdfe5e 100644
--- a/examples/stm32l4/src/bin/spe_adin1110_http_server.rs
+++ b/examples/stm32l4/src/bin/spe_adin1110_http_server.rs
@@ -111,8 +111,8 @@ async fn main(spawner: Spawner) {
111 let led_uc4_blue = Output::new(dp.PG15, Level::High, Speed::Low); 111 let led_uc4_blue = Output::new(dp.PG15, Level::High, Speed::Low);
112 112
113 // Read the uc_cfg switches 113 // Read the uc_cfg switches
114 let mut uc_cfg0 = Input::new(dp.PB2, Pull::None); 114 let uc_cfg0 = Input::new(dp.PB2, Pull::None);
115 let mut uc_cfg1 = Input::new(dp.PF11, Pull::None); 115 let uc_cfg1 = Input::new(dp.PF11, Pull::None);
116 let _uc_cfg2 = Input::new(dp.PG6, Pull::None); 116 let _uc_cfg2 = Input::new(dp.PG6, Pull::None);
117 let _uc_cfg3 = Input::new(dp.PG11, Pull::None); 117 let _uc_cfg3 = Input::new(dp.PG11, Pull::None);
118 118
@@ -130,8 +130,8 @@ async fn main(spawner: Spawner) {
130 130
131 // Setup IO and SPI for the SPE chip 131 // Setup IO and SPI for the SPE chip
132 let spe_reset_n = Output::new(dp.PC7, Level::Low, Speed::Low); 132 let spe_reset_n = Output::new(dp.PC7, Level::Low, Speed::Low);
133 let mut spe_cfg0 = Input::new(dp.PC8, Pull::None); 133 let spe_cfg0 = Input::new(dp.PC8, Pull::None);
134 let mut spe_cfg1 = Input::new(dp.PC9, Pull::None); 134 let spe_cfg1 = Input::new(dp.PC9, Pull::None);
135 let _spe_ts_capt = Output::new(dp.PC6, Level::Low, Speed::Low); 135 let _spe_ts_capt = Output::new(dp.PC6, Level::Low, Speed::Low);
136 136
137 let spe_int = Input::new(dp.PB11, Pull::None); 137 let spe_int = Input::new(dp.PB11, Pull::None);
diff --git a/examples/stm32l4/src/bin/spi_blocking_async.rs b/examples/stm32l4/src/bin/spi_blocking_async.rs
index a989a5a4a..68dbb70ad 100644
--- a/examples/stm32l4/src/bin/spi_blocking_async.rs
+++ b/examples/stm32l4/src/bin/spi_blocking_async.rs
@@ -29,7 +29,7 @@ async fn main(_spawner: Spawner) {
29 let _wake = Output::new(p.PB13, Level::Low, Speed::VeryHigh); 29 let _wake = Output::new(p.PB13, Level::Low, Speed::VeryHigh);
30 let mut reset = Output::new(p.PE8, Level::Low, Speed::VeryHigh); 30 let mut reset = Output::new(p.PE8, Level::Low, Speed::VeryHigh);
31 let mut cs = Output::new(p.PE0, Level::High, Speed::VeryHigh); 31 let mut cs = Output::new(p.PE0, Level::High, Speed::VeryHigh);
32 let mut ready = Input::new(p.PE1, Pull::Up); 32 let ready = Input::new(p.PE1, Pull::Up);
33 33
34 cortex_m::asm::delay(100_000); 34 cortex_m::asm::delay(100_000);
35 reset.set_high(); 35 reset.set_high();
diff --git a/examples/stm32l4/src/bin/spi_dma.rs b/examples/stm32l4/src/bin/spi_dma.rs
index 7922165df..946a759b1 100644
--- a/examples/stm32l4/src/bin/spi_dma.rs
+++ b/examples/stm32l4/src/bin/spi_dma.rs
@@ -24,7 +24,7 @@ async fn main(_spawner: Spawner) {
24 let _wake = Output::new(p.PB13, Level::Low, Speed::VeryHigh); 24 let _wake = Output::new(p.PB13, Level::Low, Speed::VeryHigh);
25 let mut reset = Output::new(p.PE8, Level::Low, Speed::VeryHigh); 25 let mut reset = Output::new(p.PE8, Level::Low, Speed::VeryHigh);
26 let mut cs = Output::new(p.PE0, Level::High, Speed::VeryHigh); 26 let mut cs = Output::new(p.PE0, Level::High, Speed::VeryHigh);
27 let mut ready = Input::new(p.PE1, Pull::Up); 27 let ready = Input::new(p.PE1, Pull::Up);
28 28
29 cortex_m::asm::delay(100_000); 29 cortex_m::asm::delay(100_000);
30 reset.set_high(); 30 reset.set_high();