[−][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 read_with_timeout(
&mut self,
recv_buf: &mut [u8],
delay_source: &mut impl DelayMs<u8>,
max_ms: u8
) -> Result<usize, Self::SensorError>
&mut self,
recv_buf: &mut [u8],
delay_source: &mut impl DelayMs<u8>,
max_ms: u8
) -> Result<usize, Self::SensorError>
Wait for sensor to indicate it has data available before reading
max_ms
maximum number of milliseconds to wait for data
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
fn requires_soft_reset(&self) -> bool
Does this interface require a soft reset after init?
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 requires_soft_reset(&self) -> bool
[src]
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_with_timeout(
&mut self,
recv_buf: &mut [u8],
delay_source: &mut impl DelayMs<u8>,
max_ms: u8
) -> Result<usize, Self::SensorError>
[src]
&mut self,
recv_buf: &mut [u8],
delay_source: &mut impl DelayMs<u8>,
max_ms: u8
) -> Result<usize, Self::SensorError>
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, RS, CommE, PinE> SensorInterface for SpiInterface<SPI, CSN, IN, RS> where
SPI: Write<u8, Error = CommE> + Transfer<u8, Error = CommE>,
CSN: OutputPin<Error = PinE>,
IN: InputPin<Error = PinE>,
RS: OutputPin<Error = PinE>,
CommE: Debug,
PinE: Debug,
[src]
SPI: Write<u8, Error = CommE> + Transfer<u8, Error = CommE>,
CSN: OutputPin<Error = PinE>,
IN: InputPin<Error = PinE>,
RS: OutputPin<Error = PinE>,
CommE: Debug,
PinE: Debug,
type SensorError = Error<CommE, PinE>
fn requires_soft_reset(&self) -> bool
[src]
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>
Read a complete packet from the sensor
fn read_with_timeout(
&mut self,
recv_buf: &mut [u8],
delay_source: &mut impl DelayMs<u8>,
max_ms: u8
) -> Result<usize, Self::SensorError>
[src]
&mut self,
recv_buf: &mut [u8],
delay_source: &mut impl DelayMs<u8>,
max_ms: u8
) -> Result<usize, Self::SensorError>