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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for I2cConfig
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