Skip to content

Class OpenSkyhawk::InputBase

ClassList > OpenSkyhawk > InputBase

Abstract base for all hardware-polled input objects. More...

  • #include <PanelGroup.h>

Inherited by the following classes: OpenSkyhawk::AnalogInput, OpenSkyhawk::MultiPosInput, OpenSkyhawk::RotaryEncoder, OpenSkyhawk::Switch2Pos

Public Functions

Type Name
virtual void configure ()
Configure hardware pins for this input.
virtual void forceReport () = 0
Read hardware state and emit a CAN EVT unconditionally.
InputBase * next () const
Next input in the list; nullptr at end.
virtual void poll () = 0
Read hardware state and emit a CAN EVT if state changed.

Public Static Functions

Type Name
InputBase * head ()
Head of the self-registered linked list.

Protected Functions

Type Name
InputBase ()
Registers this instance into the linked list.

Detailed Description

Declare concrete input objects at global scope; the constructor self-registers into a static linked list. PanelGroup::setup() calls configure() on every registered input after chip initialisation, then calls forceReport() for the boot EVT burst. PanelGroup::loop() calls poll() every iteration.

Public Functions Documentation

function configure

Configure hardware pins for this input.

inline virtual void OpenSkyhawk::InputBase::configure () 

Called by PanelGroup::setup() after chip.init() completes. Call _pin.configureAsInput() here — not in the constructor — because MCP23017 register writes require chip.init() to have run first.

Default is a no-op. Override in every input class that owns a PinRef.


function forceReport

Read hardware state and emit a CAN EVT unconditionally.

virtual void OpenSkyhawk::InputBase::forceReport () = 0

Called during the boot EVT burst and on every SYNC_REQ. Bypasses debounce. Establishes the current reading as the new baseline so subsequent poll() calls have a valid comparison point.


function next

Next input in the list; nullptr at end.

InputBase * OpenSkyhawk::InputBase::next () const

function poll

Read hardware state and emit a CAN EVT if state changed.

virtual void OpenSkyhawk::InputBase::poll () = 0

Called by PanelGroup::loop() every iteration. Must be non-blocking. Implementations apply their own debounce / filtering and call CANProtocol::sendBatched() only on confirmed state change.


Public Static Functions Documentation

function head

Head of the self-registered linked list.

static InputBase * OpenSkyhawk::InputBase::head () 

Protected Functions Documentation

function InputBase

Registers this instance into the linked list.

OpenSkyhawk::InputBase::InputBase () 


The documentation for this class was generated from the following file Firmware/Libraries/PanelGroup/PanelGroup.h