timer
应用实例
串口实例: customer_app/peripheral/demo_timer
。
API参考
Header File
- components/platform/hosal/include/hosal_timer.h
Functions
-
int
hosal_timer_init
(hosal_timer_dev_t *tim) init a hardware timer
- Return
- 0 : success
- other :error
- Parameters
tim
: timer device
-
int
hosal_timer_start
(hosal_timer_dev_t *tim) start a hardware timer
- Return
- 0 : success
- other : error
- Parameters
tim
: timer device
-
void
hosal_timer_stop
(hosal_timer_dev_t *tim) stop a hardware timer
- Return
- none
- Parameters
tim
: timer device
-
int
hosal_timer_finalize
(hosal_timer_dev_t *tim) De-initialises an TIMER interface, Turns off an TIMER hardware interface
- Return
- 0 : success
- other : error
- Parameters
tim
: timer device
Structures
-
struct
hosal_timer_config_t
Define timer config args
Public Members
-
uint32_t
period
timer period, us
-
uint8_t
reload_mode
auto reload or not
-
hosal_timer_cb_t
cb
timer handle when expired
-
void *
arg
timer handle args
-
uint32_t
-
struct
hosal_timer_dev_t
Define timer dev handle
Public Members
-
int8_t
port
timer port
-
hosal_timer_config_t
config
timer config
-
void *
priv
priv data
-
int8_t