![]() |
OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
|
System functionality not exposed to the end user. More...
Go to the source code of this file.
Namespaces | |
| namespace | internals::hid::common |
| Common functionality to all HID implementations. | |
Functions | |
| void | internals::batteryMonitor::getReady () |
| Prepare to run. | |
| void | internals::batteryMonitor::configureForTesting () |
| Configure period, warning and power-off limits for testing. | |
| void | internals::batteryMonitor::configureFakeMonitor (BatteryStatus *fakeStatus) |
| Configure a fake monitor for testing. | |
| void * | internals::batteryMonitor::getHardwareInstance () |
| Get the Hardware Instance object. | |
| void | internals::batteryCalibration::getReady () |
| Prepare to run. | |
| void | internals::batteryCalibration::clear () |
| Clear calibration data (but may persist in flash memory). | |
| void | internals::batteryCalibration::addSample (int reading) |
| Add an ADC reading to calibration data. The battery should get fully charged before first call. | |
| void | internals::pixels::getReady () |
| Prepare to run. | |
| void | internals::pixels::set (PixelGroup group, uint8_t pixelIndex, uint8_t red, uint8_t green, uint8_t blue) |
| Set the color of a single pixel. | |
| void | internals::pixels::setAll (PixelGroup group, uint8_t red, uint8_t green, uint8_t blue) |
| Set the color of all pixels in a group. | |
| void | internals::pixels::shiftToNext (PixelGroup group) |
| Shift all pixel colors to the next pixel index. | |
| void | internals::pixels::shiftToPrevious (PixelGroup group) |
| Shift all pixel colors to the previous pixel index. | |
| void | internals::pixels::show () |
| Display all pixels in all groups at once. | |
| void | internals::pixels::reset () |
| Turn off all pixels in all groups. | |
| uint8_t | internals::pixels::getCount (PixelGroup group) |
| Get the total number of pixels in a group. | |
| void | internals::ui::getReady () |
| Prepare to run. | |
| void | internals::inputs::getReady () |
| Prepare to run. | |
| void | internals::inputs::addFakeInput (FakeInput *instance) |
| Add a fake input instance for testing. | |
| void | internals::inputs::notifyInputEvent (const DecouplingEvent &input) |
| Push an input event into the decoupling queue (for testing) | |
| void | internals::inputHub::getReady () |
| Check that user configuration is correct. | |
| void | internals::inputHub::onRawInput (DecouplingEvent &input) |
| Process a single input event. | |
| void | internals::storage::getReady () |
| Prepare to run. | |
| void | internals::inputMap::getReady () |
| Prepare to run. | |
| void | internals::inputMap::clear () |
| Clear the whole map (for testing) and the custom defaults. | |
| void | internals::inputMap::map (bool isAltModeEngaged, uint64_t firmware_bitmap, uint64_t &low, uint64_t &high) |
| Map a firmware-defined input bitmap. | |
| void | internals::power::getReady () |
| Prepare to run. | |
| void | internals::hid::begin (std::string deviceName, std::string deviceManufacturer, bool enableAutoPowerOff, uint16_t VID, uint16_t PID, bool usb_enable=true, bool ble_enable=true, bool exclusive=false) |
| Start BLE/Bluetooth HID. | |
| bool | internals::hid::supportsCustomHardwareID () |
| Support for a custom PID/VID. | |
| bool | internals::hid::isConnected () |
| Tell if there is a host connection. | |
| void | internals::hid::reportChangeInConfig () |
| Report a change in user settings (clutch function, etc.) | |
| void | internals::hid::reportBatteryLevel (const BatteryStatus &status) |
| Report current battery level and status to the host computer. | |
| void | internals::hid::reportInput (uint64_t inputsLow, uint64_t inputsHigh, uint8_t POVstate, uint8_t leftAxis, uint8_t rightAxis, uint8_t clutchAxis) |
| Report HID inputs. | |
| void | internals::hid::reset () |
| Report all inputs as not active. | |
| void | internals::hid::common::getReady () |
| Prepare to run. | |
| uint16_t | internals::hid::common::onGetFeature (uint8_t report_id, uint8_t *buffer, uint16_t len) |
| Send feature report. | |
| void | internals::hid::common::onSetFeature (uint8_t report_id, const uint8_t *buffer, uint16_t len) |
| Receive a feature report. | |
| void | internals::hid::common::onOutput (uint8_t report_id, const uint8_t *buffer, uint16_t len) |
| Receive an output report. | |
| void | internals::hid::common::onReset (uint8_t *report) |
| Resets data for the input report. | |
| void | internals::hid::common::onReportInput (uint8_t *report, bool ¬ifyConfigChanges, uint64_t &inputsLow, uint64_t &inputsHigh, uint8_t &POVstate, uint8_t &leftAxis, uint8_t &rightAxis, uint8_t &clutchAxis) |
| Sets data for the input report. | |
| BatteryStatusChrData | internals::hid::common::toBleBatteryStatus (const BatteryStatus &status) |
| Convert a battery status to the data format required by the BAS specification (BLE only) | |
System functionality not exposed to the end user.
Definition in file SimWheelInternals.hpp.
| void internals::inputs::addFakeInput | ( | FakeInput * | instance | ) |
Add a fake input instance for testing.
| instance | Fake iput instance |
| void internals::batteryCalibration::addSample | ( | int | reading | ) |
Add an ADC reading to calibration data. The battery should get fully charged before first call.
| reading | An ADC reading of current battery(+) voltage. |
| void internals::hid::begin | ( | std::string | deviceName, |
| std::string | deviceManufacturer, | ||
| bool | enableAutoPowerOff, | ||
| uint16_t | VID, | ||
| uint16_t | PID, | ||
| bool | usb_enable = true, | ||
| bool | ble_enable = true, | ||
| bool | exclusive = false ) |
Start BLE/Bluetooth HID.
usb_enable and ble_enable to false will cause a runtime errorVID will be ignored as another USB-IF license would be required. However, Espressif (the license holder) allows to use a custom PID . See https://docs.espressif.com/projects/esp-iot-solution/en/latest/usb/usb_overview/usb_vid_pid.html| deviceName | Configured device name |
| deviceManufacturer | Configured device manufacturer |
| enableAutoPowerOff | Request for automatic shutdown (may be ignored) |
| VID | Configured custom vendor ID (may be ignored) |
| PID | Configured custom product ID |
| usb_enable | if true and available, USB connectivity is enabled |
| ble_enable | if true and available, BLE connectivity is enabled |
| exclusive | if true, any previous connection is dropped when another comes |
| void internals::batteryMonitor::configureFakeMonitor | ( | BatteryStatus * | fakeStatus | ) |
Configure a fake monitor for testing.
| fakeStatus | Pointer to variable holding the fake battery status |
| uint8_t internals::pixels::getCount | ( | PixelGroup | group | ) |
Get the total number of pixels in a group.
| group | Group of pixels |
| void * internals::batteryMonitor::getHardwareInstance | ( | ) |
Get the Hardware Instance object.
| bool internals::hid::isConnected | ( | ) |
Tell if there is a host connection.
| void internals::inputMap::map | ( | bool | isAltModeEngaged, |
| uint64_t | firmware_bitmap, | ||
| uint64_t & | low, | ||
| uint64_t & | high ) |
Map a firmware-defined input bitmap.
| isAltModeEngaged | True if ALT mode is engaged, false otherwise. |
| firmware_bitmap | Firmware-defined input bitmap |
| low | Least significant 64-bits of the user-defined map |
| high | Most significant 64-bits of the user-defined map |
|
inline |
Push an input event into the decoupling queue (for testing)
| input | Event to push |
| void internals::inputHub::onRawInput | ( | DecouplingEvent & | input | ) |
Process a single input event.
| input | Event to process |
| void internals::hid::reportBatteryLevel | ( | const BatteryStatus & | status | ) |
Report current battery level and status to the host computer.
| status | Battery status |
| void internals::hid::reportInput | ( | uint64_t | inputsLow, |
| uint64_t | inputsHigh, | ||
| uint8_t | POVstate, | ||
| uint8_t | leftAxis, | ||
| uint8_t | rightAxis, | ||
| uint8_t | clutchAxis ) |
Report HID inputs.
| [in] | inputsLow | State of input numbers 0 to 63 |
| [in] | inputsHigh | State of input numbers 64 to 127 |
| [in] | POVstate | State of the hat switch (POV or DPAD), this is, a button number in the range 0 (no input) to 8 (up-left). |
| [in] | leftAxis | Position of the left clutch, in the range 0-254. |
| [in] | rightAxis | Position of the right clutch, in the range 0-254. |
| [in] | clutchAxis | Position of the combined clutch, in the range 0-254. |
| void internals::pixels::set | ( | PixelGroup | group, |
| uint8_t | pixelIndex, | ||
| uint8_t | red, | ||
| uint8_t | green, | ||
| uint8_t | blue ) |
Set the color of a single pixel.
| group | The group to which the pixel is a member |
| pixelIndex | Index of the pixel in the LED strip (zero-based) |
| red | Red component of the pixel color |
| green | Green component of the pixel color |
| blue | Blue component of the pixel color |
| void internals::pixels::setAll | ( | PixelGroup | group, |
| uint8_t | red, | ||
| uint8_t | green, | ||
| uint8_t | blue ) |
Set the color of all pixels in a group.
| group | A group of pixels |
| red | Red component of the pixel color |
| green | Green component of the pixel color |
| blue | Blue component of the pixel color |
| void internals::pixels::shiftToNext | ( | PixelGroup | group | ) |
Shift all pixel colors to the next pixel index.
| group | A group of pixels |
| void internals::pixels::shiftToPrevious | ( | PixelGroup | group | ) |
Shift all pixel colors to the previous pixel index.
| group | A group of pixels |
| bool internals::hid::supportsCustomHardwareID | ( | ) |
Support for a custom PID/VID.