[][src]Trait avr_hal_generic::i2c::I2cOps

pub trait I2cOps<H, SDA, SCL> {
    pub fn raw_setup<CLOCK: Clock>(&mut self, speed: u32);
pub fn raw_start(
        &mut self,
        address: u8,
        direction: Direction
    ) -> Result<(), Error>;
pub fn raw_write(&mut self, bytes: &[u8]) -> Result<(), Error>;
pub fn raw_read(&mut self, buffer: &mut [u8]) -> Result<(), Error>;
pub fn raw_stop(&mut self) -> Result<(), Error>; }

Internal trait for low-level I2C peripherals.

This trait defines the common interface for all I2C peripheral variants. It is used as an intermediate abstraction ontop of which the I2c API is built. Prefer using the I2c API instead of this trait.

Required methods

pub fn raw_setup<CLOCK: Clock>(&mut self, speed: u32)[src]

Setup the bus for operation at a certain speed.

Warning: This is a low-level method and should not be called directly from user code.

pub fn raw_start(
    &mut self,
    address: u8,
    direction: Direction
) -> Result<(), Error>
[src]

Start a bus transaction to a certain address in either read or write mode.

If a previous transaction was not stopped via raw_stop(), this should generate a repeated start condition.

Warning: This is a low-level method and should not be called directly from user code.

pub fn raw_write(&mut self, bytes: &[u8]) -> Result<(), Error>[src]

Write some bytes to the bus.

This method must only be called after a transaction in write mode was successfully started.

Warning: This is a low-level method and should not be called directly from user code.

pub fn raw_read(&mut self, buffer: &mut [u8]) -> Result<(), Error>[src]

Read some bytes from the bus.

This method must only be called after a transaction in read mode was successfully started.

Warning: This is a low-level method and should not be called directly from user code.

pub fn raw_stop(&mut self) -> Result<(), Error>[src]

Send a stop-condition and release the bus.

This method must only be called after successfully starting a bus transaction. This method does not need to block until the stop condition has actually occured.

Warning: This is a low-level method and should not be called directly from user code.

Loading content...

Implementors

Loading content...