[−][src]Trait bno080::interface::SensorInterface
A method of communicating with the sensor
Associated Types
type SensorError
Interface error type
Required methods
fn setup(
&mut self,
delay_source: &mut impl DelayMs<u8>
) -> Result<(), Self::SensorError>
&mut self,
delay_source: &mut impl DelayMs<u8>
) -> Result<(), Self::SensorError>
give the sensor interface a chance to set up
fn write_packet(&mut self, packet: &[u8]) -> Result<(), Self::SensorError>
Write the whole packet provided
fn read_packet(
&mut self,
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>
&mut self,
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>
Read the next packet from the sensor Returns the size of the packet read (up to the size of the slice provided)
fn send_and_receive_packet(
&mut self,
send_buf: &[u8],
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>
&mut self,
send_buf: &[u8],
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>
Send a packet and receive the response immediately
Implementors
impl<I2C, CommE> SensorInterface for I2cInterface<I2C> where
I2C: Write<Error = CommE> + Read<Error = CommE> + WriteRead<Error = CommE>,
[src]
I2C: Write<Error = CommE> + Read<Error = CommE> + WriteRead<Error = CommE>,
type SensorError = Error<CommE, ()>
fn setup(
&mut self,
delay_source: &mut impl DelayMs<u8>
) -> Result<(), Self::SensorError>
[src]
&mut self,
delay_source: &mut impl DelayMs<u8>
) -> Result<(), Self::SensorError>
fn write_packet(&mut self, packet: &[u8]) -> Result<(), Self::SensorError>
[src]
fn read_packet(
&mut self,
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>
[src]
&mut self,
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>
Read one packet into the receive buffer
fn send_and_receive_packet(
&mut self,
send_buf: &[u8],
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>
[src]
&mut self,
send_buf: &[u8],
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>
impl<SPI, CSN, IN, WAK, RS, CommE, PinE> SensorInterface for SpiInterface<SPI, CSN, IN, WAK, RS> where
SPI: Write<u8, Error = CommE> + Transfer<u8, Error = CommE>,
CSN: OutputPin<Error = PinE>,
IN: InputPin<Error = PinE>,
WAK: OutputPin<Error = PinE>,
RS: OutputPin<Error = PinE>,
[src]
SPI: Write<u8, Error = CommE> + Transfer<u8, Error = CommE>,
CSN: OutputPin<Error = PinE>,
IN: InputPin<Error = PinE>,
WAK: OutputPin<Error = PinE>,
RS: OutputPin<Error = PinE>,
type SensorError = Error<CommE, PinE>
fn setup(
&mut self,
delay_source: &mut impl DelayMs<u8>
) -> Result<(), Self::SensorError>
[src]
&mut self,
delay_source: &mut impl DelayMs<u8>
) -> Result<(), Self::SensorError>
fn send_and_receive_packet(
&mut self,
send_buf: &[u8],
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>
[src]
&mut self,
send_buf: &[u8],
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>
fn write_packet(&mut self, packet: &[u8]) -> Result<(), Self::SensorError>
[src]
fn read_packet(
&mut self,
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>
[src]
&mut self,
recv_buf: &mut [u8]
) -> Result<usize, Self::SensorError>