[][src]Trait mcp794xx::Rtcc

pub trait Rtcc {
    type Error;
    fn get_seconds(&mut self) -> Result<u8, Self::Error>;
fn get_minutes(&mut self) -> Result<u8, Self::Error>;
fn get_hours(&mut self) -> Result<Hours, Self::Error>;
fn get_weekday(&mut self) -> Result<u8, Self::Error>;
fn get_day(&mut self) -> Result<u8, Self::Error>;
fn get_month(&mut self) -> Result<u8, Self::Error>;
fn get_year(&mut self) -> Result<u16, Self::Error>;
fn get_datetime(&mut self) -> Result<DateTime, Self::Error>;
fn set_seconds(&mut self, seconds: u8) -> Result<(), Self::Error>;
fn set_minutes(&mut self, minutes: u8) -> Result<(), Self::Error>;
fn set_hours(&mut self, hours: Hours) -> Result<(), Self::Error>;
fn set_weekday(&mut self, weekday: u8) -> Result<(), Self::Error>;
fn set_day(&mut self, day: u8) -> Result<(), Self::Error>;
fn set_month(&mut self, month: u8) -> Result<(), Self::Error>;
fn set_year(&mut self, year: u16) -> Result<(), Self::Error>;
fn set_datetime(&mut self, datetime: &DateTime) -> Result<(), Self::Error>; }

Real-Time Clock / Calendar

Associated Types

type Error

Error type

Loading content...

Required methods

fn get_seconds(&mut self) -> Result<u8, Self::Error>

Read the seconds.

fn get_minutes(&mut self) -> Result<u8, Self::Error>

Read the minutes.

fn get_hours(&mut self) -> Result<Hours, Self::Error>

Read the hours.

fn get_weekday(&mut self) -> Result<u8, Self::Error>

Read the day of the week [1-7].

fn get_day(&mut self) -> Result<u8, Self::Error>

Read the day of the month [1-31].

fn get_month(&mut self) -> Result<u8, Self::Error>

Read the month [1-12].

fn get_year(&mut self) -> Result<u16, Self::Error>

Read the year (e.g. 2000).

fn get_datetime(&mut self) -> Result<DateTime, Self::Error>

Read the date and time.

fn set_seconds(&mut self, seconds: u8) -> Result<(), Self::Error>

Set the seconds [0-59].

fn set_minutes(&mut self, minutes: u8) -> Result<(), Self::Error>

Set the minutes [0-59].

fn set_hours(&mut self, hours: Hours) -> Result<(), Self::Error>

Set the hours.

Changes the operating mode to 12h/24h depending on the parameter.

fn set_weekday(&mut self, weekday: u8) -> Result<(), Self::Error>

Set the day of week [1-7].

fn set_day(&mut self, day: u8) -> Result<(), Self::Error>

Set the day of month [1-31].

fn set_month(&mut self, month: u8) -> Result<(), Self::Error>

Set the month [1-12].

fn set_year(&mut self, year: u16) -> Result<(), Self::Error>

Set the year. (e.g. 2000)

fn set_datetime(&mut self, datetime: &DateTime) -> Result<(), Self::Error>

Set the date and time.

Loading content...

Implementors

impl<DI, E, IC> Rtcc for Mcp794xx<DI, IC> where
    DI: WriteData<Error = Error<E>> + ReadData<Error = Error<E>>, 
[src]

type Error = Error<E>

fn get_year(&mut self) -> Result<u16, Self::Error>[src]

This device can compensate for leap years up to 2399 but only the two last year digits are stored so we will return the year as in the range 2000-2099.

fn set_weekday(&mut self, weekday: u8) -> Result<(), Self::Error>[src]

Note that this clears the power failed flag.

fn set_year(&mut self, year: u16) -> Result<(), Self::Error>[src]

This device can compensate for leap years up to 2399 but only the two last year digits are stored so we only support the range 2000-2099.

fn get_datetime(&mut self) -> Result<DateTime, Self::Error>[src]

This device can compensate for leap years up to 2399 but only the two last year digits are stored so we will return the year as in the range 2000-2099.

fn set_datetime(&mut self, datetime: &DateTime) -> Result<(), Self::Error>[src]

Note that this clears the power failed flag. This device can compensate for leap years up to 2399 but only the two last year digits are stored so we only support the range 2000-2099.

Loading content...