35#ifndef _NO_OS_SRC_TIMER_H_
36#define _NO_OS_SRC_TIMER_H_
40#define TIMER_MAX_TABLE 4
96 void (*handler)(
void *),
112 uint64_t *elapsed_time);
148 uint64_t *elapsed_time);
152 void (*handler)(
void *),
int32_t no_os_timer_start(struct no_os_timer_desc *desc)
Start a timer.
Definition no_os_timer.c:99
int32_t no_os_timer_set_callback(struct no_os_timer_desc *desc, void(*handler)(void *), void *ctx)
Register timer callback and context.
Definition no_os_timer.c:223
int32_t no_os_timer_init(struct no_os_timer_desc **desc, const struct no_os_timer_init_param *param)
Initialize hardware timer and the handler structure associated with it.
Definition no_os_timer.c:52
int32_t no_os_timer_counter_get(struct no_os_timer_desc *desc, uint32_t *counter)
Get the value of the counter register for the timer.
Definition no_os_timer.c:133
int32_t no_os_timer_counter_set(struct no_os_timer_desc *desc, uint32_t new_val)
Set the timer counter register value.
Definition no_os_timer.c:151
int32_t no_os_timer_count_clk_set(struct no_os_timer_desc *desc, uint32_t freq_hz)
Set the timer clock frequency.
Definition no_os_timer.c:186
int32_t no_os_timer_stop(struct no_os_timer_desc *desc)
Stop a timer from counting.
Definition no_os_timer.c:115
int32_t no_os_timer_remove(struct no_os_timer_desc *desc)
Free the memory allocated by timer_init().
Definition no_os_timer.c:80
int32_t no_os_timer_get_elapsed_time_nsec(struct no_os_timer_desc *desc, uint64_t *elapsed_time)
Get the elapsed time in nsec for the timer.
Definition no_os_timer.c:204
int32_t no_os_timer_count_clk_get(struct no_os_timer_desc *desc, uint32_t *freq_hz)
Get the timer clock frequency.
Definition no_os_timer.c:168
Structure holding timer descriptor.
Definition no_os_timer.h:46
void * extra
Definition no_os_timer.h:58
uint16_t id
Definition no_os_timer.h:50
void * mutex
Definition no_os_timer.h:48
uint32_t freq_hz
Definition no_os_timer.h:52
uint32_t ticks_count
Definition no_os_timer.h:54
const struct no_os_timer_platform_ops * platform_ops
Definition no_os_timer.h:56
Structure holding the parameters for timer initialization.
Definition no_os_timer.h:72
void * extra
Definition no_os_timer.h:82
uint16_t id
Definition no_os_timer.h:74
uint32_t freq_hz
Definition no_os_timer.h:76
const struct no_os_timer_platform_ops * platform_ops
Definition no_os_timer.h:80
uint32_t ticks_count
Definition no_os_timer.h:78