Struct stm32_hal2::i2c::I2cConfig
source · 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
Configuration data for the I2C peripheral.
Fields§
§mode: I2cModeSelect master or slave mode. Defaults to Master.
speed: I2cSpeedSelect 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(). Defaults to Standard mode, 100kHz.
address_bits: AddressBitsAllows setting 7 or 10-bit addresses. Defaults to 7.
noise_filter: NoiseFilterSelect the analog noise filter, a digital filter, or no filter. Deafults to analog.
smbus: boolSupport for SMBUS, including hardware PEC, and alert pin. Defaults to false.
nostretch: boolOptionally disable clock stretching. Defaults to false (stretching allowed). Only relevant in slave mode.