pub trait Instance {
Show 14 methods fn register_block(&self) -> &RegisterBlock; fn i2c_number(&self) -> usize; fn setup(
        &mut self,
        frequency: Rate<u32, 1, 1>,
        clocks: &Clocks
    ) -> Result<(), SetupError> { ... } fn reset(&mut self) { ... } fn reset_command_list(&mut self) { ... } fn set_filter(&mut self, sda_threshold: Option<u8>, scl_threshold: Option<u8>) { ... } fn set_frequency(
        &mut self,
        source_clk: Rate<u32, 1, 1>,
        bus_freq: Rate<u32, 1, 1>
    ) -> Result<(), SetupError> { ... } fn execute_transmission(&mut self) -> Result<(), Error> { ... } fn add_write_operation<'a, I>(
        &self,
        addr: u8,
        bytes: &[u8],
        cmd_iterator: &mut I,
        include_stop: bool
    ) -> Result<(), Error>
   where
        I: Iterator<Item = &'a Reg<COMD_SPEC>>
, { ... } fn add_read_operation<'a, I>(
        &self,
        addr: u8,
        buffer: &[u8],
        cmd_iterator: &mut I
    ) -> Result<(), Error>
   where
        I: Iterator<Item = &'a Reg<COMD_SPEC>>
, { ... } fn reset_fifo(&mut self) { ... } fn master_write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Error> { ... } fn master_read(&mut self, addr: u8, buffer: &mut [u8]) -> Result<(), Error> { ... } fn master_write_read(
        &mut self,
        addr: u8,
        bytes: &[u8],
        buffer: &mut [u8]
    ) -> Result<(), Error> { ... }
}
Expand description

I2C Peripheral Instance

Required Methods

Provided Methods

Resets the I2C controller (FIFO + FSM + command list)

Resets the I2C peripheral’s command registers

Sets the filter with a supplied threshold in clock cycles for which a pulse must be present to pass the filter

Sets the frequency of the I2C interface by calculating and applying the associated timings

Start the actual transmission on a previously configured command set

This includes the monitoring of the execution in the peripheral and the return of the operation outcome, including error states

Resets the transmit and receive FIFO buffers

Send data bytes from the bytes array to a target slave with the address addr

Read bytes from a target slave with the address addr The number of read bytes is deterimed by the size of the buffer argument

Write bytes from the bytes array first and then read n bytes into the buffer array with n being the size of the array.

Implementations on Foreign Types

Implementors