|
Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
|
Definition at line 26 of file pot_calibration.hpp.
Public Member Functions | |
| uint32_t | normalize (uint32_t raw) const |
Static Public Member Functions | |
| static PotCalibration | from_two_point (uint32_t ccw_reading, uint32_t cw_reading) |
| static constexpr PotCalibration | default_patch_init () |
| static constexpr PotCalibration | default_full_range () |
Public Attributes | |
| uint32_t | raw_min = 0 |
| uint32_t | raw_max = 65535 |
| bool | inverted = false |
Static Public Attributes | |
| static constexpr uint32_t | OUTPUT_MAX = 65535 |
|
inline |
Normalize raw ADC reading to [0, OUTPUT_MAX], clamped.
Definition at line 34 of file pot_calibration.hpp.
References inverted, raw_max, and raw_min.
Referenced by sbl::control::input::Pot::smoothed().
|
inlinestatic |
Build calibration from measured CCW and CW ADC readings. Automatically detects inversion (if CCW reading > CW reading).
Definition at line 55 of file pot_calibration.hpp.
|
inlinestaticconstexpr |
Preset for an inverted pot spanning raw counts 0 to 33000.
Definition at line 61 of file pot_calibration.hpp.
|
inlinestaticconstexpr |
Default full-range (no calibration needed).
Definition at line 64 of file pot_calibration.hpp.
|
staticconstexpr |
Definition at line 27 of file pot_calibration.hpp.
| uint32_t sbl::control::input::PotCalibration::raw_min = 0 |
ADC reading at logical minimum (CCW after inversion)
Definition at line 29 of file pot_calibration.hpp.
Referenced by normalize().
| uint32_t sbl::control::input::PotCalibration::raw_max = 65535 |
ADC reading at logical maximum (CW after inversion)
Definition at line 30 of file pot_calibration.hpp.
Referenced by normalize().
| bool sbl::control::input::PotCalibration::inverted = false |
true if high ADC value = CCW (knob turned left)
Definition at line 31 of file pot_calibration.hpp.
Referenced by normalize().