Loading...
Searching...
No Matches
convert_frac.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Kaspar Schleiser <kaspar@schleiser.de>
3 * Copyright (C) 2018 Eistec AB
4 *
5 * This file is subject to the terms and conditions of the GNU Lesser General
6 * Public License v2.1. See the file LICENSE in the top level directory for more
7 * details.
8 */
9
28#ifndef ZTIMER_CONVERT_FRAC_H
29#define ZTIMER_CONVERT_FRAC_H
30
31#include <stdint.h>
32#include "ztimer.h"
33#include "ztimer/convert.h"
34#include "ztimer/convert_frac.h"
35#include "frac.h"
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
64
74 ztimer_clock_t *lower,
75 uint32_t freq_self, uint32_t freq_lower);
76
85 uint32_t freq_self, uint32_t freq_lower);
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif /* ZTIMER_CONVERT_FRAC_H */
ztimer frequency conversion base module
ztimer_convert_frac interface definitions
void ztimer_convert_frac_change_rate(ztimer_convert_frac_t *self, uint32_t freq_self, uint32_t freq_lower)
Change the scaling without affecting the current count.
void ztimer_convert_frac_init(ztimer_convert_frac_t *self, ztimer_clock_t *lower, uint32_t freq_self, uint32_t freq_lower)
ztimer_convert_frac_t constructor
frac descriptor for fraction consisting of two 32 bit integers
Definition frac.h:53
ztimer device structure
Definition ztimer.h:369
ztimer_convert_frac frequency conversion layer class
uint32_t round
Rounding value, will be added to all lower set().
ztimer_convert_t super
Superclass instance.
frac_t scale_set
Frequency conversion scaling constant from self to lower.
frac_t scale_now
Frequency conversion scaling constant from lower to self.
base type for ztimer convert modules
Definition convert.h:45
ztimer API