aboutsummaryrefslogtreecommitdiff
path: root/examples
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
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')
-rw-r--r--examples/rp/src/bin/button.rs2
-rw-r--r--examples/stm32c0/src/bin/button.rs2
-rw-r--r--examples/stm32f3/src/bin/button.rs2
-rw-r--r--examples/stm32f4/src/bin/button.rs2
-rw-r--r--examples/stm32f7/src/bin/button.rs2
-rw-r--r--examples/stm32g0/src/bin/button.rs2
-rw-r--r--examples/stm32g4/src/bin/button.rs2
-rw-r--r--examples/stm32l0/src/bin/button.rs2
-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
-rw-r--r--examples/stm32wl/src/bin/button.rs2
13 files changed, 16 insertions, 16 deletions
diff --git a/examples/rp/src/bin/button.rs b/examples/rp/src/bin/button.rs
index e9054fd48..4ad2ca3b7 100644
--- a/examples/rp/src/bin/button.rs
+++ b/examples/rp/src/bin/button.rs
@@ -16,7 +16,7 @@ async fn main(_spawner: Spawner) {
16 16
17 // Use PIN_28, Pin34 on J0 for RP Pico, as a input. 17 // Use PIN_28, Pin34 on J0 for RP Pico, as a input.
18 // You need to add your own button. 18 // You need to add your own button.
19 let mut button = Input::new(p.PIN_28, Pull::Up); 19 let button = Input::new(p.PIN_28, Pull::Up);
20 20
21 loop { 21 loop {
22 if button.is_high() { 22 if button.is_high() {
diff --git a/examples/stm32c0/src/bin/button.rs b/examples/stm32c0/src/bin/button.rs
index 265200132..8017f0274 100644
--- a/examples/stm32c0/src/bin/button.rs
+++ b/examples/stm32c0/src/bin/button.rs
@@ -12,7 +12,7 @@ fn main() -> ! {
12 12
13 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
14 14
15 let mut button = Input::new(p.PC13, Pull::Up); 15 let button = Input::new(p.PC13, Pull::Up);
16 16
17 loop { 17 loop {
18 if button.is_high() { 18 if button.is_high() {
diff --git a/examples/stm32f3/src/bin/button.rs b/examples/stm32f3/src/bin/button.rs
index 2cd356787..406730aae 100644
--- a/examples/stm32f3/src/bin/button.rs
+++ b/examples/stm32f3/src/bin/button.rs
@@ -12,7 +12,7 @@ fn main() -> ! {
12 12
13 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
14 14
15 let mut button = Input::new(p.PA0, Pull::Down); 15 let button = Input::new(p.PA0, Pull::Down);
16 let mut led1 = Output::new(p.PE9, Level::High, Speed::Low); 16 let mut led1 = Output::new(p.PE9, Level::High, Speed::Low);
17 let mut led2 = Output::new(p.PE15, Level::High, Speed::Low); 17 let mut led2 = Output::new(p.PE15, Level::High, Speed::Low);
18 18
diff --git a/examples/stm32f4/src/bin/button.rs b/examples/stm32f4/src/bin/button.rs
index ad30a56a2..564908998 100644
--- a/examples/stm32f4/src/bin/button.rs
+++ b/examples/stm32f4/src/bin/button.rs
@@ -12,7 +12,7 @@ fn main() -> ! {
12 12
13 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
14 14
15 let mut button = Input::new(p.PC13, Pull::Down); 15 let button = Input::new(p.PC13, Pull::Down);
16 let mut led1 = Output::new(p.PB0, Level::High, Speed::Low); 16 let mut led1 = Output::new(p.PB0, Level::High, Speed::Low);
17 let _led2 = Output::new(p.PB7, Level::High, Speed::Low); 17 let _led2 = Output::new(p.PB7, Level::High, Speed::Low);
18 let mut led3 = Output::new(p.PB14, Level::High, Speed::Low); 18 let mut led3 = Output::new(p.PB14, Level::High, Speed::Low);
diff --git a/examples/stm32f7/src/bin/button.rs b/examples/stm32f7/src/bin/button.rs
index ad30a56a2..564908998 100644
--- a/examples/stm32f7/src/bin/button.rs
+++ b/examples/stm32f7/src/bin/button.rs
@@ -12,7 +12,7 @@ fn main() -> ! {
12 12
13 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
14 14
15 let mut button = Input::new(p.PC13, Pull::Down); 15 let button = Input::new(p.PC13, Pull::Down);
16 let mut led1 = Output::new(p.PB0, Level::High, Speed::Low); 16 let mut led1 = Output::new(p.PB0, Level::High, Speed::Low);
17 let _led2 = Output::new(p.PB7, Level::High, Speed::Low); 17 let _led2 = Output::new(p.PB7, Level::High, Speed::Low);
18 let mut led3 = Output::new(p.PB14, Level::High, Speed::Low); 18 let mut led3 = Output::new(p.PB14, Level::High, Speed::Low);
diff --git a/examples/stm32g0/src/bin/button.rs b/examples/stm32g0/src/bin/button.rs
index 265200132..8017f0274 100644
--- a/examples/stm32g0/src/bin/button.rs
+++ b/examples/stm32g0/src/bin/button.rs
@@ -12,7 +12,7 @@ fn main() -> ! {
12 12
13 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
14 14
15 let mut button = Input::new(p.PC13, Pull::Up); 15 let button = Input::new(p.PC13, Pull::Up);
16 16
17 loop { 17 loop {
18 if button.is_high() { 18 if button.is_high() {
diff --git a/examples/stm32g4/src/bin/button.rs b/examples/stm32g4/src/bin/button.rs
index 6f3db0819..daebdd04d 100644
--- a/examples/stm32g4/src/bin/button.rs
+++ b/examples/stm32g4/src/bin/button.rs
@@ -12,7 +12,7 @@ fn main() -> ! {
12 12
13 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
14 14
15 let mut button = Input::new(p.PC13, Pull::Down); 15 let button = Input::new(p.PC13, Pull::Down);
16 16
17 loop { 17 loop {
18 if button.is_high() { 18 if button.is_high() {
diff --git a/examples/stm32l0/src/bin/button.rs b/examples/stm32l0/src/bin/button.rs
index 165a714a5..707486cdc 100644
--- a/examples/stm32l0/src/bin/button.rs
+++ b/examples/stm32l0/src/bin/button.rs
@@ -11,7 +11,7 @@ async fn main(_spawner: Spawner) {
11 let p = embassy_stm32::init(Default::default()); 11 let p = embassy_stm32::init(Default::default());
12 info!("Hello World!"); 12 info!("Hello World!");
13 13
14 let mut button = Input::new(p.PB2, Pull::Up); 14 let button = Input::new(p.PB2, Pull::Up);
15 let mut led1 = Output::new(p.PA5, Level::High, Speed::Low); 15 let mut led1 = Output::new(p.PA5, Level::High, Speed::Low);
16 let mut led2 = Output::new(p.PB5, Level::High, Speed::Low); 16 let mut led2 = Output::new(p.PB5, Level::High, Speed::Low);
17 17
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();
diff --git a/examples/stm32wl/src/bin/button.rs b/examples/stm32wl/src/bin/button.rs
index 3397e5ba6..eccd211e2 100644
--- a/examples/stm32wl/src/bin/button.rs
+++ b/examples/stm32wl/src/bin/button.rs
@@ -12,7 +12,7 @@ fn main() -> ! {
12 12
13 let p = embassy_stm32::init(Default::default()); 13 let p = embassy_stm32::init(Default::default());
14 14
15 let mut button = Input::new(p.PA0, Pull::Up); 15 let button = Input::new(p.PA0, Pull::Up);
16 let mut led1 = Output::new(p.PB15, Level::High, Speed::Low); 16 let mut led1 = Output::new(p.PB15, Level::High, Speed::Low);
17 let mut led2 = Output::new(p.PB9, Level::High, Speed::Low); 17 let mut led2 = Output::new(p.PB9, Level::High, Speed::Low);
18 18