Sound Byte Libs 1ee2ca6
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
handle.hpp
Go to the documentation of this file.
1/**
2 * @file handle.hpp
3 * @brief ADC handle type for hardware abstraction
4 * @ingroup hal
5 *
6 * Canonical definition of AdcHandle - the primary way to reference
7 * ADC channels in SBL. Used by drivers, generated hardware configs, and
8 * user code.
9 */
10
11#ifndef SBL_HAL_ADC_HANDLE_HPP_
12#define SBL_HAL_ADC_HANDLE_HPP_
13
14#include <cstdint>
15
16namespace sbl {
17
18/**
19 * @brief ADC channel handle
20 *
21 * Represents an ADC input as resolved from hardware manifests.
22 * Used to pass channel configuration to driver functions.
23 *
24 * Examples:
25 * - STM32 ADC1 channel 0: AdcHandle{1, 0}
26 * - RP2040 ADC channel 2: AdcHandle{0, 2} - Single ADC peripheral
27 * - Daisy Seed CV input: AdcHandle{1, 17} - ADC1_IN17 on STM32H750
28 */
29struct AdcHandle {
30 uint32_t adc; ///< ADC peripheral number (1-indexed on STM32, 0 on RP2040)
31 uint32_t channel; ///< Channel within the ADC peripheral
32};
33
34} // namespace sbl
35
36#endif // SBL_HAL_ADC_HANDLE_HPP_
Root namespace for all Sound Byte Libs functionality.
Definition aliases.hpp:24
ADC channel handle.
Definition handle.hpp:29
uint32_t channel
Channel within the ADC peripheral.
Definition handle.hpp:31
uint32_t adc
ADC peripheral number (1-indexed on STM32, 0 on RP2040)
Definition handle.hpp:30