#rtc #arceos #aarch64 #pl031

no-std arm_pl031

System Real Time Clock (RTC) Drivers for aarch64 based on PL031

5 unstable releases

0.4.1 Apr 2, 2026
0.2.1 Jul 24, 2024
0.2.0 Jul 22, 2024
0.1.1 Jul 15, 2024
0.1.0 Jul 15, 2024

#225 in Hardware support

Download history 319/week @ 2025-12-27 467/week @ 2026-01-03 274/week @ 2026-01-10 379/week @ 2026-01-17 723/week @ 2026-01-24 859/week @ 2026-01-31 852/week @ 2026-02-07 191/week @ 2026-02-14 739/week @ 2026-02-21 988/week @ 2026-02-28 843/week @ 2026-03-07 1224/week @ 2026-03-14 1042/week @ 2026-03-21 1473/week @ 2026-03-28 783/week @ 2026-04-04 644/week @ 2026-04-11

4,166 downloads per month
Used in 50 crates (3 directly)

GPL-3.0-or-later OR Apache-2…

9KB
100 lines

arm_pl031

Crates.io

System Real Time Clock (RTC) Drivers for aarch64 based on PL031.

Examples

use arm_pl031::Rtc;

let rtc = unsafe { Rtc::new(0x901_0000 as _) };
let epoch_time = rtc.get_unix_timestamp();

base_addr needs to be the device virtual address available for mmio, which can be obtained from the device tree, for example:

/ {
	interrupt-parent = <0x8002>;
	model = "linux,dummy-virt";
	#size-cells = <0x02>;
	#address-cells = <0x02>;
	compatible = "linux,dummy-virt";

	pl031@9010000 {
		clock-names = "apb_pclk";
		clocks = <0x8000>;
		interrupts = <0x00 0x02 0x04>;
		reg = <0x00 0x9010000 0x00 0x1000>;
		compatible = "arm,pl031\0arm,primecell";
	};

    ...
}

Dependencies

~1MB
~18K SLoC