Loading...
Searching...
No Matches
convert_frac.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2018 Kaspar Schleiser <kaspar@schleiser.de>
3 * SPDX-FileCopyrightText: 2018 Eistec AB
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
27
28#include <stdint.h>
29#include "ztimer.h"
30#include "ztimer/convert.h"
31#include "ztimer/convert_frac.h"
32#include "frac.h"
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
61
71 ztimer_clock_t *lower,
72 uint32_t freq_self, uint32_t freq_lower);
73
82 uint32_t freq_self, uint32_t freq_lower);
83
84#ifdef __cplusplus
85}
86#endif
87
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
struct ztimer_clock ztimer_clock_t
ztimer_clock_t forward declaration
Definition ztimer.h:287
frac descriptor for fraction consisting of two 32 bit integers
Definition frac.h:49
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:41
ztimer API