Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
scan.hpp File Reference

ADC DMA scan interface — continuous multi-channel acquisition. More...

Detailed Description

ADC DMA scan interface — continuous multi-channel acquisition.

Platform-agnostic interface for DMA-based ADC scanning. The driver handles all DMA configuration internally; the HAL just forwards calls.

Usage: #include <sbl/hw/hal/adc/scan.hpp>

SBL_DMA_BUFFER static volatile uint16_t adc_buf[2]; const sbl::AdcHandle channels[] = { sbl::hw::adc::knob1, sbl::hw::adc::knob2 }; sbl::adc::start_scan<sbl::driver::Adc>(channels, 2, adc_buf);

// Main loop: just read adc_buf[0], adc_buf[1] — always fresh

Definition in file scan.hpp.

#include "handle.hpp"
#include "types.hpp"

Go to the source code of this file.

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::adc
 Convenience layer: read a channel, start and stop a scan.
 

Functions

template<typename Driver >
void sbl::adc::start_scan (const AdcHandle *channels, uint8_t num_channels, uint16_t *buffer, SampleTime sample_time=SampleTime::Slow)
 Start continuous DMA scan of multiple ADC channels.
 
template<typename Driver >
void sbl::adc::start_scan (const AdcHandle *channels, uint8_t num_channels, uint16_t *buffer, const SampleTime *sample_times)
 Start continuous DMA scan with per-channel sample times.
 
template<typename Driver >
void sbl::adc::stop_scan ()
 Stop DMA scan mode.