Class OpenSkyhawk::AnalogOutput
ClassList > OpenSkyhawk > AnalogOutput
Abstract base for outputs driven by one 16-bit DCS-BIOS value (FirmwarePlan D16). More...
#include <AnalogOutput.h>
Inherits the following classes: OpenSkyhawk::OutputBase
Inherited by the following classes: OpenSkyhawk::Dimmer, OpenSkyhawk::IntegerOutput
Public Functions
| Type | Name |
|---|---|
| virtual void | onControlPacket (uint16_t controlId, uint16_t value) Match, decode, dedup, then apply() . Called byPanelGroup for every CTRL_BCAST packet. |
Public Functions inherited from OpenSkyhawk::OutputBase
| Type | Name |
|---|---|
| virtual void | configure () Configure hardware pins for this output. |
| OutputBase * | next () const Next output in the list; nullptr at end. |
| virtual void | onControlPacket (uint16_t controlId, uint16_t value) = 0 Called for every non-null ControlPacket in a CTRL_BCAST frame. |
| virtual void | update () Called every PanelGroup::loop() iteration. |
Public Static Functions inherited from OpenSkyhawk::OutputBase
| Type | Name |
|---|---|
| OutputBase * | head () Head of the self-registered linked list. |
Protected Functions
| Type | Name |
|---|---|
| AnalogOutput (uint16_t controlId, uint16_t mask=0xFFFF, uint8_t shift=0) Construct the base. Registration into PanelGroup 's output list isOutputBase 's. |
|
| virtual void | apply (uint16_t value) = 0 Sink hook — called with the decoded value, only when it changed. |
Protected Functions inherited from OpenSkyhawk::OutputBase
| Type | Name |
|---|---|
| OutputBase () Registers this instance into the linked list. |
Detailed Description
Owns what every member shares, so a subclass is only its sink: controlId matching on each CTRL_BCAST packet, (value & mask) >> shift decoding — the same address/mask/shift triple DCS-BIOS uses, so packed fields work as well as whole-word outputs — and change dedup, so apply() runs only when the decoded value differs from the last one applied. DCS-BIOS re-broadcasts full state after SYNC_REQ; without the dedup every subclass would repeat the same work on every resync.
Does not know what the value means or where it goes — that is the subclass's apply(). Does not configure pins: a subclass with hardware overrides configure().
Members: Dimmer (PWM duty on a GPIO timer pin), IntegerOutput (user callback). Needle gauges are deliberately not members — they use NeedleGauge + a MotorDriver, which add calibration and smooth motion.
Public Functions Documentation
function onControlPacket
Match, decode, dedup, then apply() . Called byPanelGroup for every CTRL_BCAST packet.
virtual void OpenSkyhawk::AnalogOutput::onControlPacket (
uint16_t controlId,
uint16_t value
)
Parameters:
controlIdIncoming packet controlId. Ignored if != the configured one.valueRaw 16-bit DCS-BIOS value.
Implements OpenSkyhawk::OutputBase::onControlPacket
Protected Functions Documentation
function AnalogOutput
Construct the base. Registration into PanelGroup 's output list isOutputBase 's.
OpenSkyhawk::AnalogOutput::AnalogOutput (
uint16_t controlId,
uint16_t mask=0xFFFF,
uint8_t shift=0
)
Parameters:
controlIdDCS-BIOS output address (A_4E_C_* from A4EC_OutputIds.h).maskBits of the 16-bit word belonging to this output. Default: all. Use the A_4E_C_*_AM constants for packed fields.shiftRight-shift applied after masking. Default 0.
function apply
Sink hook — called with the decoded value, only when it changed.
virtual void OpenSkyhawk::AnalogOutput::apply (
uint16_t value
) = 0
Parameters:
value(raw & mask) >> shift.
The documentation for this class was generated from the following file Firmware/Libraries/PanelGroup/Outputs/AnalogOutput/AnalogOutput.h