Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
types.hpp
Go to the documentation of this file.
1/**
2 * @file types.hpp
3 * @brief Interrupt system types and enumerations
4 * @ingroup hal
5 *
6 * Common interrupt types shared across the interrupt system.
7 * Simple enumerations and data structures - no behavior.
8 */
9
10#ifndef SBL_HAL_INTERRUPTS_TYPES_HPP_
11#define SBL_HAL_INTERRUPTS_TYPES_HPP_
12
13#include <cstdint>
14
15namespace sbl {
16namespace hal {
17namespace interrupts {
18
19/**
20 * @brief Interrupt priority levels for ARM Cortex-M
21 *
22 * ARM Cortex-M uses lower numerical values for higher priority.
23 * These values map directly to ARM NVIC priority levels.
24 */
25enum class Priority : uint8_t {
26 Highest = 0, ///< Highest priority (0)
27 High = 4, ///< High priority
28 Medium = 8, ///< Medium priority
29 Low = 12, ///< Low priority
30 Lowest = 15 ///< Lowest priority (15)
31};
32
33/**
34 * @brief External interrupt trigger types
35 */
36enum class Trigger : uint8_t {
37 Rising, ///< Rising edge trigger
38 Falling, ///< Falling edge trigger
39 Change, ///< Any edge (rising or falling)
40 Low, ///< Low level trigger
41 High ///< High level trigger
42};
43
44/**
45 * @brief Interrupt handler function type
46 *
47 * Keep interrupt handlers fast and minimal.
48 * Avoid blocking operations in ISR context.
49 */
50using Handler = void(*)();
51
52} // namespace interrupts
53} // namespace hal
54} // namespace sbl
55
56#endif // SBL_HAL_INTERRUPTS_TYPES_HPP_
void(*)() Handler
Interrupt handler function type.
Definition types.hpp:50
Trigger
External interrupt trigger types.
Definition types.hpp:36
@ Falling
Falling edge trigger
@ Rising
Rising edge trigger.
@ Change
Any edge (rising or falling)
Priority
Interrupt priority levels for ARM Cortex-M.
Definition types.hpp:25
@ Highest
Highest priority (0)
@ Lowest
Lowest priority (15)
Root namespace for all Sound Byte Libs functionality.
Definition aliases.hpp:24