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 56 typedef void (*isr_fxn_t)(void);
57 typedef void (*hwi_dispatch_fxn_t)(void);
59 static 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) {
152 AONEventMcuWakeUpSet(AON_EVENT_MCU_WU1, AON_EVENT_RTC_CH1);
153 AONRTCCombinedEventConfig(HWIP_RTC_CH | RTIMER_RTC_CH);
173 AONRTCCompareValueSet(RTIMER_RTC_CH, (uint32_t)t);
174 AONRTCChannelEnable(RTIMER_RTC_CH);
187 return (rtimer_clock_t)AONRTCCurrentCompareValueGet();
rtimer_clock_t rtimer_arch_now()
Returns the current real-time clock time.
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_schedule(rtimer_clock_t t)
Schedules an rtimer task to be triggered at time t.
void rtimer_arch_init(void)
We don't need to explicitly initialise anything but this routine is required by the API...
void rtimer_run_next(void)
Execute the next real-time task and schedule the next task, if any.