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
timer_requirements.hpp File Reference

The periodic-callback timer contract. More...

Detailed Description

The periodic-callback timer contract.

Every MCU provides sbl::driver::TimerCallback, one periodic interrupt with one callback (the control tick's base period):

  • start(uint32_t period_us, void (*cb)()) - start; a second start while running is an error
  • set_period(uint32_t period_us) - change the period
  • stop() - stop

The free-running counter is the tick port, whose contract is <sbl/system/port/tick_requirements.hpp>.

Usage, at the bottom of a driver's timer_callback.hpp:

static_assert(sbl::validation::timer_callback_valid<sbl::driver::TimerCallback>,
"TimerCallback driver incomplete");
The periodic-callback timer contract.

Definition in file timer_requirements.hpp.

#include <cstdint>
#include <type_traits>

Go to the source code of this file.

Classes

struct  sbl::validation::has_timer_callback_start< T, typename >
 
struct  sbl::validation::has_timer_callback_start< T, std::void_t< decltype(T::start(std::declval< uint32_t >(), std::declval< void(*)()>()))> >
 
struct  sbl::validation::has_timer_callback_set_period< T, typename >
 
struct  sbl::validation::has_timer_callback_set_period< T, std::void_t< decltype(T::set_period(std::declval< uint32_t >()))> >
 
struct  sbl::validation::has_timer_callback_stop< T, typename >
 
struct  sbl::validation::has_timer_callback_stop< T, std::void_t< decltype(T::stop())> >
 
class  sbl::validation::TimerCallbackRequirements< Driver >
 

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::validation
 Compile-time driver contracts.
 

Variables

template<typename Driver >
constexpr bool sbl::validation::timer_callback_valid = TimerCallbackRequirements<Driver>::validate()