Sound Byte Libs 1ee2ca6
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 core {
17namespace hal {
18namespace interrupts {
19
20/**
21 * @brief Interrupt priority levels for ARM Cortex-M
22 *
23 * ARM Cortex-M uses lower numerical values for higher priority.
24 * These values map directly to ARM NVIC priority levels.
25 */
26enum class Priority : uint8_t {
27 Highest = 0, ///< Highest priority (0)
28 High = 4, ///< High priority
29 Medium = 8, ///< Medium priority
30 Low = 12, ///< Low priority
31 Lowest = 15 ///< Lowest priority (15)
32};
33
34/**
35 * @brief External interrupt trigger types
36 */
37enum class Trigger : uint8_t {
38 Rising, ///< Rising edge trigger
39 Falling, ///< Falling edge trigger
40 Change, ///< Any edge (rising or falling)
41 Low, ///< Low level trigger
42 High ///< High level trigger
43};
44
45/**
46 * @brief Interrupt handler function type
47 *
48 * Keep interrupt handlers fast and minimal.
49 * Avoid blocking operations in ISR context.
50 */
51using Handler = void(*)();
52
53} // namespace interrupts
54} // namespace hal
55} // namespace core
56} // namespace sbl
57
58#endif // SBL_HAL_INTERRUPTS_TYPES_HPP_
Priority
Interrupt priority levels for ARM Cortex-M.
Definition types.hpp:26
Trigger
External interrupt trigger types.
Definition types.hpp:37
@ Change
Any edge (rising or falling)
void(*)() Handler
Interrupt handler function type.
Definition types.hpp:51
Root namespace for all Sound Byte Libs functionality.
Definition aliases.hpp:24