Class OpenSkyhawk::IntegerOutput
ClassList > OpenSkyhawk > IntegerOutput
Callback output — the DcsBios::IntegerBuffer equivalent, for outputs no built-in class covers (a custom display, an LCD, a bespoke actuator). More...
#include <IntegerOutput.h>
Inherits the following classes: OpenSkyhawk::AnalogOutput
Public Types
| Type | Name |
|---|---|
| typedef void(*)(uint16_t value) | Callback Callback type: receives the decoded value. |
Public Functions
| Type | Name |
|---|---|
| IntegerOutput (uint16_t controlId, Callback callback, uint16_t mask=0xFFFF, uint8_t shift=0) Construct and register a callback output. |
Public Functions inherited from OpenSkyhawk::AnalogOutput
| 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 |
|---|---|
| virtual void | apply (uint16_t value) override Invoke the callback with the decoded value. Called by the base on a change. |
Protected Functions inherited from OpenSkyhawk::AnalogOutput
| 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
Calls a user-supplied callback with the decoded value whenever it changes. No PinRef: the callback owns whatever hardware is involved.
Matching, (value & mask) >> shift decoding and change dedup come from the AnalogOutput base, so the callback runs once per change rather than once per CTRL_BCAST. It runs in PanelGroup::loop() context — never from an ISR — and must not block: a slow callback delays every other output and the next CAN drain.
Public Types Documentation
typedef Callback
Callback type: receives the decoded value.
using OpenSkyhawk::IntegerOutput::Callback = void (*)(uint16_t value);
Public Functions Documentation
function IntegerOutput
Construct and register a callback output.
OpenSkyhawk::IntegerOutput::IntegerOutput (
uint16_t controlId,
Callback callback,
uint16_t mask=0xFFFF,
uint8_t shift=0
)
Parameters:
controlIdDCS-BIOS output address (A_4E_C_* from A4EC_OutputIds.h).callbackCalled with the decoded value on every change. nullptr is accepted (the output then does nothing) so a sketch can stub one out.maskBits of the 16-bit word belonging to this output. Default: all.shiftRight-shift applied after masking. Default 0.
Protected Functions Documentation
function apply
Invoke the callback with the decoded value. Called by the base on a change.
virtual void OpenSkyhawk::IntegerOutput::apply (
uint16_t value
) override
Implements OpenSkyhawk::AnalogOutput::apply
The documentation for this class was generated from the following file Firmware/Libraries/PanelGroup/Outputs/IntegerOutput/IntegerOutput.h