|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Interrupt priorities and critical sections. More...
Interrupt priorities and critical sections.
Classes | |
| class | ScopedControlCritical |
| RAII critical section against the control tick and everything below. More... | |
Enumerations | |
| enum class | Level : uint8_t { Reserved = 0 , ShortDeadline = 1 , Audio = 2 , UsbMidi = 4 , Dma = 5 , Bus = 6 , ControlTick = 8 , SoftPwm = 9 , Exti = 10 , SoftPend = 11 , Debug = 12 , SysTick = 14 , PendSv = 15 } |
| Execution levels, most urgent first. More... | |
| enum class | Trigger : uint8_t { Rising , Falling , Change , Low , High } |
| External interrupt trigger types. More... | |
Functions | |
| uint32_t | get_basepri () |
| Read BASEPRI (0 = no ceiling). | |
| void | set_basepri (uint32_t encoded) |
| Write BASEPRI unconditionally (used to restore a saved value). | |
| void | raise_basepri (uint32_t encoded) |
| uint32_t | disable_and_save () |
| Disable all configurable exceptions and return the previous PRIMASK. | |
| void | restore (uint32_t saved_state) |
| Restore PRIMASK from disable_and_save(). | |
| uint32_t | get_state () |
| Current PRIMASK (0 = enabled, 1 = disabled). | |
| bool | are_enabled () |
| True if configurable exceptions are enabled (PRIMASK clear). | |
| constexpr uint8_t | encode (Level level) |
| Encode a level as the byte written to NVIC->IP[] / SCB->SHP[] / BASEPRI. | |
| constexpr bool | masked_by_ceiling (Level level) |
True if a handler at level is masked while BASEPRI sits at the ceiling. | |
Variables | |
| constexpr Level | kBasepriCeiling = Level::ControlTick |
| The level a ScopedControlCritical raises BASEPRI to. | |
| constexpr uint8_t | kPriorityBits = 4 |
| Priority bits the target implements (STM32H750: 4 of 8). | |
|
strong |
Execution levels, most urgent first.
The invariants the scheme guarantees:
|
strong |
|
inline |
Read BASEPRI (0 = no ceiling).
Definition at line 48 of file control.hpp.
|
inline |
Write BASEPRI unconditionally (used to restore a saved value).
Definition at line 59 of file control.hpp.
Referenced by sbl::hal::interrupts::ScopedControlCritical::~ScopedControlCritical().
|
inline |
Raise BASEPRI to encoded only if that is a higher priority than the current value — never lowers it, so nested sections compose.
Definition at line 69 of file control.hpp.
Referenced by sbl::hal::interrupts::ScopedControlCritical::ScopedControlCritical().
|
inline |
Disable all configurable exceptions and return the previous PRIMASK.
This blocks the audio ISR. It exists for assert/fault handling, where the system is already lost; a critical section wants ScopedControlCritical.
Definition at line 111 of file control.hpp.
|
inline |
Restore PRIMASK from disable_and_save().
Definition at line 123 of file control.hpp.
|
inline |
Current PRIMASK (0 = enabled, 1 = disabled).
Definition at line 132 of file control.hpp.
Referenced by are_enabled().
|
inline |
True if configurable exceptions are enabled (PRIMASK clear).
Definition at line 143 of file control.hpp.
References get_state().
|
constexpr |
Encode a level as the byte written to NVIC->IP[] / SCB->SHP[] / BASEPRI.
Definition at line 62 of file types.hpp.
References kPriorityBits.
Referenced by sbl::hal::interrupts::ScopedControlCritical::ScopedControlCritical().
|
constexpr |
True if a handler at level is masked while BASEPRI sits at the ceiling.
Definition at line 67 of file types.hpp.
References kBasepriCeiling.
|
inlineconstexpr |
The level a ScopedControlCritical raises BASEPRI to.
Definition at line 56 of file types.hpp.
Referenced by masked_by_ceiling(), and sbl::hal::interrupts::ScopedControlCritical::ScopedControlCritical().