Skip to content

noahrinehart/cmos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages