diff options
| author | Dario Nieuwenhuis <[email protected]> | 2022-02-15 17:28:48 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2022-02-15 17:29:05 +0100 |
| commit | d9aec181a4612ba5ffff4c2a9d1ba762021e3b29 (patch) | |
| tree | 720588304798671a11794cf1d107e0626530d24c /examples/rp/src | |
| parent | d7aea31a859ea3ba0ed3055fcbc5d08a604b6428 (diff) | |
rp: impl eh1.0 blocking traits
Diffstat (limited to 'examples/rp/src')
| -rw-r--r-- | examples/rp/src/bin/spi.rs | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/spi_display.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/rp/src/bin/spi.rs b/examples/rp/src/bin/spi.rs index 71dec94f3..3348dc999 100644 --- a/examples/rp/src/bin/spi.rs +++ b/examples/rp/src/bin/spi.rs | |||
| @@ -34,7 +34,7 @@ async fn main(_spawner: Spawner, p: Peripherals) { | |||
| 34 | loop { | 34 | loop { |
| 35 | cs.set_low(); | 35 | cs.set_low(); |
| 36 | let mut buf = [0x90, 0x00, 0x00, 0xd0, 0x00, 0x00]; | 36 | let mut buf = [0x90, 0x00, 0x00, 0xd0, 0x00, 0x00]; |
| 37 | spi.transfer(&mut buf); | 37 | spi.blocking_transfer_in_place(&mut buf).unwrap(); |
| 38 | cs.set_high(); | 38 | cs.set_high(); |
| 39 | 39 | ||
| 40 | let x = (buf[1] as u32) << 5 | (buf[2] as u32) >> 3; | 40 | let x = (buf[1] as u32) << 5 | (buf[2] as u32) >> 3; |
diff --git a/examples/rp/src/bin/spi_display.rs b/examples/rp/src/bin/spi_display.rs index 96f0cf378..01149c250 100644 --- a/examples/rp/src/bin/spi_display.rs +++ b/examples/rp/src/bin/spi_display.rs | |||
| @@ -131,7 +131,7 @@ impl<'a> embedded_hal::blocking::spi::Write<u8> for DisplaySpi<'a> { | |||
| 131 | this.display_cs.set_low(); | 131 | this.display_cs.set_low(); |
| 132 | this.last_mode = SpiMode::Display; | 132 | this.last_mode = SpiMode::Display; |
| 133 | } | 133 | } |
| 134 | this.spi.write(words); | 134 | this.spi.write(words).unwrap(); |
| 135 | Ok(()) | 135 | Ok(()) |
| 136 | } | 136 | } |
| 137 | } | 137 | } |
| @@ -147,7 +147,7 @@ impl<'a> embedded_hal::blocking::spi::Transfer<u8> for TouchSpi<'a> { | |||
| 147 | this.display_cs.set_high(); | 147 | this.display_cs.set_high(); |
| 148 | this.last_mode = SpiMode::Touch; | 148 | this.last_mode = SpiMode::Touch; |
| 149 | } | 149 | } |
| 150 | this.spi.transfer(words); | 150 | this.spi.transfer(words).unwrap(); |
| 151 | Ok(words) | 151 | Ok(words) |
| 152 | } | 152 | } |
| 153 | } | 153 | } |
