Trait kernel::hil::i2c::I2CHwSlaveClient

source ·
pub trait I2CHwSlaveClient {
    // Required methods
    fn command_complete(
        &self,
        buffer: &'static mut [u8],
        length: usize,
        transmission_type: SlaveTransmissionType,
    );
    fn read_expected(&self);
    fn write_expected(&self);
}
Expand description

Client interface for capsules that use I2CSlave devices.

Required Methods§

source

fn command_complete( &self, buffer: &'static mut [u8], length: usize, transmission_type: SlaveTransmissionType, )

Called when an I2C command completed.

source

fn read_expected(&self)

Called from the I2C slave hardware to say that a Master has sent us a read message, but the driver did not have a buffer containing data setup, and therefore cannot respond. The I2C slave hardware will stretch the clock while waiting for the upper layer capsule to provide data to send to the remote master. Call I2CSlave::read_send() to provide data.

source

fn write_expected(&self)

Called from the I2C slave hardware to say that a Master has sent us a write message, but there was no buffer setup to read the bytes into. The HW will stretch the clock while waiting for the user to call I2CSlave::write_receive() with a buffer.

Implementors§