OpenSourceSimWheelESP32
Open-source wireless steering wheel/button box for ESP32 boards
Loading...
Searching...
No Matches
InputService Class Reference

Input hardware services. More...

#include <InternalServices.hpp>

Public Member Functions

virtual void recalibrateAxes ()
 Force auto-calibration of all axes (analog clutch paddles)
 
virtual void reverseLeftAxis ()
 Change polarity of left axis (if any)
 
virtual void reverseRightAxis ()
 Change polarity of right axis (if any)
 
virtual void setRotaryPulseWidthMultiplier (PulseWidthMultiplier multiplier, bool save=true)
 Multiply the pulse width of rotary encoders.
 
virtual PulseWidthMultiplier getRotaryPulseWidthMultiplier ()
 Get the current pulse width multiplier for rotary encoders.
 
virtual bool getAxisCalibration (int &minLeft, int &maxLeft, int &minRight, int &maxRight)
 Get current axis calibration data.
 
virtual void setAxisCalibration (int minLeft, int maxLeft, int minRight, int maxRight, bool save=true)
 Set the Axis calibration data.
 
virtual void getAxisPolarity (bool &leftAxisReversed, bool &rightAxisReversed)
 Get axes polarity.
 
virtual void setAxisPolarity (bool leftAxisReversed, bool rightAxisReversed, bool save=true)
 Set axes polarity.
 
virtual void update ()
 Repeat last input event.
 

Additional Inherited Members

- Static Public Member Functions inherited from DependencyManager< InputService >
static InputServicecall ()
 Get the service provider implementing the service.
 
static void inject (_Args &&...__args)
 Inject a service provider.
 
static void inject (InputService *provider)
 Inject a service provider.
 
static void reset ()
 Remove the injected service provider (for testing)
 

Detailed Description

Input hardware services.

Definition at line 114 of file InternalServices.hpp.

Member Function Documentation

◆ getAxisCalibration()

virtual bool InputService::getAxisCalibration ( int & minLeft,
int & maxLeft,
int & minRight,
int & maxRight )
inlinevirtual

Get current axis calibration data.

Note
To be called from the storage namespace
Parameters
[out]minLeftminimum ADC reading for the left clutch
[out]maxLeftmaximum ADC reading for the left clutch
[out]minRightminimum ADC reading for the right clutch
[out]maxRightmaximum ADC reading for the right clutch
Returns
true if there are analog clutch paddles
true if there are no analog clutch paddles, so the output parameters were not set.

Definition at line 173 of file InternalServices.hpp.

◆ getAxisPolarity()

virtual void InputService::getAxisPolarity ( bool & leftAxisReversed,
bool & rightAxisReversed )
inlinevirtual

Get axes polarity.

Parameters
[out]leftAxisReversedTrue if the left axis is reversed
[out]rightAxisReversedTrue if the right axis is reversed

Definition at line 203 of file InternalServices.hpp.

◆ getRotaryPulseWidthMultiplier()

virtual PulseWidthMultiplier InputService::getRotaryPulseWidthMultiplier ( )
inlinevirtual

Get the current pulse width multiplier for rotary encoders.

Returns
PulseWidthMultiplier A pulse width multiplier greater than zero.

Definition at line 155 of file InternalServices.hpp.

◆ recalibrateAxes()

virtual void InputService::recalibrateAxes ( )
inlinevirtual

Force auto-calibration of all axes (analog clutch paddles)

Definition at line 121 of file InternalServices.hpp.

◆ reverseLeftAxis()

virtual void InputService::reverseLeftAxis ( )
inlinevirtual

Change polarity of left axis (if any)

Note
Saved to flash memory without delay

Definition at line 128 of file InternalServices.hpp.

◆ reverseRightAxis()

virtual void InputService::reverseRightAxis ( )
inlinevirtual

Change polarity of right axis (if any)

Note
Saved to flash memory without delay

Definition at line 135 of file InternalServices.hpp.

◆ setAxisCalibration()

virtual void InputService::setAxisCalibration ( int minLeft,
int maxLeft,
int minRight,
int maxRight,
bool save = true )
inlinevirtual

Set the Axis calibration data.

Note
To be called from the storage namespace
Parameters
[in]minLeftminimum ADC reading for the left clutch
[in]maxLeftmaximum ADC reading for the left clutch
[in]minRightminimum ADC reading for the right clutch
[in]maxRightmaximum ADC reading for the right clutch
[in]saveIf true, save to persistent storage

Definition at line 190 of file InternalServices.hpp.

◆ setAxisPolarity()

virtual void InputService::setAxisPolarity ( bool leftAxisReversed,
bool rightAxisReversed,
bool save = true )
inlinevirtual

Set axes polarity.

Parameters
leftAxisReversedTrue if the left axis is reversed
rightAxisReversedTrue if the right axis is reversed
saveIf true, save to persistent storage

Definition at line 214 of file InternalServices.hpp.

◆ setRotaryPulseWidthMultiplier()

virtual void InputService::setRotaryPulseWidthMultiplier ( PulseWidthMultiplier multiplier,
bool save = true )
inlinevirtual

Multiply the pulse width of rotary encoders.

Note
Valid values are saved to flash memory without delay.
Parameters
multiplierA pulse width multiplier greater than zero. Valid values are between 1 and 6. Invalid values are ignored.
saveTrue to save to flash memory

Definition at line 146 of file InternalServices.hpp.

◆ update()

virtual void InputService::update ( )
inlinevirtual

Repeat last input event.

Definition at line 223 of file InternalServices.hpp.


The documentation for this class was generated from the following file: