cmos

Crates.iocmos
lib.rscmos
version0.1.2
sourcesrc
created_at2018-12-09 18:50:54.328242
updated_at2020-09-15 03:24:16.171066
descriptionA utility to read, write CMOS and RTC data. Standard library not required.
homepagehttps://github.com/noahrinehart/cmos
repositoryhttps://github.com/noahrinehart/cmos
max_upload_size
id100972
size16,253
Noah Rinehart (noahrinehart)

documentation

https://docs.rs/cmos/

README

CMOS

A utility to read, write CMOS and RTC data. Standard library not required.

Linux build status Coverage Status crates.io

Requirements

Using the library (only tested on x86, nightly compiler required)

Add the crate to your project

# Cargo.toml
cmos = "0.1.2"

Examples

To read the RTC using the century register.

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.

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.

Contributing

Feel free to contribute what you want. Just send in a pull request!

License

MIT

Commit count: 54

cargo fmt