42#include <ti/devices/DeviceFamily.h>
43#include DeviceFamily_constructPath(driverlib/aon_event.h)
44#include DeviceFamily_constructPath(driverlib/aon_rtc.h)
45#include DeviceFamily_constructPath(driverlib/interrupt.h)
47#include <ti/drivers/dpl/ClockP.h>
48#include <ti/drivers/dpl/HwiP.h>
53#define HWIP_RTC_CH AON_RTC_CH0
54#define RTIMER_RTC_CH AON_RTC_CH1
56typedef void (*isr_fxn_t)(void);
57typedef void (*hwi_dispatch_fxn_t)(void);
59static hwi_dispatch_fxn_t hwi_dispatch_fxn;
80 if(AONRTCEventGet(RTIMER_RTC_CH)) {
81 AONRTCEventClear(RTIMER_RTC_CH);
82 AONRTCChannelDisable(RTIMER_RTC_CH);
90 if(AONRTCEventGet(HWIP_RTC_CH)) {
93 IntPendClear(INT_AON_RTC_COMB);
104 ClockP_Struct clk_object;
105 ClockP_Params clk_params;
106 volatile isr_fxn_t *ramvec_table;
108 key = HwiP_disable();
119 ClockP_Params_init(&clk_params);
121 ClockP_destruct(&clk_object);
124 ramvec_table = (isr_fxn_t *)HWREG(NVIC_VTABLE);
137 hwi_dispatch_fxn = (hwi_dispatch_fxn_t)ramvec_table[INT_AON_RTC_COMB];
138 if(!hwi_dispatch_fxn) {
151 IntPrioritySet(INT_AON_RTC_COMB, INT_PRI_LEVEL7);
153 AONEventMcuWakeUpSet(AON_EVENT_MCU_WU3, AON_EVENT_RTC_CH1);
154 AONRTCCombinedEventConfig(HWIP_RTC_CH | RTIMER_RTC_CH);
169 AONRTCCompareValueSet(RTIMER_RTC_CH, (uint32_t)t);
170 AONRTCChannelEnable(RTIMER_RTC_CH);
183 return (rtimer_clock_t)AONRTCCurrentCompareValueGet();
static void rtimer_clock_stub(uintptr_t unused)
Stub function used when creating the dummy clock object.
static void rtimer_isr_hook(void)
The Man-in-the-Middle ISR hook for the HWI dispatch ISR.
void rtimer_arch_init(void)
We don't need to explicitly initialise anything but this routine is required by the API.
rtimer_clock_t rtimer_arch_now()
Returns the current real-time clock time.
void rtimer_arch_schedule(rtimer_clock_t t)
Schedules an rtimer task to be triggered at time t.
void rtimer_run_next(void)
Execute the next real-time task and schedule the next task, if any.