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
sbl::system::timer Namespace Reference

The system timer over the tick port: the count, the 64-bit count, busy waits and milliseconds. More...

Detailed Description

The system timer over the tick port: the count, the 64-bit count, busy waits and milliseconds.

Classes

struct  MillisTimestamp
 

Typedefs

using Port = sbl::driver::Tick
 

Functions

constexpr uint32_t rate ()
 
uint32_t count ()
 
uint64_t count64 ()
 
void init ()
 
void busy_wait_us (uint32_t us)
 
void busy_wait_ms (uint32_t ms)
 
uint32_t millis ()
 

Typedef Documentation

◆ Port

using sbl::system::timer::Port = typedef sbl::driver::Tick

Definition at line 29 of file timer.hpp.

Function Documentation

◆ rate()

constexpr uint32_t sbl::system::timer::rate ( )
inlineconstexpr

Counts per second.

Definition at line 34 of file timer.hpp.

Referenced by busy_wait_us(), and millis().

◆ count()

uint32_t sbl::system::timer::count ( )
inline

The rolling 32-bit count.

Definition at line 37 of file timer.hpp.

Referenced by busy_wait_us().

◆ count64()

uint64_t sbl::system::timer::count64 ( )
inline

The count since the port started, 64 bits.

Definition at line 40 of file timer.hpp.

References sbl::system::Epoch< Port >::count64().

Referenced by millis().

◆ init()

void sbl::system::timer::init ( )
inline

Register the overflow handler and enable the interrupt. Called by the driver's init().

Definition at line 43 of file timer.hpp.

References sbl::system::Epoch< Port >::reset().

◆ busy_wait_us()

void sbl::system::timer::busy_wait_us ( uint32_t  us)
inline

Spin for us microseconds. Any execution level.

Definition at line 50 of file timer.hpp.

References count(), and rate().

Referenced by busy_wait_ms().

◆ busy_wait_ms()

void sbl::system::timer::busy_wait_ms ( uint32_t  ms)
inline

Spin for ms milliseconds. Any execution level.

Definition at line 58 of file timer.hpp.

References busy_wait_us().

◆ millis()

uint32_t sbl::system::timer::millis ( )
inline

Milliseconds since the port started, modulo 2^32.

Definition at line 65 of file timer.hpp.

References count64(), and rate().