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 Pcf8523;
use Pcf8523DateTime;
// configure I2C bus at 100, 400 or 1_000 kHz...
let mut pcf8523 = new?;
// 1:41:13PM on 08.21.2025
let dt = new?;
pcf8523.set_datetime?;
pcf8523.start?;
let now = pcf8523.now?.timestamp;
Usage (async)
use Pcf8523;
use Pcf8523DateTime;
// configure I2C bus at 100, 400 or 1_000 kHz...
let mut pcf8523 = new.await?;
// 1:41:13PM on 08.21.2025
let dt = new?;
pcf8523.set_datetime.await?;
pcf8523.start.await?;
let now = pcf8523.now.await?.timestamp;
Examples
Tests
From the root dir: $ cargo test