Trait Base

Source
pub trait Base<Err> {
    // Required methods
    fn write_command(
        &mut self,
        command: Command,
        data: Option<u16>,
    ) -> Result<(), Error<Err>>;
    fn read_command(
        &mut self,
        command: Command,
        data: &mut [u8],
    ) -> Result<(), Error<Err>>;
}
Expand description

Base API for reading and writing to the device This should not be required by consumers, but is exposed to support alternate use (or in future provide ModBus support)

Required Methods§

Source

fn write_command( &mut self, command: Command, data: Option<u16>, ) -> Result<(), Error<Err>>

Write a command to the device with optional data

Source

fn read_command( &mut self, command: Command, data: &mut [u8], ) -> Result<(), Error<Err>>

Read information from the device

Implementors§

Source§

impl<Conn, Err> Base<Err> for Conn
where Conn: I2c<Error = Err>, Err: Debug,

Base implementation for I2C devices