AVR USB RGB LED Controller  1.1
 All Classes Namespaces Files Functions Variables Typedefs Properties Macros Pages
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
LibRgbLedCtrl.Rgbledctrl Class Reference

C# .NET Wrapper class for C library More...

Inherits IDisposable.

Public Member Functions

 Rgbledctrl ()
 Initialise stuff More...
 
void Dispose ()
 Deal with unmanaged memory More...
 
bool open ()
 Open whatever device is found first More...
 
bool open (uint idx)
 Open device using its position/index in the list of devices found by find() More...
 
bool open (byte value, ushort address)
 Open device that has the specified value at the specified EEPROM address. More...
 
void close ()
 Close RGB LED controller. More...
 
bool poke ()
 Check if the device is still connected More...
 
bool reset ()
 Reset device (makes the watchdog timer timeout) More...
 
bool 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. More...
 
bool setRGB (Color colour)
 Set red, green and blue brightnesses in one go More...
 
bool setR (byte value)
 Set red LED brightness More...
 
bool setG (byte value)
 Set green LED brightness More...
 
bool setB (byte value)
 Set blue LED brightness More...
 
bool eeprom_write (byte data, ushort address)
 Write a byte to device EEPROM More...
 
bool eeprom_read (ref byte data, ushort address)
 Read a byte from device EEPROM More...
 

Static Public Member Functions

static void init ()
 Initialises libraries. Should be called before any other stuff. More...
 
static uint find ()
 Updates devices list. Should be called before opening a controller. More...
 
static bool sameDevice (IntPtr handle1, IntPtr handle2)
 Checks to see if two handles are handles for the same device More...
 

Public Attributes

const byte RGBLED_IDLETIME_DISABLE = 0
 Disable LED fade when no USB activity. More...
 

Properties

byte[] version [get]
 Controller firmware version More...
 
ushort eepromSize [get]
 Available EEPROM space More...
 
Color colour [get]
 Current colour More...
 
byte idleTime [get]
 Idle timeout (seconds) More...
 
IntPtr handle [get]
 LibUSB device handle More...
 

Detailed Description

C# .NET Wrapper class for C library

Constructor & Destructor Documentation

LibRgbLedCtrl.Rgbledctrl.Rgbledctrl ( )
inline

Initialise stuff

Member Function Documentation

void LibRgbLedCtrl.Rgbledctrl.close ( )
inline

Close RGB LED controller.

void LibRgbLedCtrl.Rgbledctrl.Dispose ( )
inline

Deal with unmanaged memory

bool LibRgbLedCtrl.Rgbledctrl.eeprom_read ( ref byte  data,
ushort  address 
)
inline

Read a byte from device EEPROM

Parameters
data
addressEEPROM Address
Returns
true on success, false on failure
bool LibRgbLedCtrl.Rgbledctrl.eeprom_write ( byte  data,
ushort  address 
)
inline

Write a byte to device EEPROM

Parameters
dataValue to write
addressEEPROM Address
Returns
true on success, false on failure
static uint LibRgbLedCtrl.Rgbledctrl.find ( )
inlinestatic

Updates devices list. Should be called before opening a controller.

Returns
Number of RGB LED controllers found.
static void LibRgbLedCtrl.Rgbledctrl.init ( )
inlinestatic

Initialises libraries. Should be called before any other stuff.

bool LibRgbLedCtrl.Rgbledctrl.open ( )
inline

Open whatever device is found first

Returns
true on success, false on failure
bool LibRgbLedCtrl.Rgbledctrl.open ( uint  idx)
inline

Open device using its position/index in the list of devices found by find()

Parameters
idxIndex
Returns
true on success, false on failure
bool LibRgbLedCtrl.Rgbledctrl.open ( byte  value,
ushort  address 
)
inline

Open device that has the specified value at the specified EEPROM address.

Parameters
valueValue to check for
addressEEPROM address to look at
Returns
true on success, false on failure
bool LibRgbLedCtrl.Rgbledctrl.poke ( )
inline

Check if the device is still connected

Returns
true on success, false on failure
bool LibRgbLedCtrl.Rgbledctrl.reset ( )
inline

Reset device (makes the watchdog timer timeout)

Returns
true on success, false on failure
static bool LibRgbLedCtrl.Rgbledctrl.sameDevice ( IntPtr  handle1,
IntPtr  handle2 
)
inlinestatic

Checks to see if two handles are handles for the same device

Parameters
handle1Device handle 1
handle2Device handle 2
Returns
true if they are handles for the same device, otherwise false
bool LibRgbLedCtrl.Rgbledctrl.setB ( byte  value)
inline

Set blue LED brightness

Parameters
valueBrightness
Returns
true on success, false on failure
bool LibRgbLedCtrl.Rgbledctrl.setG ( byte  value)
inline

Set green LED brightness

Parameters
valueBrightness
Returns
true on success, false on failure
bool LibRgbLedCtrl.Rgbledctrl.setIdleTime ( byte  time)
inline

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
time
Returns
true on success, false on failure
bool LibRgbLedCtrl.Rgbledctrl.setR ( byte  value)
inline

Set red LED brightness

Parameters
valueBrightness
Returns
true on success, false on failure
bool LibRgbLedCtrl.Rgbledctrl.setRGB ( Color  colour)
inline

Set red, green and blue brightnesses in one go

Parameters
colourThe colour to set to
Returns
true on success, false on failure

Member Data Documentation

const byte LibRgbLedCtrl.Rgbledctrl.RGBLED_IDLETIME_DISABLE = 0

Disable LED fade when no USB activity.

Property Documentation

Color LibRgbLedCtrl.Rgbledctrl.colour
get

Current colour

ushort LibRgbLedCtrl.Rgbledctrl.eepromSize
get

Available EEPROM space

IntPtr LibRgbLedCtrl.Rgbledctrl.handle
get

LibUSB device handle

byte LibRgbLedCtrl.Rgbledctrl.idleTime
get

Idle timeout (seconds)

byte [] LibRgbLedCtrl.Rgbledctrl.version
get

Controller firmware version


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