Struct stm32_hal2::i2c::I2cConfig [−][src]
pub struct I2cConfig {
pub mode: I2cMode,
pub speed: I2cSpeed,
pub address_bits: AddressBits,
pub noise_filter: NoiseFilter,
pub smbus: bool,
pub nostretch: bool,
}
Expand description
Initial configuration data for the I2C peripheral.
Fields
mode: I2cMode
Select master or slave mode. Defaults to Master.
speed: I2cSpeed
pub speed_mode: SpeedMode,
Select between one of 4 preset speeds. If you’d like to use custom
speed settings, use the PAC directly, with I2C disabled, after the
peripheral clocks are enabled by new()
. Default to Standard mode, 100kHz.
address_bits: AddressBits
Allows setting 7 or 10-bit addresses. Defaults to 7.
noise_filter: NoiseFilter
Select the analog noise filter, a digital filter, or no filter.
smbus: bool
Support for SMBUS, including hardware PEC, and alert pin. Defaults to false.
nostretch: bool
Optionally disable clock stretching. Defaults to false (stretching allowed) Only relevant in slave mode.