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.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.