Sound Byte Libs
0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
target_clock.hpp
Go to the documentation of this file.
1
/**
2
* @file target_clock.hpp
3
* @brief The target's control clock: Clock over the system timer
4
* @ingroup control
5
*
6
* The source is the system timer (<sbl/system/timer.hpp>), whose tick port
7
* the target mounts by include path. App and library code use TargetClock
8
* so the source type appears in one place.
9
*/
10
11
#ifndef SBL_CONTROL_TARGET_CLOCK_HPP_
12
#define SBL_CONTROL_TARGET_CLOCK_HPP_
13
14
#include <cstdint>
15
16
#include <
sbl/control/clock.hpp
>
17
#include <
sbl/system/timer.hpp
>
18
19
namespace
sbl::control
{
20
21
/** The system timer as a clock source. */
22
struct
SystemTimerSource
{
23
static
constexpr
uint32_t TICKS_PER_SECOND =
sbl::system::timer::rate
();
24
static
uint32_t now() {
return
sbl::system::timer::count
(); }
25
};
26
27
using
TargetClock
=
Clock<SystemTimerSource>
;
28
29
}
// namespace sbl::control
30
31
#endif
// SBL_CONTROL_TARGET_CLOCK_HPP_
sbl::control::Clock
Definition
clock.hpp:25
clock.hpp
The control clock: the app's one control timebase.
sbl::control
The control stack: scheduler, event queue, merge, CC mapping, calibration.
Definition
calibration.hpp:39
sbl::system::timer::rate
constexpr uint32_t rate()
Definition
timer.hpp:34
sbl::system::timer::count
uint32_t count()
Definition
timer.hpp:37
sbl::control::SystemTimerSource
Definition
target_clock.hpp:22
timer.hpp
The system timer: the count, 64-bit time, busy waits and millis()
src
sbl
control
target_clock.hpp
Generated by
1.9.8