Functions | |
| void | rt_system_tick_init (void) |
| rt_tick_t | rt_tick_get (void) |
| void | rt_tick_increase (void) |
| rt_tick_t | rt_tick_from_millisecond (rt_uint32_t ms) |
| void | rt_system_timer_init (void) |
| void | rt_timer_init (rt_timer_t timer, const char *name, void(*timeout)(void *parameter), void *parameter, rt_tick_t time, rt_uint8_t flag) |
| rt_err_t | rt_timer_detach (rt_timer_t timer) |
| rt_timer_t | rt_timer_create (const char *name, void(*timeout)(void *parameter), void *parameter, rt_tick_t time, rt_uint8_t flag) |
| rt_err_t | rt_timer_delete (rt_timer_t timer) |
| rt_err_t | rt_timer_start (rt_timer_t timer) |
| rt_err_t | rt_timer_stop (rt_timer_t timer) |
| rt_err_t | rt_timer_control (rt_timer_t timer, rt_uint8_t cmd, void *arg) |
| void | rt_timer_check () |
The timing sensitivity of thread is implemented by timers. The timer can be set as one-shot or periodic timeout.
| void rt_system_tick_init | ( | void | ) |
This function will init system tick and set it to zero.
| void rt_system_timer_init | ( | ) |
This function will init system timer
| rt_tick_t rt_tick_from_millisecond | ( | rt_uint32_t | ms | ) |
This function will calculate the tick from millisecond.
| ms | the specified millisecond |
| rt_tick_t rt_tick_get | ( | ) |
This function will return current tick from operating system startup
| void rt_tick_increase | ( | ) |
This function will notify kernel there is one tick passed. Normally, this function is invoked by clock ISR.
| void rt_timer_check | ( | void | ) |
This function will check timer list, if a timeout event happens, the corresponding timeout function will be invoked.
| rt_err_t rt_timer_control | ( | rt_timer_t | timer, | |
| rt_uint8_t | cmd, | |||
| void * | arg | |||
| ) |
This function will get or set some options of the timer
| timer | the timer to be get or set | |
| cmd | the control command | |
| arg | the argument |
| rt_timer_t rt_timer_create | ( | const char * | name, | |
| void(*)(void *parameter) | timeout, | |||
| void * | parameter, | |||
| rt_tick_t | time, | |||
| rt_uint8_t | flag | |||
| ) |
This function will create a timer
| name | the name of timer | |
| timeout | the timeout function | |
| parameter | the parameter of timeout function | |
| time | the tick of timer | |
| flag | the flag of timer |
| rt_err_t rt_timer_delete | ( | rt_timer_t | timer | ) |
This function will delete a timer and release timer memory
| timer | the timer to be deleted |
| rt_err_t rt_timer_detach | ( | rt_timer_t | timer | ) |
This function will detach a timer from timer management.
| timer | the static timer object |
| void rt_timer_init | ( | rt_timer_t | timer, | |
| const char * | name, | |||
| void(*)(void *parameter) | timeout, | |||
| void * | parameter, | |||
| rt_tick_t | time, | |||
| rt_uint8_t | flag | |||
| ) |
This function will init a timer, normally this function is used to initialize a static timer object.
| timer | the static timer object | |
| name | the name of timer | |
| timeout | the timeout function | |
| parameter | the parameter of timeout function | |
| time | the tick of timer | |
| flag | the flag of timer |
| rt_err_t rt_timer_start | ( | rt_timer_t | timer | ) |
This function will start the timer
| timer | the timer to be started |
| rt_err_t rt_timer_stop | ( | rt_timer_t | timer | ) |
This function will stop the timer
| timer | the timer to be stopped |
1.5.7