Expand description
§PCF8563/BM8563 Real-Time Clock Driver
This crate provides a bisync-based driver for the PCF8563 and BM8563 real-time clock ICs,
built upon the device-driver crate for robust, declarative register definitions via a
YAML manifest. It supports both asynchronous (async) and blocking operation through a
unified API, using the bisync crate for seamless compatibility
with both embedded-hal and embedded-hal-async traits.
§Features
- Declarative Register Map: Full device configuration defined in
device.yaml. - Unified Async/Blocking Support: Write your code once and use it in both async and blocking contexts via bisync.
- Type-Safe API: High-level functions for reading/setting date and time
and a generated low-level API (
ll) for direct register access. - Full RTC Functionality: Date/time, alarms, timer, and clock output control.
- Optional
rtccTraits (blocking): Enable thertccfeature to implementrtcc::DateTimeAccessandrtcc::Rtccon the blocking driver. defmtandlogIntegration: Optional support for logging and debugging.
§Getting Started
To use the driver, instantiate Pcf8563 (blocking) or Pcf8563Async (async) with your I2C bus implementation:
let i2c_bus = todo!();
let mut rtc = Pcf8563::new(i2c_bus);
let datetime = rtc.get_datetime()?;For async environments, use Pcf8563Async (re-exported from the asynchronous module):
let i2c_bus = todo!();
let mut rtc = Pcf8563Async::new(i2c_bus);
let datetime = rtc.get_datetime().await?;For a detailed register map, please refer to the device.yaml file in the
repository.
§Supported Devices
- PCF8563 - NXP real-time clock (original)
- BM8563 - Compatible clone found in M5Stack devices
Modules§
- field_
sets - Module containing the generated fieldsets of the registers and commands
Structs§
- Alarm
- Alarm configuration
- Date
Time - Date and time structure
- Pcf8563
- Pcf8563
Async - Pcf8563
Interface - Pcf8563
LowLevel - Root block of the Pcf8563LowLevel driver
- Time
- Time-only structure (for clock applications without calendar)
Enums§
- Clkout
Frequency - CLKOUT output frequency selection
- RtcError
- Timer
Frequency - Timer source clock frequency
Constants§
- PCF8563_
I2C_ ADDR - PCF8563/BM8563 I2C address (7-bit)