Struct stm32_hal2::i2c::I2c[][src]

pub struct I2c<R> {
    pub regs: R,
    pub cfg: I2cConfig,
}
Expand description

Represents an Inter-Integrated Circuit (I2C) peripheral.

Fields

regs: Rcfg: I2cConfig

Implementations

Initialize a I2C peripheral, including configuration register writes, and enabling and resetting its RCC peripheral clock. freq is in Hz.

Enable SMBus support. See L44 RM, section 37.4.11: SMBus initialization

Read multiple words to a buffer. Can return an error due to Bus, Arbitration, or NACK.

Write an array of words. Can return an error due to Bus, Arbitration, or NACK.

Write and read an array of words. Can return an error due to Bus, Arbitration, or NACK.

Read data, using DMA. See L44 RM, 37.4.16: “Transmission using DMA” Note that the channel argument is only used on F3 and L4. For a single write, set autoend to true. For a write_read and other use cases, set it to false.

Read data, using DMA. See L44 RM, 37.4.16: “Reception using DMA” Note that the channel argument is only used on F3 and L4.

Trait Implementations

Error type

Reads enough bytes from slave with address to fill buffer Read more

Error type

Sends bytes to slave with address addr Read more

Error type

Sends bytes to slave with address addr and then reads enough bytes to fill buffer in a single transaction Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.