[][src]Trait bmi088::SensorInterface

pub trait SensorInterface {
    type InterfaceError;
    fn register_read(&mut self, reg: u8) -> Result<u8, Self::InterfaceError>;
fn register_write(
        &mut self,
        reg: u8,
        val: u8
    ) -> Result<(), Self::InterfaceError>;
fn read_vec3_i16(
        &mut self,
        reg: u8
    ) -> Result<[i16; 3], Self::InterfaceError>; }

A method of communicating with the sensor

Associated Types

type InterfaceError

Interface associated error type

Loading content...

Required methods

fn register_read(&mut self, reg: u8) -> Result<u8, Self::InterfaceError>

Read a single byte from a register address

fn register_write(
    &mut self,
    reg: u8,
    val: u8
) -> Result<(), Self::InterfaceError>

Write a single byte to a register address

fn read_vec3_i16(&mut self, reg: u8) -> Result<[i16; 3], Self::InterfaceError>

read a vector of three i16 from the given register address

Loading content...

Implementors

impl<I2C, CommE> SensorInterface for I2cInterface<I2C> where
    I2C: Read<Error = CommE> + Write<Error = CommE> + WriteRead<Error = CommE>, 
[src]

type InterfaceError = Error<CommE, ()>

impl<SPI, CSN, CommE, PinE> SensorInterface for SpiInterface<SPI, CSN> where
    SPI: Write<u8, Error = CommE> + Transfer<u8, Error = CommE>,
    CSN: OutputPin<Error = PinE>, 
[src]

type InterfaceError = Error<CommE, PinE>

Loading content...