|
Sound Byte Libs 0.5.1-121-g3358a44
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Definition at line 25 of file pot_calibration.hpp.
#include <pot_calibration.hpp>
Public Member Functions | |
| uint32_t | normalize (uint32_t raw) const |
| Normalize raw ADC reading to [0, kOutputMax], clamped. | |
Static Public Member Functions | |
| static PotCalibration | from_two_point (uint32_t ccw_reading, uint32_t cw_reading) |
| static constexpr PotCalibration | default_patch_init () |
| Default for Daisy Patch.init() (inverted, ~0–33000 range). | |
| static constexpr PotCalibration | default_full_range () |
| Default full-range (no calibration needed). | |
Public Attributes | |
| uint32_t | raw_min = 0 |
| ADC reading at logical minimum (CCW after inversion) | |
| uint32_t | raw_max = 65535 |
| ADC reading at logical maximum (CW after inversion) | |
| bool | inverted = false |
| true if high ADC value = CCW (knob turned left) | |
Static Public Attributes | |
| static constexpr uint32_t | kOutputMax = 65535 |
|
inline |
Normalize raw ADC reading to [0, kOutputMax], clamped.
Definition at line 33 of file pot_calibration.hpp.
References inverted, kOutputMax, raw_max, and raw_min.
Referenced by sbl::components::input::Pot::smoothed().
|
inlinestatic |
Build calibration from measured CCW and CW ADC readings. Automatically detects inversion (if CCW reading > CW reading).
Definition at line 47 of file pot_calibration.hpp.
|
inlinestaticconstexpr |
Default for Daisy Patch.init() (inverted, ~0–33000 range).
Definition at line 57 of file pot_calibration.hpp.
|
inlinestaticconstexpr |
Default full-range (no calibration needed).
Definition at line 62 of file pot_calibration.hpp.
|
staticconstexpr |
Definition at line 26 of file pot_calibration.hpp.
Referenced by normalize(), and sbl::components::input::Pot::smoothed().
| uint32_t sbl::components::input::PotCalibration::raw_min = 0 |
ADC reading at logical minimum (CCW after inversion)
Definition at line 28 of file pot_calibration.hpp.
Referenced by normalize().
| uint32_t sbl::components::input::PotCalibration::raw_max = 65535 |
ADC reading at logical maximum (CW after inversion)
Definition at line 29 of file pot_calibration.hpp.
Referenced by normalize().
| bool sbl::components::input::PotCalibration::inverted = false |
true if high ADC value = CCW (knob turned left)
Definition at line 30 of file pot_calibration.hpp.
Referenced by normalize().