[][src]Trait kernel::hil::i2c::SMBusMaster

pub trait SMBusMaster: I2CMaster {
    fn smbus_write_read(
        &self,
        addr: u8,
        data: &'static mut [u8],
        write_len: u8,
        read_len: u8
    ) -> Result<(), (Error, &'static mut [u8])>;
fn smbus_write(
        &self,
        addr: u8,
        data: &'static mut [u8],
        len: u8
    ) -> Result<(), (Error, &'static mut [u8])>;
fn smbus_read(
        &self,
        addr: u8,
        buffer: &'static mut [u8],
        len: u8
    ) -> Result<(), (Error, &'static mut [u8])>; }

Interface for an SMBus Master hardware driver. The device implementing this will also seperately implement I2CMaster.

Required methods

fn smbus_write_read(
    &self,
    addr: u8,
    data: &'static mut [u8],
    write_len: u8,
    read_len: u8
) -> Result<(), (Error, &'static mut [u8])>

Write data then read data via the I2C Master device in an SMBus compatible way.

This function will use the I2C master to write data to a device and then read data from the device in a SMBus compatible way. This will be a best effort attempt to match the SMBus specification based on what the hardware can support. This function is expected to make any hardware changes required to support SMBus and then revert those changes to support future I2C.

addr: The address of the device to write to data: The buffer to write the data from and read back to write_len: The length of the write operation read_len: The length of the read operation

fn smbus_write(
    &self,
    addr: u8,
    data: &'static mut [u8],
    len: u8
) -> Result<(), (Error, &'static mut [u8])>

Write data via the I2C Master device in an SMBus compatible way.

This function will use the I2C master to write data to a device in a SMBus compatible way. This will be a best effort attempt to match the SMBus specification based on what the hardware can support. This function is expected to make any hardware changes required to support SMBus and then revert those changes to support future I2C.

addr: The address of the device to write to data: The buffer to write the data from len: The length of the operation

fn smbus_read(
    &self,
    addr: u8,
    buffer: &'static mut [u8],
    len: u8
) -> Result<(), (Error, &'static mut [u8])>

Read data via the I2C Master device in an SMBus compatible way.

This function will use the I2C master to read data from a device in a SMBus compatible way. This will be a best effort attempt to match the SMBus specification based on what the hardware can support. This function is expected to make any hardware changes required to support SMBus and then revert those changes to support future I2C.

addr: The address of the device to read from buffer: The buffer to store the data to len: The length of the operation

Loading content...

Implementors

Loading content...