WriteData

Trait WriteData 

Source
pub trait WriteData: Sealed {
    type Error;

    // Required methods
    fn write_accel_register<R: RegWrite>(
        &mut self,
        reg: R,
    ) -> Result<(), Self::Error>;
    fn write_gyro_register<R: RegWrite>(
        &mut self,
        reg: R,
    ) -> Result<(), Self::Error>;
    fn write_mag_register<R: RegWrite>(
        &mut self,
        reg: R,
    ) -> Result<(), Self::Error>;
}
Expand description

Write data

Required Associated Types§

Source

type Error

Error type

Required Methods§

Source

fn write_accel_register<R: RegWrite>( &mut self, reg: R, ) -> Result<(), Self::Error>

Write to an u8 accelerometer register

Source

fn write_gyro_register<R: RegWrite>( &mut self, reg: R, ) -> Result<(), Self::Error>

Write to an u8 gyroscope register

Source

fn write_mag_register<R: RegWrite>(&mut self, reg: R) -> Result<(), Self::Error>

Write to an u8 magnetometer register

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<I2C, E> WriteData for I2cInterface<I2C>
where I2C: Write<Error = E>,

Source§

impl<SPI, CSXL, CSGYR, CSMAG, CommE, PinE> WriteData for SpiInterface<SPI, CSXL, CSGYR, CSMAG>
where SPI: Write<u8, Error = CommE>, CSXL: OutputPin<Error = PinE>, CSGYR: OutputPin<Error = PinE>, CSMAG: OutputPin<Error = PinE>,

Source§

type Error = Error<CommE, PinE>