63 namespace batteryCalibration
247 bool isAltModeEngaged,
248 uint64_t firmware_bitmap,
288 std::string deviceName,
289 std::string deviceManufacturer,
290 bool enableAutoPowerOff,
293 bool usb_enable =
true,
294 bool ble_enable =
true,
295 bool exclusive =
false);
373 uint16_t
onGetFeature(uint8_t report_id, uint8_t *buffer, uint16_t len);
382 void onSetFeature(uint8_t report_id,
const uint8_t *buffer, uint16_t len);
391 void onOutput(uint8_t report_id,
const uint8_t *buffer, uint16_t len);
416 bool ¬ifyConfigChanges,
418 uint64_t &inputsHigh,
422 uint8_t &clutchAxis);
Types and constants used everywhere for firmware implementation.
void configureForTesting()
Configure period, warning and power-off limits for testing.
void * getHardwareInstance()
Get the Hardware Instance object.
void shiftToNext(PixelGroup group)
Shift all pixel colors to the next pixel index.
void addFakeInput(FakeInput *instance)
Add a fake input instance for testing.
void clear()
Clear calibration data (but may persist in flash memory).
void getReady()
Prepare to run.
bool isConnected()
Tell if there is a host connection.
uint8_t getCount(PixelGroup group)
Get the total number of pixels in a group.
bool supportsCustomHardwareID()
Support for a custom PID/VID.
void notifyInputEvent(const DecouplingEvent &input)
Push an input event into the decoupling queue (for testing)
void addSample(int reading)
Add an ADC reading to calibration data. The battery should get fully charged before first call.
void reportChangeInConfig()
Report a change in user settings (clutch function, etc.)
void reset()
Turn off all pixels in all groups.
void shiftToPrevious(PixelGroup group)
Shift all pixel colors to the previous pixel index.
void reportInput(uint64_t inputsLow, uint64_t inputsHigh, uint8_t POVstate, uint8_t leftAxis, uint8_t rightAxis, uint8_t clutchAxis)
Report HID inputs.
void 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.
void onRawInput(DecouplingEvent &input)
Process a single input event.
void configureFakeMonitor(BatteryStatus *fakeStatus)
Configure a fake monitor for testing.
void map(bool isAltModeEngaged, uint64_t firmware_bitmap, uint64_t &low, uint64_t &high)
Map a firmware-defined input bitmap.
void setAll(PixelGroup group, uint8_t red, uint8_t green, uint8_t blue)
Set the color of all pixels in a group.
void show()
Display all pixels in all groups at once.
void reportBatteryLevel(const BatteryStatus &status)
Report current battery level and status to the host computer.
Types and constants required for custom firmware setup.
PixelGroup
Available RGB LED groups for pixel control.
Everything related to the measurement of available battery charge.
Everything related to the HID protocol.
uint16_t onGetFeature(uint8_t report_id, uint8_t *buffer, uint16_t len)
Send feature report.
void onOutput(uint8_t report_id, const uint8_t *buffer, uint16_t len)
Receive an output report.
void getReady()
Prepare to run.
void 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.
void onReset(uint8_t *report)
Resets data for the input report.
BatteryStatusChrData toBleBatteryStatus(const BatteryStatus &status)
Convert a battery status to the data format required by the BAS specification (BLE only)
void onSetFeature(uint8_t report_id, const uint8_t *buffer, uint16_t len)
Receive a feature report.
Everything related to pixel control.
Everything related to power management.
Everything related to the user interface, if available.
Data format for the Battery Level Status characteristic (packed)