diff options
| author | Dario Nieuwenhuis <[email protected]> | 2023-04-27 18:23:36 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-27 18:23:36 +0000 |
| commit | c19de2984751ba6fa2972ee66cfa2a6310d5f0c1 (patch) | |
| tree | 9ba8fa01994be9ef43af404cb4399854e8c6de22 /src/bus.rs | |
| parent | f4bfda345d3d18232926a87b10333a2e624f4d04 (diff) | |
| parent | 9e96655757180d7fe32ebff1ed93a35a4c3cff28 (diff) | |
Merge pull request #63 from kbleeke/generalize-events
rework event handling to allow sending data to `Control`
Diffstat (limited to 'src/bus.rs')
| -rw-r--r-- | src/bus.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/bus.rs b/src/bus.rs index add346b2f..e26f11120 100644 --- a/src/bus.rs +++ b/src/bus.rs | |||
| @@ -1,11 +1,10 @@ | |||
| 1 | use core::slice; | ||
| 2 | |||
| 3 | use embassy_futures::yield_now; | 1 | use embassy_futures::yield_now; |
| 4 | use embassy_time::{Duration, Timer}; | 2 | use embassy_time::{Duration, Timer}; |
| 5 | use embedded_hal_1::digital::OutputPin; | 3 | use embedded_hal_1::digital::OutputPin; |
| 6 | use futures::FutureExt; | 4 | use futures::FutureExt; |
| 7 | 5 | ||
| 8 | use crate::consts::*; | 6 | use crate::consts::*; |
| 7 | use crate::slice8_mut; | ||
| 9 | 8 | ||
| 10 | /// Custom Spi Trait that _only_ supports the bus operation of the cyw43 | 9 | /// Custom Spi Trait that _only_ supports the bus operation of the cyw43 |
| 11 | /// Implementors are expected to hold the CS pin low during an operation. | 10 | /// Implementors are expected to hold the CS pin low during an operation. |
| @@ -327,8 +326,3 @@ fn swap16(x: u32) -> u32 { | |||
| 327 | fn cmd_word(write: bool, incr: bool, func: u32, addr: u32, len: u32) -> u32 { | 326 | fn cmd_word(write: bool, incr: bool, func: u32, addr: u32, len: u32) -> u32 { |
| 328 | (write as u32) << 31 | (incr as u32) << 30 | (func & 0b11) << 28 | (addr & 0x1FFFF) << 11 | (len & 0x7FF) | 327 | (write as u32) << 31 | (incr as u32) << 30 | (func & 0b11) << 28 | (addr & 0x1FFFF) << 11 | (len & 0x7FF) |
| 329 | } | 328 | } |
| 330 | |||
| 331 | fn slice8_mut(x: &mut [u32]) -> &mut [u8] { | ||
| 332 | let len = x.len() * 4; | ||
| 333 | unsafe { slice::from_raw_parts_mut(x.as_mut_ptr() as _, len) } | ||
| 334 | } | ||
