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

Notifications using pixel control. More...

#include <SimWheelTypes.hpp>

Public Member Functions

 PixelControlNotification (PixelControlNotification &other)=delete
 
void operator= (const PixelControlNotification &)=delete
 
virtual void pixelControl_OnStart ()
 Called just once after initialization.
 
virtual void pixelControl_OnBitePoint (uint8_t bitePoint)
 Notify a change in current bite point.
 
virtual void pixelControl_OnConnected ()
 Notify device is connected.
 
virtual void pixelControl_OnBLEdiscovering ()
 Notify device is in discovery mode.
 
virtual void pixelControl_OnSaveSettings ()
 Notify that user settings have been saved to flash memory.
 
virtual void pixelControl_OnLowBattery ()
 Notify low battery.
 
- Public Member Functions inherited from AbstractUserInterface
 AbstractUserInterface (const AbstractUserInterface &)=delete
 
AbstractUserInterfaceoperator= (const AbstractUserInterface &)=delete
 
virtual uint16_t getStackSize ()
 Get the stack size required by this user interface.
 
virtual void onTelemetryData (const TelemetryData *pTelemetryData)
 Notify new telemetry data.
 
virtual void onUserInput (uint8_t inputNumber)
 Notify user input.
 

Static Public Member Functions

static PixelControlNotificationgetInstance ()
 Get the singleton instance.
 

Protected Member Functions

 PixelControlNotification ()
 Initialize.
 
void show (PixelGroup group) noexcept
 Show pixels all at once in a specific group.
 
void show () noexcept
 Show pixels all at once in all groups.
 
bool renderBatteryLevel (uint32_t barColor=0x00ACFA70)
 Macro to render the current battery SoC.
 
- Protected Member Functions inherited from AbstractUserInterface
uint32_t frameTimer (uint32_t &timerVariable, uint32_t elapsedTimeMs, uint32_t timeLimitMs)
 Simple timer.
 

Static Protected Member Functions

static void reset () noexcept
 Show all pixels in black in all groups all at once.
 
static uint8_t getPixelCount (PixelGroup group) noexcept
 Get the count of pixels in a pixel group.
 

Protected Attributes

::std::vector< Pixeltelemetry_pixel {}
 Pixel vector for the telemetry group.
 
::std::vector< Pixelbacklit_button_pixel {}
 Pixel vector for the backlit buttons group.
 
::std::vector< Pixelindividual_pixel {}
 Pixel vector for the individual pixels group.
 
bool notConnectedYet = true
 Flag to indicate host connection.
 

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.
 
bool requiresWheelTelemetry = false
 Set to true to receive and use wheel telemetry data.
 

Detailed Description

Notifications using pixel control.

Note
All methods are called in a separate low-priority thread

Definition at line 1750 of file SimWheelTypes.hpp.

Constructor & Destructor Documentation

◆ PixelControlNotification()

PixelControlNotification::PixelControlNotification ( )
inlineprotected

Initialize.

Definition at line 1767 of file SimWheelTypes.hpp.

Member Function Documentation

◆ getInstance()

static PixelControlNotification * PixelControlNotification::getInstance ( )
inlinestatic

Get the singleton instance.

Returns
PixelControlNotification* Singleton instance

Definition at line 1837 of file SimWheelTypes.hpp.

◆ getPixelCount()

static uint8_t PixelControlNotification::getPixelCount ( PixelGroup group)
staticprotectednoexcept

Get the count of pixels in a pixel group.

Parameters
groupPixel group
Returns
uint8_t The count of pixels or zero if the group was not configured.

◆ pixelControl_OnBitePoint()

virtual void PixelControlNotification::pixelControl_OnBitePoint ( uint8_t bitePoint)
virtual

Notify a change in current bite point.

Parameters
bitePointLast known bite point.

◆ pixelControl_OnBLEdiscovering()

virtual void PixelControlNotification::pixelControl_OnBLEdiscovering ( )
virtual

Notify device is in discovery mode.

Note
Not called in the USB implementation.

◆ pixelControl_OnConnected()

virtual void PixelControlNotification::pixelControl_OnConnected ( )
virtual

Notify device is connected.

Note
Called in a low priority thread.

◆ pixelControl_OnLowBattery()

virtual void PixelControlNotification::pixelControl_OnLowBattery ( )
virtual

Notify low battery.

Note
Called at timed intervals while the low battery condition persists.

◆ renderBatteryLevel()

bool PixelControlNotification::renderBatteryLevel ( uint32_t barColor = 0x00ACFA70)
protected

Macro to render the current battery SoC.

Note
Does nothing if there is no battery. Pixels are rendered, but not shown yet.
Parameters
barColorPacked RGB color to use in the percentage bar.
Returns
True if there is a battery.
False if there is no battery.

◆ reset()

static void PixelControlNotification::reset ( )
staticprotectednoexcept

Show all pixels in black in all groups all at once.

Note
Does not overwrite pixel vector members

◆ show()

void PixelControlNotification::show ( PixelGroup group)
protectednoexcept

Show pixels all at once in a specific group.

Parameters
groupPixel group

Member Data Documentation

◆ backlit_button_pixel

::std::vector<Pixel> PixelControlNotification::backlit_button_pixel {}
protected

Pixel vector for the backlit buttons group.

Definition at line 1775 of file SimWheelTypes.hpp.

◆ individual_pixel

::std::vector<Pixel> PixelControlNotification::individual_pixel {}
protected

Pixel vector for the individual pixels group.

Definition at line 1778 of file SimWheelTypes.hpp.

◆ notConnectedYet

bool PixelControlNotification::notConnectedYet = true
protected

Flag to indicate host connection.

Note
True on startup or connection loss. False after a connection is established. For read only. Do not overwrite.

Definition at line 1787 of file SimWheelTypes.hpp.

◆ telemetry_pixel

::std::vector<Pixel> PixelControlNotification::telemetry_pixel {}
protected

Pixel vector for the telemetry group.

Definition at line 1772 of file SimWheelTypes.hpp.


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