#[non_exhaustive]pub struct Config { /* private fields */ }Expand description
I2C driver configuration
Implementations§
Source§impl Config
impl Config
Sourcepub fn with_frequency(self, frequency: Rate) -> Self
pub fn with_frequency(self, frequency: Rate) -> Self
Assign the given value to the frequency field.
Sourcepub fn with_timeout(self, timeout: BusTimeout) -> Self
Available on crate feature unstable only.
pub fn with_timeout(self, timeout: BusTimeout) -> Self
unstable only.Assign the given value to the timeout field.
Sourcepub fn timeout(&self) -> BusTimeout
Available on crate feature unstable only.
pub fn timeout(&self) -> BusTimeout
unstable only.I2C SCL timeout period.
Default value: disabled
Sourcepub fn with_software_timeout(self, software_timeout: SoftwareTimeout) -> Self
pub fn with_software_timeout(self, software_timeout: SoftwareTimeout) -> Self
Assign the given value to the software_timeout field.
Sourcepub fn software_timeout(&self) -> SoftwareTimeout
pub fn software_timeout(&self) -> SoftwareTimeout
Software timeout.
Default value: disabled.
Sourcepub fn with_scl_st_timeout(self, scl_st_timeout: FsmTimeout) -> Self
Available on crate feature unstable only.
pub fn with_scl_st_timeout(self, scl_st_timeout: FsmTimeout) -> Self
unstable only.Assign the given value to the scl_st_timeout field.
Sourcepub fn scl_st_timeout(&self) -> FsmTimeout
Available on crate feature unstable only.
pub fn scl_st_timeout(&self) -> FsmTimeout
unstable only.Sets the threshold value for the unchanged period of the SCL_FSM.
Default value: 16.
Sourcepub fn with_scl_main_st_timeout(self, scl_main_st_timeout: FsmTimeout) -> Self
Available on crate feature unstable only.
pub fn with_scl_main_st_timeout(self, scl_main_st_timeout: FsmTimeout) -> Self
unstable only.Assign the given value to the scl_main_st_timeout field.
Sourcepub fn scl_main_st_timeout(&self) -> FsmTimeout
Available on crate feature unstable only.
pub fn scl_main_st_timeout(&self) -> FsmTimeout
unstable only.Sets the threshold for the unchanged duration of the SCL_MAIN_FSM.
Default value: 16.
Sourcepub fn with_clock_source(self, clock_source: ClockSource) -> Self
Available on crate feature unstable only.
pub fn with_clock_source(self, clock_source: ClockSource) -> Self
unstable only.Assign the given value to the clock_source field.
Sourcepub fn clock_source(&self) -> ClockSource
Available on crate feature unstable only.
pub fn clock_source(&self) -> ClockSource
unstable only.The clock source for the I2C peripheral.
Default value: ClockSource::default().
Sourcepub fn with_scl_sample_level(self, scl_sample_level: Level) -> Self
Available on crate feature unstable only.
pub fn with_scl_sample_level(self, scl_sample_level: Level) -> Self
unstable only.Assign the given value to the scl_sample_level field.
Sourcepub fn scl_sample_level(&self) -> Level
Available on crate feature unstable only.
pub fn scl_sample_level(&self) -> Level
unstable only.Selects whether the controller samples the SDA line while SCL is high or low.
Standard I2C devices change SDA while SCL is low and hold it stable while
SCL is high, so the line is sampled while SCL is high by default
(Level::High).
Sourcepub fn with_bus_arbitration(self, bus_arbitration: bool) -> Self
Available on crate feature unstable only.
pub fn with_bus_arbitration(self, bus_arbitration: bool) -> Self
unstable only.Assign the given value to the bus_arbitration field.
Sourcepub fn bus_arbitration(&self) -> bool
Available on crate feature unstable only.
pub fn bus_arbitration(&self) -> bool
unstable only.Enables I2C bus arbitration detection.
Default value: false.
Trait Implementations§
impl Copy for Config
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)