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 | |
| parent | d7aea31a859ea3ba0ed3055fcbc5d08a604b6428 (diff) | |
rp: impl eh1.0 blocking traits
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/rp/.cargo/config.toml | 2 | ||||
| -rw-r--r-- | examples/rp/Cargo.toml | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/spi.rs | 2 | ||||
| -rw-r--r-- | examples/rp/src/bin/spi_display.rs | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/examples/rp/.cargo/config.toml b/examples/rp/.cargo/config.toml index 1ce57510b..ac54f9693 100644 --- a/examples/rp/.cargo/config.toml +++ b/examples/rp/.cargo/config.toml | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] | 1 | [target.'cfg(all(target_arch = "arm", target_os = "none"))'] |
| 2 | runner = "probe-run-rp --chip RP2040" | 2 | runner = "probe-run --chip RP2040" |
| 3 | 3 | ||
| 4 | [build] | 4 | [build] |
| 5 | target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ | 5 | target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+ |
diff --git a/examples/rp/Cargo.toml b/examples/rp/Cargo.toml index b3dfb04dc..c067fbbcf 100644 --- a/examples/rp/Cargo.toml +++ b/examples/rp/Cargo.toml | |||
| @@ -7,7 +7,7 @@ version = "0.1.0" | |||
| 7 | 7 | ||
| 8 | [dependencies] | 8 | [dependencies] |
| 9 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } | 9 | embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } |
| 10 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt"] } | 10 | embassy-rp = { version = "0.1.0", path = "../../embassy-rp", features = ["defmt", "unstable-traits", "nightly", "unstable-pac"] } |
| 11 | atomic-polyfill = "0.1.5" | 11 | atomic-polyfill = "0.1.5" |
| 12 | 12 | ||
| 13 | defmt = "0.3" | 13 | defmt = "0.3" |
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 | } |
