InPlay API
hal_cnt_timer.h
1 
12 #ifndef HAL_CNT_TIMER_H
13 #define HAL_CNT_TIMER_H
14 
23 #include <stdio.h>
24 #include <stdint.h>
25 #include <stdbool.h>
26 #include <string.h>
27 
28 #include "./hal/hal_counter.h"
29 enum cnt_tim_err {
30  CNT_TIM_ERR_OK = 0,
31  CNT_TIM_ERR_INVALID_PARAM = -1,
32  CNT_TIM_ERR_IN_USE = -2,
33  CNT_TIM_ERR_BAD_STATE = -3,
34 };
35 
36 enum cnt_timer_id_t {
37  CNT_TIMER0 = 0,
38  CNT_TIMER1,
39  CNT_TIMER2,
40  CNT_TIMER3,
41  CNT_TIMER_MAX,
42 };
43 
52 void *hal_cnt_timer_open(int id, int prio, void *arg, void (*tmr_cb)(void *));
53 
59 void hal_cnt_timer_close(void *hdl);
60 
61 
62 
63 
74 int hal_cnt_timer_start(void *hdl, uint32_t count, int reload);
82 int hal_cnt_timer_stop(void *hdl);
83 
84 
85 uint32_t hal_cnt_timer_us_to_tick(void *hdl, uint32_t usec);
87 
88 
89 #endif
void * hal_cnt_timer_open(int id, int prio, void *arg, void(*tmr_cb)(void *))
Open counter timer.
int hal_cnt_timer_stop(void *hdl)
Stop Timer periodic function.
int hal_cnt_timer_start(void *hdl, uint32_t count, int reload)
Run Timer periodic function.
void hal_cnt_timer_close(void *hdl)
Open counter timer.