Loading...
Searching...
No Matches
dpl_callout.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2020 Inria
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
21
22#include "os/os_callout.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
32 struct os_callout co;
33};
34
49static inline void dpl_callout_init(struct dpl_callout *c, struct dpl_eventq *q,
50 dpl_event_fn *e_cb, void *e_arg)
51{
52 os_callout_init(&c->co, &q->evq, (os_event_fn *) e_cb, e_arg);
53}
54
63static inline dpl_error_t dpl_callout_reset(struct dpl_callout *c, dpl_time_t ticks)
64{
65 return (dpl_error_t) os_callout_reset(&c->co, ticks);
66}
67
73static inline void dpl_callout_stop(struct dpl_callout *c)
74{
75 os_callout_stop(&c->co);
76}
77
78#ifdef __cplusplus
79}
80#endif
static void dpl_callout_stop(struct dpl_callout *c)
Stops the callout from firing.
Definition dpl_callout.h:73
static void dpl_callout_init(struct dpl_callout *c, struct dpl_eventq *q, dpl_event_fn *e_cb, void *e_arg)
Initialize a callout.
Definition dpl_callout.h:49
static dpl_error_t dpl_callout_reset(struct dpl_callout *c, dpl_time_t ticks)
Reset the callout to fire off in 'ticks' ticks.
Definition dpl_callout.h:63
os_error_t dpl_error_t
dpl error type
Definition dpl_error.h:47
void dpl_event_fn(struct dpl_event *ev)
dpl event callback function
Definition dpl_eventq.h:45
os_time_t dpl_time_t
dpl time type
Definition dpl_types.h:53
void os_event_fn(struct os_event *ev)
Event callback function.
Definition os_eventq.h:47
dpl callout wrapper
Definition dpl_callout.h:31
struct os_callout co
the callout
Definition dpl_callout.h:32
dpl event queue wrapper
Definition dpl_eventq.h:38
struct os_eventq evq
the event queue
Definition dpl_eventq.h:39