ckb-next
v0.2.8 at branch master
ckb-next driver for corsair devices
|
Go to the source code of this file.
Macros | |
#define | DEV_MAX 9 |
#define | IS_CONNECTED(kb) ((kb) && (kb)->handle && (kb)->uinput_kb && (kb)->uinput_mouse) |
#define | dmutex(kb) (devmutex + INDEX_OF(kb, keyboard)) |
#define | imutex(kb) (inputmutex + INDEX_OF(kb, keyboard)) |
#define | mmutex(kb) (macromutex + INDEX_OF(kb, keyboard)) |
#define | mmutex2(kb) (macromutex2 + INDEX_OF(kb, keyboard)) |
#define | mvar(kb) (macrovar + INDEX_OF(kb, keyboard)) |
#define | setactive(kb, makeactive) ((makeactive) ? (kb)->vtable->active((kb), 0, 0, 0, 0) : (kb)->vtable->idle((kb), 0, 0, 0, 0)) |
setactive() calls via the corresponding kb->vtable either the active() or the idle() function. active() is called if the parameter makeactive is true, idle if it is false. What function is called effectively is device dependent. Have a look at device_vtable.c for more information. More... | |
#define | IN_HID 0x80 |
#define | IN_CORSAIR 0x40 |
#define | ACT_LIGHT 1 |
#define | ACT_NEXT 3 |
#define | ACT_NEXT_NOWRAP 5 |
#define | ACT_LOCK 8 |
#define | ACT_MR_RING 9 |
#define | ACT_M1 10 |
#define | ACT_M2 11 |
#define | ACT_M3 12 |
Functions | |
int | start_dev (usbdevice *kb, int makeactive) |
int | start_kb_nrgb (usbdevice *kb, int makeactive) |
int | setactive_kb (usbdevice *kb, int active) |
int | setactive_mouse (usbdevice *kb, int active) |
int | cmd_active_kb (usbdevice *kb, usbmode *dummy1, int dummy2, int dummy3, const char *dummy4) |
int | cmd_active_mouse (usbdevice *kb, usbmode *dummy1, int dummy2, int dummy3, const char *dummy4) |
int | cmd_idle_kb (usbdevice *kb, usbmode *dummy1, int dummy2, int dummy3, const char *dummy4) |
int | cmd_idle_mouse (usbdevice *kb, usbmode *dummy1, int dummy2, int dummy3, const char *dummy4) |
int | cmd_pollrate (usbdevice *kb, usbmode *dummy1, int dummy2, int rate, const char *dummy3) |
void | setmodeindex_nrgb (usbdevice *kb, int index) |
Variables | |
usbdevice | keyboard [9] |
remember all usb devices. Needed for closeusb(). More... | |
pthread_mutex_t | devmutex [9] |
Mutex for handling the usbdevice structure. More... | |
pthread_mutex_t | inputmutex [9] |
Mutex for dealing with usb input frames. More... | |
pthread_mutex_t | macromutex [9] |
Protecting macros against lightning: Both use usb_send. More... | |
pthread_mutex_t | macromutex2 [9] |
Protecting the single link list of threads and the macrovar. More... | |
pthread_cond_t | macrovar [9] |
This variable is used to stop and wakeup all macro threads which have to wait. More... | |
#define ACT_LIGHT 1 |
Definition at line 68 of file device.h.
Referenced by setactive_kb().
#define ACT_LOCK 8 |
Definition at line 71 of file device.h.
Referenced by setactive_kb().
#define ACT_M1 10 |
Definition at line 73 of file device.h.
Referenced by setactive_kb().
#define ACT_M2 11 |
Definition at line 74 of file device.h.
Referenced by setactive_kb().
#define ACT_M3 12 |
Definition at line 75 of file device.h.
Referenced by setactive_kb().
#define ACT_MR_RING 9 |
Definition at line 72 of file device.h.
Referenced by setactive_kb().
#define DEV_MAX 9 |
Definition at line 8 of file device.h.
Referenced by _start_dev(), _updateconnected(), quitWithLock(), usb_rm_device(), and usbadd().
Definition at line 18 of file device.h.
Referenced by _ledthread(), _setupusb(), closeusb(), devmain(), and usbadd().
#define imutex | ( | kb | ) | (inputmutex + INDEX_OF(kb, keyboard)) |
Definition at line 22 of file device.h.
Referenced by _setupusb(), closeusb(), cmd_bind(), cmd_erase(), cmd_eraseprofile(), cmd_get(), cmd_macro(), cmd_notify(), cmd_rebind(), cmd_unbind(), os_inputmain(), setactive_kb(), setactive_mouse(), and setupusb().
#define IN_CORSAIR 0x40 |
Definition at line 65 of file device.h.
Referenced by setactive_kb(), and setactive_mouse().
#define IN_HID 0x80 |
Definition at line 64 of file device.h.
Referenced by setactive_kb(), and setactive_mouse().
#define IS_CONNECTED | ( | kb | ) | ((kb) && (kb)->handle && (kb)->uinput_kb && (kb)->uinput_mouse) |
Definition at line 12 of file device.h.
Referenced by _updateconnected(), devmain(), quitWithLock(), and usbadd().
#define mmutex | ( | kb | ) | (macromutex + INDEX_OF(kb, keyboard)) |
Definition at line 26 of file device.h.
Referenced by _usbrecv(), _usbsend(), and play_macro().
#define mmutex2 | ( | kb | ) | (macromutex2 + INDEX_OF(kb, keyboard)) |
Definition at line 28 of file device.h.
Referenced by play_macro().
Definition at line 30 of file device.h.
Referenced by play_macro().
#define setactive | ( | kb, | |
makeactive | |||
) | ((makeactive) ? (kb)->vtable->active((kb), 0, 0, 0, 0) : (kb)->vtable->idle((kb), 0, 0, 0, 0)) |
Definition at line 44 of file device.h.
Referenced by _start_dev(), and revertusb().
Definition at line 114 of file device_keyboard.c.
References setactive_kb().
int cmd_active_mouse | ( | usbdevice * | kb, |
usbmode * | dummy1, | ||
int | dummy2, | ||
int | dummy3, | ||
const char * | dummy4 | ||
) |
Definition at line 44 of file device_mouse.c.
References setactive_mouse().
Definition at line 123 of file device_keyboard.c.
References setactive_kb().
int cmd_idle_mouse | ( | usbdevice * | kb, |
usbmode * | dummy1, | ||
int | dummy2, | ||
int | dummy3, | ||
const char * | dummy4 | ||
) |
Definition at line 53 of file device_mouse.c.
References setactive_mouse().
Definition at line 62 of file device_mouse.c.
References MSG_SIZE, usbdevice::pollrate, and usbsend.
int setactive_kb | ( | usbdevice * | kb, |
int | active | ||
) |
Definition at line 20 of file device_keyboard.c.
References ACT_LIGHT, ACT_LOCK, ACT_M1, ACT_M2, ACT_M3, ACT_MR_RING, usbdevice::active, DELAY_MEDIUM, lighting::forceupdate, imutex, IN_CORSAIR, IN_HID, usbdevice::input, inputupdate(), keymap, usbinput::keys, usbprofile::lastlight, MSG_SIZE, N_KEYS_HW, NEEDS_FW_UPDATE, usbdevice::profile, usbsend, and usbdevice::vtable.
Referenced by cmd_active_kb(), and cmd_idle_kb().
int setactive_mouse | ( | usbdevice * | kb, |
int | active | ||
) |
Definition at line 9 of file device_mouse.c.
References usbdevice::active, lighting::forceupdate, imutex, IN_CORSAIR, IN_HID, usbdevice::input, inputupdate(), usbinput::keys, usbprofile::lastlight, MSG_SIZE, NEEDS_FW_UPDATE, usbdevice::profile, and usbsend.
Referenced by cmd_active_mouse(), and cmd_idle_mouse().
void setmodeindex_nrgb | ( | usbdevice * | kb, |
int | index | ||
) |
Definition at line 132 of file device_keyboard.c.
References NK95_M1, NK95_M2, NK95_M3, and nk95cmd.
int start_dev | ( | usbdevice * | kb, |
int | makeactive | ||
) |
Definition at line 89 of file device.c.
References _start_dev(), USB_DELAY_DEFAULT, and usbdevice::usbdelay.
int start_kb_nrgb | ( | usbdevice * | kb, |
int | makeactive | ||
) |
Definition at line 9 of file device_keyboard.c.
References usbdevice::active, NK95_HWOFF, nk95cmd, and usbdevice::pollrate.
pthread_mutex_t devmutex[9] |
Definition at line 12 of file device.c.
Referenced by _updateconnected(), quitWithLock(), and usb_rm_device().
usbdevice keyboard[9] |
Definition at line 10 of file device.c.
Referenced by _mkdevpath(), _mknotifynode(), _rmnotifynode(), _setupusb(), _updateconnected(), closeusb(), main(), mkfwnode(), os_closeusb(), os_inputmain(), os_inputopen(), os_setupusb(), quitWithLock(), rmdevpath(), usb_rm_device(), and usbadd().