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

Two-point ADC calibration. More...

Detailed Description

Two-point ADC calibration.

Maps raw ADC readings to a normalized integer range using measured endpoint values. Handles inverted ADC layouts (high raw = CCW) and clamps output. Uses uint32_t to support any ADC resolution (12-bit, 16-bit, 24-bit).

Usage:

auto cal = PotCalibration::from_two_point(ccw_reading, cw_reading);
uint32_t t = cal.normalize(raw_adc); // [0, 65535]
// Convert to float in [0, 1]
float value = t * (1.0f / 65535.0f);

Definition in file pot_calibration.hpp.

#include <cstdint>

Go to the source code of this file.

Classes

struct  sbl::control::input::PotCalibration
 

Namespaces

namespace  sbl
 Root namespace for all Sound Byte Libs code.
 
namespace  sbl::control
 The control stack: scheduler, event queue, merge, CC mapping, calibration.
 
namespace  sbl::control::input
 Inputs: debounce, decoding, smoothing and scaling of raw samples.