diff options
| author | kbleeke <[email protected]> | 2023-03-21 19:15:54 +0100 |
|---|---|---|
| committer | kbleeke <[email protected]> | 2023-03-21 19:15:54 +0100 |
| commit | b4b8d829801e149c90f9f0fc85736be3549dff87 (patch) | |
| tree | 3ea1041c1f18d9bb1a17779b543bc0597f2c60b5 /src/lib.rs | |
| parent | a6a2a035d57ced9a7a9bb2ef325885063ea83295 (diff) | |
remove use of embedded-hal SPI traits. Instead just call our bus trait directly and push responsibility for implementing CS on the trait implementor
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs index bcc3c59bd..f0a7aaa0f 100644 --- a/src/lib.rs +++ b/src/lib.rs | |||
| @@ -22,7 +22,6 @@ use embassy_futures::yield_now; | |||
| 22 | use embassy_net_driver_channel as ch; | 22 | use embassy_net_driver_channel as ch; |
| 23 | use embassy_time::{block_for, Duration, Timer}; | 23 | use embassy_time::{block_for, Duration, Timer}; |
| 24 | use embedded_hal_1::digital::OutputPin; | 24 | use embedded_hal_1::digital::OutputPin; |
| 25 | use embedded_hal_async::spi::SpiDevice; | ||
| 26 | 25 | ||
| 27 | use crate::bus::Bus; | 26 | use crate::bus::Bus; |
| 28 | pub use crate::bus::SpiBusCyw43; | 27 | pub use crate::bus::SpiBusCyw43; |
| @@ -513,8 +512,7 @@ pub async fn new<'a, PWR, SPI>( | |||
| 513 | ) -> (NetDriver<'a>, Control<'a>, Runner<'a, PWR, SPI>) | 512 | ) -> (NetDriver<'a>, Control<'a>, Runner<'a, PWR, SPI>) |
| 514 | where | 513 | where |
| 515 | PWR: OutputPin, | 514 | PWR: OutputPin, |
| 516 | SPI: SpiDevice, | 515 | SPI: SpiBusCyw43, |
| 517 | SPI::Bus: SpiBusCyw43<u32>, | ||
| 518 | { | 516 | { |
| 519 | let (ch_runner, device) = ch::new(&mut state.ch, [0; 6]); | 517 | let (ch_runner, device) = ch::new(&mut state.ch, [0; 6]); |
| 520 | let state_ch = ch_runner.state_runner(); | 518 | let state_ch = ch_runner.state_runner(); |
| @@ -552,8 +550,7 @@ where | |||
| 552 | impl<'a, PWR, SPI> Runner<'a, PWR, SPI> | 550 | impl<'a, PWR, SPI> Runner<'a, PWR, SPI> |
| 553 | where | 551 | where |
| 554 | PWR: OutputPin, | 552 | PWR: OutputPin, |
| 555 | SPI: SpiDevice, | 553 | SPI: SpiBusCyw43, |
| 556 | SPI::Bus: SpiBusCyw43<u32>, | ||
| 557 | { | 554 | { |
| 558 | async fn init(&mut self, firmware: &[u8]) { | 555 | async fn init(&mut self, firmware: &[u8]) { |
| 559 | self.bus.init().await; | 556 | self.bus.init().await; |
