Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
ticks.hpp File Reference

Tick counter interface for profiling. More...

Detailed Description

Tick counter interface for profiling.

Includes the platform-specific timing backend (generated by sloth from the MCU manifest's timing capability) and provides the TickScope RAII helper. The generated backend supplies:

  • sbl::hw::timing::init() — call once at startup
  • sbl::hw::timing::read() — free-running counter (wraps at 2^32)
  • sbl::hw::timing::rate() — ticks per second

Platform implementations (selected by MCU manifest):

  • dwt: ARM DWT CYCCNT (hardware cycles)
  • posix_monotonic: clock_gettime CLOCK_MONOTONIC (nanoseconds)
  • sdk_timer: Pico SDK hardware timer (microseconds)

Definition in file ticks.hpp.

#include <cstdint>
#include <sbl/hw/config/timing.hpp>

Go to the source code of this file.

Classes

struct  sbl::diagnostics::TickScope
 

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::diagnostics
 Diagnostics and profiling.
 

Functions

void sbl::diagnostics::ticks_init ()
 Initialize the platform timing backend. Call once at startup.
 
uint32_t sbl::diagnostics::ticks ()
 Read current tick count (free-running, wraps at 2^32).
 
constexpr uint32_t sbl::diagnostics::tick_rate ()
 Tick rate in Hz (ticks per second).