ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
led.h
Go to the documentation of this file.
1 #ifndef LED_H
2 #define LED_H
3 
4 #include "includes.h"
5 #include "device.h"
6 
7 // Note: Lock dmutex before using LED commands (see device.h)
8 
9 // Send current RGB values to a device. force = 0 to update only if changed, force = 1 to update no matter what. Returns 0 on success.
10 int updatergb_kb(usbdevice* kb, int force);
11 int updatergb_mouse(usbdevice* kb, int force);
12 // Saves RGB data to device memory. Returns 0 on success.
13 int savergb_kb(usbdevice* kb, lighting* light, int mode);
14 int savergb_mouse(usbdevice* kb, lighting* light, int mode);
15 // Loads RGB data from device memory. Returns 0 on success.
16 int loadrgb_kb(usbdevice* kb, lighting* light, int mode);
17 int loadrgb_mouse(usbdevice* kb, lighting* light, int mode);
18 
19 // Generates data for an RGB command to match the given RGB data. Returns a string like "ff0000" or "w:ff0000 a:00ff00 ..."
20 // The result must be freed later.
21 char* printrgb(const lighting* light, const usbdevice* kb);
22 
23 // Command: Update an LED color
24 void cmd_rgb(usbdevice* kb, usbmode* mode, int dummy, int keyindex, const char* code);
25 
26 // Command: Turn an indicator off permanently
27 void cmd_ioff(usbdevice* kb, usbmode* mode, int dummy1, int dummy2, const char* led);
28 // Command: Turn an indicator on permanently
29 void cmd_ion(usbdevice* kb, usbmode* mode, int dummy1, int dummy2, const char* led);
30 // Command: Set an indicator to automatic mode
31 void cmd_iauto(usbdevice* kb, usbmode* mode, int dummy1, int dummy2, const char* led);
32 // Command: Set indicator notifications
33 void cmd_inotify(usbdevice* kb, usbmode* mode, int nnumber, int dummy, const char* led);
34 
35 #endif // LED_H
void cmd_inotify(usbdevice *kb, usbmode *mode, int nnumber, int dummy, const char *led)
Definition: led.c:74
int savergb_mouse(usbdevice *kb, lighting *light, int mode)
Definition: led_mouse.c:66
int updatergb_mouse(usbdevice *kb, int force)
Definition: led_mouse.c:20
int loadrgb_mouse(usbdevice *kb, lighting *light, int mode)
Definition: led_mouse.c:87
void cmd_iauto(usbdevice *kb, usbmode *mode, int dummy1, int dummy2, const char *led)
Definition: led.c:63
int updatergb_kb(usbdevice *kb, int force)
Definition: led_keyboard.c:79
int loadrgb_kb(usbdevice *kb, lighting *light, int mode)
Definition: led_keyboard.c:190
char * printrgb(const lighting *light, const usbdevice *kb)
Definition: led.c:120
void cmd_ion(usbdevice *kb, usbmode *mode, int dummy1, int dummy2, const char *led)
Definition: led.c:52
void cmd_ioff(usbdevice *kb, usbmode *mode, int dummy1, int dummy2, const char *led)
Definition: led.c:41
int savergb_kb(usbdevice *kb, lighting *light, int mode)
Definition: led_keyboard.c:148
void cmd_rgb(usbdevice *kb, usbmode *mode, int dummy, int keyindex, const char *code)
Definition: led.c:6