C++ Wrapper class for C library.
More...
#include <rgbledctrl.h>
|
static void | init () |
|
static uint | find () |
|
static bool | sameDevice (usb_dev_handle *handle1, usb_dev_handle *handle2) |
|
C++ Wrapper class for C library.
rgbledctrl::rgbledctrl |
( |
| ) |
|
rgbledctrl::~rgbledctrl |
( |
| ) |
|
void rgbledctrl::close |
( |
| ) |
|
Close device.
- Returns
- (none)
Read device EEPROM
- Parameters
-
[data] | Pointer to buffer to write data to |
[address] | EEPROM address to read |
- Returns
- true on success, false on failure
Write to device EEPROM
- Parameters
-
[data] | Data to write |
[address] | EEPROM address to write to |
- Returns
- true on success, false on failure
static uint rgbledctrl::find |
( |
| ) |
|
|
static |
Update list of RGB LED controllers, should be called before opening devices.
- Returns
- Number of RGB LED controllers found.
void rgbledctrl::getColour |
( |
s_rgbVal & |
colour | ) |
|
Current colour
- Parameters
-
[colour] | s_rgbVal structure to load colour to |
usb_dev_handle* rgbledctrl::getHandle |
( |
| ) |
|
byte rgbledctrl::getIdleTime |
( |
| ) |
|
void rgbledctrl::getVersion |
( |
byte(&) |
version[2] | ) |
|
Controller firmware version
- Parameters
-
[version] | Byte[2] array to load data to |
static void rgbledctrl::init |
( |
| ) |
|
|
static |
Initialise, must be called before anything else!
- Returns
- (none)
bool rgbledctrl::open |
( |
| ) |
|
Open whatever device is found first.
- Returns
- true on success, false on failure
bool rgbledctrl::open |
( |
uint |
idx | ) |
|
Open device using its position/index in the list of devices found by find().
- Parameters
-
- Returns
- true on success, false on failure
Open device that has the specified value at the specified EEPROM address.
- Parameters
-
[value] | Value to check for |
[address] | EEPROM address to look at |
- Returns
- true on success, false on failure
bool rgbledctrl::poke |
( |
| ) |
|
Check if the device is still connected.
- Returns
- true if connected, false if not
bool rgbledctrl::reset |
( |
| ) |
|
Reset device (makes the watchdog timer timeout).
- Returns
- true on success, false on failure
static bool rgbledctrl::sameDevice |
( |
usb_dev_handle * |
handle1, |
|
|
usb_dev_handle * |
handle2 |
|
) |
| |
|
static |
Checks to see if two handles are handles for the same device.
- Parameters
-
[handle1] | Handle 1 |
[handle2] | Handle 2 |
- Returns
- true if they are handles for the same device, otherwise false
bool rgbledctrl::setB |
( |
byte |
value | ) |
|
Set blue brightness
- Parameters
-
- Returns
- true on success, false on failure
bool rgbledctrl::setG |
( |
byte |
value | ) |
|
Set green brightness
- Parameters
-
- Returns
- true on success, false on failure
bool rgbledctrl::setIdleTime |
( |
byte |
time | ) |
|
Set idle time. Idle time is how long the controller waits (in seconds) before fading out the LEDs when there is no USB activity. RGBLED_IDLETIME_DISABLE = Disabled.
- Parameters
-
- Returns
- true on success, false on failure
bool rgbledctrl::setR |
( |
byte |
value | ) |
|
Set red brightness
- Parameters
-
- Returns
- true on success, false on failure
bool rgbledctrl::setRGB |
( |
s_rgbVal & |
colour | ) |
|
Set red, green and blue brightnesses in one go
- Parameters
-
- Returns
- true on success, false on failure
The documentation for this class was generated from the following file: