pub trait I2CSlave<'a> {
// Required methods
fn set_slave_client(&self, slave_client: &'a dyn I2CHwSlaveClient);
fn enable(&self);
fn disable(&self);
fn set_address(&self, addr: u8) -> Result<(), Error>;
fn write_receive(
&self,
data: &'static mut [u8],
max_len: usize,
) -> Result<(), (Error, &'static mut [u8])>;
fn read_send(
&self,
data: &'static mut [u8],
max_len: usize,
) -> Result<(), (Error, &'static mut [u8])>;
fn listen(&self);
}Expand description
Interface for an I2C Slave hardware driver.
Required Methods§
fn set_slave_client(&self, slave_client: &'a dyn I2CHwSlaveClient)
fn enable(&self)
fn disable(&self)
fn set_address(&self, addr: u8) -> Result<(), Error>
fn write_receive( &self, data: &'static mut [u8], max_len: usize, ) -> Result<(), (Error, &'static mut [u8])>
fn read_send( &self, data: &'static mut [u8], max_len: usize, ) -> Result<(), (Error, &'static mut [u8])>
fn listen(&self)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".