|
Sound Byte Libs 1ee2ca6
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Typedefs | |
| using | SampleTime = sbl::core::hal::adc::SampleTime |
| using | Resolution = sbl::core::hal::adc::Resolution |
Functions | |
| template<typename Driver > | |
| uint16_t | read (const AdcHandle &handle, SampleTime sample_time=SampleTime::Medium) |
| Blocking single-channel ADC read. | |
| template<typename Driver > | |
| uint32_t | to_millivolts (uint16_t raw_value, uint32_t vref_mv=3300) |
| Convert raw ADC value to voltage (millivolts) | |
| using sbl::adc::Resolution = typedef sbl::core::hal::adc::Resolution |
Definition at line 58 of file driver.hpp.
| using sbl::adc::SampleTime = typedef sbl::core::hal::adc::SampleTime |
Definition at line 57 of file driver.hpp.
|
inline |
Blocking single-channel ADC read.
Convenience function that composes low-level driver primitives. Configures the channel, starts conversion, waits for completion, and returns the raw value.
| Driver | ADC driver type (e.g., sbl::driver::Adc) |
| handle | ADC channel handle from hardware config |
| sample_time | Sampling duration (default: Medium) |
Example: auto value = sbl::adc::read<sbl::driver::Adc>(sbl::hw::adc::knob1);
Definition at line 76 of file driver.hpp.
|
inline |
Convert raw ADC value to voltage (millivolts)
| Driver | ADC driver type for resolution info |
| raw_value | Raw ADC reading |
| vref_mv | Reference voltage in millivolts (default: 3300mV) |
Definition at line 95 of file driver.hpp.