42 #include <sys/ioctl.h> 43 #include <sys/types.h> 129 __EXPORT extern int hrt_set_absolute_time_offset(int32_t time_diff_us);
184 __EXPORT extern void hrt_init(
void);
206 constexpr
hrt_abstime operator "" _s(
unsigned long long seconds)
211 constexpr
hrt_abstime operator "" _ms(
unsigned long long seconds)
216 constexpr
hrt_abstime operator "" _us(
unsigned long long seconds)
struct hrt_call * hrt_call_t
Callout record.
__EXPORT hrt_abstime hrt_store_absolute_time(volatile hrt_abstime *now)
Store the absolute time in an interrupt-safe fashion.
Definition: drv_hrt.cpp:220
void(* hrt_callout)(void *arg)
Callout function type.
Definition: drv_hrt.h:67
__EXPORT void hrt_call_at(struct hrt_call *entry, hrt_abstime calltime, hrt_callout callout, void *arg)
Call callout(arg) at absolute time calltime.
Definition: drv_hrt.cpp:461
__EXPORT void hrt_call_after(struct hrt_call *entry, hrt_abstime delay, hrt_callout callout, void *arg)
Call callout(arg) after delay has elapsed.
Definition: drv_hrt.cpp:433
__EXPORT void hrt_call_init(struct hrt_call *entry)
Initialise a hrt_call structure.
Definition: drv_hrt.cpp:258
__EXPORT bool hrt_called(struct hrt_call *entry)
If this returns true, the entry has been invoked and removed from the callout list, or it has never been entered.
Definition: drv_hrt.cpp:233
__EXPORT void hrt_call_every(struct hrt_call *entry, hrt_abstime delay, hrt_abstime interval, hrt_callout callout, void *arg)
Call callout(arg) after delay, and then after every interval.
Definition: drv_hrt.cpp:449
__BEGIN_DECLS typedef uint64_t hrt_abstime
Absolute time, in microsecond units.
Definition: drv_hrt.h:58
Callout record.
Definition: drv_hrt.h:72
__EXPORT void abstime_to_ts(struct timespec *ts, hrt_abstime abstime)
Convert absolute time to a timespec.
Definition: drv_hrt.cpp:530
__EXPORT hrt_abstime ts_to_abstime(const struct timespec *ts)
Convert a timespec to absolute time.
Definition: drv_hrt.cpp:191
__EXPORT hrt_abstime hrt_absolute_time(void)
Get absolute time in [us] (does not wrap).
Definition: drv_hrt.cpp:155
__EXPORT void hrt_cancel(struct hrt_call *entry)
Remove the entry from the callout list.
Definition: drv_hrt.cpp:241
__EXPORT hrt_abstime hrt_elapsed_time_atomic(const volatile hrt_abstime *then)
Compute the delta between a timestamp taken in the past and now.
Definition: drv_hrt.cpp:208