Skip to content

Class OpenSkyhawk::HIDAxis

ClassList > OpenSkyhawk > HIDAxis

HID axis handler. Declared at sketch scope for each joystick axis. More...

  • #include <SimGateway.h>

Public Functions

Type Name
HIDAxis (uint16_t controlId, uint8_t axisIndex)
Register a HID axis handler.
uint16_t controlId () const
controlId this handler is registered for.
void dispatch (uint16_t value)
Dispatch a value to the joystick axis.
HIDAxis * next () const
Next axis in list; nullptr at end.

Public Static Functions

Type Name
HIDAxis * head ()
First registered axis; nullptr if none.

Detailed Description

Self-registers into a static linked list at construction. SimGateway::loop() walks the list and calls OsJoystick.setAxis() when a HID frame with a matching controlId arrives. The 0–65535 unsigned value from PanelGroup is mapped to signed ±32767 internally (value − 32768).

Declare at file scope, not inside functions — C++ constructs file-scope objects before setup() runs, which is required for the linked list to be populated.

Public Functions Documentation

function HIDAxis

Register a HID axis handler.

OpenSkyhawk::HIDAxis::HIDAxis (
    uint16_t controlId,
    uint8_t axisIndex
) 

Parameters:

  • controlId CTRL_* constant from HIDControls.h (0x0010–0x001F range).
  • axisIndex OpenSkyhawkJoystick axis index (0–7).

function controlId

controlId this handler is registered for.

uint16_t OpenSkyhawk::HIDAxis::controlId () const

function dispatch

Dispatch a value to the joystick axis.

void OpenSkyhawk::HIDAxis::dispatch (
    uint16_t value
) 

Parameters:

  • value Unsigned 0–65535; mapped to int16_t (value − 32768) internally.

function next

Next axis in list; nullptr at end.

HIDAxis * OpenSkyhawk::HIDAxis::next () const

Public Static Functions Documentation

function head

First registered axis; nullptr if none.

static HIDAxis * OpenSkyhawk::HIDAxis::head () 


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