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

Interrupts driver requirements validator. More...

Detailed Description

Interrupts driver requirements validator.

Interrupts Driver Contract

Every MCU provides sbl::driver::Interrupts with these static methods:

  • save_ceiling() -> uint32_t - The current mask, opaque, for restore_ceiling()
  • raise_ceiling(Level) - Mask level and everything less urgent; never lowers the mask
  • restore_ceiling(uint32_t) - Put back a mask from save_ceiling()
  • disable_all() -> uint32_t - Mask every configurable exception; returns the previous state
  • restore_all(uint32_t) - Put back the state from disable_all()

Levels are sbl::system::interrupts::Level; the encoding to a hardware priority is the driver's. disable_all() blocks audio and is for death paths only (assert, fault); critical sections use ScopedControlCritical.

Validation Usage

At the bottom of the driver's interrupts.hpp:

static_assert(sbl::validation::interrupts_driver_valid<sbl::driver::Interrupts>,
"Interrupts driver incomplete");
Interrupts driver requirements validator.

Definition in file interrupts_requirements.hpp.

#include <cstdint>
#include <type_traits>
#include <utility>
#include <sbl/system/interrupts.hpp>

Go to the source code of this file.

Classes

class  sbl::validation::InterruptsDriverRequirements< InterruptsDriver >
 Interrupts driver requirements validator. More...
 

Namespaces

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

Variables

template<typename InterruptsDriver >
constexpr bool sbl::validation::interrupts_driver_valid = InterruptsDriverRequirements<InterruptsDriver>::validate()
 Helper to validate an interrupts driver implementation.