20#ifndef DPL_DPL_CPUTIME_H
21#define DPL_DPL_CPUTIME_H
27#include "os/os_cputime.h"
36 return os_cputime_get32();
48 return os_cputime_usecs_to_ticks(usecs);
60 return os_cputime_ticks_to_usecs(ticks);
70 os_cputime_delay_ticks(ticks);
80 os_cputime_delay_usecs(usecs);
93 os_cputime_timer_init(timer, fp, arg);
111 return os_cputime_timer_start(timer, cputime);
128 return os_cputime_timer_relative(timer, usecs);
142 os_cputime_timer_stop(timer);
static uint32_t dpl_cputime_ticks_to_usecs(uint32_t ticks)
Convert the given number of ticks into microseconds.
static uint32_t dpl_cputime_get32(void)
Returns the low 32 bits of cputime.
static void dpl_cputime_delay_usecs(uint32_t usecs)
Wait until 'usecs' microseconds has elapsed.
static uint32_t dpl_cputime_usecs_to_ticks(uint32_t usecs)
Converts the given number of microseconds into cputime ticks.
static void dpl_cputime_timer_stop(struct hal_timer *timer)
Stops a cputimer from running.
static int dpl_cputime_timer_start(struct hal_timer *timer, uint32_t cputime)
Start a cputimer that will expire at 'cputime'.
static void dpl_cputime_delay_ticks(uint32_t ticks)
Wait until the number of ticks 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_relative(struct hal_timer *timer, uint32_t usecs)
Sets a cpu timer that will expire 'usecs' microseconds from the current cputime.