uwb-core DPL (Decawave Porting Layer) cputime abstraction More...
uwb-core DPL (Decawave Porting Layer) cputime abstraction
Definition in file dpl_cputime.h.
#include "os/os_cputime.h"
Go to the source code of this file.
Functions | |
static uint32_t | dpl_cputime_get32 (void) |
Returns the low 32 bits of cputime. | |
static uint32_t | dpl_cputime_usecs_to_ticks (uint32_t usecs) |
Converts the given number of microseconds into cputime ticks. | |
static uint32_t | dpl_cputime_ticks_to_usecs (uint32_t ticks) |
Convert the given number of ticks into microseconds. | |
static void | dpl_cputime_delay_ticks (uint32_t ticks) |
Wait until the number of ticks has elapsed. | |
static void | dpl_cputime_delay_usecs (uint32_t usecs) |
Wait until 'usecs' microseconds has elapsed. | |
static void | dpl_cputime_timer_init (struct hal_timer *timer, hal_timer_cb fp, void *arg) |
Initialize a CPU timer, using the given HAL timer. | |
static int | dpl_cputime_timer_start (struct hal_timer *timer, uint32_t cputime) |
Start a cputimer that will expire at 'cputime'. | |
static int | dpl_cputime_timer_relative (struct hal_timer *timer, uint32_t usecs) |
Sets a cpu timer that will expire 'usecs' microseconds from the current cputime. | |
static void | dpl_cputime_timer_stop (struct hal_timer *timer) |
Stops a cputimer from running. | |
|
inlinestatic |
Wait until the number of ticks has elapsed.
This is a blocking delay.
ticks | The number of ticks to wait. |
Definition at line 68 of file dpl_cputime.h.
|
inlinestatic |
Wait until 'usecs' microseconds has elapsed.
This is a blocking delay.
usecs | The number of usecs to wait. |
Definition at line 78 of file dpl_cputime.h.
|
inlinestatic |
Returns the low 32 bits of cputime.
Definition at line 34 of file dpl_cputime.h.
|
inlinestatic |
Convert the given number of ticks into microseconds.
ticks | The number of ticks to convert to microseconds. |
Definition at line 58 of file dpl_cputime.h.
|
inlinestatic |
Initialize a CPU timer, using the given HAL timer.
timer | The timer to initialize. Cannot be NULL. |
fp | The timer callback function. Cannot be NULL. |
arg | Pointer to data object to pass to timer. |
Definition at line 90 of file dpl_cputime.h.
|
inlinestatic |
Sets a cpu timer that will expire 'usecs' microseconds from the current cputime.
NOTE: This must be called when the timer is stopped.
timer | Pointer to timer. Cannot be NULL. |
usecs | The number of usecs from now at which the timer will expire. |
Definition at line 126 of file dpl_cputime.h.
|
inlinestatic |
Start a cputimer that will expire at 'cputime'.
If cputime has already passed, the timer callback will still be called (at interrupt context).
NOTE: This must be called when the timer is stopped.
timer | Pointer to timer to start. Cannot be NULL. |
cputime | The cputime at which the timer should expire. time |
Definition at line 109 of file dpl_cputime.h.
|
inlinestatic |
Stops a cputimer from running.
The timer is removed from the timer queue and interrupts are disabled if no timers are left on the queue. Can be called even if timer is not running.
timer | Pointer to cputimer to stop. Cannot be NULL. |
Definition at line 140 of file dpl_cputime.h.
|
inlinestatic |
Converts the given number of microseconds into cputime ticks.
usecs | The number of microseconds to convert to ticks |
Definition at line 46 of file dpl_cputime.h.