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

Use a single-color LED as a shift light indicator. More...

#include <SimWheelUI.hpp>

Public Member Functions

 SimpleShiftLight (OutputGPIO ledPin)
 Create a simple "shift" light.
 
virtual void onStart () override
 Called just once after initialization.
 
virtual void onConnected () override
 Notify device is connected.
 
virtual void onTelemetryData (const TelemetryData *pTelemetryData) override
 Notify new telemetry data.
 
virtual void serveSingleFrame (uint32_t elapsedMs) override
 Draw a single frame.
 
virtual void shutdown () override
 Cut power to the UI hardware.
 
virtual uint8_t getMaxFPS () override
 Get the maximum FPS supported by the underlying hardware.
 
virtual uint16_t getStackSize () override
 Get the stack size required by this user interface.
 
- Public Member Functions inherited from AbstractUserInterface
 AbstractUserInterface (const AbstractUserInterface &)=delete
 
AbstractUserInterfaceoperator= (const AbstractUserInterface &)=delete
 
virtual void onBitePoint (uint8_t bitePoint)
 Notify a change in the current bite point.
 
virtual void onBLEdiscovering ()
 Notify device is in discovery mode.
 
virtual void onLowBattery ()
 Notify low battery.
 
virtual void onSaveSettings ()
 Notify that user settings have been saved to flash memory.
 

Additional Inherited Members

- Public Attributes inherited from AbstractUserInterface
bool requiresPowertrainTelemetry = false
 Set to true to receive and use powertrain telemetry data.
 
bool requiresECUTelemetry = false
 Set to true to receive and use ECU telemetry data.
 
bool requiresRaceControlTelemetry = false
 Set to true to receive and use race control telemetry data.
 
bool requiresGaugeTelemetry = false
 Set to true to receive and use telemetry data for gauges.
 
- Protected Member Functions inherited from AbstractUserInterface
uint32_t frameTimer (uint32_t &timerVariable, uint32_t elapsedTimeMs, uint32_t timeLimitMs)
 Simple timer.
 

Detailed Description

Use a single-color LED as a shift light indicator.

Definition at line 48 of file SimWheelUI.hpp.

Constructor & Destructor Documentation

◆ SimpleShiftLight()

SimpleShiftLight::SimpleShiftLight ( OutputGPIO ledPin)

Create a simple "shift" light.

Parameters
ledPinGPIO pin where the LED is attached to.

Member Function Documentation

◆ getMaxFPS()

virtual uint8_t SimpleShiftLight::getMaxFPS ( )
inlineoverridevirtual

Get the maximum FPS supported by the underlying hardware.

Note
You must override this method to receive telemetry data
Returns
uint8_t Frames per second.

Reimplemented from AbstractUserInterface.

Definition at line 64 of file SimWheelUI.hpp.

◆ getStackSize()

virtual uint16_t SimpleShiftLight::getStackSize ( )
inlineoverridevirtual

Get the stack size required by this user interface.

Warning
You should override this method if you get "stack canary" or "dual exception" errors.
Returns
uin16_t Stack size in bytes for the notification/frameserver daemon. Return zero to use a default value. Increase the stack size if you get "stack canary" or "dual exception" errors and reboots.

Reimplemented from AbstractUserInterface.

Definition at line 65 of file SimWheelUI.hpp.

◆ onConnected()

virtual void SimpleShiftLight::onConnected ( )
overridevirtual

Notify device is connected.

Reimplemented from AbstractUserInterface.

◆ onStart()

virtual void SimpleShiftLight::onStart ( )
overridevirtual

Called just once after initialization.

Reimplemented from AbstractUserInterface.

◆ onTelemetryData()

virtual void SimpleShiftLight::onTelemetryData ( const TelemetryData * pTelemetryData)
overridevirtual

Notify new telemetry data.

Parameters
pTelemetryDataPointer to telemetry data. Can be null. Safe to store for later use.
Note
For this method to get called, user code must meet the following requirements:
  • getMaxFPS must return non-zero.
  • At instance creation, one of the requiresXXXTelemetry attributes must be set to true.
Always called just before serveSingleFrame(). This method may draw a display frame into a buffer, while serveSingleFrame() just displays that frame buffer.
pTelemetryData is null when no telemetry data has been received in the previous two seconds. May be used to turn the display off.
Must not enter an infinite loop. Must return as soon as possible.

Reimplemented from AbstractUserInterface.

◆ serveSingleFrame()

virtual void SimpleShiftLight::serveSingleFrame ( uint32_t elapsedMs)
overridevirtual

Draw a single frame.

Parameters
elapsedMsElapsed milliseconds since last call.
Note
Called at timed intervals when no notifications are pending. Do not assume perfect timing.
Must not enter an infinite loop. Must return as soon as possible.

Reimplemented from AbstractUserInterface.

◆ shutdown()

virtual void SimpleShiftLight::shutdown ( )
overridevirtual

Cut power to the UI hardware.

Note
This is a command, not a notification. Not reversible.

Reimplemented from AbstractUserInterface.


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