Trident IoT SDK
 
Loading...
Searching...
No Matches
tr_hal_rtc.h
Go to the documentation of this file.
1
10
11#ifndef TR_HAL_RTC_H_
12#define TR_HAL_RTC_H_
13
14#include "tr_hal_platform.h"
15
16
20
26
30
31// this can be used to set the time and date, in addition to event and
32// interrupt settings. Unlike other HAL modules, no uninit function is
33// needed, and init can be called over and over, and just resets the
34// RTC to the settings in the struct passed in
36
37// see if the RTC is running
38// this allows apps to initialzie it if not
40
41
45
46// read time
48
49// read date
51
52// read time and date
54
55// check the difference between 2 time structs and if that diff is
56// greater than the check_against_time passed in
58 tr_hal_rtc_time* time2,
59 uint32_t check_against_ms);
60
64
65// do not need these if use the settings struct and the init function
66
67// set RTC time
69
70// set RTC date
72
73// set RTC time and date
75
76
80
81// do not need this if use the settings struct and the init function
82
83// set RTC event handler
85
86
90
91// do not need these if use the settings struct and the init function
92
93// set RTC interrupt handling
95 tr_hal_int_pri_t interrupt_priority,
96 bool wake_on_interrupt);
97
99 tr_hal_int_pri_t* interrupt_priority,
100 bool* wake_on_interrupt);
101
105// do not need these if use the settings struct and the init function
106
107// read clock divisor
109
110// set clock divisor
112
113
130
131// to setup an event of type #2 (ON_CHANGE) or type #3 (ON_VALUE)
133 tr_hal_rtc_event_trigger_t event_trigger,
134 uint16_t trigger_value);
135
136// to setup combo event (type #4)
137// can only have 1 of these at a time - chip restriction
139
140
144
145
146#endif //TR_HAL_RTC_H_
tr_hal_int_pri_t
values and a range checking function for setting the interrupt priority in the Trident HAL APIs
Definition tr_hal_platform.h:34
tr_hal_status_t tr_hal_rtc_set_event_handler(tr_hal_rtc_event_callback_t new_event_handler)
tr_hal_status_t tr_hal_rtc_get_date(tr_hal_rtc_date *return_date)
tr_hal_status_t tr_hal_rtc_set_date(tr_hal_rtc_date new_date)
bool tr_hal_rtc_diff_greater_than_ms(tr_hal_rtc_time *time1, tr_hal_rtc_time *time2, uint32_t check_against_ms)
tr_hal_status_t tr_hal_rtc_set_date_time(tr_hal_rtc_date_time new_date_time)
tr_hal_status_t tr_hal_rtc_is_running(bool *is_enabled)
tr_hal_status_t tr_hal_rtc_get_date_time(tr_hal_rtc_date_time *return_date_time)
tr_hal_status_t tr_hal_rtc_get_interrupt_behavior(bool *enable_chip_interrupts, tr_hal_int_pri_t *interrupt_priority, bool *wake_on_interrupt)
tr_hal_status_t tr_hal_rtc_set_clock_divisor(uint32_t clock_divisor)
tr_hal_status_t tr_hal_rtc_init(tr_hal_rtc_settings_t *rtc_settings)
tr_hal_status_t tr_hal_rtc_set_interrupt_behavior(bool enable_chip_interrupts, tr_hal_int_pri_t interrupt_priority, bool wake_on_interrupt)
tr_hal_status_t tr_hal_rtc_get_clock_divisor(uint32_t *clock_divisor)
tr_hal_status_t tr_hal_rtc_get_time(tr_hal_rtc_time *return_time)
tr_hal_status_t tr_hal_rtc_set_combo_trigger_event(tr_hal_rtc_date_time new_date_time)
tr_hal_status_t tr_hal_rtc_set_time_trigger_event(tr_hal_rtc_time_unit_t time_unit, tr_hal_rtc_event_trigger_t event_trigger, uint16_t trigger_value)
tr_hal_status_t tr_hal_rtc_set_time(tr_hal_rtc_time new_time)
tr_hal_status_t
Definition tr_hal_common.h:25
void(* tr_hal_rtc_event_callback_t)(uint32_t event_bitmask, tr_hal_rtc_date_time current_date_time)
Definition T32CM11_rtc.h:304
tr_hal_rtc_event_trigger_t
this enum is the trigger setting for time unit events OFF = not enabled ON_CHANGE = whenever the time...
Definition T32CM11_rtc.h:176
tr_hal_rtc_time_unit_t
this enum is used when we set up a time unit event, to tell which units we are using
Definition T32CM11_rtc.h:156
Definition T32CM11_rtc.h:135
convenience structs for use when passing around dates, times, or both
Definition T32CM11_rtc.h:107
Definition T32CM11_rtc.h:327
Definition T32CM11_rtc.h:121