![]() |
OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
|
Internal service interfaces for dependency injection. More...
#include "InternalTypes.hpp"#include <cstdint>#include <type_traits>#include <cassert>#include <typeinfo>#include <vector>Go to the source code of this file.
Classes | |
| struct | DependencyManager< Service > |
| Dependency Manager. More... | |
Macros | |
| #define | MOCK |
| Macro to mark a mock implementation for void methods. | |
| #define | MOCK_R(value) |
| Macro to mark a mock implementation for non-void methods. | |
| #define | SERVICE(ClassName) |
| Macro to declare an internal service class. | |
| #define | VOID_SINGLETON_INVOKER(Decl, Call) |
| Macro to declare a void static method in a service class. | |
| #define | SINGLETON_INVOKER(ReturnType, Decl, Call) |
| Macro to declare a non-void static method in a service class. | |
| #define | ALL_INVOKER(Decl, Call) |
| Reserved for future use. | |
| #define | BOTH_INVOKER(Decl, Call) |
| Reserved for future use. | |
Functions | |
| class | SERVICE (InputService) |
| Input hardware services. | |
| class | SERVICE (InputHubService) |
| Input Hub service. | |
| class | SERVICE (InputMapService) |
| Input map service. | |
| class | SERVICE (PowerService) |
| Power service. | |
| class | SERVICE (BatteryService) |
| Battery service. | |
| class | SERVICE (BatteryCalibrationService) |
| Battery calibration service. | |
| class | SERVICE (HidService) |
| HID service. | |
| class | SERVICE (UIService) |
| User interface service. | |
| class | SERVICE (FirmwareService) |
| Global firmware service. | |
Internal service interfaces for dependency injection.
Definition in file InternalServices.hpp.
| #define ALL_INVOKER | ( | Decl, | |
| Call ) |
Reserved for future use.
Definition at line 61 of file InternalServices.hpp.
| #define BOTH_INVOKER | ( | Decl, | |
| Call ) |
Reserved for future use.
Definition at line 70 of file InternalServices.hpp.
| #define MOCK |
Macro to mark a mock implementation for void methods.
Definition at line 30 of file InternalServices.hpp.
| #define MOCK_R | ( | value | ) |
Macro to mark a mock implementation for non-void methods.
Definition at line 35 of file InternalServices.hpp.
| #define SERVICE | ( | ClassName | ) |
Macro to declare an internal service class.
Definition at line 41 of file InternalServices.hpp.
| #define SINGLETON_INVOKER | ( | ReturnType, | |
| Decl, | |||
| Call ) |
Macro to declare a non-void static method in a service class.
Definition at line 54 of file InternalServices.hpp.
| #define VOID_SINGLETON_INVOKER | ( | Decl, | |
| Call ) |
Macro to declare a void static method in a service class.
Definition at line 47 of file InternalServices.hpp.
| class SERVICE | ( | BatteryCalibrationService | ) |
Battery calibration service.
Restart autocalibration algorithm.
Get a percentage of battery charge based on calibration data.
| reading | An ADC reading of current battery(+) voltage. |
Get a percentage of battery charge using auto-calibration. Will provide incorrect battery levels (higher) until the battery is fully charged. Anyway, this algorithm is not accurate.
| reading | An ADC reading of current battery(+) voltage |
Get the count of calibration data items
Get calibration data
| index | Index of the required datum |
Set calibration data
| index | Index of this calibration data |
| data | Data to set |
| save | True to save to persistent storage. |
Get the auto-calibration parameter
Set the auto-calibration parameter
| value | Value of the auto-calibration parameter |
| save | True to save to persistent storage. |
Definition at line 1 of file InternalServices.hpp.
| class SERVICE | ( | BatteryService | ) |
Battery service.
Get the last known battery level (SoC)
Check if the device can be powered by a battery
Check if the battery is detected
Get the full battery status
| status | Current battery status |
Definition at line 1 of file InternalServices.hpp.
| class SERVICE | ( | FirmwareService | ) |
Global firmware service.
Definition at line 1 of file InternalServices.hpp.
| class SERVICE | ( | HidService | ) |
HID service.
Get the user-defined custom hardware ID
| [out] | customVID | Custom VID or zero if not configured |
| [out] | customPID | Custom PID or zero if not configured |
Set the user-defiend custom hardware ID
customVID and customPID are set to zero, the factory defaults will be used instead.| customVID | Custom VID |
| customPID | Custom PID |
| save | True to save to persistent storage |
Definition at line 1 of file InternalServices.hpp.
| class SERVICE | ( | InputHubService | ) |
Input Hub service.
Definition at line 1 of file InternalServices.hpp.
| class SERVICE | ( | InputMapService | ) |
Input map service.
Definition at line 1 of file InternalServices.hpp.
| class SERVICE | ( | InputService | ) |
Input hardware services.
Force auto-calibration of all axes (analog clutch paddles)
Change polarity of left axis (if any)
Change polarity of right axis (if any)
Multiply the pulse width of rotary encoders
| multiplier | A pulse width multiplier greater than zero. Valid values are between 1 and 6. Invalid values are ignored. |
Get the current pulse width multiplier for rotary encoders
Get current axis calibration data
| [out] | minLeft | minimum ADC reading for the left clutch |
| [out] | maxLeft | maximum ADC reading for the left clutch |
| [out] | minRight | minimum ADC reading for the right clutch |
| [out] | maxRight | maximum ADC reading for the right clutch |
Set the Axis calibration data
| [in] | minLeft | minimum ADC reading for the left clutch |
| [in] | maxLeft | maximum ADC reading for the left clutch |
| [in] | minRight | minimum ADC reading for the right clutch |
| [in] | maxRight | maximum ADC reading for the right clutch |
| [in] | save | If true, save to persistent storage |
Get axes polarity
| [out] | leftAxisReversed | True if the left axis is reversed |
| [out] | rightAxisReversed | True if the right axis is reversed |
Set axes polarity
| leftAxisReversed | True if the left axis is reversed |
| rightAxisReversed | True if the right axis is reversed |
| save | If true, save to persistent storage |
Repeat last input event
Definition at line 1 of file InternalServices.hpp.
| class SERVICE | ( | PowerService | ) |
Power service.
Definition at line 1 of file InternalServices.hpp.
| class SERVICE | ( | UIService | ) |
User interface service.
Definition at line 1 of file InternalServices.hpp.