[][src]Trait hmc5983::interface::SensorInterface

pub trait SensorInterface {
    type InterfaceError;
    fn read_block(
        &mut self,
        reg: u8,
        recv_buf: &mut [u8]
    ) -> Result<(), Self::InterfaceError>;
fn write_reg(
        &mut self,
        reg: u8,
        val: u8
    ) -> Result<(), Self::InterfaceError>; }

A method of communicating with the device

Associated Types

type InterfaceError

Interface associated error type

Loading content...

Required methods

fn read_block(
    &mut self,
    reg: u8,
    recv_buf: &mut [u8]
) -> Result<(), Self::InterfaceError>

Read a block from a specific register reg: The register address to read from recv_buf: The buffer to receive into

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

Write a value to a register

Loading content...

Implementors

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

type InterfaceError = Error<CommE, ()>

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

type InterfaceError = Error<CommE, PinE>

Loading content...