#[non_exhaustive]pub struct SlaveConfig {
pub address: SlaveAddress,
pub second_address: Option<u8>,
pub general_call: bool,
pub clock_stretching: bool,
}Expand description
I2C slave configuration.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.address: SlaveAddressPrimary address, programmed into OADDR1.
second_address: Option<u8>Optional second 7-bit address, programmed into OADDR2.
general_call: boolRespond to the general call address (0x00).
clock_stretching: boolAllow clock stretching (NOSTRETCH = 0).
Implementations§
Source§impl SlaveConfig
impl SlaveConfig
Sourcepub fn new(address: impl Into<SlaveAddress>) -> Self
pub fn new(address: impl Into<SlaveAddress>) -> Self
Create a configuration with only the primary address set.
A plain integer selects a 7-bit address; use SlaveAddress::TenBit
for a 10-bit one.
Trait Implementations§
Source§impl Clone for SlaveConfig
impl Clone for SlaveConfig
Source§fn clone(&self) -> SlaveConfig
fn clone(&self) -> SlaveConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable)§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SlaveConfig
Source§impl Debug for SlaveConfig
impl Debug for SlaveConfig
Auto Trait Implementations§
impl Freeze for SlaveConfig
impl RefUnwindSafe for SlaveConfig
impl Send for SlaveConfig
impl Sync for SlaveConfig
impl Unpin for SlaveConfig
impl UnsafeUnpin for SlaveConfig
impl UnwindSafe for SlaveConfig
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)