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  */
66 #ifndef ZTIMER_PERIODIC_H
67 #define ZTIMER_PERIODIC_H
68 
69 #include <stdint.h>
70 
71 #include "ztimer.h"
72 
73 #ifdef __cplusplus
74 extern "C" {
75 #endif
76 
80 #define ZTIMER_PERIODIC_KEEP_GOING 0
81 
85 typedef struct {
88  uint32_t interval;
90  int (*callback)(void *);
91  void *arg;
93 
107  int (*callback)(void *),
108  void *arg, uint32_t interval);
109 
122 
131 
132 #ifdef __cplusplus
133 }
134 #endif
135 
136 #endif /* ZTIMER_PERIODIC_H */
137 
ztimer_periodic_init
void ztimer_periodic_init(ztimer_clock_t *clock, ztimer_periodic_t *timer, int(*callback)(void *), void *arg, uint32_t interval)
Initialize a periodic timer structure.
ztimer.h
ztimer API
ztimer_periodic_t::interval
uint32_t interval
interval of this timer
Definition: periodic.h:88
ztimer_periodic_start
void ztimer_periodic_start(ztimer_periodic_t *timer)
Start or restart a periodic timer.
ztimer_t
ztimer structure
Definition: ztimer.h:279
ztimer_periodic_t
ztimer periodic structure
Definition: periodic.h:85
ztimer_periodic_t::last
ztimer_now_t last
last trigger time
Definition: periodic.h:89
ztimer_clock
ztimer device structure
Definition: ztimer.h:312
ztimer_periodic_stop
void ztimer_periodic_stop(ztimer_periodic_t *timer)
Stop a periodic timer.
ztimer_periodic_t::clock
ztimer_clock_t * clock
clock for this timer
Definition: periodic.h:87
ztimer_now_t
uint32_t ztimer_now_t
type for ztimer_now() result
Definition: ztimer.h:270
ztimer_periodic_t::arg
void * arg
argument for callback
Definition: periodic.h:91
ztimer_periodic_t::timer
ztimer_t timer
timer object used for this timer
Definition: periodic.h:86