Module imxrt_hal::srtc[][src]

Secure Real-Time Clock

Basic support only: Supports enabling and setting the clock, but not any of its more advanced features (alarm, calibration, stop on security violation, etc).

The Secure Real-Time Clock continues tracking time until it is specifically disabled or loses power, even through a system reboot (and potentially a loss of power to the system, if the SRTC is connected to a battery).

Example

use imxrt_hal;

let mut peripherals = imxrt_hal::Peripherals::take().unwrap();

let mut srtc = peripherals.srtc.enable_and_set(&mut peripherals.ccm.handle, 1600000000, 0);
// Interpreted as Unix time: Sep 13 2020 12:26:40.000

let now = srtc.get();

Teensy 4.x Note

When the SRTC is enabled, setting the board into program mode then using the Teensy Loader application (GUI) to reboot it will set the current time (Unix epoch, but time in local timezone). This will overwrite whatever time you may have previously set and is ambiguous around the backwards daylight savings transition point.

Structs

SRTC

The Secure Real-Time Clock, enabled.

Unclocked

The SRTC, disabled.

Enums

EnabledState

Indicates the result of the try_enable method

Functions

micros_to_ticks

Converts the number of microseconds that have occurred since a second into clock ticks (1/32768 of a second).