Doly C++ SDK v1.00
Loading...
Searching...
No Matches
LedControl Namespace Reference

Functions

int8_t init ()
 Initialize the LED subsystem.
int8_t dispose ()
 Stop the worker thread and release resources.
bool isActive ()
 Check whether the LED subsystem is active (initialized).
void Abort (LedSide side)
 Abort any running activity on the given side.
void processActivity (uint16_t id, LedSide side, LedActivity activity)
 Set a LED activity to be processed asynchronously.
float getVersion ()
 Get current library version.

Function Documentation

◆ Abort()

void LedControl::Abort ( LedSide side)

Abort any running activity on the given side.

Parameters
sideLED side to abort.

◆ dispose()

int8_t LedControl::dispose ( )

Stop the worker thread and release resources.

Returns
Status code:
  • 0 : success
  • -1..-6 : GPIO pin release failed.
Examples
LedControl/main.cpp.

◆ getVersion()

float LedControl::getVersion ( )

Get current library version.

Original note: format 0.XYZ (3 digits after major).

Returns
Version as float.
Examples
LedControl/main.cpp.

◆ init()

int8_t LedControl::init ( )

Initialize the LED subsystem.

Returns
Status code:
  • 0 : success
  • 1 : already initialized
  • -1 : R Left GPIO init failed
  • -2 : G Left GPIO init failed
  • -3 : B Left GPIO init failed
  • -4 : R Right GPIO init failed
  • -5 : G Right GPIO init failed
  • -6 : B Right GPIO init failed
Examples
LedControl/main.cpp.

◆ isActive()

bool LedControl::isActive ( )

Check whether the LED subsystem is active (initialized).

Returns
true if initialized; false otherwise.

◆ processActivity()

void LedControl::processActivity ( uint16_t id,
LedSide side,
LedActivity activity )

Set a LED activity to be processed asynchronously.

This is a non-blocking operation. The internal worker processes the activity and completion/error is reported via LedEvent callbacks.

Parameters
idUser-defined activity identifier (forwarded to completion/error events).
sideLED side to run the activity on.
activityActivity parameters (colors, fade time).
Examples
LedControl/main.cpp.