rx8900

Crates.iorx8900
lib.rsrx8900
version0.1.2
sourcesrc
created_at2024-04-16 08:09:43.257815
updated_at2024-04-17 05:00:23.312634
descriptionA rust device driver for the Epson RX8900SA/CE I2C-Bus Interface Real Time Clock Module.
homepage
repositoryhttps://github.com/task-jp/rx8900-rs
max_upload_size
id1210046
size93,568
Tasuku Suzuki (task-jp)

documentation

https://docs.rs/rx8900

README

rx8900

A rust device driver for the Epson RX8900SA/CE I2C-Bus Interface Real Time Clock Module.

RX8900CE | Real Time Clock | Product | Epson crystal device

Brief Sheet

Application Manual

Usage

use rx8900::RX8900;

let i2c = /* ..i2c provider */
let mut delay = /* ..delay provider */

// initialize the RX8900 using the primary I2C address 0x32
let mut bme280 = RX8900::new_primary(i2c);

// initialize the rtc
bme280.init().unwrap();

// some delay
delay.delay_ms(10);

// set initial date time
let datetime = NaiveDateTime::new(
    chrono::NaiveDate::from_ymd_opt(2001, 2, 3).unwrap(),
    chrono::NaiveTime::from_hms_opt(4, 5, 6).unwrap(),
);
rx8900.set_datetime(datetime).unwrap();

// read date time from RX8900
let datetime = rx8900.datetime().unwrap();

License

Licensed under either of:

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 11

cargo fmt