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 ARM Cortex-M optimized type aliases for Sound Byte Libs
4 * @ingroup common
5 *
6 * Defines native 32-bit type aliases optimized for ARM Cortex-M processors.
7 * Using native word size eliminates unnecessary type extension instructions
8 * and provides optimal performance on 32-bit ARM architecture.
9 */
10
11#ifndef SBL_COMMON_TYPES_HPP_
12#define SBL_COMMON_TYPES_HPP_
13
14#include <cstdint>
15
16namespace sbl {
17namespace common {
18namespace types {
19
20/**
21 * @brief ARM-native GPIO port identifier
22 *
23 * Uses 32-bit native word size to eliminate UXTB instructions
24 * on ARM Cortex-M processors. Range: 0-15 for up to 16 ports.
25 */
26using GpioPortId = uint32_t;
27
28/**
29 * @brief ARM-native GPIO pin number within port
30 *
31 * Uses 32-bit native word size for optimal ARM arithmetic.
32 * Range: 0-31 for pins within a port.
33 */
34using GpioPinNum = uint32_t;
35
36/**
37 * @brief ARM-native frequency representation
38 *
39 * Native 32-bit type for frequency values in Hz.
40 * Range: 0 to 4,294,967,295 Hz (sufficient for embedded audio).
41 */
42using FrequencyHz = uint32_t;
43
44/**
45 * @brief ARM-native timing interval representation
46 *
47 * Native 32-bit type for timing intervals in milliseconds.
48 * Range: 0 to ~49.7 days in milliseconds.
49 */
50using IntervalMs = uint32_t;
51
52/**
53 * @brief ARM-native buffer index type
54 *
55 * Native 32-bit type for buffer indexing operations.
56 * Eliminates UXTH instructions in ring buffer ISR code.
57 */
58using BufferIndex = uint32_t;
59
60/**
61 * @brief ARM-native buffer size type
62 *
63 * Native 32-bit type for buffer sizing.
64 * Must be power-of-2 for efficient modulo operations.
65 */
66using BufferSize = uint32_t;
67
68} // namespace types
69} // namespace common
70} // namespace sbl
71
72#endif // SBL_COMMON_TYPES_HPP_
uint32_t GpioPortId
ARM-native GPIO port identifier.
Definition types.hpp:26
uint32_t GpioPinNum
ARM-native GPIO pin number within port.
Definition types.hpp:34
uint32_t IntervalMs
ARM-native timing interval representation.
Definition types.hpp:50
uint32_t FrequencyHz
ARM-native frequency representation.
Definition types.hpp:42
uint32_t BufferIndex
ARM-native buffer index type.
Definition types.hpp:58
uint32_t BufferSize
ARM-native buffer size type.
Definition types.hpp:66
Root namespace for all Sound Byte Libs functionality.
Definition aliases.hpp:24