|
WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
|
函数 | |
| int | osal_timer_init (osal_timer *timer) |
| Initialize the timer. | |
| int | osal_timer_start (osal_timer *timer) |
| start a timer. | |
| int | osal_timer_mod (osal_timer *timer, unsigned int interval) |
| modify a timer's timeout. | |
| int | osal_timer_start_on (osal_timer *timer, unsigned long delay, int cpu) |
| Start a timer on a particular CPU. | |
| int | osal_timer_stop (osal_timer *timer) |
| Deactivate a timer. | |
| int | osal_timer_destroy (osal_timer *timer) |
| destroy the timer. | |
| unsigned long | osal_timer_get_private_data (const void *sys_data) |
| get_private_data by timer. | |
| int | osal_timer_destroy_sync (osal_timer *timer) |
| deactivate a timer and wait for the handler to finish. | |
| unsigned long long | osal_sched_clock (void) |
| Obtain system time in nanoseconds. | |
| unsigned long long | osal_get_jiffies (void) |
| Obtain the number of Ticks(in liteos) or jiffies(in linux). | |
| unsigned long | osal_msecs_to_jiffies (const unsigned int m) |
| Convert milliseconds to Ticks/jiffies. | |
| unsigned int | osal_jiffies_to_msecs (const unsigned int n) |
| Convert Ticks/jiffies to milliseconds. | |
| unsigned int | osal_get_cycle_per_tick (void) |
| Obtain the number of cycles in one tick. | |
| void | osal_gettimeofday (osal_timeval *tv) |
| Obtaining the Current System Kernel Time. | |
| int | osal_hrtimer_create (osal_hrtimer *hrtimer) |
| Create a high-resolution timer. | |
| int | osal_hrtimer_start (osal_hrtimer *hrtimer) |
| Start a high-resolution timer. | |
| int | osal_hrtimer_destroy (osal_hrtimer *hrtimer) |
| Delete an existing high-resolution timer. | |
| unsigned int osal_get_cycle_per_tick | ( | void | ) |
Obtain the number of cycles in one tick.
| unsigned long long osal_get_jiffies | ( | void | ) |
Obtain the number of Ticks(in liteos) or jiffies(in linux).
| void osal_gettimeofday | ( | osal_timeval * | tv | ) |
Obtaining the Current System Kernel Time.
| tv | [out] Obtained Current System Kernel Time. |
| int osal_hrtimer_create | ( | osal_hrtimer * | hrtimer | ) |
Create a high-resolution timer.
| hrtimer | [in/out] The hrtimer to be initialized. Assign values to hrtimer->handler and hrtimer->interval before calling this interface, because you will not be able to change them after that. |
| int osal_hrtimer_destroy | ( | osal_hrtimer * | hrtimer | ) |
Delete an existing high-resolution timer.
| int osal_hrtimer_start | ( | osal_hrtimer * | hrtimer | ) |
Start a high-resolution timer.
| -1 | The high-resolution timer fails to be started. |
| 0 | The high-resolution timer is successfully started. |
| 1 | The high-resolution timer node is already in the linked list. |
| unsigned int osal_jiffies_to_msecs | ( | const unsigned int | n | ) |
Convert Ticks/jiffies to milliseconds.
| n | [in] Number of Ticks/jiffies be converted. |
| unsigned long osal_msecs_to_jiffies | ( | const unsigned int | m | ) |
Convert milliseconds to Ticks/jiffies.
| m | [in] The time to be converted. Unit: ms. |
| unsigned long long osal_sched_clock | ( | void | ) |
Obtain system time in nanoseconds.
| int osal_timer_destroy | ( | osal_timer * | timer | ) |
destroy the timer.
| timer | [in] The timer to be destroyed. |
| int osal_timer_destroy_sync | ( | osal_timer * | timer | ) |
deactivate a timer and wait for the handler to finish.
| unsigned long osal_timer_get_private_data | ( | const void * | sys_data | ) |
get_private_data by timer.
| sys_data | [in] Parameters passed to the callback function. |
| int osal_timer_init | ( | osal_timer * | timer | ) |
Initialize the timer.
| timer | [in/out] The timer to be initialized. Assign values to timer->handler and timer->data before calling this interface, because you will not be able to change them after that. |
| int osal_timer_mod | ( | osal_timer * | timer, |
| unsigned int | interval | ||
| ) |
modify a timer's timeout.
| timer | [in] the timer to be modified. |
| interval | [in] new timeout, unit: ms. |
| int osal_timer_start | ( | osal_timer * | timer | ) |
start a timer.
| timer | [in] the timer to be start. |
| int osal_timer_start_on | ( | osal_timer * | timer, |
| unsigned long | delay, | ||
| int | cpu | ||
| ) |
Start a timer on a particular CPU.
| timer | [in] the timer to be added. |
| delay | [in] delay time. |
| cpu | [in] the CPU to start it on. |
| int osal_timer_stop | ( | osal_timer * | timer | ) |
Deactivate a timer.
| timer | [in] the timer to be deactivated. |
| 1 | stop success, timer is pengding. (Only Linux and LiteOS are supported return 1) |
| OSAL_SUCCESS | stop success, timer is already stoped. |
| OSAL_FAILURE |