LedDevice implementation for a USBasp programmer with modified firmware (https://github.com/poljvd/hyperion-usbasp)
More...
#include <LedDeviceHyperionUsbasp.h>
|
enum | Commands { CMD_WRITE_WS2801 = 10,
CMD_WRITE_WS2812 = 11
} |
|
|
| LedDeviceHyperionUsbasp (const QJsonObject &deviceConfig) |
| Constructs specific LedDevice. More...
|
|
bool | init (const QJsonObject &deviceConfig) |
| Sets configuration. More...
|
|
virtual | ~LedDeviceHyperionUsbasp () |
| Destructor of the LedDevice; closes the output device if it is open.
|
|
int | open () |
| Opens and configures the output device. More...
|
|
| LedDevice (const QJsonObject &config=QJsonObject(), QObject *parent=nullptr) |
|
virtual int | switchOff () |
| Switch the leds off (led hardware disable)
|
|
virtual int | switchOn () |
| Switch the leds on (led hardware enable), used if reinitialization is required for the device implementation.
|
|
virtual int | setLedValues (const std::vector< ColorRgb > &ledValues) |
|
const QString & | getColorOrder () |
| Get color order of device. More...
|
|
void | setActiveDevice (QString dev) |
|
const QString & | getActiveDevice () |
|
void | setLedCount (int ledCount) |
|
int | getLedCount () |
|
void | setEnable (bool enable) |
|
bool | enabled () |
|
int | getLatchTime () |
|
bool | componentState () |
|
|
static libusb_device_handle * | openDevice (libusb_device *device) |
|
static QString | getString (libusb_device *device, int stringDescriptorIndex) |
|
|
uint8_t | _writeLedsCommand |
| command to write the leds
|
|
libusb_context * | _libusbContext |
| libusb context
|
|
libusb_device_handle * | _deviceHandle |
| libusb device handle
|
|
QJsonObject | _devConfig |
|
Logger * | _log |
| The common Logger instance for all LedDevices.
|
|
std::vector< uint8_t > | _ledBuffer |
| The buffer containing the packed RGB values.
|
|
bool | _deviceReady |
|
QString | _activeDevice |
|
int | _ledCount |
|
int | _ledRGBCount |
|
int | _ledRGBWCount |
|
QTimer | _refresh_timer |
| Timer object which makes sure that led data is written at a minimum rate e.g. More...
|
|
unsigned int | _refresh_timer_interval |
|
qint64 | _last_write_time |
|
unsigned int | _latchTime_ms |
|
|
static uint16_t | _usbVendorId = 0x16c0 |
| Usb device identifiers.
|
|
static uint16_t | _usbProductId = 0x05dc |
|
static QString | _usbProductDescription = "Hyperion led controller" |
|
LedDevice implementation for a USBasp programmer with modified firmware (https://github.com/poljvd/hyperion-usbasp)
§ LedDeviceHyperionUsbasp()
LedDeviceHyperionUsbasp::LedDeviceHyperionUsbasp |
( |
const QJsonObject & |
deviceConfig | ) |
|
Constructs specific LedDevice.
- Parameters
-
deviceConfig | json device config |
§ init()
bool LedDeviceHyperionUsbasp::init |
( |
const QJsonObject & |
deviceConfig | ) |
|
|
virtual |
Sets configuration.
- Parameters
-
deviceConfig | the json device config |
- Returns
- true if success
Reimplemented from LedDevice.
§ open()
int LedDeviceHyperionUsbasp::open |
( |
| ) |
|
|
virtual |
Opens and configures the output device.
- Returns
- Zero on succes else negative
Reimplemented from LedDevice.
§ testAndOpen()
int LedDeviceHyperionUsbasp::testAndOpen |
( |
libusb_device * |
device | ) |
|
|
protected |
Test if the device is a Hyperion Usbasp device.
- Returns
- Zero on succes else negative
§ write()
int LedDeviceHyperionUsbasp::write |
( |
const std::vector< ColorRgb > & |
ledValues | ) |
|
|
protectedvirtual |
Writes the RGB-Color values to the leds.
- Parameters
-
[in] | ledValues | The RGB-color per led |
- Returns
- Zero on success else negative
Implements LedDevice.
The documentation for this class was generated from the following files: