137 #ifndef HAL_TIM_USE_INTERRUPT_EVENTS
138 #define HAL_TIM_USE_INTERRUPT_EVENTS 1
142 #ifndef HAL_TIM_USE_TASK_EVENTS
143 #define HAL_TIM_USE_TASK_EVENTS 1
148 #define TIM_NO_EVENT 0xffffffff
171 uint32_t counter_periods : 31;
172 uint32_t negative : 1;
223 #define TIM_Deinit(TIM) (TIM)->Deinit(TIM)
230 #define TIM_GetTime(TIM) (TIM)->GetTime(TIM)
237 #define TIM_ResetCounter(TIM) (TIM)->ResetCounter(TIM)
245 #define TIM_GetCapabilities(TIM, Caps) (TIM)->GetCapabilities(TIM, Caps)
254 #define TIM_GetError(TIM, TickTimeBase) (TIM)->GetError(TIM, TickTimeBase)
443 static HAL_INLINE
int TIM_IsEventValid(
TIM_EventID event_id) {
if (
TIM_NO_EVENT == event_id.
id) {
return 0; }
return 1; }
Definition: hal_tim.h:169
uint32_t MinTickBase
Lowest possible time base for a timer tick (in nanoseconds) - for highest timer resolution.
Definition: hal_tim.h:194
void TIM_TaskEventProc(TIMDevice tim)
This type indicates that the event handler is called from within an interrupt service routine...
Definition: hal_tim.h:184
TIM_Time TIM_GetEventTime(TIMDevice tim, TIM_EventID event_id)
HALRESULT
Definition: hal_defs.h:16
int TIM_CompareTime(TIM_Time t1, TIM_Time t2)
This type indicates, that the event handler is called from a task (and NOT directly in an interrupt s...
Definition: hal_tim.h:186
TIM_Time TIM_SubtractTime(TIMDevice tim, TIM_Time t1, TIM_Time t2)
TIM_EventID TIM_GetNextEvent(TIMDevice tim)
TIM_EventID TIM_InitEvent(TIMDevice tim, void(*handler)(TIMDevice tim, TIM_EventID event_id, TIM_Time expire_time, void *context), TIM_EventType type, void *context)
uint32_t counter_ticks
absolute number of ticks
Definition: hal_tim.h:174
uint32_t id
32-bit plain id
Definition: hal_tim.h:158
Definition: hal_tim.h:156
void TIM_InterruptProc(TIMDevice tim)
Uninitialized type of event.
Definition: hal_tim.h:182
void TIM_DeinitEvent(TIMDevice tim, TIM_EventID event_id)
various compiler-dependent definitions
void TIM_Init(TIMDevice tim, uint32_t TickTimeBase)
Definition: hal_tim.h:191
uint32_t TickTimeBase
Definition: hali_tim.h:47
TIM_Time TIM_NSToTimTime(TIMDevice tim, int64_t ns)
int64_t TIM_GetTimeElapsed(TIMDevice tim, TIM_Time since)
uint32_t MaxTickBase
Highest possible time base for a timer tick(in nanoseconds) - for widest time range.
Definition: hal_tim.h:196
HALRESULT TIM_ScheduleEvent(TIMDevice tim, TIM_EventID event_id, TIM_Time delta_time)
int64_t TIM_GetTimeInNS(TIMDevice tim)
Definition: hali_tim.h:42
uint32_t CounterRange
Hardware counter range. This would be for example 0x0000ffff for 16bit timers.
Definition: hal_tim.h:198
#define TIM_NO_EVENT
An identifier representing uninitialized (empty) event.
Definition: hal_tim.h:148
TIM_Time TIM_AddTime(TIMDevice tim, TIM_Time t1, TIM_Time t2)
struct TIMDeviceDesc * TIMDevice
Definition: hal_tim.h:203
HALRESULT TIM_ScheduleEventAt(TIMDevice tim, TIM_EventID event_id, TIM_Time abs_time)
bool TIM_IsEventScheduled(TIMDevice tim, TIM_EventID event_id)
HALRESULT TIM_UnscheduleEvent(TIMDevice tim, TIM_EventID event_id)
TIM_Time TIM_GetTimeToEvent(TIMDevice tim, TIM_EventID event_id)
int64_t TIM_TimTimeToNS(TIMDevice tim, TIM_Time t)
TIM_EventID TIM_SetEventType(TIMDevice tim, TIM_EventID event_id, TIM_EventType type)
TIM_EventType TIM_GetEventType(TIM_EventID event_id)
TIM_EventType
Definition: hal_tim.h:179