pub struct Config {
pub i2c_addr: I2cAddr,
pub mode: ControlRegisterMode,
}Expand description
Configuration of the DS3502 for set-up.
§Differences from default behavior
According to the datasheet, by default, the control register (CR) is initialized in Mode 0 (0x00), so I2C writes to both the Wiper Register (WR) and initial value register (IVR), which saves the WR value to the EEPROM.
The EEPROM has a limited number of write cycles, so the default configuration initializes the driver with CR in Mode 1 (0x80) the factory behavior by setting the control register mode to be wiper register only.
To restore factory behavior set the mode to ControlRegisterMode::WiperAndInitialValue
Fields§
§i2c_addr: I2cAddrThe default I2C address is 0x28
mode: ControlRegisterModeBy default, EEPROM saves are disabled, see ControlRegisterMode for more details.
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 UnwindSafe for Config
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