Sound Byte Libs 29c5ff3
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
Typedefs | Functions
sbl::cv Namespace Reference

Typedefs

using CvInput = sbl::components::cv::CvInput
 
using CvInputConfig = sbl::components::cv::CvInputConfig
 
using Smoothing = sbl::components::cv::Smoothing
 

Functions

template<typename Driver >
uint16_t read (CvInput &input, const AdcHandle &handle, adc::SampleTime sample_time=adc::SampleTime::Slow)
 Read ADC channel and feed into CvInput filter.
 
uint16_t read_dma (CvInput &input, const uint16_t *buffer, uint8_t channel_index)
 Read from DMA scan buffer and feed into CvInput filter.
 

Typedef Documentation

◆ CvInput

Definition at line 24 of file input.hpp.

◆ CvInputConfig

Definition at line 25 of file input.hpp.

◆ Smoothing

Definition at line 26 of file input.hpp.

Function Documentation

◆ read()

template<typename Driver >
uint16_t sbl::cv::read ( CvInput input,
const AdcHandle handle,
adc::SampleTime  sample_time = adc::SampleTime::Slow 
)
inline

Read ADC channel and feed into CvInput filter.

Blocking read followed by CvInput::update(). Returns the smoothed value.

Template Parameters
DriverADC driver type (e.g., sbl::driver::Adc)
Parameters
inputCvInput instance to update
handleADC channel handle
sample_timeSampling duration (default: Slow for pot sources)
Returns
Smoothed value (0–65535)
Note
Not ISR-safe — wraps blocking ADC polling read

Definition at line 42 of file input.hpp.

References sbl::components::cv::CvInput::update(), and sbl::components::cv::CvInput::value().

Here is the call graph for this function:

◆ read_dma()

uint16_t sbl::cv::read_dma ( CvInput input,
const uint16_t *  buffer,
uint8_t  channel_index 
)
inline

Read from DMA scan buffer and feed into CvInput filter.

For use with sbl::adc::start_scan(). The DMA buffer is the abstraction boundary — no driver template needed. Casts to volatile to ensure the compiler generates a real memory read (buffer is updated by DMA hardware).

Parameters
inputCvInput instance to update
bufferDMA scan buffer (from start_scan)
channel_indexIndex of this channel in the scan sequence
Returns
Smoothed value (0–65535)
Note
ISR-safe — volatile DMA buffer read, no blocking

Definition at line 63 of file input.hpp.

References sbl::components::cv::CvInput::update(), and sbl::components::cv::CvInput::value().

Here is the call graph for this function: