nxp-pcf8523

Crates.ionxp-pcf8523
lib.rsnxp-pcf8523
version2.0.0
created_at2025-08-22 15:06:24.761173+00
updated_at2026-01-03 23:05:43.440827+00
descriptionA no-std driver for the NXP PCF8523 RTC and calendar module.
homepage
repositoryhttps://github.com/ardentTech/nxp-pcf8523
max_upload_size
id1806484
size58,168
Jonathan D. Baker (ardentTech)

documentation

README

NXP PCF8523

#![no_std], async-first driver for the NXP PCF8523 RTC and calendar module built on top of the Rust embedded-hal. Supported I2C modes include standard (100 kHz), fast (400 kHz) and fast+ (1_000 kHz), and the module has a fixed I2C address of 0x68.

Usage (blocking)

Enable sync feature in Cargo.toml, then:

use nxp_pcf8523::Pcf8523;
use nxp_pcf8523::datetime::Pcf8523DateTime;

// configure I2C bus at 100, 400 or 1_000 kHz...

let mut pcf8523 = Pcf8523::new(i2c_bus, Pcf8523T {})?;
// 1:41:13PM on 08.21.2025
let dt = Pcf8523DateTime::new(13, 41, 13, 8, 21, 25)?;
pcf8523.set_datetime(dt)?;
pcf8523.start()?;
let now = pcf8523.now()?.timestamp();

Usage (async)

use nxp_pcf8523::Pcf8523;
use nxp_pcf8523::datetime::Pcf8523DateTime;

// configure I2C bus at 100, 400 or 1_000 kHz...

let mut pcf8523 = Pcf8523::new(i2c_bus, Pcf8523T {}).await?;
// 1:41:13PM on 08.21.2025
let dt = Pcf8523DateTime::new(13, 41, 13, 8, 21, 25)?;
pcf8523.set_datetime(dt).await?;
pcf8523.start().await?;
let now = pcf8523.now().await?.timestamp();

Examples

Tests

From the root dir: $ cargo test

Resources

Acknowledgements

License

Commit count: 34

cargo fmt