/*-----------------------------------------*\ | AMDWraithPrismController.h | | | | Driver for AMD Wraith Prism RGB lighting | | controller | | | | Adam Honse (CalcProgrammer1) 12/6/2019 | \*-----------------------------------------*/ #include "AMDWraithPrismController.h" #include #include #include AMDWraithPrismController::AMDWraithPrismController(libusb_device_handle* dev_handle) { dev = dev_handle; strcpy(device_name, "AMD Wraith Prism"); SendEnableCommand(); SendRemapCommand(); SendEffectCommand(); } AMDWraithPrismController::~AMDWraithPrismController() { } char* AMDWraithPrismController::GetDeviceName() { return device_name; } void AMDWraithPrismController::SendEnableCommand() { unsigned char usb_buf[] = { 0x41, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; int actual; libusb_interrupt_transfer(dev, 0x04, usb_buf, 64, &actual, 0); libusb_interrupt_transfer(dev, 0x83, usb_buf, 64, &actual, 0); } void AMDWraithPrismController::SendRemapCommand() { unsigned char usb_buf[] = { 0x51, 0xA0, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x05, 0x06, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; int actual; libusb_interrupt_transfer(dev, 0x04, usb_buf, 64, &actual, 0); libusb_interrupt_transfer(dev, 0x83, usb_buf, 64, &actual, 0); } void AMDWraithPrismController::SendEffectCommand() { unsigned char usb_buf[] = { 0x51, 0x2C, 0x01, 0x00, 0x05, 0xFF, 0x00, 0x01, 0xFF, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; int actual; libusb_interrupt_transfer(dev, 0x04, usb_buf, 64, &actual, 0); libusb_interrupt_transfer(dev, 0x83, usb_buf, 64, &actual, 0); }