Began skeleton of new UninitializedW5500 struct and Bus trait/impls

This commit is contained in:
Jonah Dahlquist 2019-08-04 23:48:52 -05:00 committed by Jonah Dahlquist
commit 03e30ef699
6 changed files with 1019 additions and 976 deletions

24
src/bus/three_wire.rs Normal file
View file

@ -0,0 +1,24 @@
use embedded_hal::spi::FullDuplex;
use crate::bus::Bus;
pub struct ThreeWire {}
impl ThreeWire {
pub fn new() -> Self {
Self { }
}
}
impl<Spi: FullDuplex<u8>> Bus<Spi> for ThreeWire {
type Error = Spi::Error;
fn transfer_frame<'a, 'b>(
spi: &'b mut Spi,
address_phase: [u8; 2],
control_phase: u8,
data_phase: &'a mut [u8],
) -> Result<&'a mut [u8], nb::Error<Self::Error>> {
// TODO implement transfer
Ok(data_phase)
}
}