HALFRED  0.4.0
hali_tim.h
Go to the documentation of this file.
1 
10 #ifndef HALI_TIM_H
11 #define HALI_TIM_H
12 
13 #include "hal_tim.h"
14 
15 
17 typedef struct {
21  void (*handler)(TIMDevice tim, TIM_EventID event_id, TIM_Time expire_time, void* context);
23  void* context;
26 } TIM_Event;
27 
29 typedef struct {
31  int32_t MaxEvents;
33  int32_t InstalledEvents;
39 
40 
43 {
47  uint32_t TickTimeBase;
48 
57 
65  void (*Init)(TIMDevice timdevice, uint32_t TickTimeBase);
66 
73  void (*Deinit)(TIMDevice timdevice);
74 
82  TIM_Time (*GetTime)(TIMDevice timdevice);
83 
89  void (*ResetCounter)(TIMDevice timdevice);
90 
96  void (*GetCapabilities)(TIMDevice timdevice, TIM_Capabilities* caps);
97 
106  int32_t (*GetError)(TIMDevice timdevice, uint32_t TickTimeBase);
107 
111  int (*ScheduleEvent)(TIMDevice timdevice, TIM_Time time);
112 
113 };
114 
117 
118 #endif /* HALI_TIM_H */
void(* GetCapabilities)(TIMDevice timdevice, TIM_Capabilities *caps)
Definition: hali_tim.h:96
Definition: hal_tim.h:169
TIM_Time(* GetTime)(TIMDevice timdevice)
Definition: hali_tim.h:82
void(* Deinit)(TIMDevice timdevice)
Definition: hali_tim.h:73
TIM_Event * EventTable
event table, note that event_id holds an index to this table
Definition: hali_tim.h:37
TIM_EventTable * IntEvents
Definition: hali_tim.h:52
Definition: hali_tim.h:17
int32_t InstalledEvents
number of installed events
Definition: hali_tim.h:33
Definition: hal_tim.h:156
Definition: hali_tim.h:29
Definition: hal_tim.h:191
uint32_t TickTimeBase
Definition: hali_tim.h:47
Definition: hali_tim.h:42
int32_t MaxEvents
maximal number of events that can be installed (this is the size of EventTable)
Definition: hali_tim.h:31
void(* Init)(TIMDevice timdevice, uint32_t TickTimeBase)
Definition: hali_tim.h:65
int32_t(* GetError)(TIMDevice timdevice, uint32_t TickTimeBase)
Definition: hali_tim.h:106
void * context
user-defined event context
Definition: hali_tim.h:23
Timer API.
void(* ResetCounter)(TIMDevice timdevice)
Definition: hali_tim.h:89
TIM_EventTable * TskEvents
Definition: hali_tim.h:56
int(* ScheduleEvent)(TIMDevice timdevice, TIM_Time time)
Definition: hali_tim.h:111
TIM_EventID NextEvent
index of the next interrupt-level event
Definition: hali_tim.h:35
TIM_EventID next_event
id of the next event
Definition: hali_tim.h:25
TIM_Time expires
time at which event expires
Definition: hali_tim.h:19