uwb-core DPL (Decawave Porting Layer) cputime abstraction More...
uwb-core DPL (Decawave Porting Layer) cputime abstraction
Definition in file dpl_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. More... | |
static uint32_t | dpl_cputime_usecs_to_ticks (uint32_t usecs) |
Converts the given number of microseconds into cputime ticks. More... | |
static uint32_t | dpl_cputime_ticks_to_usecs (uint32_t ticks) |
Convert the given number of ticks into microseconds. More... | |
static void | dpl_cputime_delay_ticks (uint32_t ticks) |
Wait until the number of ticks has elapsed. More... | |
static void | dpl_cputime_delay_usecs (uint32_t usecs) |
Wait until 'usecs' microseconds has elapsed. More... | |
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. More... | |
static int | dpl_cputime_timer_start (struct hal_timer *timer, uint32_t cputime) |
Start a cputimer that will expire at 'cputime'. More... | |
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. More... | |
static void | dpl_cputime_timer_stop (struct hal_timer *timer) |
Stops a cputimer from running. More... | |
|
inlinestatic |
Wait until the number of ticks has elapsed.
This is a blocking delay.
ticks | The number of ticks to wait. |
Definition at line 72 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 83 of file dpl_cputime.h.
|
inlinestatic |
Returns the low 32 bits of cputime.
Definition at line 37 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 61 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 95 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 133 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. |
Definition at line 115 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 153 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 49 of file dpl_cputime.h.