A utility to read, write CMOS and RTC data. Standard library not required.
Add the crate to your project ```sh
cmos = "0.1.1" ```
To read the RTC using the century register.
rust
use cmos::{CMOS, CMOSCenturyHandler};
// Create a CMOS object (unsafe due to the use of port I/O)
let mut cmos = unsafe { CMOS::new() };
// Read the rtc date time using this year
let rtc = cmos.read_rtc(CMOSCenturyHandler::CenturyRegister(32));
To read the RTC using the current year.
rust
use cmos::{CMOS, CMOSCenturyHandler};
// Create a CMOS object (unsafe due to the use of port I/O)
let mut cmos = unsafe { CMOS::new() };
// Read the rtc date time using this year
let rtc = cmos.read_rtc(CMOSCenturyHandler::CurrentYear(2018));
Check the docs for more information.
Feel free to contribute what you want. Just send in a pull request!
MIT