pub trait NineDOFDevice: Device + AK8963<Error = <Self as Device>::Error> {
    // Required method
    fn read_9dof(
        &mut self,
        reg: Register,
        buffer: &mut [u8; 21]
    ) -> Result<(), <Self as Device>::Error>;
}
Expand description

The trait describes how to aquire 9 degrees-of-freedom measurements (plug a temperature reading) from an MPU

Required Methods§

source

fn read_9dof( &mut self, reg: Register, buffer: &mut [u8; 21] ) -> Result<(), <Self as Device>::Error>

Perform a 9DOF reading

The trait assumes a contiguous reading of (x, y, z) accelerometer, temperature, (x,y,z) gyroscope, and (x, y, z) magnetometer. Essentially, this is the layout of a single SPI read transaction. Any other implementors are required to meet this layout.

Implementors§

source§

impl<I2C, E> NineDOFDevice for I2cDevice<I2C>where I2C: Read<Error = E> + Write<Error = E> + WriteRead<Error = E>,

source§

impl<SPI, NCS, E, EO> NineDOFDevice for SpiDevice<SPI, NCS>where SPI: Write<u8, Error = E> + Transfer<u8, Error = E>, NCS: OutputPin<Error = EO>,