-
Notifications
You must be signed in to change notification settings - Fork 0
/
tTimer.h
47 lines (40 loc) · 1.09 KB
/
tTimer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef TTIMER_H
#define TTIMER_H
#include "tEvent.h"
typedef enum _tTimerState {
tTimerCreated,
tTimerStarted,
tTimerRunning,
tTimerStopped,
tTimerDestroyed
} tTimerState;
typedef struct _tTimer {
tNode linkNode;
uint32_t startDelayTicks;
uint32_t durationTicks;
uint32_t delayTicks;
void (*timerFunc) (void * arg);
void * arg;
uint32_t config;
tTimerState state;
} tTimer;
typedef struct _tTimerInfo{
uint32_t startDelayTicks;
uint32_t durationTicks;
void (*timerFunc) (void * arg);
void * arg;
uint32_t config;
tTimerState state;
}tTimerInfo;
#define TIMER_CONFIG_TYPE_HARD (1 << 0)
#define TIMER_CONFIG_TYPE_SOFT (0 << 0)
void tTimerInit(tTimer * timer, uint32_t delayTicks, uint32_t durationTicks,
void (*timerFunc) (void * arg), void * arg, uint32_t config);
void tTimerStart (tTimer * timer);
void tTimerStop (tTimer * timer);
void tTimerDestroy(tTimer * timer);
void tTimerGetInfo(tTimer * timer, tTimerInfo * info);
void tTimerModuleTickNotify (void);
void tTimerModuleInit (void);
void tTimerInitTask(void);
#endif