diff options
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 | } | ||
