This is the Timer Subsystem for controlling Timer of a SOC.
◆ timer_deinit()
int32_t timer_deinit |
( |
struct timer * |
timer | ) |
|
Deinit Timer
- Parameters
-
- Returns
- -1 on error 0 on ok
◆ timer_getTime()
uint64_t timer_getTime |
( |
struct timer * |
timer | ) |
|
Get Time
- Parameters
-
- Returns
- time
◆ timer_init()
struct timer* timer_init |
( |
uint32_t |
index, |
|
|
uint32_t |
prescaler, |
|
|
uint64_t |
basetime, |
|
|
int64_t |
adjust |
|
) |
| |
Init Timer
- Parameters
-
index | Index of timer |
prescaler | Prescaler of Timer 0 if only get Timer Instants timer must initialized |
basetime | Base time of adjustment for example 20ms |
adjust | Diff to basetime for example 10us |
- Returns
- Timer instance NULL on Error or not init if prescaler = 0
◆ timer_oneshot()
int32_t timer_oneshot |
( |
struct timer * |
timer, |
|
|
uint64_t |
us |
|
) |
| |
Set timer in oneshot mode, stop after us
- Parameters
-
timer | Timer instance |
us | Timerout |
- Returns
- -1 on error 0 on ok
◆ timer_periodic()
int32_t timer_periodic |
( |
struct timer * |
timer, |
|
|
uint64_t |
us |
|
) |
| |
Set timer in periodic mode
- Parameters
-
timer | Timer instance |
us | Timerout |
- Returns
- -1 on error 0 on ok
◆ timer_setOverflowCallback()
int32_t timer_setOverflowCallback |
( |
struct timer * |
timer, |
|
|
bool(*)(struct timer *timer, void *data) |
callback, |
|
|
void * |
data |
|
) |
| |
Set Overflow Callback
- Parameters
-
timer | Timer instance |
callback | Callback used if Timer Overflow |
data | Data passed to Callback |
- Returns
- -1 on error 0 on ok
◆ timer_start()
int32_t timer_start |
( |
struct timer * |
timer | ) |
|
Start timer
- Parameters
-
- Returns
- -1 on error 0 on ok
◆ timer_stop()
int32_t timer_stop |
( |
struct timer * |
timer | ) |
|
Stop timer
- Parameters
-
- Returns
- -1 on error 0 on ok