[−][src]Struct pcf8523::Pcf8523
Methods
impl Pcf8523
[src]
pub fn new(i2cpath: &str) -> Pcf8523
[src]
Returns a new Pcf8523 using the specified path to an i2c-dev device.
Arguments
i2cpath
- Path to the I2C device, e.g. /dev/i2c-1
Panics
This function panics if there is an issue opening the device.
pub fn get_time(&mut self) -> DateTime<Utc>
[src]
Returns the time in UTC from the device.
Panics
Panics if there is an issue reading the I2C bus, or if the data stored on the chip is not a valid UTC time.
pub fn set_time(&mut self, time: DateTime<Utc>)
[src]
Programs the given time, in UTC, to the device.
Panics
Panics if:
- The current year is < 2000 or >= 2100, or
- If there is an error writing to the I2C bus.
Auto Trait Implementations
impl Sync for Pcf8523
impl Send for Pcf8523
impl Unpin for Pcf8523
impl RefUnwindSafe for Pcf8523
impl UnwindSafe for Pcf8523
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,