Loading...
Searching...
No Matches
periodic.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Kaspar Schleiser <kaspar@schleiser.de>
3 * 2020 Freie Universität Berlin
4 * 2020 Inria
5 *
6 * This file is subject to the terms and conditions of the GNU Lesser
7 * General Public License v2.1. See the file LICENSE in the top level
8 * directory for more details.
9 */
69#ifndef ZTIMER_PERIODIC_H
70#define ZTIMER_PERIODIC_H
71
72#include <stdbool.h>
73#include <stdint.h>
74
75#include "ztimer.h"
76
77#ifdef __cplusplus
78extern "C" {
79#endif
80
84#define ZTIMER_PERIODIC_KEEP_GOING true
85
89typedef bool (*ztimer_periodic_callback_t)(void *);
90
102
117 bool (*callback)(void *),
118 void *arg, uint32_t interval);
119
132
145
154
155#ifdef __cplusplus
156}
157#endif
158
159#endif /* ZTIMER_PERIODIC_H */
uint32_t ztimer_now_t
type for ztimer_now() result
Definition ztimer.h:310
ztimer device structure
Definition ztimer.h:369
ztimer periodic structure
Definition periodic.h:94
ztimer_clock_t * clock
clock for this timer
Definition periodic.h:96
ztimer_periodic_callback_t callback
called on each trigger
Definition periodic.h:99
void * arg
argument for callback
Definition periodic.h:100
ztimer_now_t last
last trigger time
Definition periodic.h:98
uint32_t interval
interval of this timer
Definition periodic.h:97
ztimer_t timer
timer object used for this timer
Definition periodic.h:95
ztimer structure
Definition ztimer.h:318
bool(* ztimer_periodic_callback_t)(void *)
Type of callbacks in periodic timers.
Definition periodic.h:89
void ztimer_periodic_stop(ztimer_periodic_t *timer)
Stop a periodic timer.
void ztimer_periodic_start_now(ztimer_periodic_t *timer)
Start or restart a periodic timer without initial timer delay.
void ztimer_periodic_start(ztimer_periodic_t *timer)
Start or restart a periodic timer.
void ztimer_periodic_init(ztimer_clock_t *clock, ztimer_periodic_t *timer, bool(*callback)(void *), void *arg, uint32_t interval)
Initialize a periodic timer structure.
ztimer API