[−][src]Trait lsm9ds1::interface::Interface
Interface Trait. SpiInterface
and I2cInterface
implement this.
Associated Types
type Error
Required methods
fn write(
&mut self,
sensor: Sensor,
addr: u8,
value: u8
) -> Result<(), Self::Error>
&mut self,
sensor: Sensor,
addr: u8,
value: u8
) -> Result<(), Self::Error>
Writes a byte to a sensor's specified register address.
Arguments
sensor
-Sensor
to talk toaddr
- register addressvalue
- value to write
fn read(
&mut self,
sensor: Sensor,
addr: u8,
buffer: &mut [u8]
) -> Result<(), Self::Error>
&mut self,
sensor: Sensor,
addr: u8,
buffer: &mut [u8]
) -> Result<(), Self::Error>
Reads multiple bytes from a sensor's specified register address.
Arguments
sensor
-Sensor
to talk toaddr
- register addressbuffer
- buffer to store read data
Implementors
impl<I2C, CommE> Interface for I2cInterface<I2C> where
I2C: WriteRead<Error = CommE> + Write<Error = CommE>,
[src]
I2C: WriteRead<Error = CommE> + Write<Error = CommE>,
Implementation of Interface
type Error = Error<CommE>
fn write(
&mut self,
sensor: Sensor,
addr: u8,
value: u8
) -> Result<(), Self::Error>
[src]
&mut self,
sensor: Sensor,
addr: u8,
value: u8
) -> Result<(), Self::Error>
fn read(
&mut self,
sensor: Sensor,
addr: u8,
buffer: &mut [u8]
) -> Result<(), Self::Error>
[src]
&mut self,
sensor: Sensor,
addr: u8,
buffer: &mut [u8]
) -> Result<(), Self::Error>
impl<SPI, AG, M, CommE, PinE> Interface for SpiInterface<SPI, AG, M> where
SPI: Transfer<u8, Error = CommE> + Write<u8, Error = CommE>,
AG: OutputPin<Error = PinE>,
M: OutputPin<Error = PinE>,
[src]
SPI: Transfer<u8, Error = CommE> + Write<u8, Error = CommE>,
AG: OutputPin<Error = PinE>,
M: OutputPin<Error = PinE>,
Implementation of Interface