aboutsummaryrefslogtreecommitdiff
path: root/src/bus.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bus.rs')
-rw-r--r--src/bus.rs8
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 @@
1use core::slice;
2
3use embassy_futures::yield_now; 1use embassy_futures::yield_now;
4use embassy_time::{Duration, Timer}; 2use embassy_time::{Duration, Timer};
5use embedded_hal_1::digital::OutputPin; 3use embedded_hal_1::digital::OutputPin;
6use futures::FutureExt; 4use futures::FutureExt;
7 5
8use crate::consts::*; 6use crate::consts::*;
7use 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 {
327fn cmd_word(write: bool, incr: bool, func: u32, addr: u32, len: u32) -> u32 { 326fn 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
331fn 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}