[][src]Struct pcf8523::Pcf8523

pub struct Pcf8523 { /* fields omitted */ }


impl Pcf8523[src]

pub fn new(i2cpath: &str) -> Pcf8523[src]

Returns a new Pcf8523 using the specified path to an i2c-dev device.


  • i2cpath - Path to the I2C device, e.g. /dev/i2c-1


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 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 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>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> Any for T where
    T: 'static + ?Sized