Trident IoT SDK
Loading...
Searching...
No Matches
tr_rtc_driver.h
Go to the documentation of this file.
1
44
49
50
51#ifndef TR_RTC_DRIVER_
52#define TR_RTC_DRIVER_
53
54#include <stdint.h>
55#include <stdbool.h>
56#include "tr_hal_rtc.h"
57#ifdef __cplusplus
58extern "C" {
59#endif
60
65
70
102void tr_rtc_driver_init(uint32_t reset_reason);
103 /* rtc_init */
105
111
121uint64_t tr_rtc_get_hw_ms(void);
122
143uint64_t tr_rtc_get_uptime_ms(void);
144 /* rtc_time */
146
152
165
183void tr_rtc_wallclock_ms_set(uint64_t ms_since_2000);
184 /* rtc_wallclock */
186
192
202
227 /* rtc_calendar */
229
235
270void tr_rtc_setup_alarm(uint64_t delta_ms);
271 /* rtc_alarm */
273
279
290void tr_rtc_ms_to_calendar(uint64_t ms_since_2000, tr_hal_rtc_date_time* date);
291
308 /* rtc_convert */
310 /* rtc_api */
312
313#ifdef __cplusplus
314}
315#endif
316
317#endif //TR_RTC_DRIVER_H_
void tr_rtc_setup_alarm(uint64_t delta_ms)
Program an RTC alarm to fire approximately delta_ms in the future.
void tr_rtc_calendar_get(tr_hal_rtc_date_time *date)
Read the current hardware RTC calendar.
void tr_rtc_calendar_set(const tr_hal_rtc_date_time *date)
Set the hardware RTC calendar safely (preserving uptime).
void tr_rtc_ms_to_calendar(uint64_t ms_since_2000, tr_hal_rtc_date_time *date)
Convert ms‑since‑2000 to a calendar (Y/M/D h:m:s.ms).
uint64_t tr_rtc_calendar_to_ms(const tr_hal_rtc_date_time *date)
Convert a calendar (Y/M/D h:m:s.ms) to ms‑since‑2000.
void tr_rtc_driver_init(uint32_t reset_reason)
Initialize the RTC driver and reconstruct internal state.
uint64_t tr_rtc_get_hw_ms(void)
Get the current hardware RTC time in milliseconds since 2000‑01‑01.
uint64_t tr_rtc_get_uptime_ms(void)
Get the 64‑bit monotonic uptime in milliseconds.
void tr_rtc_wallclock_ms_set(uint64_t ms_since_2000)
Set the wall‑clock (ms since 2000‑01‑01) using the offset model.
uint64_t tr_rtc_wallclock_ms_get(void)
Get the wall‑clock time (ms since 2000‑01‑01).
Definition T32CM11_rtc.h:135
This is the common include file for the Trident HAL Power Mgmt.