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: I2cMode
Select master or slave mode. Defaults to Master.
speed: I2cSpeed
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()
. Defaults 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. Deafults to analog.
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.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for I2cConfig
impl Send for I2cConfig
impl Sync for I2cConfig
impl Unpin for I2cConfig
impl UnwindSafe for I2cConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more