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

Typedefs

using Pot = sbl::components::control::Pot
 
using PotConfig = sbl::components::control::PotConfig
 

Functions

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

Typedef Documentation

◆ Pot

Definition at line 25 of file input.hpp.

◆ PotConfig

Definition at line 26 of file input.hpp.

Function Documentation

◆ read()

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

Read ADC channel and feed into Pot (EWMA + deadband)

Blocking read followed by Pot::update(). Returns the stable value.

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

Definition at line 42 of file input.hpp.

References sbl::components::control::Pot::update(), and sbl::components::control::Pot::value().

Here is the call graph for this function:

◆ read_dma()

uint16_t sbl::pot::read_dma ( Pot pot,
const uint16_t *  buffer,
uint8_t  channel_index 
)
inline

Read from DMA scan buffer and feed into Pot.

For use with sbl::adc::start_scan(). Casts to volatile to ensure the compiler generates a real memory read (buffer updated by DMA hardware).

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

Definition at line 62 of file input.hpp.

References sbl::components::control::Pot::update(), and sbl::components::control::Pot::value().

Here is the call graph for this function: