Struct OpenSkyhawk::AnalogConfig
ClassList > OpenSkyhawk > AnalogConfig
Tuning for an AnalogInput . Every field has a default, so a sketch sets only what differs, by name:{ .hysteresis = 32, .ewmaShift = 4, .pollMs = 2 } (#295).More...
#include <AnalogInput.h>
Public Attributes
| Type | Name |
|---|---|
| uint8_t | ewmaShift = [**DEFAULT\_EWMA\_SHIFT**](structOpenSkyhawk_1_1AnalogConfig.md#variable-default_ewma_shift) |
| uint16_t | hysteresis = [**HYSTERESIS\_AUTO**](structOpenSkyhawk_1_1AnalogConfig.md#variable-hysteresis_auto)Output counts of movement required before a new value is emitted (HYSTERESIS_AUTO: by route). |
| uint16_t | maxRaw = 65535Raw ADC value mapping to 65535. Readings above are clamped. |
| uint16_t | minRaw = 0Raw ADC value mapping to 0. Readings below are clamped. |
| uint16_t | pollMs = [**DEFAULT\_POLL\_MS**](structOpenSkyhawk_1_1AnalogConfig.md#variable-default_poll_ms) |
| bool | reverse = falsefalse: minRaw → 0, maxRaw → 65535. true: inverted. |
Public Static Attributes
| Type | Name |
|---|---|
| constexpr uint16_t | DCS_HYSTERESIS = 1024DCS-BIOS route: 1024 keeps a sweep from flooding DCS-BIOS import (SoakRig and E2E use it). |
| constexpr uint8_t | DEFAULT_EWMA_SHIFT = 3EWMA α = 1/2^3 = 1/8. |
| constexpr uint16_t | DEFAULT_POLL_MS = 8default min interval between ADC reads (ms). |
| constexpr uint16_t | HID_HYSTERESIS = 128HID route: 128 — the value the axis calibration was validated with (#46/#251). |
| constexpr uint16_t | HYSTERESIS_AUTO = 0xFFFF |
| constexpr uint8_t | MAX_EWMA_SHIFT = 15cap: scaled<<shift must fit int32 at full scale. |
Detailed Description
Fields are only ever appended, each with a default, so a new setting never breaks a sketch. The constants are the defaults and limits the fields refer to.
Public Attributes Documentation
variable ewmaShift
uint8_t OpenSkyhawk::AnalogConfig::ewmaShift;
EWMA smoothing strength: α = 1/2^ewmaShift. Capped to MAX_EWMA_SHIFT — beyond that the int32 accumulator (scaled << shift) would overflow at full scale.
variable hysteresis
Output counts of movement required before a new value is emitted (HYSTERESIS_AUTO: by route).
uint16_t OpenSkyhawk::AnalogConfig::hysteresis;
variable maxRaw
Raw ADC value mapping to 65535. Readings above are clamped.
uint16_t OpenSkyhawk::AnalogConfig::maxRaw;
variable minRaw
Raw ADC value mapping to 0. Readings below are clamped.
uint16_t OpenSkyhawk::AnalogConfig::minRaw;
variable pollMs
uint16_t OpenSkyhawk::AnalogConfig::pollMs;
Min interval between ADC reads, ms. Per instance, not per node. Not clamped: 0 means read every loop iteration, which is legal but makes τ track the loop rate — not a controlled quantity. An ADS1115 PinRef blocks ~8 ms per conversion whatever this says, so keep those at the default or higher.
variable reverse
false: minRaw → 0, maxRaw → 65535. true: inverted.
bool OpenSkyhawk::AnalogConfig::reverse;
Public Static Attributes Documentation
variable DCS_HYSTERESIS
DCS-BIOS route: 1024 keeps a sweep from flooding DCS-BIOS import (SoakRig and E2E use it).
constexpr uint16_t OpenSkyhawk::AnalogConfig::DCS_HYSTERESIS;
variable DEFAULT_EWMA_SHIFT
EWMA α = 1/2^3 = 1/8.
constexpr uint8_t OpenSkyhawk::AnalogConfig::DEFAULT_EWMA_SHIFT;
variable DEFAULT_POLL_MS
default min interval between ADC reads (ms).
constexpr uint16_t OpenSkyhawk::AnalogConfig::DEFAULT_POLL_MS;
variable HID_HYSTERESIS
HID route: 128 — the value the axis calibration was validated with (#46/#251).
constexpr uint16_t OpenSkyhawk::AnalogConfig::HID_HYSTERESIS;
variable HYSTERESIS_AUTO
constexpr uint16_t OpenSkyhawk::AnalogConfig::HYSTERESIS_AUTO;
hysteresis default: chosen from the controlId's route when the input is constructed — DCS_HYSTERESIS for a DCSIN_* (DCS-BIOS) id, HID_HYSTERESIS for a CTRL_* (HID) id. Any other value is used as given.
variable MAX_EWMA_SHIFT
cap: scaled<<shift must fit int32 at full scale.
constexpr uint8_t OpenSkyhawk::AnalogConfig::MAX_EWMA_SHIFT;
The documentation for this class was generated from the following file Firmware/Libraries/PanelGroup/Inputs/AnalogInput/AnalogInput.h