ublox_core/interface/
spi.rs1use embedded_hal as hal;
2use hal::digital::v2::OutputPin;
3
4use super::DeviceInterface;
5use crate::Error;
6use shufflebuf::ShuffleBuf;
7
8pub struct SpiInterface<SPI, CSN> {
11 _spi: SPI,
13 _csn: CSN,
15 _shuffler: ShuffleBuf,
16}
17
18impl<SPI, CSN, CommE, PinE> DeviceInterface for SpiInterface<SPI, CSN>
19where
20 SPI: hal::blocking::spi::Write<u8, Error = CommE>
21 + hal::blocking::spi::Transfer<u8, Error = CommE>,
22 CSN: OutputPin<Error = PinE>,
23{
24 type InterfaceError = Error<CommE>;
25
26 fn fill(&mut self) -> usize {
27 unimplemented!()
29 }
30
31 fn read(&mut self) -> Result<u8, Self::InterfaceError> {
32 unimplemented!()
33 }
34
35 fn read_many(
36 &mut self,
37 _buffer: &mut [u8],
38 ) -> Result<usize, Self::InterfaceError> {
39 unimplemented!()
40 }
41}