#[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: 1048575 bus cycles
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_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).
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
Mutably borrows from an owned value. Read more
§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)
🔬This is a nightly-only experimental API. (
clone_to_uninit)