Compare commits
241
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
227fd375fb | ||
|
|
069eeccb60 | ||
|
|
da77b63bea | ||
|
|
791d8820d6 | ||
|
|
05fbe381dd | ||
|
|
3b2466ba10 | ||
|
|
acc7fa6754 | ||
|
|
394a5c8eb0 | ||
|
|
ac6d89b611 | ||
|
|
46cdd6fbe1 | ||
|
|
14d543b9e4 | ||
|
|
8a831cef04 | ||
|
|
9fd79b1ad2 | ||
|
|
c9c37a4576 | ||
|
|
fe53d90664 | ||
|
|
8e8a9c8e05 | ||
|
|
dafc6e9cbc | ||
|
|
68b113bf86 | ||
|
|
eb5d8b579c | ||
|
|
56df76dbfc | ||
|
|
878f32fccf | ||
|
|
63828313bd | ||
|
|
31992acad1 | ||
|
|
bd41ba3b5c | ||
|
|
b9309c61e1 | ||
|
|
7fc8aea930 | ||
|
|
b35e119325 | ||
|
|
8fb790358f | ||
|
|
39c6dbf361 | ||
|
|
9d189d5b9b | ||
|
|
9e5c63cc64 | ||
|
|
b664f35e17 | ||
|
|
381e3ac70c | ||
|
|
e3225d93c4 | ||
|
|
1b3480bf8a | ||
|
|
a6bea17df2 | ||
|
|
28d73d74bc | ||
|
|
cf383cacdd | ||
|
|
d9b0995b44 | ||
|
|
79eb758a52 | ||
|
|
75463b8772 | ||
|
|
5da92fca4e | ||
|
|
d11be2aa0b | ||
|
|
285a7bce4e | ||
|
|
21009cdc45 | ||
|
|
a0cee2ce2b | ||
|
|
ba33ff0c35 | ||
|
|
795616e62d | ||
|
|
baa033ff7f | ||
|
|
33ec03d129 | ||
|
|
a0d5a985f0 | ||
|
|
1275fe816b | ||
|
|
d4e1ed5245 | ||
|
|
b833a43490 | ||
|
|
94295c52ba | ||
|
|
f32aa29ecd | ||
|
|
623fdfe522 | ||
|
|
a122ccdc37 | ||
|
|
74219e502a | ||
|
|
73cd84f43c | ||
|
|
f5a8ecc3f4 | ||
|
|
86a6a130e7 | ||
|
|
703afac049 | ||
|
|
2d0ebb7279 | ||
|
|
d9b51e4a02 | ||
|
|
387fed4f79 | ||
|
|
df0137c2b0 | ||
|
|
7c059fa3e3 | ||
|
|
1a62db7246 | ||
|
|
3a0b93c774 | ||
|
|
1afe65d206 | ||
|
|
962754f379 | ||
|
|
e69c9eedae | ||
|
|
9182d1e566 | ||
|
|
893de3f076 | ||
|
|
4f1c623093 | ||
|
|
7846d22bd8 | ||
|
|
68ae9ef9d5 | ||
|
|
44641ca8a6 | ||
|
|
152f16b31c | ||
|
|
b87f7150fc | ||
|
|
831a7cf5eb | ||
|
|
f99843a550 | ||
|
|
35217bce51 | ||
|
|
00077347b4 | ||
|
|
b2c9ace9c8 | ||
|
|
fd7dbd618d | ||
|
|
103b5f27bb | ||
|
|
71c1ffe91c | ||
|
|
0154f3c5dc | ||
|
|
60bc375345 | ||
|
|
5a2dca1ced | ||
|
|
c80f3be283 | ||
|
|
52f757ced2 | ||
|
|
156b7d0f89 | ||
|
|
69a8c84b4d | ||
|
|
d30f3a5f03 | ||
|
|
2868f61766 | ||
|
|
5d1c990b18 | ||
|
|
e6eeb906b8 | ||
|
|
ea00807a06 | ||
|
|
95b1133395 | ||
|
|
d56a9133ab | ||
|
|
8c96bf03f5 | ||
|
|
79e546fa43 | ||
|
|
baed37ecc7 | ||
|
|
c0be211236 | ||
|
|
55506f984e | ||
|
|
d03ca67ae5 | ||
|
|
b7f8eeb034 | ||
|
|
e8e0362d85 | ||
|
|
e9f430d8ed | ||
|
|
a306cf815b | ||
|
|
7c0eba1dc3 | ||
|
|
5d20744653 | ||
|
|
7e74c295a3 | ||
|
|
d145ee38e7 | ||
|
|
0a39673b9d | ||
|
|
6e93443034 | ||
|
|
cb71627d29 | ||
|
|
35f10dfb48 | ||
|
|
04ef7a2c28 | ||
|
|
a58e79ba71 | ||
|
|
3a74c85be8 | ||
|
|
6e71cd39b9 | ||
|
|
248668ea7d | ||
|
|
496a7a3609 | ||
|
|
112b6a2b9b | ||
|
|
7c38dad1ab | ||
|
|
cd1c9c705b | ||
|
|
b7f68379c2 | ||
|
|
43c0fea3be | ||
|
|
39f112bb98 | ||
|
|
3d113dab3c | ||
|
|
92f397544b | ||
|
|
fe4ca34528 | ||
|
|
464ef419e7 | ||
|
|
30e35eb44c | ||
|
|
b92a8996e9 | ||
|
|
c887ea94ff | ||
|
|
25a753b97a | ||
|
|
a86ab2955a | ||
|
|
259e05360e | ||
|
|
36b4f52cbc | ||
|
|
ee6343900b | ||
|
|
3818398d86 | ||
|
|
0973f6149b | ||
|
|
1e1fb09821 | ||
|
|
dfe099fe9b | ||
|
|
3b6450f188 | ||
|
|
971a2cc300 | ||
|
|
6b8db478fb | ||
|
|
3932a9614c | ||
|
|
4dde4fffe3 | ||
|
|
57d38be688 | ||
|
|
b79522a955 | ||
|
|
94333ff2f1 | ||
|
|
d3f4bfe192 | ||
|
|
d130e64f69 | ||
|
|
f7e9cddae9 | ||
|
|
6fbcf62d76 | ||
|
|
1a6943fe17 | ||
|
|
cde2343d09 | ||
|
|
c746b30287 | ||
|
|
3582b96dd9 | ||
|
|
d258065e36 | ||
|
|
7627466891 | ||
|
|
c476ee46f8 | ||
|
|
6fc68f4e62 | ||
|
|
75bac1fd4e | ||
|
|
94042375a7 | ||
|
|
103306c6c8 | ||
|
|
6d37d262ea | ||
|
|
473331dd3a | ||
|
|
bc9d03ef48 | ||
|
|
740c88fe0c | ||
|
|
684ef09168 | ||
|
|
e3b08fc15d | ||
|
|
5c931a61b4 | ||
|
|
ad7534d00d | ||
|
|
c81f8699f1 | ||
|
|
2af03eb0dc | ||
|
|
5064ba3f1d | ||
|
|
c5abe47859 | ||
|
|
8fdd0e40f8 | ||
|
|
a6a07ba0d7 | ||
|
|
614fef4189 | ||
|
|
d3e7dba2b7 | ||
|
|
39343c3e9e | ||
|
|
73865fec59 | ||
|
|
b508818f23 | ||
|
|
bef8ae0a2f | ||
|
|
cce2d41500 | ||
|
|
175f3ed338 | ||
|
|
c2cc7c6163 | ||
|
|
8fee041fad | ||
|
|
dfc1f8524a | ||
|
|
752bd2e35a | ||
|
|
01fe0b4630 | ||
|
|
e7f8bc0136 | ||
|
|
370918e07f | ||
|
|
133966677b | ||
|
|
44f84e4781 | ||
|
|
a8354ee046 | ||
|
|
4550e3073a | ||
|
|
abe7a49092 | ||
|
|
82a486bfb6 | ||
|
|
ad06e733f8 | ||
|
|
4306603a28 | ||
|
|
554f834a90 | ||
|
|
7236bec61f | ||
|
|
c799f1bfe9 | ||
|
|
f15c3c1420 | ||
|
|
aa67045330 | ||
|
|
736640f38d | ||
|
|
e9caf663bc | ||
|
|
8afbea53de | ||
|
|
c3d496ad5b | ||
|
|
06501f528d | ||
|
|
f6a678c1a4 | ||
|
|
30690d0ebd | ||
|
|
7a830cddf9 | ||
|
|
3dc1365d39 | ||
|
|
b03cd94ae8 | ||
|
|
bbf348d273 | ||
|
|
dce48eb415 | ||
|
|
decf14635d | ||
|
|
db4f49bbba | ||
|
|
26824fcb6e | ||
|
|
8afad91b33 | ||
|
|
69de0b13c4 | ||
|
|
967153bc10 | ||
|
|
971d9be1bd | ||
|
|
7a3faef886 | ||
|
|
f67030fcc7 | ||
|
|
7353e99449 | ||
|
|
91d9597c89 | ||
|
|
2eb569912b | ||
|
|
9410d9c066 | ||
|
|
29d8788e25 | ||
|
|
0304c50bc6 |
@@ -1,66 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| A4TechDetector.cpp |
|
||||
| |
|
||||
| Detector for A4Tech Devices |
|
||||
| |
|
||||
| Chris M (Dr_No) 30 Jun 2022 |
|
||||
| Mohammed Julfikar Ali Mahbub (o-julfikar) 01 Apr 2024 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "BloodyB820RController.h"
|
||||
#include "BloodyMouseController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_BloodyB820R.h"
|
||||
#include "RGBController_BloodyMouse.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| A4 Tech USB vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define A4_TECH_VID 0x09DA
|
||||
|
||||
DetectedControllers DetectA4TechMouseControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
BloodyMouseController* controller = new BloodyMouseController(dev, info->path, info->product_id, name);
|
||||
RGBController_BloodyMouse* rgb_controller = new RGBController_BloodyMouse(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectBloodyB820R(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
BloodyB820RController* controller = new BloodyB820RController(dev, info->path, name);
|
||||
RGBController_BloodyB820R* rgb_controller = new RGBController_BloodyB820R(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W60 Pro", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W60_PRO_PID, 2, 0xFF33, 0x0529);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W70 Max", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W70_MAX_PID, 2, 0xFF33, 0x0518);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W90 Max", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W90_MAX_PID, 2, 0xFF33, 0x053D);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W90 Pro", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W90_PRO_PID, 2, 0xFF33, 0x054D);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody MP 50RS", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_MP_50RS_PID, 2, 0xFFF2, 0x6009);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody B820R", DetectBloodyB820R, A4_TECH_VID, BLOODY_B820R_PID, 2, 0xFF52, 0x0210);
|
||||
@@ -0,0 +1,40 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| BloodyB820RControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Bloody B820R Devices |
|
||||
| |
|
||||
| Mohammed Julfikar Ali Mahbub (o-julfikar) 01 Apr 2024 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "BloodyB820RController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_BloodyB820R.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| A4 Tech USB vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define A4_TECH_VID 0x09DA
|
||||
|
||||
DetectedControllers DetectBloodyB820R(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
BloodyB820RController* controller = new BloodyB820RController(dev, info->path, name);
|
||||
RGBController_BloodyB820R* rgb_controller = new RGBController_BloodyB820R(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody B820R", DetectBloodyB820R, A4_TECH_VID, BLOODY_B820R_PID, 2, 0xFF52, 0x0210);
|
||||
@@ -0,0 +1,44 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| BloodyMouseControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Bloody Mouse Devices |
|
||||
| |
|
||||
| Chris M (Dr_No) 30 Jun 2022 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "BloodyMouseController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_BloodyMouse.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| A4 Tech USB vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define A4_TECH_VID 0x09DA
|
||||
|
||||
DetectedControllers DetectBloodyMouseControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
BloodyMouseController* controller = new BloodyMouseController(dev, info->path, info->product_id, name);
|
||||
RGBController_BloodyMouse* rgb_controller = new RGBController_BloodyMouse(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W60 Pro", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W60_PRO_PID, 2, 0xFF33, 0x0529);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W70 Max", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W70_MAX_PID, 2, 0xFF33, 0x0518);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W90 Max", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W90_MAX_PID, 2, 0xFF33, 0x053D);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W90 Pro", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W90_PRO_PID, 2, 0xFF33, 0x054D);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody MP 50RS", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_MP_50RS_PID, 2, 0xFFF2, 0x6009);
|
||||
@@ -269,7 +269,7 @@ void RGBController_PolychromeUSB::SetupZones()
|
||||
new_led.name = zones[channel_idx].name;
|
||||
new_led.name.append(", LED ");
|
||||
new_led.name.append(std::to_string(led_ch_idx + 1));
|
||||
new_led.value = channel_idx;
|
||||
new_led.value = (unsigned int)channel_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
@@ -334,9 +334,14 @@ void RGBController_PolychromeUSB::DeviceUpdateLEDs()
|
||||
}
|
||||
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||
{
|
||||
if(zones[zone_idx].leds_count == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned char set_mode = zones_info[zone_idx].mode;
|
||||
|
||||
if (set_mode>modes.size())
|
||||
if(set_mode>modes.size())
|
||||
{
|
||||
set_mode = active_mode;
|
||||
}
|
||||
@@ -347,6 +352,11 @@ void RGBController_PolychromeUSB::DeviceUpdateLEDs()
|
||||
|
||||
void RGBController_PolychromeUSB::DeviceUpdateZoneLEDs(int zone)
|
||||
{
|
||||
if(zones[zone].leds_count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned char set_mode=zones_info[zone].mode;
|
||||
|
||||
if(set_mode > modes.size())
|
||||
@@ -354,7 +364,7 @@ void RGBController_PolychromeUSB::DeviceUpdateZoneLEDs(int zone)
|
||||
set_mode = active_mode;
|
||||
}
|
||||
|
||||
controller->WriteZone(zone, set_mode, zones_info[zone].speed, zones[zone].colors[0], false);
|
||||
controller->WriteZone((unsigned char)zone, set_mode, zones_info[zone].speed, zones[zone].colors[0], false);
|
||||
}
|
||||
|
||||
void RGBController_PolychromeUSB::DeviceUpdateSingleLED(int led)
|
||||
@@ -362,12 +372,17 @@ void RGBController_PolychromeUSB::DeviceUpdateSingleLED(int led)
|
||||
unsigned int channel = leds[led].value;
|
||||
unsigned char set_mode = zones_info[channel].mode;
|
||||
|
||||
if(zones[channel].leds_count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(set_mode > modes.size())
|
||||
{
|
||||
set_mode = active_mode;
|
||||
}
|
||||
|
||||
controller->WriteZone(channel, set_mode, zones_info[channel].speed, zones[channel].colors[0], false);
|
||||
controller->WriteZone((unsigned char)channel, set_mode, zones_info[channel].speed, zones[channel].colors[0], false);
|
||||
}
|
||||
|
||||
unsigned char RGBController_PolychromeUSB::GetDeviceMode(unsigned char zone)
|
||||
|
||||
-3
@@ -238,7 +238,6 @@ void RGBController_ASRockPolychromeV2SMBus::SetupZones()
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int led_count = 0;
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up LEDs |
|
||||
\*---------------------------------------------------------*/
|
||||
@@ -268,8 +267,6 @@ void RGBController_ASRockPolychromeV2SMBus::SetupZones()
|
||||
\*---------------------------------------------------------*/
|
||||
leds.push_back(*new_led);
|
||||
|
||||
led_count++;
|
||||
|
||||
if(zone_idx == POLYCHROME_V2_ZONE_ADDRESSABLE)
|
||||
{
|
||||
break;
|
||||
|
||||
+4
-26
@@ -1,7 +1,7 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| AlienwareKeyboardControllerDetect.cpp |
|
||||
| AlienwareAW410KControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Alienware Keyboard |
|
||||
| Detector for Alienware AW410K Keyboard |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
@@ -10,38 +10,17 @@
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "AlienwareAW410KController.h"
|
||||
#include "AlienwareAW510KController.h"
|
||||
#include "RGBController_AlienwareAW410K.h"
|
||||
#include "RGBController_AlienwareAW510K.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Alienware vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_VID 0x04F2
|
||||
#define ALIENWARE_VID 0x04F2
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_AW510K_PID 0x1830
|
||||
#define ALIENWARE_AW410K_PID 0x1968
|
||||
|
||||
DetectedControllers DetectAlienwareAW510KControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AlienwareAW510KController* controller = new AlienwareAW510KController(dev, info->path, name);
|
||||
RGBController_AlienwareAW510K* rgb_controller = new RGBController_AlienwareAW510K(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
#define ALIENWARE_AW410K_PID 0x1968
|
||||
|
||||
DetectedControllers DetectAlienwareAW410KControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
@@ -61,5 +40,4 @@ DetectedControllers DetectAlienwareAW410KControllers(hid_device_info* info, cons
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Alienware AW510K", DetectAlienwareAW510KControllers, ALIENWARE_VID, ALIENWARE_AW510K_PID, 0x02, 0xFF00, 0x01);
|
||||
REGISTER_HID_DETECTOR_IPU("Alienware AW410K", DetectAlienwareAW410KControllers, ALIENWARE_VID, ALIENWARE_AW410K_PID, 0x02, 0xFF00, 0x01);
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| AlienwareAW510KControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Alienware AW510K Keyboard |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "AlienwareAW510KController.h"
|
||||
#include "RGBController_AlienwareAW510K.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Alienware vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_VID 0x04F2
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_AW510K_PID 0x1830
|
||||
|
||||
DetectedControllers DetectAlienwareAW510KControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AlienwareAW510KController* controller = new AlienwareAW510KController(dev, info->path, name);
|
||||
RGBController_AlienwareAW510K* rgb_controller = new RGBController_AlienwareAW510K(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Alienware AW510K", DetectAlienwareAW510KControllers, ALIENWARE_VID, ALIENWARE_AW510K_PID, 0x02, 0xFF00, 0x01);
|
||||
@@ -21,13 +21,13 @@
|
||||
DetectedControllers DetectArcticControllers()
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
std::vector<std::string *> ports;
|
||||
std::vector<std::string> ports;
|
||||
|
||||
ports = find_usb_serial_port(CH341_VID, CH341_PID);
|
||||
|
||||
for(unsigned int device = 0; device < ports.size(); device++)
|
||||
{
|
||||
ArcticController *controller = new ArcticController(*ports[device]);
|
||||
ArcticController *controller = new ArcticController(ports[device]);
|
||||
|
||||
if(controller->IsPresent())
|
||||
{
|
||||
@@ -38,8 +38,6 @@ DetectedControllers DetectArcticControllers()
|
||||
{
|
||||
delete controller;
|
||||
}
|
||||
|
||||
delete ports[device];
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#define AURA_ROG_GLADIUS_II_WIRELESS_1_PID 0x189E
|
||||
#define AURA_ROG_GLADIUS_II_WIRELESS_2_PID 0x18A0
|
||||
#define AURA_ROG_GLADIUS_III_PID 0x197B
|
||||
#define AURA_ROG_GLADIUS_III_CORE_PID 0x1C8D
|
||||
#define AURA_ROG_GLADIUS_III_WIRELESS_USB_PID 0x197D
|
||||
#define AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID 0x197F
|
||||
#define AURA_ROG_GLADIUS_III_WIRELESS_BT_PID 0x1981
|
||||
@@ -217,6 +218,20 @@ static std::map<int,mouse_type> aura_mouse_devices =
|
||||
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
|
||||
}
|
||||
},
|
||||
{
|
||||
AURA_ROG_GLADIUS_III_CORE_PID, // ROG Gladius III Core
|
||||
{
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
100,
|
||||
false,
|
||||
1,
|
||||
false,
|
||||
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
|
||||
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_REACTIVE }
|
||||
}
|
||||
},
|
||||
{
|
||||
AURA_ROG_GLADIUS_III_WIRELESS_USB_PID, // ROG Gladius III Wireless USB
|
||||
{
|
||||
|
||||
+1
-1
@@ -221,7 +221,7 @@ void RGBController_AuraUSB::SetupZones()
|
||||
|
||||
new_led.name.append(std::to_string(led_idx));
|
||||
|
||||
new_led.value = channel_idx;
|
||||
new_led.value = (unsigned int)channel_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
@@ -464,6 +464,7 @@ REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Origin COD",
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_1_PID, 1, 0xFF13);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_2_PID, 2, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Core", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_CORE_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless USB", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_USB_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless 2.4Ghz", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless Bluetooth", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_BT_PID, 0, 0xFF01);
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
DetectedControllers DetectBlinkyTapeControllers()
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
std::vector<std::string *> device_locations = find_usb_serial_port(BLINKINLABS_VID, BLINKYTAPE_PID);
|
||||
std::vector<std::string> device_locations = find_usb_serial_port(BLINKINLABS_VID, BLINKYTAPE_PID);
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < device_locations.size(); device_idx++)
|
||||
{
|
||||
BlinkyTapeController* controller = new BlinkyTapeController();
|
||||
controller->Initialize(*device_locations[device_idx]);
|
||||
controller->Initialize(device_locations[device_idx]);
|
||||
|
||||
RGBController_BlinkyTape* rgb_controller = new RGBController_BlinkyTape(controller);
|
||||
|
||||
|
||||
@@ -45,7 +45,8 @@ void ColorfulGPUController::SetDirect(RGBColor color)
|
||||
uint8_t g = RGBGetGValue(color);
|
||||
uint8_t b = RGBGetBValue(color);
|
||||
|
||||
if(this->bus->info.pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV)
|
||||
if(this->bus->info.pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV
|
||||
|| this->bus->info.pci_subsystem_device == COLORFUL_IGAME_RTX_4090_NEPTUNE_OCV)
|
||||
{
|
||||
uint8_t data_pkt[COLORFUL_PACKET_LENGTH_V2] = { 0xAA, 0xEF, 0x01, 0x04, 0x88, 0x26 };
|
||||
for(int i=6; i < COLORFUL_PACKET_LENGTH_V2 -2; i = i + 3)
|
||||
|
||||
@@ -52,7 +52,7 @@ REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Advanced OC 12G L-V", Detec
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_GA106_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_ADVANCED_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060TI_ADVANCED_OC, 0x61);
|
||||
@@ -74,8 +74,13 @@ REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4070 Vulcan OC-V", Detec
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4070 SUPER Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070S_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4070S_ULTRAW_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4080 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4080_ULTRAW_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4080 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4080_ULTRAW_OCV2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Neptune OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_NEPTUNE_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_ADVANCED_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_ADVANCED_OCV2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060_ULTRAW_OC, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060_ULTRAW_OC_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070_ULTRAW_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070_ULTRAW_OCV2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070_ULTRAW_OCV2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ti Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070TI_ULTRAW_OC, 0x61);
|
||||
@@ -340,7 +340,6 @@ void CorsairCommanderCoreController::SetDirectColor
|
||||
lastzones = zones;
|
||||
int packet_offset = 0;
|
||||
int led_idx = 0;
|
||||
int channel_idx = 0;
|
||||
int packet_len = CORSAIR_COMMANDER_CORE_RGB_DATA_LENGTH;
|
||||
|
||||
if(pid == CORSAIR_COMMANDER_CORE_XT_PID)
|
||||
@@ -369,8 +368,6 @@ void CorsairCommanderCoreController::SetDirectColor
|
||||
{
|
||||
packet_offset += 3 * (34 - zones[zone_idx].leds_count);
|
||||
}
|
||||
|
||||
channel_idx++;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
||||
@@ -26,6 +26,7 @@ CorsairDRAMController::CorsairDRAMController(i2c_smbus_interface *bus, corsair_d
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
device_index = 0;
|
||||
direct_mode = true;
|
||||
pid = 0;
|
||||
vid = 0;
|
||||
protocol_version = 0;
|
||||
@@ -132,13 +133,77 @@ void CorsairDRAMController::SetColorsPerLED(RGBColor* colors)
|
||||
| bytes, use a second block write to the second |
|
||||
| block write address for the remaining data |
|
||||
\*-------------------------------------------------*/
|
||||
bus->i2c_smbus_write_block_data(dev, CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_1, 32, direct_packet);
|
||||
s32 ret = bus->i2c_smbus_write_block_data(dev, CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_1, 32, direct_packet);
|
||||
|
||||
if(direct_packet_size > 32)
|
||||
if((ret >= 0) && (direct_packet_size > 32))
|
||||
{
|
||||
bus->i2c_smbus_write_block_data(dev, CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_2, direct_packet_size - 32, direct_packet + 32);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Corsair DRAM supports an alternate means of |
|
||||
| writing block data without using SMBus block |
|
||||
| operations. If block operations are not |
|
||||
| available, fall back to this scheme. |
|
||||
| |
|
||||
| Blocks are split up into word data writes. |
|
||||
| Some data bytes are packed into the lower nibble |
|
||||
| of the register address byte. |
|
||||
\*-------------------------------------------------*/
|
||||
if(ret < 0)
|
||||
{
|
||||
unsigned int block_index = 0;
|
||||
|
||||
while(block_index < direct_packet_size)
|
||||
{
|
||||
unsigned char reg_value_0 = 0xA0;
|
||||
unsigned char reg_value_1 = 0x00;
|
||||
unsigned short word_value_0 = 0;
|
||||
unsigned short word_value_1 = 0;
|
||||
|
||||
if(block_index == 0)
|
||||
{
|
||||
reg_value_0 = 0x90;
|
||||
}
|
||||
|
||||
word_value_0 = (direct_packet[block_index]);
|
||||
block_index++;
|
||||
|
||||
if(block_index < direct_packet_size)
|
||||
{
|
||||
word_value_0 |= (direct_packet[block_index] << 8);
|
||||
block_index++;
|
||||
}
|
||||
|
||||
if(block_index < direct_packet_size)
|
||||
{
|
||||
reg_value_1 = 0xA0;
|
||||
reg_value_0 |= (direct_packet[block_index] & 0x0F);
|
||||
reg_value_1 |= (direct_packet[block_index] & 0xF0) >> 4;
|
||||
block_index++;
|
||||
}
|
||||
|
||||
if(block_index < direct_packet_size)
|
||||
{
|
||||
word_value_1 = (direct_packet[block_index]);
|
||||
block_index++;
|
||||
}
|
||||
|
||||
if(block_index < direct_packet_size)
|
||||
{
|
||||
word_value_1 |= (direct_packet[block_index] << 8);
|
||||
block_index++;
|
||||
}
|
||||
|
||||
bus->i2c_smbus_write_word_data(dev, reg_value_0, word_value_0);
|
||||
|
||||
if(reg_value_1 > 0)
|
||||
{
|
||||
bus->i2c_smbus_write_word_data(dev, reg_value_1, word_value_1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Remember to delete the data buffer |
|
||||
\*-------------------------------------------------*/
|
||||
|
||||
@@ -24,18 +24,15 @@ using namespace std::chrono_literals;
|
||||
|
||||
bool TestForCorsairDRAMController(i2c_smbus_interface *bus, unsigned char address)
|
||||
{
|
||||
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
|
||||
|
||||
LOG_DEBUG("[%s] Trying address %02X", CORSAIR_DRAM_NAME, address);
|
||||
|
||||
int res = bus->i2c_smbus_read_byte_data(address, 0x43);
|
||||
|
||||
if(res < 0)
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: res was %04X", CORSAIR_DRAM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x43);
|
||||
|
||||
if(!(res == 0x1A || res == 0x1B || res == 0x1C))
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: expected 0x1A, 0x1B, or 0x1C, got %04X", CORSAIR_DRAM_NAME, res);
|
||||
|
||||
@@ -98,7 +98,16 @@ void RGBController_CorsairICueLink::SetupZones()
|
||||
lcd_zone.leds_min = controller->GetEndpoints()[lcd_idx]->led_channels;
|
||||
lcd_zone.leds_max = lcd_zone.leds_min;
|
||||
lcd_zone.leds_count = lcd_zone.leds_min;
|
||||
|
||||
zones.push_back(lcd_zone);
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < lcd_zone.leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = "LED " + std::to_string(led_idx + 1);
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ void RGBController_CorsairLightingNode::SetupZones()
|
||||
new_led.name = zones[zone_idx].name + ", LED " + std::to_string(led_ch_idx + 1);
|
||||
|
||||
leds.push_back(new_led);
|
||||
leds_channel.push_back(zone_idx);
|
||||
leds_channel.push_back((unsigned int)zone_idx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -413,7 +413,7 @@ void RGBController_CorsairLightingNode::DeviceUpdateMode()
|
||||
{
|
||||
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||
{
|
||||
DeviceUpdateZoneMode(zone_idx);
|
||||
DeviceUpdateZoneMode((int)zone_idx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -526,27 +526,26 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
||||
char offset = 0;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
| Some Corsair keyboards (e.g. K70 RGB MK.2) do not |
|
||||
| answer the firmware-info query on the control |
|
||||
| interface until several seconds after the host first |
|
||||
| talks to them following a cold boot. A single read |
|
||||
| attempt returns all zeros, the device type comes back |
|
||||
| as 0x00, and the device is discarded as UNKNOWN. |
|
||||
| Retry the query until a valid device type byte is |
|
||||
| returned or the attempt cap is reached. Each failed |
|
||||
| attempt is paced by the 1s hid_read_timeout below, so |
|
||||
| the cap also bounds the detection stall for a device |
|
||||
| that opens but never answers. Observed need |
|
||||
| on a K70 RGB MK.2 cold boot is 2 attempts; the cap |
|
||||
| leaves generous headroom. |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
int attempt = 0;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Read Firmware Info packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = CORSAIR_COMMAND_READ;
|
||||
usb_buf[0x02] = CORSAIR_PROPERTY_FIRMWARE_INFO;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet and try reading it using an HID read |
|
||||
| If that fails, repeat the send and read the reply as |
|
||||
| a feature report. |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
actual = hid_read_timeout(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH, 1000);
|
||||
|
||||
if(actual == 0)
|
||||
do
|
||||
{
|
||||
offset = 0;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-------------------------------------------------*/
|
||||
@@ -559,10 +558,48 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
||||
usb_buf[0x01] = CORSAIR_COMMAND_READ;
|
||||
usb_buf[0x02] = CORSAIR_PROPERTY_FIRMWARE_INFO;
|
||||
|
||||
hid_send_feature_report(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
actual = hid_get_feature_report(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
offset = 1;
|
||||
}
|
||||
/*-------------------------------------------------*\
|
||||
| Send packet and try reading it using an HID read |
|
||||
| If that fails, repeat the send and read the reply |
|
||||
| as a feature report. |
|
||||
\*-------------------------------------------------*/
|
||||
hid_write(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
actual = hid_read_timeout(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH, 1000);
|
||||
|
||||
if(actual == 0)
|
||||
{
|
||||
/*---------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*---------------------------------------------*/
|
||||
memset(usb_buf, 0x00, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| Set up Read Firmware Info packet |
|
||||
\*---------------------------------------------*/
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = CORSAIR_COMMAND_READ;
|
||||
usb_buf[0x02] = CORSAIR_PROPERTY_FIRMWARE_INFO;
|
||||
|
||||
hid_send_feature_report(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
actual = hid_get_feature_report(dev, usb_buf, CORSAIR_PERIPHERAL_PACKET_LENGTH);
|
||||
offset = 1;
|
||||
}
|
||||
|
||||
attempt++;
|
||||
|
||||
LOG_DEBUG("[%s] Firmware info attempt %d/%d: device type %02X", CORSAIR_PERIPHERAL_CONTROLLER_NAME, attempt, CORSAIR_FW_INFO_MAX_ATTEMPTS, usb_buf[0x14 + offset]);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Stop as soon as a valid device type is returned |
|
||||
| 0xC0 keyboard / 0xC1 mouse / 0xC2 pad or stand |
|
||||
\*-------------------------------------------------*/
|
||||
if(usb_buf[0x14 + offset] == 0xC0
|
||||
|| usb_buf[0x14 + offset] == 0xC1
|
||||
|| usb_buf[0x14 + offset] == 0xC2)
|
||||
{
|
||||
break;
|
||||
}
|
||||
} while(attempt < CORSAIR_FW_INFO_MAX_ATTEMPTS);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Get device type |
|
||||
@@ -570,7 +607,7 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
||||
| 0xC1 Device is a mouse |
|
||||
| 0xC2 Device is a mousepad or headset stand |
|
||||
\*-----------------------------------------------------*/
|
||||
LOG_DEBUG("[%s] Device type %02X", CORSAIR_PERIPHERAL_CONTROLLER_NAME, usb_buf[0x14 + offset]);
|
||||
LOG_DEBUG("[%s] Device type %02X after %d attempt(s)", CORSAIR_PERIPHERAL_CONTROLLER_NAME, usb_buf[0x14 + offset], attempt);
|
||||
|
||||
switch(usb_buf[0x14 + offset])
|
||||
{
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "RGBController.h"
|
||||
|
||||
#define CORSAIR_PERIPHERAL_PACKET_LENGTH 65
|
||||
#define CORSAIR_FW_INFO_MAX_ATTEMPTS 10
|
||||
|
||||
enum
|
||||
{
|
||||
|
||||
@@ -35,6 +35,12 @@ CorsairPeripheralV2Controller::CorsairPeripheralV2Controller(hid_device* dev_han
|
||||
write_cmd = CORSAIR_V2_WRITE_WIRELESS_ID;
|
||||
pid = GetAddress(0x12);
|
||||
break;
|
||||
|
||||
case CORSAIR_K57_RGB_WIRED_PID:
|
||||
write_cmd = 0x80;
|
||||
light_ctrl = CORSAIR_V2_LIGHT_CTRL1;
|
||||
skip_reads = true;
|
||||
break;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
@@ -93,14 +99,17 @@ CorsairPeripheralV2Controller::CorsairPeripheralV2Controller(hid_device* dev_han
|
||||
| If lighting control endpoint 2 is unavailable |
|
||||
| then use endpoint 1. |
|
||||
\*---------------------------------------------------------*/
|
||||
result = StartTransaction(0);
|
||||
if(result > 0)
|
||||
if(light_ctrl == CORSAIR_V2_LIGHT_CTRL2)
|
||||
{
|
||||
light_ctrl = CORSAIR_V2_LIGHT_CTRL1;
|
||||
StartTransaction(0);
|
||||
result = StartTransaction(0);
|
||||
if(result > 0)
|
||||
{
|
||||
light_ctrl = CORSAIR_V2_LIGHT_CTRL1;
|
||||
StartTransaction(0);
|
||||
}
|
||||
StopTransaction(0);
|
||||
LOG_DEBUG("[%s] Lighting Endpoint set to %02X", device_name.c_str(), light_ctrl);
|
||||
}
|
||||
StopTransaction(0);
|
||||
LOG_DEBUG("[%s] Lighting Endpoint set to %02X", device_name.c_str(), light_ctrl);
|
||||
}
|
||||
|
||||
CorsairPeripheralV2Controller::~CorsairPeripheralV2Controller()
|
||||
@@ -171,7 +180,11 @@ void CorsairPeripheralV2Controller::SetRenderMode(corsair_v2_device_mode mode)
|
||||
buffer[5] = mode;
|
||||
|
||||
hid_write(dev, buffer, CORSAIR_V2_WRITE_SIZE);
|
||||
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
|
||||
|
||||
if(!skip_reads)
|
||||
{
|
||||
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
void CorsairPeripheralV2Controller::LightingControl(uint8_t opt1)
|
||||
@@ -191,7 +204,11 @@ void CorsairPeripheralV2Controller::LightingControl(uint8_t opt1)
|
||||
buffer[5] = 0x00;
|
||||
|
||||
hid_write(dev, buffer, CORSAIR_V2_WRITE_SIZE);
|
||||
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
|
||||
|
||||
if(!skip_reads)
|
||||
{
|
||||
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int CorsairPeripheralV2Controller::GetKeyboardLayout()
|
||||
@@ -240,7 +257,11 @@ unsigned char CorsairPeripheralV2Controller::StartTransaction(uint8_t opt1)
|
||||
buffer[4] = light_ctrl;
|
||||
|
||||
hid_write(dev, buffer, CORSAIR_V2_WRITE_SIZE);
|
||||
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
|
||||
|
||||
if(!skip_reads)
|
||||
{
|
||||
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
|
||||
}
|
||||
|
||||
return buffer[2];
|
||||
}
|
||||
@@ -257,11 +278,20 @@ void CorsairPeripheralV2Controller::StopTransaction(uint8_t opt1)
|
||||
buffer[4] = opt1;
|
||||
|
||||
hid_write(dev, buffer, CORSAIR_V2_WRITE_SIZE);
|
||||
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
|
||||
|
||||
if(!skip_reads)
|
||||
{
|
||||
hid_read_timeout(dev, buffer, CORSAIR_V2_WRITE_SIZE, CORSAIR_V2_TIMEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
void CorsairPeripheralV2Controller::ClearPacketBuffer()
|
||||
{
|
||||
if(skip_reads)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
uint8_t result = 0;
|
||||
uint8_t buffer[CORSAIR_V2_PACKET_SIZE];
|
||||
|
||||
@@ -304,7 +334,11 @@ void CorsairPeripheralV2Controller::SetLEDs(uint8_t *data, uint16_t data_size)
|
||||
memcpy(&buffer[offset1], &data[0], copy_bytes);
|
||||
|
||||
hid_write(dev, buffer, pkt_sze);
|
||||
hid_read_timeout(dev, buffer, pkt_sze, CORSAIR_V2_TIMEOUT_SHORT);
|
||||
|
||||
if(!skip_reads)
|
||||
{
|
||||
hid_read_timeout(dev, buffer, pkt_sze, CORSAIR_V2_TIMEOUT_SHORT);
|
||||
}
|
||||
|
||||
remaining -= copy_bytes;
|
||||
buffer[2] = CORSAIR_V2_CMD_BLK_WN;
|
||||
@@ -325,7 +359,11 @@ void CorsairPeripheralV2Controller::SetLEDs(uint8_t *data, uint16_t data_size)
|
||||
memcpy(&buffer[offset2], &data[index], copy_bytes);
|
||||
|
||||
hid_write(dev, buffer, pkt_sze);
|
||||
hid_read_timeout(dev, buffer, pkt_sze, CORSAIR_V2_TIMEOUT_SHORT);
|
||||
|
||||
if(!skip_reads)
|
||||
{
|
||||
hid_read_timeout(dev, buffer, pkt_sze, CORSAIR_V2_TIMEOUT_SHORT);
|
||||
}
|
||||
|
||||
remaining -= copy_bytes;
|
||||
}
|
||||
|
||||
@@ -109,6 +109,7 @@ private:
|
||||
|
||||
uint8_t write_cmd = CORSAIR_V2_WRITE_WIRED_ID;
|
||||
uint16_t pkt_sze = CORSAIR_V2_WRITE_SIZE;
|
||||
bool skip_reads = false;
|
||||
std::string firmware_version;
|
||||
std::string location;
|
||||
};
|
||||
|
||||
@@ -67,6 +67,7 @@ DetectedControllers DetectCorsairV2SoftwareControllers(hid_device_info* info, co
|
||||
| Keyboards |
|
||||
\*---------------------------------------------------------*/
|
||||
REGISTER_HID_DETECTOR_IP("Corsair K55 RGB PRO", DetectCorsairV2SoftwareControllers, CORSAIR_VID, CORSAIR_K55_RGB_PRO_PID, 1, 0xFF42);
|
||||
REGISTER_HID_DETECTOR_IP("Corsair K57 RGB (Wired)", DetectCorsairV2SoftwareControllers, CORSAIR_VID, CORSAIR_K57_RGB_WIRED_PID, 1, 0xFF42);
|
||||
REGISTER_HID_DETECTOR_IP("Corsair K60 RGB PRO", DetectCorsairV2SoftwareControllers, CORSAIR_VID, CORSAIR_K60_RGB_PRO_PID, 1, 0xFF42);
|
||||
REGISTER_HID_DETECTOR_IP("Corsair K60 RGB PRO Low Profile", DetectCorsairV2SoftwareControllers, CORSAIR_VID, CORSAIR_K60_RGB_PRO_LP_PID, 1, 0xFF42);
|
||||
REGISTER_HID_DETECTOR_IP("Corsair K60 RGB PRO TKL Black", DetectCorsairV2HardwareControllers, CORSAIR_VID, CORSAIR_K60_RGB_PRO_TKL_B_PID, 1, 0xFF42);
|
||||
|
||||
@@ -48,6 +48,31 @@ std::vector<unsigned int> corsair_full_size_values =
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| KEYMAPS |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
keyboard_keymap_overlay_values corsair_K57_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
|
||||
{
|
||||
corsair_full_size_values,
|
||||
{
|
||||
/* Add more regional layout fixes here */
|
||||
}
|
||||
},
|
||||
{
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Name, Alternate Name, OpCode |
|
||||
\*-------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
{ 0, 0, 17, 0, "Power/Wireless Indicator", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_ROW, }, // Insert Profile into new row
|
||||
{ 0, 0, 18, 1, "Lock/Macro Indicator", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Light key
|
||||
{ 0, 1, 0, 131, "Key: G1", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G1 key
|
||||
{ 0, 2, 0, 132, "Key: G2", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G2 key
|
||||
{ 0, 3, 0, 133, "Key: G3", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G3 key
|
||||
{ 0, 4, 0, 134, "Key: G4", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G4 key
|
||||
{ 0, 5, 0, 135, "Key: G5", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G5 key
|
||||
{ 0, 6, 0, 136, "Key: G6", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert G6 key
|
||||
}
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values corsair_K60_layout
|
||||
{
|
||||
KEYBOARD_SIZE::KEYBOARD_SIZE_FULL,
|
||||
@@ -116,12 +141,14 @@ keyboard_keymap_overlay_values corsair_k70_pro_layout
|
||||
{ 0, 0, 0, 128, "Profile", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_ROW, }, // Insert Profile into new row
|
||||
{ 0, 0, 1, 113, "Light", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Light key
|
||||
{ 0, 0, 2, 114, "Lock", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Lock Key
|
||||
{ 0, 0, 10, 191, "Logo", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Logo
|
||||
{ 0, 0, 10, 138, "Logo", KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Logo
|
||||
{ 0, 0, 18, 102, KEY_EN_MEDIA_MUTE, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Mute Key
|
||||
{ 0, 1, 17, 123, KEY_EN_MEDIA_STOP, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Stop Key
|
||||
{ 0, 1, 18, 126, KEY_EN_MEDIA_PREVIOUS, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Previous Track Key
|
||||
{ 0, 1, 19, 124, KEY_EN_MEDIA_PLAY_PAUSE, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Play Pause Key
|
||||
{ 0, 1, 20, 125, KEY_EN_MEDIA_NEXT, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert Next Tack Key
|
||||
{ 0, 6, 5, 140, KEY_EN_SPACE, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert spacebar L
|
||||
{ 0, 6, 7, 141, KEY_EN_SPACE, KEY_EN_UNUSED, KEYBOARD_OPCODE_INSERT_SHIFT_RIGHT, }, // Insert spacebar R
|
||||
}
|
||||
};
|
||||
|
||||
@@ -167,10 +194,10 @@ keyboard_keymap_overlay_values corsair_K70_CORE_TKL_layout
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Name, Alternate Name, OpCode, |
|
||||
\*-------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
{ 0, 0, 14, 70, KEY_EN_MEDIA_MUTE, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Swap PRSC with Mute
|
||||
{ 0, 0, 14, 70, KEY_EN_MEDIA_MUTE, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Swap PRSC with Mute
|
||||
{ 0, 0, 15, 71, KEY_EN_UNUSED, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Remove SCLK
|
||||
{ 0, 0, 16, 72, KEY_EN_MEDIA_VOLUME_UP, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Swap PSBK with Volume Potion Up
|
||||
|
||||
{ 0, 0, 16, 72, KEY_EN_MEDIA_VOLUME_UP, KEY_EN_UNUSED, KEYBOARD_OPCODE_SWAP_ONLY, }, // Swap PSBK with Volume Potion Up
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
@@ -772,6 +799,38 @@ static const corsair_v2_device k55_rgb_pro_device =
|
||||
nullptr
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*\
|
||||
| Corsair K57 RGB (Wired) 1B1C:1B6E |
|
||||
| |
|
||||
| Zone "Keyboard" |
|
||||
| Matrix |
|
||||
| 7 Rows, 22 Columns |
|
||||
\*-------------------------------------------------------------*/
|
||||
static const corsair_v2_zone k57_rgb_wired_zone =
|
||||
{
|
||||
ZONE_EN_KEYBOARD,
|
||||
ZONE_TYPE_MATRIX,
|
||||
7,
|
||||
22
|
||||
};
|
||||
|
||||
static const corsair_v2_device k57_rgb_wired_device =
|
||||
{
|
||||
CORSAIR_K57_RGB_WIRED_PID,
|
||||
DEVICE_TYPE_KEYBOARD,
|
||||
7,
|
||||
22,
|
||||
{
|
||||
&k57_rgb_wired_zone,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr
|
||||
},
|
||||
&corsair_K57_layout
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*\
|
||||
| Corsair K60 RGB Pro 1B1C:1BA0 |
|
||||
| |
|
||||
@@ -1461,6 +1520,7 @@ const corsair_v2_device* corsair_v2_device_list_data[] =
|
||||
| KEYBOARDS |
|
||||
\*-----------------------------------------------------------------*/
|
||||
&k55_rgb_pro_device,
|
||||
&k57_rgb_wired_device,
|
||||
&k60_rgb_pro_device,
|
||||
&k60_rgb_pro_lp_device,
|
||||
&k60_rgb_pro_tkl_device_b,
|
||||
|
||||
@@ -69,6 +69,8 @@ typedef struct
|
||||
| Corsair V2 Protocol Keyboards |
|
||||
\*-----------------------------------------------------*/
|
||||
#define CORSAIR_K55_RGB_PRO_PID 0x1BA4
|
||||
#define CORSAIR_K57_RGB_WIRED_PID 0x1B6E
|
||||
#define CORSAIR_K57_RGB_WIRELESS_PID 0x1B62
|
||||
#define CORSAIR_K60_RGB_PRO_PID 0x1BA0
|
||||
#define CORSAIR_K60_RGB_PRO_LP_PID 0x1BAD
|
||||
#define CORSAIR_K60_RGB_PRO_TKL_B_PID 0x1BC7
|
||||
|
||||
@@ -1,217 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairWirelessController.cpp |
|
||||
| |
|
||||
| Driver for Corsair wireless keyboard |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 08 May 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include "CorsairWirelessController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
CorsairWirelessController::CorsairWirelessController(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
|
||||
EnterDirectMode();
|
||||
}
|
||||
|
||||
CorsairWirelessController::~CorsairWirelessController()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
device_type CorsairWirelessController::GetDeviceType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
std::string CorsairWirelessController::GetDeviceLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string CorsairWirelessController::GetFirmwareString()
|
||||
{
|
||||
return firmware_version;
|
||||
}
|
||||
|
||||
std::string CorsairWirelessController::GetName()
|
||||
{
|
||||
return name;
|
||||
}
|
||||
|
||||
std::string CorsairWirelessController::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
int ret = hid_get_serial_number_string(dev, serial_string, 128);
|
||||
|
||||
if(ret != 0)
|
||||
{
|
||||
return("");
|
||||
}
|
||||
|
||||
return(StringUtils::wstring_to_string(serial_string));
|
||||
}
|
||||
|
||||
void CorsairWirelessController::SetLEDs(std::vector<RGBColor>colors)
|
||||
{
|
||||
unsigned char buf[3 * 137];
|
||||
|
||||
for(int color = 0; color < 137; color++)
|
||||
{
|
||||
buf[0 + color] = RGBGetRValue(colors[color]);
|
||||
buf[137 + color] = RGBGetGValue(colors[color]);
|
||||
buf[274+color] = RGBGetBValue(colors[color]);
|
||||
}
|
||||
|
||||
StartDirectMode();
|
||||
|
||||
SendDirectFrame(true, &buf[0]);
|
||||
SendDirectFrame(false, &buf[57]);
|
||||
SendDirectFrame(false, &buf[118]);
|
||||
SendDirectFrame(false, &buf[179]);
|
||||
SendDirectFrame(false, &buf[240]);
|
||||
SendDirectFrame(false, &buf[301]);
|
||||
SendDirectFrame(false, &buf[362]);
|
||||
}
|
||||
|
||||
void CorsairWirelessController::SetName(std::string device_name)
|
||||
{
|
||||
name = device_name;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------------------------------*\
|
||||
| Private packet sending functions. |
|
||||
\*-------------------------------------------------------------------------------------------------*/
|
||||
|
||||
void CorsairWirelessController::EnterDirectMode()
|
||||
{
|
||||
unsigned char usb_buf[65];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Submit Mouse Colors packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0x80;
|
||||
usb_buf[0x02] = 0x01;
|
||||
usb_buf[0x03] = 0x03;
|
||||
usb_buf[0x04] = 0x00;
|
||||
usb_buf[0x05] = 0x02;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet using feature reports, as headset stand |
|
||||
| seems to not update completely using HID writes |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, usb_buf, 65);
|
||||
|
||||
}
|
||||
|
||||
void CorsairWirelessController::StartDirectMode()
|
||||
{
|
||||
unsigned char usb_buf[65];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Submit Mouse Colors packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0x80;
|
||||
usb_buf[0x02] = 0x0D;
|
||||
usb_buf[0x03] = 0x00;
|
||||
usb_buf[0x04] = 0x01;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet using feature reports, as headset stand |
|
||||
| seems to not update completely using HID writes |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, usb_buf, 65);
|
||||
|
||||
}
|
||||
|
||||
void CorsairWirelessController::ExitDirectMode()
|
||||
{
|
||||
unsigned char usb_buf[65];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Submit Mouse Colors packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0x80;
|
||||
usb_buf[0x02] = 0x01;
|
||||
usb_buf[0x03] = 0x03;
|
||||
usb_buf[0x04] = 0x00;
|
||||
usb_buf[0x05] = 0x01;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet using feature reports, as headset stand |
|
||||
| seems to not update completely using HID writes |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, usb_buf, 65);
|
||||
|
||||
}
|
||||
|
||||
void CorsairWirelessController::SendDirectFrame(bool first_frame, unsigned char* data)
|
||||
{
|
||||
unsigned char usb_buf[65];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Submit Mouse Colors packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0x80;
|
||||
usb_buf[0x02] = first_frame ? 0x06 : 0x07;
|
||||
usb_buf[0x03] = 0x00;
|
||||
|
||||
if(first_frame)
|
||||
{
|
||||
usb_buf[0x04] = 0x9B;
|
||||
usb_buf[0x05] = 0x01;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Copy in colors in <RED> <GREEN> <BLUE> order |
|
||||
\*-----------------------------------------------------*/
|
||||
if(first_frame)
|
||||
{
|
||||
memcpy(&usb_buf[0x08], data, 57);
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(&usb_buf[0x04], data, 61);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet using feature reports, as headset stand |
|
||||
| seems to not update completely using HID writes |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, usb_buf, 65);
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairWirelessController.h |
|
||||
| |
|
||||
| Driver for Corsair wireless keyboard |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 08 May 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <hidapi.h>
|
||||
#include "RGBController.h"
|
||||
|
||||
class CorsairWirelessController
|
||||
{
|
||||
public:
|
||||
CorsairWirelessController(hid_device* dev_handle, const char* path);
|
||||
~CorsairWirelessController();
|
||||
|
||||
device_type GetDeviceType();
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetFirmwareString();
|
||||
std::string GetName();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SetLEDs(std::vector<RGBColor> colors);
|
||||
void SetName(std::string device_name);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
|
||||
std::string firmware_version;
|
||||
std::string location;
|
||||
std::string name;
|
||||
device_type type;
|
||||
|
||||
void EnterDirectMode();
|
||||
void ExitDirectMode();
|
||||
void StartDirectMode();
|
||||
void SendDirectFrame(bool first_frame, unsigned char* data);
|
||||
};
|
||||
@@ -1,59 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairWirelessControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Corsair wireless keyboard |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 08 May 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "CorsairWirelessController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_CorsairWireless.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Corsair vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CORSAIR_VID 0x1B1C
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CORSAIR_K57_RGB_WIRED_PID 0x1B6E
|
||||
#define CORSAIR_K57_RGB_WIRELESS_PID 0x1B62
|
||||
|
||||
DetectedControllers DetectCorsairWirelessControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
CorsairWirelessController* controller = new CorsairWirelessController(dev, info->path);
|
||||
controller->SetName(name);
|
||||
|
||||
if(controller->GetDeviceType() != DEVICE_TYPE_UNKNOWN)
|
||||
{
|
||||
RGBController_CorsairWireless* rgb_controller = new RGBController_CorsairWireless(controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete controller;
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboards |
|
||||
\*---------------------------------------------------------*/
|
||||
REGISTER_HID_DETECTOR_IPU("Corsair K57 RGB (Wired)", DetectCorsairWirelessControllers, CORSAIR_VID, CORSAIR_K57_RGB_WIRED_PID, 1, 0xFF42, 1);
|
||||
//REGISTER_HID_DETECTOR_IPU("Corsair K57 RGB (Wireless)", DetectCorsairWirelessControllers, CORSAIR_VID, CORSAIR_K57_RGB_WIRELESS_PID, 1, 0xFF42, 1);
|
||||
@@ -1,319 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_CorsairWireless.cpp |
|
||||
| |
|
||||
| RGBController for Corsair wireless keyboard |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 08 May 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBControllerKeyNames.h"
|
||||
#include "RGBController_CorsairWireless.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
//0xFFFFFFFF indicates an unused entry in matrix
|
||||
#define NA 0xFFFFFFFF
|
||||
|
||||
static unsigned int matrix_map[7][24] =
|
||||
{ { NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, 0, 1, NA, NA, NA },
|
||||
{ 131, 41, NA, 58, 59, 60, 61, NA, 62, 63, 64, 65, NA, 66, 67, 68, 69, 70, 71, 72, NA, NA, NA, NA },
|
||||
{ 132, 53, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, NA, 45, 46, 42, NA, 73, 74, 75, 83, 84, 85, 86 },
|
||||
{ 133, 43, NA, 20, 26, 8, 21, NA, 23, 28, 24, 12, 18, 19, 47, 48, 49, 76, 77, 78, 95, 96, 97, 87 },
|
||||
{ 134, 57, NA, 4, 22, 7, 9, NA, 10, 11, 13, 14, 15, 51, 52, NA, 40, NA, NA, NA, 92, 93, 94, NA },
|
||||
{ 135, 106, NA, 29, 27, 6, 25, NA, 5, NA, 17, 16, 54, 55, 56, 110, NA, NA, 82, NA, 89, 90, 91, 88 },
|
||||
{ 136, 105, 108, 107, NA, NA, NA, NA, 44, NA, NA, NA, NA, 111, 122, 101, 109, 80, 81, 79, 98, NA, 99, NA } };
|
||||
|
||||
static const char* zone_names[] =
|
||||
{
|
||||
ZONE_EN_KEYBOARD,
|
||||
};
|
||||
|
||||
static const unsigned int zone_sizes[] =
|
||||
{
|
||||
137
|
||||
};
|
||||
|
||||
static const zone_type zone_types[] =
|
||||
{
|
||||
ZONE_TYPE_MATRIX,
|
||||
};
|
||||
|
||||
static const char* led_names[] =
|
||||
{
|
||||
"Power/Wireless Indicator",
|
||||
"Lock/Macro Indicator",
|
||||
"N/A",
|
||||
"N/A",
|
||||
KEY_EN_A,
|
||||
KEY_EN_B,
|
||||
KEY_EN_C,
|
||||
KEY_EN_D,
|
||||
KEY_EN_E,
|
||||
KEY_EN_F,
|
||||
KEY_EN_G,
|
||||
KEY_EN_H,
|
||||
KEY_EN_I,
|
||||
KEY_EN_J,
|
||||
KEY_EN_K,
|
||||
KEY_EN_L,
|
||||
KEY_EN_M,
|
||||
KEY_EN_N,
|
||||
KEY_EN_O,
|
||||
KEY_EN_P,
|
||||
KEY_EN_Q,
|
||||
KEY_EN_R,
|
||||
KEY_EN_S,
|
||||
KEY_EN_T,
|
||||
KEY_EN_U,
|
||||
KEY_EN_V,
|
||||
KEY_EN_W,
|
||||
KEY_EN_X,
|
||||
KEY_EN_Y,
|
||||
KEY_EN_Z,
|
||||
KEY_EN_1,
|
||||
KEY_EN_2,
|
||||
KEY_EN_3,
|
||||
KEY_EN_4,
|
||||
KEY_EN_5,
|
||||
KEY_EN_6,
|
||||
KEY_EN_7,
|
||||
KEY_EN_8,
|
||||
KEY_EN_9,
|
||||
KEY_EN_0,
|
||||
KEY_EN_ANSI_ENTER,
|
||||
KEY_EN_ESCAPE,
|
||||
KEY_EN_BACKSPACE,
|
||||
KEY_EN_TAB,
|
||||
KEY_EN_SPACE,
|
||||
KEY_EN_MINUS,
|
||||
KEY_EN_EQUALS,
|
||||
KEY_EN_LEFT_BRACKET,
|
||||
KEY_EN_RIGHT_BRACKET,
|
||||
KEY_EN_ANSI_BACK_SLASH,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_SEMICOLON,
|
||||
KEY_EN_QUOTE,
|
||||
KEY_EN_BACK_TICK,
|
||||
KEY_EN_COMMA,
|
||||
KEY_EN_PERIOD,
|
||||
KEY_EN_FORWARD_SLASH,
|
||||
KEY_EN_CAPS_LOCK,
|
||||
KEY_EN_F1,
|
||||
KEY_EN_F2,
|
||||
KEY_EN_F3,
|
||||
KEY_EN_F4,
|
||||
KEY_EN_F5,
|
||||
KEY_EN_F6,
|
||||
KEY_EN_F7,
|
||||
KEY_EN_F8,
|
||||
KEY_EN_F9,
|
||||
KEY_EN_F10,
|
||||
KEY_EN_F11,
|
||||
KEY_EN_F12,
|
||||
KEY_EN_PRINT_SCREEN,
|
||||
KEY_EN_SCROLL_LOCK,
|
||||
KEY_EN_PAUSE_BREAK,
|
||||
KEY_EN_INSERT,
|
||||
KEY_EN_HOME,
|
||||
KEY_EN_PAGE_UP,
|
||||
KEY_EN_DELETE,
|
||||
KEY_EN_END,
|
||||
KEY_EN_PAGE_DOWN,
|
||||
KEY_EN_RIGHT_ARROW,
|
||||
KEY_EN_LEFT_ARROW,
|
||||
KEY_EN_DOWN_ARROW,
|
||||
KEY_EN_UP_ARROW,
|
||||
KEY_EN_NUMPAD_LOCK,
|
||||
KEY_EN_NUMPAD_DIVIDE,
|
||||
KEY_EN_NUMPAD_TIMES,
|
||||
KEY_EN_NUMPAD_MINUS,
|
||||
KEY_EN_NUMPAD_PLUS,
|
||||
KEY_EN_NUMPAD_ENTER,
|
||||
KEY_EN_NUMPAD_1,
|
||||
KEY_EN_NUMPAD_2,
|
||||
KEY_EN_NUMPAD_3,
|
||||
KEY_EN_NUMPAD_4,
|
||||
KEY_EN_NUMPAD_5,
|
||||
KEY_EN_NUMPAD_6,
|
||||
KEY_EN_NUMPAD_7,
|
||||
KEY_EN_NUMPAD_8,
|
||||
KEY_EN_NUMPAD_9,
|
||||
KEY_EN_NUMPAD_0,
|
||||
KEY_EN_NUMPAD_PERIOD,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_MENU,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_LEFT_CONTROL,
|
||||
KEY_EN_LEFT_SHIFT,
|
||||
KEY_EN_LEFT_ALT,
|
||||
KEY_EN_LEFT_WINDOWS,
|
||||
KEY_EN_RIGHT_CONTROL,
|
||||
KEY_EN_RIGHT_SHIFT,
|
||||
KEY_EN_RIGHT_ALT,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_RIGHT_FUNCTION,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
KEY_EN_UNUSED,
|
||||
"Key: G1",
|
||||
"Key: G2",
|
||||
"Key: G3",
|
||||
"Key: G4",
|
||||
"Key: G5",
|
||||
"Key: G6",
|
||||
};
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Corsair Wireless Peripheral
|
||||
@category Keyboard
|
||||
@type USB
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :x:
|
||||
@detectors DetectCorsairWirelessControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_CorsairWireless::RGBController_CorsairWireless(CorsairWirelessController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetName();
|
||||
vendor = "Corsair";
|
||||
description = "Corsair RGB Peripheral Device";
|
||||
type = controller->GetDeviceType();
|
||||
version = controller->GetFirmwareString();
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| The Corsair Lighting Node Pro requires a packet within|
|
||||
| 20 seconds of sending the lighting change in order |
|
||||
| to not revert back into rainbow mode. Start a thread |
|
||||
| to continuously send a keepalive packet every 5s |
|
||||
\*-----------------------------------------------------*/
|
||||
keepalive_thread_run = true;
|
||||
keepalive_thread = new std::thread(&RGBController_CorsairWireless::KeepaliveThread, this);
|
||||
}
|
||||
|
||||
RGBController_CorsairWireless::~RGBController_CorsairWireless()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Close keepalive thread |
|
||||
\*-----------------------------------------------------*/
|
||||
keepalive_thread_run = false;
|
||||
keepalive_thread->join();
|
||||
delete keepalive_thread;
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_CorsairWireless::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Determine number of zones |
|
||||
| For now, keyboard has 2 zones and mousemat has 1 |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned int num_zones = 1;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up zones |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned int total_led_count = 0;
|
||||
for(unsigned int zone_idx = 0; zone_idx < num_zones; zone_idx++)
|
||||
{
|
||||
zone new_zone;
|
||||
|
||||
new_zone.name = zone_names[zone_idx];
|
||||
new_zone.type = zone_types[zone_idx];
|
||||
new_zone.leds_min = zone_sizes[zone_idx];
|
||||
new_zone.leds_max = zone_sizes[zone_idx];
|
||||
new_zone.leds_count = zone_sizes[zone_idx];
|
||||
|
||||
if(zone_types[zone_idx] == ZONE_TYPE_MATRIX)
|
||||
{
|
||||
new_zone.matrix_map.Set(7, 24, (unsigned int *)&matrix_map);
|
||||
}
|
||||
|
||||
zones.push_back(new_zone);
|
||||
total_led_count += new_zone.leds_count;
|
||||
}
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < total_led_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
|
||||
new_led.name = led_names[led_idx];
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairWireless::DeviceUpdateLEDs()
|
||||
{
|
||||
last_update_time = std::chrono::steady_clock::now();
|
||||
|
||||
controller->SetLEDs(colors);
|
||||
}
|
||||
|
||||
void RGBController_CorsairWireless::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
controller->SetLEDs(colors);
|
||||
}
|
||||
|
||||
void RGBController_CorsairWireless::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
controller->SetLEDs(colors);
|
||||
}
|
||||
|
||||
void RGBController_CorsairWireless::DeviceUpdateMode()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RGBController_CorsairWireless::KeepaliveThread()
|
||||
{
|
||||
while(keepalive_thread_run.load())
|
||||
{
|
||||
if(active_mode == 0)
|
||||
{
|
||||
if((std::chrono::steady_clock::now() - last_update_time) > std::chrono::milliseconds(5000))
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
}
|
||||
std::this_thread::sleep_for(1000ms);
|
||||
}
|
||||
}
|
||||
@@ -134,7 +134,14 @@ void CrucialController::CrucialRegisterWriteBlock(crucial_register reg, unsigned
|
||||
bus->i2c_smbus_write_word_data(dev, 0x00, ((reg << 8) & 0xFF00) | ((reg >> 8) & 0x00FF));
|
||||
|
||||
//Write Crucial block data
|
||||
bus->i2c_smbus_write_block_data(dev, 0x03, sz, data);
|
||||
if(bus->i2c_smbus_write_block_data(dev, 0x03, sz, data) == -1)
|
||||
{
|
||||
//Fall back to individual byte operations if the block operation fails
|
||||
for(unsigned int block_byte = 0; block_byte < sz; block_byte++)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x01, data[block_byte]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CrucialController::SendEffectColor
|
||||
|
||||
@@ -28,12 +28,6 @@ using namespace std::chrono_literals;
|
||||
|
||||
static const unsigned char crucial_addresses[] =
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| These addresses have been disabled due to conflict with |
|
||||
| ENE DRAM. Since the detection scheme is the same, ENE |
|
||||
| RAM will be detected as Crucial. We need to improve the |
|
||||
| Crucial detection scheme. |
|
||||
\*---------------------------------------------------------*/
|
||||
0x39,
|
||||
0x3A,
|
||||
0x3B,
|
||||
@@ -71,19 +65,19 @@ bool TestForCrucialController(i2c_smbus_interface* bus, unsigned char address)
|
||||
{
|
||||
bool pass = false;
|
||||
|
||||
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
|
||||
int res = bus->i2c_smbus_read_byte(address);
|
||||
|
||||
if (res >= 0)
|
||||
if(res >= 0)
|
||||
{
|
||||
pass = true;
|
||||
|
||||
LOG_DEBUG("[%s] Detected an I2C device at address %02X", CRUCIAL_CONTROLLER_NAME, address);
|
||||
|
||||
for (int i = 0xA0; i < 0xB0; i++)
|
||||
for(int i = 0xA0; i < 0xB0; i++)
|
||||
{
|
||||
res = bus->i2c_smbus_read_byte_data(address, i);
|
||||
|
||||
if (res != (i - 0xA0))
|
||||
if(res != (i - 0xA0))
|
||||
{
|
||||
LOG_VERBOSE("[%s] Detection failed testing register %02X. Expected %02X, got %02X.", CRUCIAL_CONTROLLER_NAME, i, (i - 0xA0), res);
|
||||
|
||||
@@ -149,7 +143,7 @@ DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &
|
||||
{
|
||||
for(unsigned int slot = 0; slot < 4; slot++)
|
||||
{
|
||||
int res = buses[bus]->i2c_smbus_write_quick(0x27, I2C_SMBUS_WRITE);
|
||||
int res = buses[bus]->i2c_smbus_read_byte(0x27);
|
||||
|
||||
if(res < 0)
|
||||
{
|
||||
@@ -163,7 +157,7 @@ DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &
|
||||
|
||||
if(address_list_idx < CRUCIAL_ADDRESS_COUNT)
|
||||
{
|
||||
res = buses[bus]->i2c_smbus_write_quick(crucial_addresses[address_list_idx], I2C_SMBUS_WRITE);
|
||||
res = buses[bus]->i2c_smbus_read_byte(crucial_addresses[address_list_idx]);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -116,7 +116,7 @@ void RGBController_DRGB::SetupZones()
|
||||
led new_led;
|
||||
new_led.name = zones[channel_idx].name + ", LED " + std::to_string(led_ch_idx);
|
||||
leds.push_back(new_led);
|
||||
leds_channel.push_back(channel_idx);
|
||||
leds_channel.push_back((unsigned int)channel_idx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -220,7 +220,7 @@ void RGBController_Debug::SetupZones()
|
||||
/*-------------------------------------------------*\
|
||||
| Clear any existing color/LED configuration |
|
||||
\*-------------------------------------------------*/
|
||||
led_alt_names.clear();
|
||||
led_display_names.clear();
|
||||
leds.clear();
|
||||
colors.clear();
|
||||
|
||||
@@ -409,7 +409,7 @@ void RGBController_Debug::SetupZones()
|
||||
|
||||
leds.push_back(single_led);
|
||||
|
||||
led_alt_names.push_back("");
|
||||
led_display_names.push_back("");
|
||||
|
||||
nlohmann::json configuration_json;
|
||||
JsonUtils::JsonParse(configuration, configuration_json);
|
||||
@@ -461,7 +461,7 @@ void RGBController_Debug::SetupZones()
|
||||
|
||||
leds.push_back(linear_led);
|
||||
|
||||
led_alt_names.push_back("");
|
||||
led_display_names.push_back("");
|
||||
}
|
||||
|
||||
zone_idx++;
|
||||
@@ -505,7 +505,7 @@ void RGBController_Debug::SetupZones()
|
||||
|
||||
if(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_DEVICE_SPECIFIC)
|
||||
{
|
||||
if(configuration_json.contains("zones") && (zone_idx < (int)configuration_json["zones"].size()))
|
||||
if(configuration_json.contains("zones") && (zone_idx < configuration_json["zones"].size()))
|
||||
{
|
||||
if(configuration_json["zones"][zone_idx].contains("configuration"))
|
||||
{
|
||||
@@ -604,7 +604,7 @@ void RGBController_Debug::SetupZones()
|
||||
|
||||
leds.push_back(keyboard_led);
|
||||
|
||||
led_alt_names.push_back(new_kb.GetKeyAltNameAt(led_idx));
|
||||
led_display_names.push_back(new_kb.GetKeyAltNameAt(led_idx));
|
||||
}
|
||||
|
||||
if(first_run)
|
||||
@@ -663,7 +663,7 @@ void RGBController_Debug::SetupZones()
|
||||
|
||||
leds.push_back(underglow_led);
|
||||
|
||||
led_alt_names.push_back("");
|
||||
led_display_names.push_back("");
|
||||
}
|
||||
|
||||
zone_idx++;
|
||||
@@ -719,7 +719,7 @@ void RGBController_Debug::SetupZones()
|
||||
|
||||
leds.push_back(resizable_led);
|
||||
|
||||
led_alt_names.push_back("");
|
||||
led_display_names.push_back("");
|
||||
}
|
||||
|
||||
zone_idx++;
|
||||
@@ -767,7 +767,7 @@ void RGBController_Debug::DeviceUpdateDeviceSpecificConfiguration()
|
||||
|
||||
}
|
||||
|
||||
void RGBController_Debug::DeviceUpdateDeviceSpecificZoneConfiguration(int zone)
|
||||
void RGBController_Debug::DeviceUpdateDeviceSpecificZoneConfiguration(int /*zone*/)
|
||||
{
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
@@ -21,14 +21,14 @@
|
||||
DetectedControllers DetectDygmaRaiseControllers()
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
std::vector<std::string *> ports = find_usb_serial_port(DYGMA_RAISE_VID, DYGMA_RAISE_PID);
|
||||
std::vector<std::string> ports = find_usb_serial_port(DYGMA_RAISE_VID, DYGMA_RAISE_PID);
|
||||
|
||||
for(std::size_t i = 0; i < ports.size(); i++)
|
||||
{
|
||||
if(*ports[i] != "")
|
||||
if(ports[i] != "")
|
||||
{
|
||||
DygmaRaiseController* controller = new DygmaRaiseController();
|
||||
controller->Initialize((char *)ports[i]->c_str());
|
||||
controller->Initialize((char *)ports[i].c_str());
|
||||
|
||||
RGBController_DygmaRaise* rgb_controller = new RGBController_DygmaRaise(controller);
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ DetectedControllers DetectENESMBusDRAMControllers(std::vector<i2c_smbus_interfac
|
||||
|
||||
for(unsigned int slot = 0; slot < 8; slot++)
|
||||
{
|
||||
int res = buses[bus]->i2c_smbus_write_quick(0x77, I2C_SMBUS_WRITE);
|
||||
int res = buses[bus]->i2c_smbus_read_byte(0x77);
|
||||
|
||||
if(res < 0)
|
||||
{
|
||||
@@ -176,7 +176,7 @@ DetectedControllers DetectENESMBusDRAMControllers(std::vector<i2c_smbus_interfac
|
||||
{
|
||||
LOG_DEBUG("[ENE SMBus DRAM] Testing address %02X to see if there is a device there", ene_ram_addresses[address_list_idx]);
|
||||
|
||||
res = buses[bus]->i2c_smbus_write_quick(ene_ram_addresses[address_list_idx], I2C_SMBUS_WRITE);
|
||||
res = buses[bus]->i2c_smbus_read_byte(ene_ram_addresses[address_list_idx]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -413,6 +413,8 @@ REGISTER_I2C_PCI_DETECTOR("ASUS ROG MATRIX PLATINUM GeForce RTX 4090",
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5060 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5060_O8G_GAMING, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070_O12G_GAMING, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Ti Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070TI_O16G_GAMING, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Ti Gaming BTF White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070TI_O16G_GAMING_BTF_WHITE, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5070 Ti Gaming White OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5070TI_O16G_GAMING_WHITE, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG STRIX GeForce RTX 5070 Ti Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, ASUS_SUB_VEN, ASUS_ROG_STRIX_RTX_5070TI_O16G_GAMING_OC, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5080 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5080_O16G_GAMING, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5090 Gaming OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_TUF_RTX_5090_O32G_GAMING, 0x67);
|
||||
@@ -420,7 +422,9 @@ REGISTER_I2C_PCI_DETECTOR("ASUS TUF GeForce RTX 5090 Gaming",
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_O16G_GAMING, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080 OC WHITE", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_O16G_GAMING_WHITE, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_16G_GAMING, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5080 WHITE", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5080_16G_GAMING_WHITE, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5090 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5090_O32G_GAMING, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5090", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5090_O32G_GAMING_2, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5090 OC BTF", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5090_O32G_GAMING_BTF, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL GeForce RTX 5090 OC WHITE", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_RTX_5090_O32G_GAMING_WHITE, 0x67);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASUS ROG ASTRAL LC GeForce RTX 5090 OC", DetectENESMBusGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, ASUS_SUB_VEN, ASUS_ROG_ASTRAL_LC_RTX_5090_O32G_GAMING, 0x67);
|
||||
|
||||
@@ -61,5 +61,12 @@ void ENESMBusInterface_i2c_smbus::ENERegisterWriteBlock(ene_dev_id dev, ene_regi
|
||||
bus->i2c_smbus_write_word_data(dev, 0x00, ((reg << 8) & 0xFF00) | ((reg >> 8) & 0x00FF));
|
||||
|
||||
//Write ENE block data
|
||||
bus->i2c_smbus_write_block_data(dev, 0x03, sz, data);
|
||||
if(bus->i2c_smbus_write_block_data(dev, 0x03, sz, data) == -1)
|
||||
{
|
||||
//Fall back to individual byte operations if the block operation fails
|
||||
for(unsigned int block_byte = 0; block_byte < sz; block_byte++)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x01, data[block_byte]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| EVGAKeyboardControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for EVGA keyboard devices |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_EVGAKeyboard.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| EVGA USB vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define EVGA_USB_VID 0x3842
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define Z15_ISO_PID 0x260E
|
||||
#define Z15_ANSI_PID 0x2608
|
||||
#define Z20_ANSI_PID 0x260A
|
||||
#define Z20_UK_PID 0x2610
|
||||
|
||||
DetectedControllers DetectEVGAKeyboardControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
EVGAKeyboardController* controller = new EVGAKeyboardController(dev, info->path, info->product_id, name);
|
||||
RGBController_EVGAKeyboard* rgb_controller = new RGBController_EVGAKeyboard(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ISO_PID, 1, 0x08, 0x4B);
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ANSI_PID, 1, 0x08, 0x4B);
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA Z20 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z20_ANSI_PID, 1, 0x08, 0x4B);
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA Z20 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z20_UK_PID, 1, 0x08, 0x4B);
|
||||
|
||||
+5
-37
@@ -1,7 +1,7 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| EVGAUSBControllerDetect.cpp |
|
||||
| EVGAMouseControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for EVGA USB devices |
|
||||
| Detector for EVGA mouse devices |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
@@ -9,45 +9,18 @@
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_EVGAKeyboard.h"
|
||||
#include "RGBController_EVGAMouse.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| EVGA USB vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define EVGA_USB_VID 0x3842
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define Z15_ISO_PID 0x260E
|
||||
#define Z15_ANSI_PID 0x2608
|
||||
#define Z20_ANSI_PID 0x260A
|
||||
#define Z20_UK_PID 0x2610
|
||||
#define EVGA_USB_VID 0x3842
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Mouse product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define X20_WIRED_PID 0x2420
|
||||
#define X20_WIRELESS_ADAPTER_PID 0x2402
|
||||
|
||||
DetectedControllers DetectEVGAKeyboardControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
EVGAKeyboardController* controller = new EVGAKeyboardController(dev, info->path, info->product_id, name);
|
||||
RGBController_EVGAKeyboard* rgb_controller = new RGBController_EVGAKeyboard(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
#define X20_WIRED_PID 0x2420
|
||||
#define X20_WIRELESS_ADAPTER_PID 0x2402
|
||||
|
||||
DetectedControllers DetectEVGAMouse(hid_device_info* info, const std::string &name, int connection_type)
|
||||
{
|
||||
@@ -77,10 +50,5 @@ DetectedControllers DetectWirelessEVGAMouse(hid_device_info* info, const std::st
|
||||
return(DetectEVGAMouse(info, name, EVGA_PERIPHERAL_CONNECTION_TYPE_WIRELESS));
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ISO_PID, 1, 0x08, 0x4B);
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA Z15 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z15_ANSI_PID, 1, 0x08, 0x4B);
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA Z20 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z20_ANSI_PID, 1, 0x08, 0x4B);
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA Z20 Keyboard", DetectEVGAKeyboardControllers, EVGA_USB_VID, Z20_UK_PID, 1, 0x08, 0x4B);
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA X20 Gaming Mouse", DetectWiredEVGAMouse, EVGA_USB_VID, X20_WIRED_PID, 2, 0xFFFF, 0);
|
||||
REGISTER_HID_DETECTOR_IPU("EVGA X20 USB Receiver", DetectWirelessEVGAMouse, EVGA_USB_VID, X20_WIRELESS_ADAPTER_PID, 2, 0xFFFF, 0);
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| EVisionKeyboardControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for EVision/Huafenda keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "EVisionKeyboardController.h"
|
||||
#include "RGBController_EVisionKeyboard.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| EVision vendor ID |
|
||||
| NOTE: EVision (and Huafenda) use rebranded Sonix MCUs |
|
||||
| Some EVision/Huafenda keyboards use the Sonix VID while |
|
||||
| others use EVision's VID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define SONIX_VID 0x0C45
|
||||
#define EVISION_VID 0x320F
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| EVision Usage Page |
|
||||
\*---------------------------------------------------------*/
|
||||
#define EVISION_KEYBOARD_USAGE_PAGE 0xFF1C
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define EVISION_SONIX_5004_PID 0x5004
|
||||
#define EVISION_SONIX_5104_PID 0x5104
|
||||
#define EVISION_SONIX_5204_PID 0x5204
|
||||
#define EVISION_SONIX_652F_PID 0x652F
|
||||
#define EVISION_SONIX_7672_PID 0x7672
|
||||
#define EVISION_SONIX_7698_PID 0x7698
|
||||
#define EVISION_SONIX_8520_PID 0x8520
|
||||
#define EVISION_5000_PID 0x5000
|
||||
#define EVISION_502A_PID 0x502A
|
||||
#define EVISION_505B_PID 0x505B
|
||||
#define EVISION_5064_PID 0x5064
|
||||
#define EVISION_5078_PID 0x5078
|
||||
#define EVISION_5084_PID 0x5084
|
||||
|
||||
DetectedControllers DetectEVisionKeyboards(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
EVisionKeyboardController* controller = new EVisionKeyboardController(dev, info->path, name);
|
||||
RGBController_EVisionKeyboard* rgb_controller = new RGBController_EVisionKeyboard(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboards |
|
||||
\*---------------------------------------------------------*/
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5004", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_5004_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5104", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_5104_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5204", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_5204_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:652F", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_652F_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:7672", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_7672_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:7698", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_7698_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:8520", DetectEVisionKeyboards, SONIX_VID, EVISION_SONIX_8520_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5000", DetectEVisionKeyboards, EVISION_VID, EVISION_5000_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:502A", DetectEVisionKeyboards, EVISION_VID, EVISION_502A_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:505B", DetectEVisionKeyboards, EVISION_VID, EVISION_505B_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5078", DetectEVisionKeyboards, EVISION_VID, EVISION_5078_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5064", DetectEVisionKeyboards, EVISION_VID, EVISION_5064_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5084", DetectEVisionKeyboards, EVISION_VID, EVISION_5084_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
@@ -1,129 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| EVisionKeyboardControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for EVision keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "EVisionKeyboardController.h"
|
||||
#include "EVisionV2KeyboardController.h"
|
||||
#include "RGBController_EVisionKeyboard.h"
|
||||
#include "RGBController_EVisionV2Keyboard.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define EVISION_KEYBOARD_VID 0x0C45
|
||||
#define EVISION_KEYBOARD2_VID 0x320F
|
||||
#define EVISION_KEYBOARD3_VID 0x3299
|
||||
#define EVISION_KEYBOARD_USAGE_PAGE 0xFF1C
|
||||
#define ENDORFY_OMNIS_PID 0x0012
|
||||
#define DEXP_BLAZE_PID 0x5084
|
||||
#define GLORIOUS_GMMK_TKL_PID 0x5064
|
||||
#define REDRAGON_K550_PID 0x5204
|
||||
#define MARS_GAMING_MKMINI_PID 0x5078
|
||||
#define SKILLKORP_K5_PID 0x505B
|
||||
#define REDRAGON_K552_PID 0x5104
|
||||
#define REDRAGON_K552_V2_PID 0x5000
|
||||
#define REDRAGON_K556_PID 0x5004
|
||||
#define TECWARE_PHANTOM_ELITE_PID 0x652F
|
||||
#define WARRIOR_KANE_TC235 0x8520
|
||||
#define WOMIER_K87_PID 0x502A
|
||||
#define WOMIER_K66_PID 0x7698
|
||||
#define BYGG_CSB_ICL01_PID 0x5041
|
||||
#define GAMEPOWER_OGRE_RGB_PID 0x7672
|
||||
|
||||
DetectedControllers DetectEVisionKeyboards(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
EVisionKeyboardController* controller = new EVisionKeyboardController(dev, info->path, name);
|
||||
RGBController_EVisionKeyboard* rgb_controller = new RGBController_EVisionKeyboard(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectEVisionV2Keyboards(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
json settings = ResourceManager::get()->GetSettingsManager()->GetSettings("EVision2Settings");
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
EVisionV2KeyboardController* controller = new EVisionV2KeyboardController(dev, info->path, EVISION_V2_KEYBOARD_LAYOUT, name);
|
||||
RGBController_EVisionV2Keyboard* rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_KEYBOARD);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
if(!settings.contains("AdditionalZones") || settings["AdditionalZones"] == true)
|
||||
{
|
||||
rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_LOGO);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_EDGE);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectEndorfyKeyboards(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
json settings = ResourceManager::get()->GetSettingsManager()->GetSettings("EndorfySettings");
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
EVisionV2KeyboardController* controller = new EVisionV2KeyboardController(dev, info->path, ENDORFY_KEYBOARD_LAYOUT, name);
|
||||
RGBController_EVisionV2Keyboard* rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_KEYBOARD);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
if(!settings.contains("AdditionalZones") || settings["AdditionalZones"] == true)
|
||||
{
|
||||
rgb_controller = new RGBController_EVisionV2Keyboard(controller, ENDORFY_KEYBOARD_PART_EDGE);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------*\
|
||||
| Keyboards |
|
||||
\*---------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5078", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, MARS_GAMING_MKMINI_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5204", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, REDRAGON_K550_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5104", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, REDRAGON_K552_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5000", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, REDRAGON_K552_V2_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:5004", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, REDRAGON_K556_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:652F", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, TECWARE_PHANTOM_ELITE_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:8520", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, WARRIOR_KANE_TC235, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:502A", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, WOMIER_K87_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 0C45:7698", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, WOMIER_K66_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5064", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, GLORIOUS_GMMK_TKL_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5084", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, DEXP_BLAZE_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:505B", DetectEVisionKeyboards, EVISION_KEYBOARD2_VID, SKILLKORP_K5_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("Endorfy Omnis", DetectEndorfyKeyboards, EVISION_KEYBOARD3_VID, ENDORFY_OMNIS_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("CSB/ICL01 Keyboard", DetectEVisionV2Keyboards, EVISION_KEYBOARD2_VID, BYGG_CSB_ICL01_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("Gamepower Ogre RGB 0C45:7672", DetectEVisionKeyboards, EVISION_KEYBOARD_VID, GAMEPOWER_OGRE_RGB_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
+90
@@ -0,0 +1,90 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| EVisionKeyboardV2ControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for EVision V2 keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "EVisionV2KeyboardController.h"
|
||||
#include "RGBController_EVisionV2Keyboard.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| EVision vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define EVISION_VID 0x320F
|
||||
#define SPCGEAR_VID 0x3299
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| EVision Usage Page |
|
||||
\*---------------------------------------------------------*/
|
||||
#define EVISION_KEYBOARD_USAGE_PAGE 0xFF1C
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ENDORFY_OMNIS_PID 0x0012
|
||||
#define BYGG_CSB_ICL01_PID 0x5041
|
||||
|
||||
DetectedControllers DetectEVisionV2Keyboards(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
json settings = ResourceManager::get()->GetSettingsManager()->GetSettings("EVision2Settings");
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
EVisionV2KeyboardController* controller = new EVisionV2KeyboardController(dev, info->path, EVISION_V2_KEYBOARD_LAYOUT, name);
|
||||
RGBController_EVisionV2Keyboard* rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_KEYBOARD);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
if(!settings.contains("AdditionalZones") || settings["AdditionalZones"] == true)
|
||||
{
|
||||
rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_LOGO);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_EDGE);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectEndorfyKeyboards(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
json settings = ResourceManager::get()->GetSettingsManager()->GetSettings("EndorfySettings");
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
EVisionV2KeyboardController* controller = new EVisionV2KeyboardController(dev, info->path, ENDORFY_KEYBOARD_LAYOUT, name);
|
||||
RGBController_EVisionV2Keyboard* rgb_controller = new RGBController_EVisionV2Keyboard(controller, EVISION_V2_KEYBOARD_PART_KEYBOARD);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
if(!settings.contains("AdditionalZones") || settings["AdditionalZones"] == true)
|
||||
{
|
||||
rgb_controller = new RGBController_EVisionV2Keyboard(controller, ENDORFY_KEYBOARD_PART_EDGE);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboards |
|
||||
\*---------------------------------------------------------*/
|
||||
REGISTER_HID_DETECTOR_IP("EVision Keyboard 320F:5041", DetectEVisionV2Keyboards, EVISION_VID, BYGG_CSB_ICL01_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
REGISTER_HID_DETECTOR_IP("Endorfy Omnis", DetectEndorfyKeyboards, SPCGEAR_VID, ENDORFY_OMNIS_PID, 1, EVISION_KEYBOARD_USAGE_PAGE);
|
||||
@@ -230,16 +230,41 @@ void FnaticStreakController::SetLEDsDirect(std::vector<led> leds, std::vector<RG
|
||||
|
||||
void FnaticStreakController::SendRGBToDevice()
|
||||
{
|
||||
unsigned int total_leds = GetLEDCount();
|
||||
unsigned int data_size = total_leds * 3;
|
||||
if(keyboard_type == FNATIC_STREAK_TYPE_65)
|
||||
{
|
||||
unsigned char data[64];
|
||||
memset(data, 0x00, sizeof(data));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| For direct/software control, use command 0x0f |
|
||||
| This bypasses the profile and allows immediate update |
|
||||
| The 0x03 subcommand indicates per-key color data |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned char prefix[] = { 0x0f, 0x03 };
|
||||
SendRequest(prefix, sizeof(prefix), color_buf, data_size);
|
||||
data[0] = 0x0F;
|
||||
data[1] = 0x15;
|
||||
|
||||
data[7] = 0x0F;
|
||||
data[8] = 0x03;
|
||||
|
||||
for(unsigned int i = 9; i < 25; i++)
|
||||
{
|
||||
data[i] = 0xFF;
|
||||
}
|
||||
|
||||
data[25] = color_buf[0];
|
||||
data[26] = color_buf[1];
|
||||
data[27] = color_buf[2];
|
||||
|
||||
hid_write(dev, data, sizeof(data));
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned int total_leds = GetLEDCount();
|
||||
unsigned int data_size = total_leds * 3;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| For direct/software control, use command 0x0f |
|
||||
| This bypasses the profile and allows immediate update |
|
||||
| The 0x03 subcommand indicates per-key color data |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned char prefix[] = { 0x0f, 0x03 };
|
||||
SendRequest(prefix, sizeof(prefix), color_buf, data_size);
|
||||
}
|
||||
}
|
||||
|
||||
void FnaticStreakController::SetPulse(unsigned char color_mode, unsigned char r, unsigned char g, unsigned char b, unsigned char speed)
|
||||
|
||||
@@ -51,7 +51,8 @@
|
||||
enum FnaticStreakType
|
||||
{
|
||||
FNATIC_STREAK_TYPE_FULL,
|
||||
FNATIC_STREAK_TYPE_MINI
|
||||
FNATIC_STREAK_TYPE_MINI,
|
||||
FNATIC_STREAK_TYPE_65
|
||||
};
|
||||
|
||||
class FnaticStreakController
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
|
||||
#define FNATIC_STREAK_PID 0x0101
|
||||
#define FNATIC_MINISTREAK_PID 0x0102
|
||||
#define FNATIC_STREAK65_PID 0x0105
|
||||
|
||||
DetectedControllers DetectFnaticStreakKeyboard(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
@@ -42,6 +43,10 @@ DetectedControllers DetectFnaticStreakKeyboard(hid_device_info* info, const std:
|
||||
{
|
||||
kb_type = FNATIC_STREAK_TYPE_MINI;
|
||||
}
|
||||
else if(info->product_id == FNATIC_STREAK65_PID)
|
||||
{
|
||||
kb_type = FNATIC_STREAK_TYPE_65;
|
||||
}
|
||||
else
|
||||
{
|
||||
kb_type = FNATIC_STREAK_TYPE_FULL;
|
||||
@@ -58,3 +63,4 @@ DetectedControllers DetectFnaticStreakKeyboard(hid_device_info* info, const std:
|
||||
|
||||
REGISTER_HID_DETECTOR_I("Fnatic Streak", DetectFnaticStreakKeyboard, FNATIC_VID, FNATIC_STREAK_PID, 1);
|
||||
REGISTER_HID_DETECTOR_I("Fnatic miniStreak", DetectFnaticStreakKeyboard, FNATIC_VID, FNATIC_MINISTREAK_PID, 1);
|
||||
REGISTER_HID_DETECTOR_I("Fnatic Streak65", DetectFnaticStreakKeyboard, FNATIC_VID, FNATIC_STREAK65_PID, 1);
|
||||
|
||||
@@ -563,7 +563,7 @@ void RGBController_GaiZhongGaiKeyboard::SetupZones()
|
||||
break;
|
||||
|
||||
case GAIZHONGGAI_RGB_HUB_GREEN_PID:
|
||||
temp = controller->GetChannelLen(zone_idx);//get led_len
|
||||
temp = controller->GetChannelLen((uint8_t)zone_idx);//get led_len
|
||||
zones[zone_idx].leds_min = 0;
|
||||
zones[zone_idx].leds_max = 637;
|
||||
|
||||
@@ -600,7 +600,7 @@ void RGBController_GaiZhongGaiKeyboard::SetupZones()
|
||||
break;
|
||||
|
||||
case GAIZHONGGAI_RGB_HUB_BLUE_PID:
|
||||
temp = controller->GetChannelLen(zone_idx);//get led_len
|
||||
temp = controller->GetChannelLen((uint8_t)zone_idx);//get led_len
|
||||
zones[zone_idx].leds_min = 0;
|
||||
zones[zone_idx].leds_max = 633;
|
||||
|
||||
|
||||
@@ -99,3 +99,4 @@ REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3080 Phoenix", DetectGa
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3080 Ti Phoenix", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX3080TI_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3080TI_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3090 Phoenix", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, GAINWARD_SUB_VEN, NVIDIA_RTX3090_DEV, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 3090 Ti Phantom", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX3090TI_DEV, GAINWARD_SUB_VEN, GAINWARD_RTX_3090TI_PHANTOM, 0x49);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gainward GeForce RTX 4080 Phantom GS", DetectGainwardGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, GAINWARD_SUB_VEN, GAINWARD_RTX_4080_PHANTOM_GS_SUB_DEV, 0x49);
|
||||
|
||||
@@ -29,10 +29,13 @@ bool TestForGalaxGPUController(i2c_smbus_interface* bus, unsigned char address)
|
||||
\*-------------------------------------------------*/
|
||||
case 0x32:
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x00);
|
||||
if(res == 0x27 || res == 0x26) {
|
||||
if(res == 0x27 || res == 0x26)
|
||||
{
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x01);
|
||||
if (res == 0x10 || res == 0x20)
|
||||
if(res == 0x10 || res == 0x20)
|
||||
{
|
||||
pass = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -41,7 +44,7 @@ bool TestForGalaxGPUController(i2c_smbus_interface* bus, unsigned char address)
|
||||
\*-------------------------------------------------*/
|
||||
case 0x23:
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x00);
|
||||
if(res == 0x30)
|
||||
if(res == 0x27 || res == 0x30)
|
||||
{
|
||||
pass = true;
|
||||
}
|
||||
@@ -52,8 +55,10 @@ bool TestForGalaxGPUController(i2c_smbus_interface* bus, unsigned char address)
|
||||
\*-------------------------------------------------*/
|
||||
case 0x51:
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x00);
|
||||
if (res == 0x80)
|
||||
if(res == 0x80)
|
||||
{
|
||||
pass = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,238 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| GigabyteCastor3Controller.cpp |
|
||||
| |
|
||||
| Driver for Gigabyte Aorus Waterforce X II 360 AIO |
|
||||
| (Castor3 USB HID controller) |
|
||||
| |
|
||||
| RGB ring control only — LCD not implemented |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include "GigabyteCastor3Controller.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
GigabyteCastor3Controller::GigabyteCastor3Controller(hid_device* dev_handle, const char* path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Query firmware version via de 00 |
|
||||
| Response: de [version_byte] |
|
||||
| Observed: de 02 -> version 2 |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char de_payload[] = { 0xDE, 0x00 };
|
||||
SendPacket(de_payload, 2);
|
||||
|
||||
unsigned char response[CASTOR3_IN_SIZE];
|
||||
int bytes_read = hid_read_timeout(dev, response, CASTOR3_IN_SIZE, CASTOR3_IN_TIMEOUT_MS);
|
||||
|
||||
if(bytes_read > 1)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Strip report ID 0x99 if present on IN packets |
|
||||
\*-----------------------------------------------------*/
|
||||
int offset = 0;
|
||||
if(response[0] == CASTOR3_REPORT_ID)
|
||||
{
|
||||
offset = 1;
|
||||
}
|
||||
|
||||
if(response[offset] == 0xDE && bytes_read > offset + 1)
|
||||
{
|
||||
firmware_version = std::to_string(response[offset + 1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GigabyteCastor3Controller::~GigabyteCastor3Controller()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
std::string GigabyteCastor3Controller::GetDeviceLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string GigabyteCastor3Controller::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
int ret = hid_get_serial_number_string(dev, serial_string, 128);
|
||||
|
||||
if(ret != 0)
|
||||
{
|
||||
return("");
|
||||
}
|
||||
|
||||
return(StringUtils::wstring_to_string(serial_string));
|
||||
}
|
||||
|
||||
std::string GigabyteCastor3Controller::GetFirmwareVersion()
|
||||
{
|
||||
return firmware_version;
|
||||
}
|
||||
|
||||
void GigabyteCastor3Controller::SetEffect
|
||||
(
|
||||
unsigned char style,
|
||||
unsigned char speed,
|
||||
unsigned char brightness,
|
||||
unsigned char b4,
|
||||
unsigned char b5,
|
||||
castor3_color_type color_type,
|
||||
std::vector<RGBColor> colors
|
||||
)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Wire protocol for LED effect apply |
|
||||
| (from castor3.py led_set_effect, confirmed from |
|
||||
| led_profile.pcapng + .cled.dat cross-reference) |
|
||||
| |
|
||||
| Step 1: c9 [Style] [Speed*20] [Bright] [b4] [b5] |
|
||||
| Step 2: cd [R] [G] [B] (single-color only) |
|
||||
| -OR- b0..b3 palette registers (palette effects) |
|
||||
| Step 3: b6 (commit) |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Step 1: c9 — effect select + parameters |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char c9_payload[] =
|
||||
{
|
||||
0xC9,
|
||||
style,
|
||||
(unsigned char)(speed * 20),
|
||||
brightness,
|
||||
b4,
|
||||
b5
|
||||
};
|
||||
SendPacket(c9_payload, sizeof(c9_payload));
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Step 2a: cd — primary color for single-color effects |
|
||||
| Effects: static, pulse, flash, dflash, gradient, off |
|
||||
\*---------------------------------------------------------*/
|
||||
if(color_type == CASTOR3_COLORS_SINGLE)
|
||||
{
|
||||
unsigned char r = 0xFF, g = 0x66, b = 0x00;
|
||||
|
||||
if(colors.size() > 0)
|
||||
{
|
||||
r = RGBGetRValue(colors[0]);
|
||||
g = RGBGetGValue(colors[0]);
|
||||
b = RGBGetBValue(colors[0]);
|
||||
}
|
||||
|
||||
unsigned char cd_payload[] = { 0xCD, r, g, b };
|
||||
SendPacket(cd_payload, sizeof(cd_payload));
|
||||
}
|
||||
/*---------------------------------------------------------*\
|
||||
| Step 2b: b0..b3 — palette registers for multi-color |
|
||||
| Each register carries 2 colors (6 bytes RGB + 1 pad): |
|
||||
| bN [Style] [R1 G1 B1] [R2 G2 B2] 0x00 |
|
||||
| b0=colors 1+2, b1=colors 3+4, b2=colors 5+6, b3=7+8 |
|
||||
| |
|
||||
| Effects: colorshift(8), tricolor(3), spin(3), switch(2) |
|
||||
\*---------------------------------------------------------*/
|
||||
else if(color_type == CASTOR3_COLORS_PALETTE)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Build palette: pad to 8 colors by repeating last |
|
||||
\*-----------------------------------------------------*/
|
||||
RGBColor palette[8];
|
||||
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
if(i < (int)colors.size())
|
||||
{
|
||||
palette[i] = colors[i];
|
||||
}
|
||||
else if(colors.size() > 0)
|
||||
{
|
||||
palette[i] = colors[colors.size() - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
palette[i] = ToRGBColor(0xFF, 0x00, 0x00);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char regs[] = { 0xB0, 0xB1, 0xB2, 0xB3 };
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
RGBColor c1 = palette[i * 2];
|
||||
RGBColor c2 = palette[i * 2 + 1];
|
||||
|
||||
unsigned char bN_payload[] =
|
||||
{
|
||||
regs[i],
|
||||
style,
|
||||
(unsigned char)RGBGetRValue(c1), (unsigned char)RGBGetGValue(c1), (unsigned char)RGBGetBValue(c1),
|
||||
(unsigned char)RGBGetRValue(c2), (unsigned char)RGBGetGValue(c2), (unsigned char)RGBGetBValue(c2),
|
||||
0x00
|
||||
};
|
||||
SendPacket(bN_payload, sizeof(bN_payload));
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Step 3: b6 — commit/apply |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char b6_payload[] = { 0xB6 };
|
||||
SendPacket(b6_payload, sizeof(b6_payload));
|
||||
}
|
||||
|
||||
void GigabyteCastor3Controller::SetOff()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Off = Style 0x01 (Static) with Speed=0 |
|
||||
| From castor3.py: off uses style 0x01, speed_wire=0 |
|
||||
\*---------------------------------------------------------*/
|
||||
std::vector<RGBColor> black;
|
||||
black.push_back(ToRGBColor(0x00, 0x00, 0x00));
|
||||
|
||||
unsigned char c9_payload[] =
|
||||
{
|
||||
0xC9,
|
||||
CASTOR3_STYLE_STATIC,
|
||||
0x00, /* speed_wire = 0 for off */
|
||||
CASTOR3_BRIGHTNESS_DEFAULT,
|
||||
0x02, /* b4 */
|
||||
0x01 /* b5 */
|
||||
};
|
||||
SendPacket(c9_payload, sizeof(c9_payload));
|
||||
|
||||
unsigned char cd_payload[] = { 0xCD, 0x00, 0x00, 0x00 };
|
||||
SendPacket(cd_payload, sizeof(cd_payload));
|
||||
|
||||
unsigned char b6_payload[] = { 0xB6 };
|
||||
SendPacket(b6_payload, sizeof(b6_payload));
|
||||
}
|
||||
|
||||
void GigabyteCastor3Controller::SendPacket(const unsigned char* payload, unsigned int payload_len)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Castor3 HID OUT transport: |
|
||||
| - Byte 0: Report ID (0x99) |
|
||||
| - Bytes 1..6143: payload, zero-padded |
|
||||
| Total write size: 6144 bytes |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char buf[CASTOR3_OUT_TOTAL];
|
||||
memset(buf, 0x00, CASTOR3_OUT_TOTAL);
|
||||
|
||||
buf[0] = CASTOR3_REPORT_ID;
|
||||
|
||||
if(payload_len > CASTOR3_OUT_PAYLOAD)
|
||||
{
|
||||
payload_len = CASTOR3_OUT_PAYLOAD;
|
||||
}
|
||||
|
||||
memcpy(&buf[1], payload, payload_len);
|
||||
|
||||
hid_write(dev, buf, CASTOR3_OUT_TOTAL);
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| GigabyteCastor3Controller.h |
|
||||
| |
|
||||
| Driver for Gigabyte Aorus Waterforce X II 360 AIO |
|
||||
| (Castor3 USB HID controller) |
|
||||
| |
|
||||
| RGB ring control only — LCD not implemented |
|
||||
| |
|
||||
| Protocol reference: castor3.py reverse engineering |
|
||||
| VID=0x0414 PID=0x7A5E Report ID=0x99 |
|
||||
| OUT size: 6144 (report ID + 6143 payload) |
|
||||
| IN size: 255 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <hidapi.h>
|
||||
#include "RGBController.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Castor3 USB IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#define CASTOR3_VID 0x0414
|
||||
#define CASTOR3_PID 0x7A5E
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Castor3 HID transport |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#define CASTOR3_REPORT_ID 0x99
|
||||
#define CASTOR3_OUT_PAYLOAD 6143 /* payload after report ID */
|
||||
#define CASTOR3_OUT_TOTAL 6144 /* report ID + payload */
|
||||
#define CASTOR3_IN_SIZE 255
|
||||
#define CASTOR3_IN_TIMEOUT_MS 2000
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| LED effect style IDs (c9 byte[1]) |
|
||||
| From castor3.py LED_EFFECTS, cross-referenced with |
|
||||
| .cled.dat profile files and led_profile.pcapng |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#define CASTOR3_STYLE_STATIC 0x01
|
||||
#define CASTOR3_STYLE_PULSE 0x02
|
||||
#define CASTOR3_STYLE_CYCLE 0x03
|
||||
#define CASTOR3_STYLE_FLASH 0x04
|
||||
#define CASTOR3_STYLE_DFLASH 0x05
|
||||
#define CASTOR3_STYLE_GRADIENT 0x06
|
||||
#define CASTOR3_STYLE_COLORSHIFT 0x07
|
||||
#define CASTOR3_STYLE_WAVE 0x08
|
||||
#define CASTOR3_STYLE_RAINBOW 0x0A
|
||||
#define CASTOR3_STYLE_TRICOLOR 0x0B
|
||||
#define CASTOR3_STYLE_SPIN 0x0C
|
||||
#define CASTOR3_STYLE_SWITCH 0x0D
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| LED speed range: 1-5 (wire value = speed * 20) |
|
||||
| LED brightness range: 1-10 (direct on wire) |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#define CASTOR3_SPEED_MIN 1
|
||||
#define CASTOR3_SPEED_MAX 5
|
||||
#define CASTOR3_SPEED_DEFAULT 5
|
||||
#define CASTOR3_BRIGHTNESS_MIN 1
|
||||
#define CASTOR3_BRIGHTNESS_MAX 10
|
||||
#define CASTOR3_BRIGHTNESS_DEFAULT 10
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Color type for effects |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
enum castor3_color_type
|
||||
{
|
||||
CASTOR3_COLORS_NONE = 0, /* cycle, wave, rainbow */
|
||||
CASTOR3_COLORS_SINGLE = 1, /* static, pulse, flash... */
|
||||
CASTOR3_COLORS_PALETTE = 2, /* colorshift, tricolor... */
|
||||
};
|
||||
|
||||
class GigabyteCastor3Controller
|
||||
{
|
||||
public:
|
||||
GigabyteCastor3Controller(hid_device* dev_handle, const char* path);
|
||||
~GigabyteCastor3Controller();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetSerialString();
|
||||
std::string GetFirmwareVersion();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| LED effect application |
|
||||
| |
|
||||
| Wire sequence per effect apply: |
|
||||
| c9 [Style] [Speed*20] [Bright] [b4] [b5] |
|
||||
| cd [R] [G] [B] — single-color only |
|
||||
| b0 [Style] [R1G1B1] [R2G2B2] 00 — palette colors 1+2 |
|
||||
| b1 [Style] [R3G3B3] [R4G4B4] 00 — colors 3+4 |
|
||||
| b2 [Style] [R5G5B5] [R6G6B6] 00 — colors 5+6 |
|
||||
| b3 [Style] [R7G7B7] [R8G8B8] 00 — colors 7+8 |
|
||||
| b6 — commit/apply |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
void SetEffect(unsigned char style,
|
||||
unsigned char speed,
|
||||
unsigned char brightness,
|
||||
unsigned char b4,
|
||||
unsigned char b5,
|
||||
castor3_color_type color_type,
|
||||
std::vector<RGBColor> colors);
|
||||
|
||||
void SetOff();
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string firmware_version;
|
||||
|
||||
void SendPacket(const unsigned char* payload, unsigned int payload_len);
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| GigabyteCastor3ControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Gigabyte Aorus Waterforce X II 360 AIO |
|
||||
| (Castor3 USB HID controller) |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "GigabyteCastor3Controller.h"
|
||||
#include "RGBController_GigabyteCastor3.h"
|
||||
|
||||
#define GIGABYTE_CASTOR3_VID 0x0414
|
||||
#define GIGABYTE_CASTOR3_PID 0x7A5E
|
||||
|
||||
DetectedControllers DetectGigabyteCastor3Controllers(hid_device_info* info, const std::string& /*name*/)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
GigabyteCastor3Controller* controller = new GigabyteCastor3Controller(dev, info->path);
|
||||
RGBController_GigabyteCastor3* rgb_controller = new RGBController_GigabyteCastor3(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Gigabyte Aorus Waterforce X II 360", DetectGigabyteCastor3Controllers, GIGABYTE_CASTOR3_VID, GIGABYTE_CASTOR3_PID, 0, 0x0000, 0x0002);
|
||||
@@ -0,0 +1,440 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_GigabyteCastor3.cpp |
|
||||
| |
|
||||
| RGBController for Gigabyte Aorus Waterforce X II 360 |
|
||||
| AIO Cooler (Castor3 controller) |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_GigabyteCastor3.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Gigabyte Aorus Waterforce X II 360
|
||||
@category Cooler
|
||||
@type USB
|
||||
@save :o:
|
||||
@direct :o:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectGigabyteCastor3Controllers
|
||||
@comment Controls the LED ring on the pump head of the
|
||||
Gigabyte Aorus Waterforce X II 360 AIO cooler.
|
||||
Uses the Castor3 USB HID controller (VID 0x0414, PID 0x7A5E).
|
||||
The LED ring and fans share the same controller — they are
|
||||
not independently addressable and follow the same effect.
|
||||
LCD display control is not implemented.
|
||||
No direct/per-LED mode available — all modes are hardware
|
||||
effects with a single color or palette.
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_GigabyteCastor3::RGBController_GigabyteCastor3(GigabyteCastor3Controller* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = "Gigabyte Aorus Waterforce X II 360";
|
||||
vendor = "Gigabyte";
|
||||
type = DEVICE_TYPE_COOLER;
|
||||
description = "Gigabyte Aorus Waterforce X II 360 AIO Cooler";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
version = controller->GetFirmwareVersion();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| All modes from castor3.py LED_EFFECTS (12 effects + off) |
|
||||
| |
|
||||
| The Castor3 has no direct/per-LED mode. All effects are |
|
||||
| hardware-driven, either single-color, palette, or |
|
||||
| firmware-color (no user color). |
|
||||
| |
|
||||
| Speed: 1-5 mapped to MODE_FLAG_HAS_SPEED |
|
||||
| Brightness: 1-10 mapped to MODE_FLAG_HAS_BRIGHTNESS |
|
||||
| |
|
||||
| mode.value stores the style byte for the c9 command. |
|
||||
| mode.speed stores 1-5 (scaled to speed*20 on wire). |
|
||||
| mode.brightness stores 1-10 (direct on wire). |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Off |
|
||||
| Wire: Style=0x01 (Static) with speed_wire=0 |
|
||||
\*---------------------------------------------------------*/
|
||||
mode Off;
|
||||
Off.name = "Off";
|
||||
Off.value = 0xFF; /* sentinel — handled specially */
|
||||
Off.flags = 0;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Off);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Static — single color, no speed |
|
||||
\*---------------------------------------------------------*/
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = CASTOR3_STYLE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
Static.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
Static.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
Static.colors.resize(1);
|
||||
modes.push_back(Static);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Pulse — single color, speed + brightness |
|
||||
\*---------------------------------------------------------*/
|
||||
mode Pulse;
|
||||
Pulse.name = "Pulse";
|
||||
Pulse.value = CASTOR3_STYLE_PULSE;
|
||||
Pulse.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Pulse.speed_min = CASTOR3_SPEED_MIN;
|
||||
Pulse.speed_max = CASTOR3_SPEED_MAX;
|
||||
Pulse.speed = CASTOR3_SPEED_DEFAULT;
|
||||
Pulse.colors_min = 1;
|
||||
Pulse.colors_max = 1;
|
||||
Pulse.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Pulse.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
Pulse.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
Pulse.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
Pulse.colors.resize(1);
|
||||
modes.push_back(Pulse);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Flash — single color, speed + brightness |
|
||||
\*---------------------------------------------------------*/
|
||||
mode Flash;
|
||||
Flash.name = "Flash";
|
||||
Flash.value = CASTOR3_STYLE_FLASH;
|
||||
Flash.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Flash.speed_min = CASTOR3_SPEED_MIN;
|
||||
Flash.speed_max = CASTOR3_SPEED_MAX;
|
||||
Flash.speed = CASTOR3_SPEED_DEFAULT;
|
||||
Flash.colors_min = 1;
|
||||
Flash.colors_max = 1;
|
||||
Flash.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Flash.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
Flash.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
Flash.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
Flash.colors.resize(1);
|
||||
modes.push_back(Flash);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Double Flash — single color, speed + brightness |
|
||||
\*---------------------------------------------------------*/
|
||||
mode DFlash;
|
||||
DFlash.name = "Double Flash";
|
||||
DFlash.value = CASTOR3_STYLE_DFLASH;
|
||||
DFlash.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
DFlash.speed_min = CASTOR3_SPEED_MIN;
|
||||
DFlash.speed_max = CASTOR3_SPEED_MAX;
|
||||
DFlash.speed = CASTOR3_SPEED_DEFAULT;
|
||||
DFlash.colors_min = 1;
|
||||
DFlash.colors_max = 1;
|
||||
DFlash.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
DFlash.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
DFlash.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
DFlash.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
DFlash.colors.resize(1);
|
||||
modes.push_back(DFlash);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Cycle — firmware colors, speed only |
|
||||
\*---------------------------------------------------------*/
|
||||
mode Cycle;
|
||||
Cycle.name = "Spectrum Cycle";
|
||||
Cycle.value = CASTOR3_STYLE_CYCLE;
|
||||
Cycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Cycle.speed_min = CASTOR3_SPEED_MIN;
|
||||
Cycle.speed_max = CASTOR3_SPEED_MAX;
|
||||
Cycle.speed = CASTOR3_SPEED_DEFAULT;
|
||||
Cycle.color_mode = MODE_COLORS_NONE;
|
||||
Cycle.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
Cycle.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
Cycle.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
modes.push_back(Cycle);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Gradient — single color, speed + brightness |
|
||||
| Note: b4 = brightness on wire (special case) |
|
||||
\*---------------------------------------------------------*/
|
||||
mode Gradient;
|
||||
Gradient.name = "Gradient";
|
||||
Gradient.value = CASTOR3_STYLE_GRADIENT;
|
||||
Gradient.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Gradient.speed_min = CASTOR3_SPEED_MIN;
|
||||
Gradient.speed_max = CASTOR3_SPEED_MAX;
|
||||
Gradient.speed = CASTOR3_SPEED_DEFAULT;
|
||||
Gradient.colors_min = 1;
|
||||
Gradient.colors_max = 1;
|
||||
Gradient.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Gradient.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
Gradient.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
Gradient.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
Gradient.colors.resize(1);
|
||||
modes.push_back(Gradient);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Color Shift — 8-color palette, speed + brightness |
|
||||
\*---------------------------------------------------------*/
|
||||
mode ColorShift;
|
||||
ColorShift.name = "Color Shift";
|
||||
ColorShift.value = CASTOR3_STYLE_COLORSHIFT;
|
||||
ColorShift.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
ColorShift.speed_min = CASTOR3_SPEED_MIN;
|
||||
ColorShift.speed_max = CASTOR3_SPEED_MAX;
|
||||
ColorShift.speed = CASTOR3_SPEED_DEFAULT;
|
||||
ColorShift.colors_min = 1;
|
||||
ColorShift.colors_max = 8;
|
||||
ColorShift.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ColorShift.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
ColorShift.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
ColorShift.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
ColorShift.colors.resize(8);
|
||||
ColorShift.colors[0] = ToRGBColor(0xFF, 0x00, 0x00);
|
||||
ColorShift.colors[1] = ToRGBColor(0xFF, 0x72, 0x00);
|
||||
ColorShift.colors[2] = ToRGBColor(0xFF, 0xFF, 0x00);
|
||||
ColorShift.colors[3] = ToRGBColor(0x00, 0xFF, 0x00);
|
||||
ColorShift.colors[4] = ToRGBColor(0x00, 0xFF, 0xFF);
|
||||
ColorShift.colors[5] = ToRGBColor(0x00, 0x00, 0xFF);
|
||||
ColorShift.colors[6] = ToRGBColor(0xFF, 0x00, 0xFF);
|
||||
ColorShift.colors[7] = ToRGBColor(0xFF, 0x80, 0x80);
|
||||
modes.push_back(ColorShift);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Wave — firmware colors, speed only |
|
||||
\*---------------------------------------------------------*/
|
||||
mode Wave;
|
||||
Wave.name = "Wave";
|
||||
Wave.value = CASTOR3_STYLE_WAVE;
|
||||
Wave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Wave.speed_min = CASTOR3_SPEED_MIN;
|
||||
Wave.speed_max = CASTOR3_SPEED_MAX;
|
||||
Wave.speed = CASTOR3_SPEED_DEFAULT;
|
||||
Wave.color_mode = MODE_COLORS_NONE;
|
||||
Wave.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
Wave.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
Wave.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
modes.push_back(Wave);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Rainbow — firmware colors, speed only |
|
||||
\*---------------------------------------------------------*/
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = CASTOR3_STYLE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Rainbow.speed_min = CASTOR3_SPEED_MIN;
|
||||
Rainbow.speed_max = CASTOR3_SPEED_MAX;
|
||||
Rainbow.speed = CASTOR3_SPEED_DEFAULT;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
Rainbow.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
Rainbow.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
Rainbow.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Tri-Color — 3-color palette, speed + brightness |
|
||||
\*---------------------------------------------------------*/
|
||||
mode TriColor;
|
||||
TriColor.name = "Tri-Color";
|
||||
TriColor.value = CASTOR3_STYLE_TRICOLOR;
|
||||
TriColor.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
TriColor.speed_min = CASTOR3_SPEED_MIN;
|
||||
TriColor.speed_max = CASTOR3_SPEED_MAX;
|
||||
TriColor.speed = CASTOR3_SPEED_DEFAULT;
|
||||
TriColor.colors_min = 1;
|
||||
TriColor.colors_max = 3;
|
||||
TriColor.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
TriColor.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
TriColor.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
TriColor.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
TriColor.colors.resize(3);
|
||||
TriColor.colors[0] = ToRGBColor(0x00, 0x00, 0xFF);
|
||||
TriColor.colors[1] = ToRGBColor(0x7D, 0x00, 0xFF);
|
||||
TriColor.colors[2] = ToRGBColor(0xFF, 0x00, 0xFF);
|
||||
modes.push_back(TriColor);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Spin — 3-color palette, speed + brightness |
|
||||
\*---------------------------------------------------------*/
|
||||
mode Spin;
|
||||
Spin.name = "Spin";
|
||||
Spin.value = CASTOR3_STYLE_SPIN;
|
||||
Spin.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Spin.speed_min = CASTOR3_SPEED_MIN;
|
||||
Spin.speed_max = CASTOR3_SPEED_MAX;
|
||||
Spin.speed = CASTOR3_SPEED_DEFAULT;
|
||||
Spin.colors_min = 1;
|
||||
Spin.colors_max = 3;
|
||||
Spin.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Spin.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
Spin.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
Spin.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
Spin.colors.resize(3);
|
||||
Spin.colors[0] = ToRGBColor(0xFF, 0x00, 0xFE);
|
||||
Spin.colors[1] = ToRGBColor(0x00, 0xFF, 0xFB);
|
||||
Spin.colors[2] = ToRGBColor(0xFF, 0xFF, 0x00);
|
||||
modes.push_back(Spin);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Switch — 2-color palette, speed + brightness |
|
||||
\*---------------------------------------------------------*/
|
||||
mode Switch;
|
||||
Switch.name = "Switch";
|
||||
Switch.value = CASTOR3_STYLE_SWITCH;
|
||||
Switch.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Switch.speed_min = CASTOR3_SPEED_MIN;
|
||||
Switch.speed_max = CASTOR3_SPEED_MAX;
|
||||
Switch.speed = CASTOR3_SPEED_DEFAULT;
|
||||
Switch.colors_min = 1;
|
||||
Switch.colors_max = 2;
|
||||
Switch.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Switch.brightness_min = CASTOR3_BRIGHTNESS_MIN;
|
||||
Switch.brightness_max = CASTOR3_BRIGHTNESS_MAX;
|
||||
Switch.brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
Switch.colors.resize(2);
|
||||
Switch.colors[0] = ToRGBColor(0xFF, 0x00, 0xFE);
|
||||
Switch.colors[1] = ToRGBColor(0x00, 0xFF, 0xFB);
|
||||
modes.push_back(Switch);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_GigabyteCastor3::~RGBController_GigabyteCastor3()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_GigabyteCastor3::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Single zone: LED ring + fans (not independently |
|
||||
| addressable — fans follow the pump ring effect) |
|
||||
| |
|
||||
| This is a SINGLE zone because the protocol does not |
|
||||
| expose per-LED addressing. All LEDs display the same |
|
||||
| hardware effect simultaneously. |
|
||||
\*---------------------------------------------------------*/
|
||||
zone led_ring;
|
||||
led_ring.name = "LED Ring";
|
||||
led_ring.type = ZONE_TYPE_SINGLE;
|
||||
led_ring.leds_min = 1;
|
||||
led_ring.leds_max = 1;
|
||||
led_ring.leds_count = 1;
|
||||
zones.push_back(led_ring);
|
||||
|
||||
led new_led;
|
||||
new_led.name = "LED Ring";
|
||||
leds.push_back(new_led);
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_GigabyteCastor3::DeviceUpdateLEDs()
|
||||
{
|
||||
DeviceUpdateMode();
|
||||
}
|
||||
|
||||
void RGBController_GigabyteCastor3::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_GigabyteCastor3::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_GigabyteCastor3::DeviceUpdateMode()
|
||||
{
|
||||
unsigned char style = (unsigned char)modes[active_mode].value;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Handle Off mode (sentinel value 0xFF) |
|
||||
\*---------------------------------------------------------*/
|
||||
if(style == 0xFF)
|
||||
{
|
||||
controller->SetOff();
|
||||
return;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Determine speed, brightness, b4, b5, and color type |
|
||||
| from the effect lookup table matching castor3.py |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char speed = CASTOR3_SPEED_DEFAULT;
|
||||
unsigned char brightness = CASTOR3_BRIGHTNESS_DEFAULT;
|
||||
|
||||
if(modes[active_mode].flags & MODE_FLAG_HAS_SPEED)
|
||||
{
|
||||
speed = (unsigned char)modes[active_mode].speed;
|
||||
}
|
||||
|
||||
if(modes[active_mode].flags & MODE_FLAG_HAS_BRIGHTNESS)
|
||||
{
|
||||
brightness = (unsigned char)modes[active_mode].brightness;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Look up b4, b5, and color_type per effect |
|
||||
| These match the LED_EFFECTS dict in castor3.py |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char b4 = 0x02;
|
||||
unsigned char b5 = 0x01;
|
||||
castor3_color_type color_type = CASTOR3_COLORS_NONE;
|
||||
|
||||
switch(style)
|
||||
{
|
||||
case CASTOR3_STYLE_STATIC:
|
||||
case CASTOR3_STYLE_PULSE:
|
||||
case CASTOR3_STYLE_FLASH:
|
||||
case CASTOR3_STYLE_DFLASH:
|
||||
b4 = 0x02;
|
||||
b5 = 0x01;
|
||||
color_type = CASTOR3_COLORS_SINGLE;
|
||||
break;
|
||||
|
||||
case CASTOR3_STYLE_GRADIENT:
|
||||
/*-------------------------------------------------*\
|
||||
| Gradient: b4 = brightness on wire (special case) |
|
||||
\*-------------------------------------------------*/
|
||||
b4 = brightness;
|
||||
b5 = 0x01;
|
||||
color_type = CASTOR3_COLORS_SINGLE;
|
||||
break;
|
||||
|
||||
case CASTOR3_STYLE_CYCLE:
|
||||
case CASTOR3_STYLE_WAVE:
|
||||
case CASTOR3_STYLE_RAINBOW:
|
||||
b4 = 0x02;
|
||||
b5 = 0x01;
|
||||
color_type = CASTOR3_COLORS_NONE;
|
||||
break;
|
||||
|
||||
case CASTOR3_STYLE_COLORSHIFT:
|
||||
b4 = 0x08; /* ClrCount=8 */
|
||||
b5 = 0x02; /* CmbIndex+1=2 */
|
||||
color_type = CASTOR3_COLORS_PALETTE;
|
||||
break;
|
||||
|
||||
case CASTOR3_STYLE_TRICOLOR:
|
||||
case CASTOR3_STYLE_SPIN:
|
||||
b4 = 0x02;
|
||||
b5 = 0x01;
|
||||
color_type = CASTOR3_COLORS_PALETTE;
|
||||
break;
|
||||
|
||||
case CASTOR3_STYLE_SWITCH:
|
||||
b4 = 0x02;
|
||||
b5 = 0x01;
|
||||
color_type = CASTOR3_COLORS_PALETTE;
|
||||
break;
|
||||
}
|
||||
|
||||
controller->SetEffect(style, speed, brightness, b4, b5,
|
||||
color_type, modes[active_mode].colors);
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_GigabyteCastor3.h |
|
||||
| |
|
||||
| RGBController for Gigabyte Aorus Waterforce X II 360 |
|
||||
| AIO Cooler (Castor3 controller) |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "GigabyteCastor3Controller.h"
|
||||
|
||||
class RGBController_GigabyteCastor3 : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_GigabyteCastor3(GigabyteCastor3Controller* controller_ptr);
|
||||
~RGBController_GigabyteCastor3();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
GigabyteCastor3Controller* controller;
|
||||
};
|
||||
+17
-2
@@ -68,9 +68,14 @@ void RGBFusion2BlackwellGPUController::SetMode(uint8_t type, uint8_t zone, uint8
|
||||
if(zone_config.numberOfColors > 0)
|
||||
{
|
||||
int currentPos = 12;
|
||||
if(gpu_layout == RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5080_LAYOUT)
|
||||
switch(gpu_layout)
|
||||
{
|
||||
currentPos = 11;
|
||||
case RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5080_LAYOUT:
|
||||
case RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5090D_V2_ICE_LAYOUT:
|
||||
currentPos = 11;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
for(uint8_t i = 0; i < zone_config.numberOfColors; i++)
|
||||
@@ -90,6 +95,16 @@ void RGBFusion2BlackwellGPUController::SetZone(uint8_t zone, uint8_t mode, fusio
|
||||
if(mode == RGB_FUSION2_BLACKWELL_GPU_MODE_BREATHING)
|
||||
zone_config.brightness = RGB_FUSION2_BLACKWELL_GPU_BRIGHTNESS_MAX;
|
||||
|
||||
switch(gpu_layout)
|
||||
{
|
||||
case RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5090D_V2_ICE_LAYOUT:
|
||||
if(mode == RGB_FUSION2_BLACKWELL_GPU_MODE_DIRECT)
|
||||
mode = RGB_FUSION2_BLACKWELL_GPU_MODE_STATIC;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
uint8_t type = RGB_FUSION2_BLACKWELL_GPU_REG_COLOR;
|
||||
if(mode != RGB_FUSION2_BLACKWELL_GPU_MODE_DIRECT)
|
||||
type = RGB_FUSION2_BLACKWELL_GPU_REG_MODE;
|
||||
|
||||
+6
-5
@@ -62,11 +62,12 @@ enum
|
||||
|
||||
enum
|
||||
{
|
||||
RGB_FUSION2_BLACKWELL_GPU_SINGLE_ZONE = 0,
|
||||
RGB_FUSION2_BLACKWELL_GPU_GAMING_LAYOUT = 1,
|
||||
RGB_FUSION2_BLACKWELL_GPU_WATERFORCE_LAYOUT = 2,
|
||||
RGB_FUSION2_BLACKWELL_GPU_AORUS_WATERFORCE_LAYOUT = 3,
|
||||
RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5080_LAYOUT = 4,
|
||||
RGB_FUSION2_BLACKWELL_GPU_SINGLE_ZONE = 0,
|
||||
RGB_FUSION2_BLACKWELL_GPU_GAMING_LAYOUT = 1,
|
||||
RGB_FUSION2_BLACKWELL_GPU_WATERFORCE_LAYOUT = 2,
|
||||
RGB_FUSION2_BLACKWELL_GPU_AORUS_WATERFORCE_LAYOUT = 3,
|
||||
RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5080_LAYOUT = 4,
|
||||
RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5090D_V2_ICE_LAYOUT = 5,
|
||||
};
|
||||
|
||||
class RGBFusion2BlackwellGPUController
|
||||
|
||||
+33
-25
@@ -1,4 +1,4 @@
|
||||
/*---------------------------------------------------------*\
|
||||
/*---------------------------------------------------------*\
|
||||
| GigabyteRGBFusion2BlackwellGPUControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Gigabyte RGB Fusion 2 Blackwell GPU |
|
||||
@@ -105,34 +105,42 @@ DetectedControllers DetectGigabyteRGBFusion2BlackwellAorusMaster5080LayoutGPUCon
|
||||
return(DetectGigabyteRGBFusion2BlackwellGPUControllers(bus, i2c_addr, name, RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5080_LAYOUT));
|
||||
}
|
||||
|
||||
DetectedControllers DetectGigabyteRGBFusion2BlackwellAorusMaster5090DV2IceLayoutGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_addr, const std::string& name)
|
||||
{
|
||||
return(DetectGigabyteRGBFusion2BlackwellGPUControllers(bus, i2c_addr, name, RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5090D_V2_ICE_LAYOUT));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Nvidia GPUs |
|
||||
\*---------------------------------------------------------*/
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5060 Ti Gaming OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5060TI_GAMING_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Aero OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070_AERO_OC_12G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Eagle OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070_EAGLE_OC_12G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Gaming OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070_GAMING_OC_12G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Ti Eagle OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070TI_EAGLE_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Ti Eagle OC ICE", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070TI_EAGLE_OC_ICE_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Ti Aero OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070TI_AERO_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Ti Gaming OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070TI_GAMING_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5080 Aero OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5080_AERO_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5080 Gaming OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5080_GAMING_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 5080 MASTER", DetectGigabyteRGBFusion2BlackwellAorusMaster5080LayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX5080_MASTER_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 5080 XTREME WATERFORCE", DetectGigabyteRGBFusion2BlackwellAorusWaterforceLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX5080_XTREME_WATERFORCE_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5080 XTREME WATERFORCE", DetectGigabyteRGBFusion2BlackwellWaterforceLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5080_XTREME_WATERFORCE_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5090 Gaming OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5090_GAMING_OC_32G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5090 XTREME WATERFORCE", DetectGigabyteRGBFusion2BlackwellWaterforceLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5090_XTREME_WATERFORCE_32G_SUB_DEV1, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5090 XTREME WATERFORCE", DetectGigabyteRGBFusion2BlackwellWaterforceLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5090_XTREME_WATERFORCE_32G_SUB_DEV2, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 5090 MASTER", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX5090_MASTER_32G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 5090 MASTER ICE", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX5090_MASTER_ICE_32G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5060 Ti Gaming OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5060TI_GAMING_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Aero OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070_AERO_OC_12G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Eagle OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070_EAGLE_OC_12G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Eagle OC ICE", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070_EAGLE_OC_ICE_12G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Gaming OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070_GAMING_OC_12G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Ti Eagle OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070TI_EAGLE_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Ti Eagle OC ICE", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070TI_EAGLE_OC_ICE_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Ti Aero OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070TI_AERO_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5070 Ti Gaming OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5070TI_GAMING_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5080 Aero OC", DetectGigabyteRGBFusion2BlackwellSingleZoneGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5080_AERO_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5080 Gaming OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5080_GAMING_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 5080 MASTER", DetectGigabyteRGBFusion2BlackwellAorusMaster5080LayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX5080_MASTER_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 5080 XTREME WATERFORCE", DetectGigabyteRGBFusion2BlackwellAorusWaterforceLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX5080_XTREME_WATERFORCE_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5080 XTREME WATERFORCE", DetectGigabyteRGBFusion2BlackwellWaterforceLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5080_XTREME_WATERFORCE_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 5080 MASTER ICE", DetectGigabyteRGBFusion2BlackwellAorusMaster5080LayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5080_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX5080_MASTER_ICE_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5090 Gaming OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5090_GAMING_OC_32G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5090 XTREME WATERFORCE", DetectGigabyteRGBFusion2BlackwellWaterforceLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5090_XTREME_WATERFORCE_32G_SUB_DEV1, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 5090 XTREME WATERFORCE", DetectGigabyteRGBFusion2BlackwellWaterforceLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX5090_XTREME_WATERFORCE_32G_SUB_DEV2, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 5090 MASTER", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX5090_MASTER_32G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 5090 MASTER ICE", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX5090_MASTER_ICE_32G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 5090 D V2 MASTER ICE", DetectGigabyteRGBFusion2BlackwellAorusMaster5090DV2IceLayoutGPUControllers, NVIDIA_VEN, NVIDIA_RTX5090D_V2_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RTX5090D_V2_MASTER_ICE_24G_SUB_DEV, 0x75);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| AMD GPUs |
|
||||
\*---------------------------------------------------------*/
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 9060 XT GAMING", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI44_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX9060XT_GAMING_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 9060 XT GAMING OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI44_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX9060XT_GAMING_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS Radeon RX 9070 XT Elite", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RX9070XT_ELITE_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 9070 XT GAMING OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX9070XT_GAMING_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 9070 XT GAMING OC ICE", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX9070XT_GAMING_OC_ICE_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 9070 XT GAMING", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX9070XT_GAMING_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 9060 XT GAMING", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI44_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX9060XT_GAMING_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 9060 XT GAMING OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI44_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX9060XT_GAMING_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS Radeon RX 9070 XT Elite", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RX9070XT_ELITE_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 9070 XT GAMING OC", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX9070XT_GAMING_OC_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 9070 XT GAMING OC ICE", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX9070XT_GAMING_OC_ICE_16G_SUB_DEV, 0x75);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 9070 XT GAMING", DetectGigabyteRGBFusion2BlackwellGamingLayoutGPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX9070XT_GAMING_16G_SUB_DEV, 0x75);
|
||||
|
||||
+49
-1
@@ -395,6 +395,49 @@ void RGBController_RGBFusion2BlackwellGPU::SetupZones()
|
||||
leds.push_back(top_led);
|
||||
}
|
||||
|
||||
else if(gpu_layout == RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5090D_V2_ICE_LAYOUT)
|
||||
{
|
||||
const char * fan_names[] = { "Right Fan", "Left Fan", "Middle Fan" };
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
zone fan_zone;
|
||||
fan_zone.name = fan_names[i];
|
||||
fan_zone.type = ZONE_TYPE_SINGLE;
|
||||
fan_zone.leds_min = 1;
|
||||
fan_zone.leds_max = 1;
|
||||
fan_zone.leds_count = 1;
|
||||
zones.push_back(fan_zone);
|
||||
|
||||
led new_led;
|
||||
new_led.name = fan_names[i];
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
zone backplate;
|
||||
backplate.name = "Backplate";
|
||||
backplate.type = ZONE_TYPE_SINGLE;
|
||||
backplate.leds_min = 1;
|
||||
backplate.leds_max = 1;
|
||||
backplate.leds_count = 1;
|
||||
zones.push_back(backplate);
|
||||
|
||||
led bp_led;
|
||||
bp_led.name = "Backplate";
|
||||
leds.push_back(bp_led);
|
||||
|
||||
zone side_logo;
|
||||
side_logo.name = "Side Logo";
|
||||
side_logo.type = ZONE_TYPE_SINGLE;
|
||||
side_logo.leds_min = 1;
|
||||
side_logo.leds_max = 1;
|
||||
side_logo.leds_count = 1;
|
||||
zones.push_back(side_logo);
|
||||
|
||||
led sl_led;
|
||||
sl_led.name = "Side Logo";
|
||||
leds.push_back(sl_led);
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
@@ -434,6 +477,10 @@ void RGBController_RGBFusion2BlackwellGPU::DeviceUpdateLEDs()
|
||||
gpu_zones = 6; // Zones 4 and 5 refer to ui zone 4
|
||||
break;
|
||||
|
||||
case RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5090D_V2_ICE_LAYOUT:
|
||||
gpu_zones = 6;
|
||||
break;
|
||||
|
||||
default:
|
||||
LOG_TRACE("[%s] Invalid GPU layout (%d) when updating LEDs.", name.c_str(), gpu_layout);
|
||||
return; // should not happen
|
||||
@@ -460,7 +507,8 @@ void RGBController_RGBFusion2BlackwellGPU::DeviceUpdateLEDs()
|
||||
}
|
||||
ui_zone_idx = zone_idx - 1; // Map: HW zone 1->UI zone 0, HW zone 2->UI zone 1, HW zone 3->UI zone 2, HW zone 4->UI zone 3
|
||||
}
|
||||
else if(gpu_layout == RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5080_LAYOUT)
|
||||
else if(gpu_layout == RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5080_LAYOUT ||
|
||||
gpu_layout == RGB_FUSION2_BLACKWELL_GPU_AORUS_MASTER_5090D_V2_ICE_LAYOUT)
|
||||
{
|
||||
if(zone_idx == 5)
|
||||
{
|
||||
|
||||
@@ -135,6 +135,7 @@ REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 3090 XTREME WATERFORCE",
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 3090 XTREME WATERFORCE WB", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX3090_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX3090_XTREME_WATERFORCE_WB_SUB_DEV, 0x64);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 4070 GAMING OC", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX4070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX4070_GAMING_OC_12G, 0x71);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 4070 GAMING OC", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX4070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX4070_GAMING_OC_12G_V2, 0x71);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 4070 GAMING OC", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX4070_AD103_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX4070_GAMING_OC_12G_V2, 0x71);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Geforce RTX 4070 Aero OC", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX4070_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX4070_AERO_OC_12G_SUB_DEV, 0x71);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 4070 SUPER GAMING OC", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX4070S_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX4070S_GAMING_OC_12G, 0x71);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte GeForce RTX 4070 SUPER Aero OC", DetectGigabyteRGBFusion2GPUControllers, NVIDIA_VEN, NVIDIA_RTX4070S_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RTX4070S_AERO_OC_12G, 0x71);
|
||||
@@ -169,13 +170,16 @@ REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS GeForce RTX 5090 MASTER ICE",
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 7600 GAMING OC 8G", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI33_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX7600_GAMING_OC_8G_SUB_DEV, 0x55);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 7600 GAMING OC 8G", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI33_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX7600_GAMING_OC_8G_SUB_DEV2, 0x55);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 7600 XT GAMING OC 16G", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI33_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX7600XT_GAMING_OC_16G_SUB_DEV, 0x55);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 6700 XT EAGLE 12G", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI22_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX6700XT_EAGLE_12G_SUB_DEV, 0x63);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 6700 XT GAMING OC 12G", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI22_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX6700XT_GAMING_OC_12G_SUB_DEV, 0x62);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 6800 XT GAMING OC", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI21_DEV1, GIGABYTE_SUB_VEN, GIGABYTE_RX6800XT_GAMING_OC_SUB_DEV, 0x62);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 6900 XT GAMING OC", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI21_DEV1, GIGABYTE_SUB_VEN, GIGABYTE_RX6900XT_GAMING_OC_SUB_DEV, 0x62);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 7700 XT GAMING OC", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI32_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX7700XT_GAMING_OC_SUB_DEV, 0x62);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 7800 XT GAMING OC", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI32_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX7800XT_GAMING_OC_16G_SUB_DEV, 0x62);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 7900 GRE GAMING OC", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX7900GRE_GAMING_OC_16G_SUB_DEV, 0x62);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 7900 XT GAMING OC", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX7900XT_GAMING_OC_20G_SUB_DEV, 0x62);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte Radeon RX 7900 XTX GAMING OC", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, GIGABYTE_SUB_VEN, GIGABYTE_RX7900XTX_GAMING_OC_24G_SUB_DEV, 0x62);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS Radeon RX 7900 XTX ELITE 24G", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI31_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RX7900XTX_ELITE_24G_SUB_DEV, 0x71);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS RX 6750 XT ELITE 12G", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI22_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RX_6750_XT_ELITE_12G_SUB_DEV, 0x70);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS RX 6900 XT EXTREME WATERFORCE WB", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI21_DEV2, GIGABYTE_SUB_VEN, GIGABYTE_RX6900XT_XTREME_WATERFORCE_WB_SUB_DEV, 0x70);
|
||||
REGISTER_I2C_PCI_DETECTOR("Gigabyte AORUS Radeon RX 9070 XT Elite", DetectGigabyteRGBFusion2GPUControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, GIGABYTE_SUB_VEN, GIGABYTE_AORUS_RX9070XT_ELITE_16G_SUB_DEV, 0x73);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,7 @@
|
||||
#include <map>
|
||||
#include "RGBController.h"
|
||||
|
||||
#define GB_FUSION2_ZONES_MAX 8
|
||||
#define GB_FUSION2_ZONES_MAX 12
|
||||
|
||||
/*--------------------------------------------------------*\
|
||||
| Base LED mappings found on all controllers. |
|
||||
@@ -89,6 +89,23 @@ const FwdLedHeaders LedLookup =
|
||||
\*-------------------------------------------------*/
|
||||
};
|
||||
|
||||
/*--------------------------------------------------------*\
|
||||
| The layout_id masks for supported effects. |
|
||||
\*--------------------------------------------------------*/
|
||||
enum GB_LID_EFFECTS_MASKS : uint32_t
|
||||
{
|
||||
GB_EFF_BREATH = 0x001,
|
||||
GB_EFF_BEAT = 0x002,
|
||||
GB_EFF_CYCLE = 0x004,
|
||||
GB_EFF_FLASH = 0x008,
|
||||
GB_EFF_RANDOM = 0x010,
|
||||
GB_EFF_WAVE = 0x020,
|
||||
GB_EFF_DFLASH = 0x040,
|
||||
GB_EFF_WAVE1 = 0x080,
|
||||
GB_EFF_WAVE2 = 0x100,
|
||||
GB_EFF_CORE_MASK = 0x1FF
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GB_FUSION2_LED_IDX idx;
|
||||
|
||||
@@ -64,7 +64,7 @@ RGBFusion2USBController::RGBFusion2USBController(hid_device* handle, const char*
|
||||
{
|
||||
return;
|
||||
}
|
||||
if(report.support_cmd_flag >= 0x02)
|
||||
if(report.support_cmd_flag & 0x02)
|
||||
{
|
||||
EnableLampArray(false);
|
||||
}
|
||||
@@ -95,10 +95,9 @@ bool RGBFusion2USBController::RefreshHardwareInfo()
|
||||
return false;
|
||||
}
|
||||
|
||||
IT8297Report report;
|
||||
std::memcpy(&report, buffer, sizeof(IT8297Report));
|
||||
report_loaded = true;
|
||||
|
||||
device_num = report.device_num;
|
||||
description = std::string(report.str_product, 28);
|
||||
if(std::string::iterator nul = std::find(description.begin(), description.end(), '\0');
|
||||
nul != description.end())
|
||||
@@ -318,7 +317,7 @@ bool RGBFusion2USBController::SetCalibration(const EncodedCalibration& cal, bool
|
||||
cal_data.mainboard = desired.c.rgb_cali;
|
||||
cal_data.spare[0] = desired.c.c_spare0;
|
||||
cal_data.spare[1] = desired.c.c_spare1;
|
||||
|
||||
|
||||
if(product_id == 0x5711)
|
||||
{
|
||||
cal_data.dled[2] = desired.c.d_strip_c2;
|
||||
@@ -362,12 +361,22 @@ void RGBFusion2USBController::SetLedCount(unsigned int c0, unsigned int c1, unsi
|
||||
\*---------------------------------------------------------*/
|
||||
bool RGBFusion2USBController::SetStripBuiltinEffectState(int hdr, bool enable)
|
||||
{
|
||||
static bool first_call = true;
|
||||
int bitmask = 0;
|
||||
|
||||
if(hdr == -1)
|
||||
{
|
||||
bitmask = 0x01 | 0x02 | 0x08 | 0x10;
|
||||
switch(product_id)
|
||||
{
|
||||
case 0xa100:
|
||||
bitmask = 0x01;
|
||||
break;
|
||||
case 0x5711:
|
||||
bitmask = 0x01 | 0x02 | 0x08 | 0x10;
|
||||
break;
|
||||
default:
|
||||
bitmask = 0x01 | 0x02;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -392,16 +401,14 @@ bool RGBFusion2USBController::SetStripBuiltinEffectState(int hdr, bool enable)
|
||||
}
|
||||
}
|
||||
|
||||
int new_effect_disabled = enable
|
||||
? (effect_disabled & ~bitmask)
|
||||
: (effect_disabled | bitmask);
|
||||
|
||||
if(!first_call && new_effect_disabled == effect_disabled)
|
||||
int base_mask = (effect_disabled < 0) ? 0 : effect_disabled;
|
||||
int new_effect_disabled = enable
|
||||
? (base_mask & ~bitmask)
|
||||
: (base_mask | bitmask);
|
||||
if(effect_disabled >= 0 && new_effect_disabled == effect_disabled)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
first_call = false;
|
||||
effect_disabled = new_effect_disabled;
|
||||
int res = SendCCReport(0x32, effect_disabled);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(50));
|
||||
@@ -439,10 +446,14 @@ bool RGBFusion2USBController::EnableLampArray(bool enable)
|
||||
{
|
||||
return SendCCReport(0x48, enable ? 1 : 0);
|
||||
}
|
||||
|
||||
|
||||
std::string RGBFusion2USBController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
if(product_id == 0xa100)
|
||||
{
|
||||
return ("GC-USB");
|
||||
}
|
||||
return (name);
|
||||
}
|
||||
|
||||
std::string RGBFusion2USBController::GetDeviceDescription()
|
||||
@@ -703,3 +714,135 @@ void RGBFusion2USBController::ResetController()
|
||||
}
|
||||
ApplyEffect(true);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Check controller for gen2 ARGB support |
|
||||
| Checks for supported device number |
|
||||
| Then checks for supported controllers |
|
||||
| Then checks for supported feature bit (SaveLEDState) |
|
||||
| Finally checks for strip detection value. |
|
||||
\*---------------------------------------------------------*/
|
||||
bool RGBFusion2USBController::SupportsGen2() const
|
||||
{
|
||||
bool supports_gen2 = false;
|
||||
|
||||
supports_gen2 = (device_num == 0x00)
|
||||
&& (product_id == 0x5702 || product_id==0x5711 || product_id==0x8950)
|
||||
&& (report.support_cmd_flag & 0x01)
|
||||
&& (report.strip_detect == 0x01);
|
||||
|
||||
return supports_gen2;
|
||||
}
|
||||
|
||||
std::vector<Gen2StripInfo> RGBFusion2USBController::ExportGen2Strips() const
|
||||
{
|
||||
size_t count = (product_id == 0x5711) ? 4u : 2u;
|
||||
std::vector<Gen2StripInfo> out;
|
||||
out.reserve(count);
|
||||
for(size_t i = 0; i < count; ++i)
|
||||
{
|
||||
out.push_back(g2_strip_info[i]);
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Scan Headers for Gen2 Devices |
|
||||
\*---------------------------------------------------------*/
|
||||
bool RGBFusion2USBController::ScanGen2Strips(uint8_t enabled_headers)
|
||||
{
|
||||
for(unsigned int i = 0; i < 4; ++i)
|
||||
{
|
||||
if(g2_strip_info[i].LedsOfStrip.capacity() < 15)
|
||||
{
|
||||
g2_strip_info[i].LedsOfStrip.reserve(15);
|
||||
}
|
||||
|
||||
g2_strip_info[i].numStrip = 0;
|
||||
g2_strip_info[i].totalLeds = 0;
|
||||
g2_strip_info[i].LedsOfStrip.clear();
|
||||
}
|
||||
|
||||
const unsigned int hdr_lim = (product_id == 0x5711) ? 4u : 2u;
|
||||
|
||||
for(unsigned int slot = 0; slot < hdr_lim; ++slot)
|
||||
{
|
||||
if(!(enabled_headers & (1U << slot)))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
static constexpr uint8_t delta[4] = {4, 5, 0, 1};
|
||||
|
||||
uint8_t scan_cmd = GEN2_LED_BASE_SCAN + delta[slot];
|
||||
uint8_t info_cmd = scan_cmd + 2;
|
||||
|
||||
if(!SendCCReport(scan_cmd, 0x00, 0x00))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(700));
|
||||
|
||||
if(!SendCCReport(info_cmd, 0x00, 0x00))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
unsigned char feat_buf[64] = {0};
|
||||
feat_buf[0] = report_id;
|
||||
|
||||
int recv_len = hid_get_feature_report
|
||||
(
|
||||
dev,
|
||||
feat_buf,
|
||||
sizeof(feat_buf)
|
||||
);
|
||||
|
||||
if(recv_len < 64)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
int seg_count = feat_buf[1];
|
||||
|
||||
if(seg_count > 15)
|
||||
{
|
||||
seg_count = 15;
|
||||
}
|
||||
|
||||
Gen2StripInfo& dst = g2_strip_info[slot];
|
||||
dst.numStrip = seg_count;
|
||||
dst.LedsOfStrip.resize(seg_count);
|
||||
uint32_t total_leds = 0;
|
||||
const int counts_base = 2;
|
||||
|
||||
for(int k = 0; k < seg_count; ++k)
|
||||
{
|
||||
const int off = counts_base + (k * 2);
|
||||
uint16_t lo = feat_buf[off];
|
||||
uint16_t hi = feat_buf[off + 1];
|
||||
uint16_t cnt = lo | (hi << 8);
|
||||
dst.LedsOfStrip[k] = cnt;
|
||||
total_leds += cnt;
|
||||
}
|
||||
|
||||
dst.totalLeds = total_leds;
|
||||
|
||||
SetLedCount(0, 0, 0, 0);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(20));
|
||||
|
||||
SaveLEDState(false);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(20));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Check controller for persistent state support |
|
||||
\*---------------------------------------------------------*/
|
||||
bool RGBFusion2USBController::SupportsSaveLEDState() const
|
||||
{
|
||||
return(report_loaded && (report.support_cmd_flag & 0x01));
|
||||
}
|
||||
|
||||
@@ -21,6 +21,11 @@
|
||||
|
||||
#define FUSION2_USB_BUFFER_SIZE 64
|
||||
|
||||
/*--------------------------------------------------------*\
|
||||
| Gen2 scan/info opcode base |
|
||||
\*--------------------------------------------------------*/
|
||||
#define GEN2_LED_BASE_SCAN 0x38
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Effects mode list |
|
||||
\*---------------------------------------------------------*/
|
||||
@@ -83,6 +88,16 @@ struct EncodedCalibration
|
||||
std::string mainboard;
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| High level struct to contain Gen2 Header Data |
|
||||
\*---------------------------------------------------------*/
|
||||
struct Gen2StripInfo
|
||||
{
|
||||
uint8_t numStrip = 0;
|
||||
std::vector<uint16_t> LedsOfStrip;
|
||||
uint32_t totalLeds = 0;
|
||||
};
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
@@ -219,6 +234,10 @@ union PktEffect
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
|
||||
e.report_id = report_id;
|
||||
if(pid ==0xA100)
|
||||
{
|
||||
led = -1;
|
||||
}
|
||||
if(led == -1)
|
||||
{
|
||||
e.zone0 = (pid == 0x5711) ? 0x07FF : 0xFF;
|
||||
@@ -321,6 +340,10 @@ public:
|
||||
void SetLEDEffect(int led, int mode, unsigned int speed, unsigned char brightness, bool random, uint32_t* color);
|
||||
bool SetStripBuiltinEffectState(int hdr, bool enable);
|
||||
void SetStripColors(unsigned int hdr, RGBColor * colors, unsigned int num_colors, int single_led = -1);
|
||||
bool SupportsGen2() const;
|
||||
bool ScanGen2Strips(uint8_t hdr_mask);
|
||||
bool SaveLEDState(bool enable);
|
||||
bool SupportsSaveLEDState() const;
|
||||
|
||||
EncodedCalibration GetCalibration(bool refresh_from_hw = false);
|
||||
std::string GetDeviceName();
|
||||
@@ -330,6 +353,8 @@ public:
|
||||
std::string GetFWVersion();
|
||||
uint16_t GetProductID();
|
||||
std::string GetSerial();
|
||||
std::vector<Gen2StripInfo> ExportGen2Strips() const;
|
||||
Gen2StripInfo g2_strip_info[4];
|
||||
|
||||
private:
|
||||
std::string DecodeCalibrationBuffer(uint32_t value) const;
|
||||
@@ -338,14 +363,13 @@ private:
|
||||
uint32_t EncodeCalibrationBuffer(const std::string& rgb_order);
|
||||
bool RefreshHardwareInfo();
|
||||
void ResetController();
|
||||
bool SaveLEDState(bool enable);
|
||||
bool SaveCalState();
|
||||
bool SendCCReport(uint8_t a, uint8_t b, uint8_t c = 0);
|
||||
bool SendReport(uint8_t id, uint8_t a, uint8_t b, uint8_t c = 0);
|
||||
int SendPacket(unsigned char* packet);
|
||||
|
||||
hid_device* dev;
|
||||
int device_num;
|
||||
uint8_t device_num;
|
||||
uint16_t product_id;
|
||||
uint32_t effect_zone_mask = 0;
|
||||
int mode;
|
||||
@@ -356,7 +380,7 @@ private:
|
||||
std::string location;
|
||||
std::string version;
|
||||
std::string chip_id;
|
||||
int effect_disabled = 0;
|
||||
int effect_disabled = -1;
|
||||
int report_id = 0xCC;
|
||||
bool report_loaded = false;
|
||||
bool cali_loaded = false;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#define DETECTOR_NAME "Gigabyte RGB Fusion 2 USB"
|
||||
|
||||
#define GC_USB_VID 0x0414
|
||||
#define IT8297_VID 0x048D
|
||||
#define IT8297_IFC 0
|
||||
#define IT8297_U 0xCC
|
||||
@@ -47,3 +48,4 @@ REGISTER_HID_DETECTOR_PU(DETECTOR_NAME, DetectGigabyteRGBFusion2USBControllers,
|
||||
REGISTER_HID_DETECTOR_PU(DETECTOR_NAME, DetectGigabyteRGBFusion2USBControllers, IT8297_VID, 0x8950, IT8297_UPG, IT8297_U);
|
||||
REGISTER_HID_DETECTOR_PU(DETECTOR_NAME, DetectGigabyteRGBFusion2USBControllers, IT8297_VID, 0x5702, IT8297_UPG, IT8297_U);
|
||||
REGISTER_HID_DETECTOR_PU(DETECTOR_NAME, DetectGigabyteRGBFusion2USBControllers, IT8297_VID, 0x5711, IT8297_UPG, IT8297_U);
|
||||
REGISTER_HID_DETECTOR_PU(DETECTOR_NAME, DetectGigabyteRGBFusion2USBControllers, GC_USB_VID, 0xa100, IT8297_UPG, IT8297_U);
|
||||
|
||||
+611
-141
File diff suppressed because it is too large
Load Diff
@@ -57,22 +57,33 @@ public:
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
void DeviceUpdateZoneMode(int zone);
|
||||
void DeviceSaveMode() override;
|
||||
|
||||
private:
|
||||
std::string detector_name;
|
||||
|
||||
RGBFusion2USBController* controller;
|
||||
int device_num;
|
||||
uint8_t device_num;
|
||||
RGBColor null_color = 0;
|
||||
bool supports_gen2 = 0;
|
||||
/*---------------------------------------------------------*\
|
||||
| The intial value of device_index should point to the |
|
||||
| layout for the generic_device |
|
||||
\*---------------------------------------------------------*/
|
||||
uint32_t device_index = 0;
|
||||
|
||||
uint16_t product_id = 0;
|
||||
uint32_t effects_mask = 0;
|
||||
void Init_Controller();
|
||||
int GetLED_Zone(int led_idx);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Per instance layout lookup tables. |
|
||||
\*---------------------------------------------------------*/
|
||||
gb_fusion2_device instance_layout{};
|
||||
gb_fusion2_layout instance_zones{};
|
||||
std::vector<gb_fusion2_zone*> allocated_zones;
|
||||
|
||||
nlohmann::json WriteCalJsonFrom(
|
||||
const EncodedCalibration& src);
|
||||
void FillMissingWith(
|
||||
|
||||
@@ -16,10 +16,21 @@
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
static std::map<std::string, unsigned int> govee_led_counts
|
||||
struct GoveeHardwareInfo
|
||||
{
|
||||
{ "H619A", 20 },
|
||||
{ "H70B1", 20 },
|
||||
unsigned int led_count;
|
||||
unsigned int matrix_row_len; // 0 = linear
|
||||
};
|
||||
|
||||
const unsigned int GOVEE_FALLBACK_LED_COUNT = 20;
|
||||
|
||||
static std::map<std::string, GoveeHardwareInfo> govee_hardware_info
|
||||
{
|
||||
{ "H6022", { 132, 12 } }, // Govee Smart Table Lamp 2
|
||||
{ "H612F", { 12, 0 } }, // Govee Strip Light S (3m)
|
||||
{ "H619A", { 20, 0 } }, // Govee RGBIC Led Strip Lights
|
||||
{ "H70B1", { 20, 0 } }, // Govee LED Curtain Lights
|
||||
{ "H607C", { 174, 0 } }, // Govee Floor Lamp 2
|
||||
};
|
||||
|
||||
RGBController_Govee::RGBController_Govee(GoveeController* controller_ptr)
|
||||
@@ -69,37 +80,61 @@ RGBController_Govee::~RGBController_Govee()
|
||||
|
||||
void RGBController_Govee::SetupZones()
|
||||
{
|
||||
unsigned int led_count = 0;
|
||||
std::map<std::string, unsigned int>::iterator it = govee_led_counts.find(controller->GetSku());
|
||||
if(it != govee_led_counts.end())
|
||||
GoveeHardwareInfo hw = { GOVEE_FALLBACK_LED_COUNT, 0 };
|
||||
bool resizable = true;
|
||||
|
||||
std::map<std::string, GoveeHardwareInfo>::iterator it = govee_hardware_info.find(controller->GetSku());
|
||||
if(it != govee_hardware_info.end())
|
||||
{
|
||||
led_count = it->second;
|
||||
}
|
||||
/*-----------------------------------------------------*\
|
||||
| Fallback so Direct mode is usable even if SKU isn't |
|
||||
| in the table |
|
||||
\*-----------------------------------------------------*/
|
||||
if(led_count == 0)
|
||||
{
|
||||
led_count = 20; /* safe default; user can resize in UI */
|
||||
hw = it->second;
|
||||
resizable = false;
|
||||
}
|
||||
|
||||
zone strip;
|
||||
strip.name = "Govee Strip";
|
||||
strip.type = ZONE_TYPE_LINEAR;
|
||||
strip.leds_count = led_count;
|
||||
/*-----------------------------------------------------*\
|
||||
| Only make resizable for unknown SKUs |
|
||||
\*-----------------------------------------------------*/
|
||||
if(govee_led_counts.find(controller->GetSku()) == govee_led_counts.end())
|
||||
strip.leds_count = hw.led_count;
|
||||
strip.leds_min = resizable ? 0 : hw.led_count;
|
||||
strip.leds_max = resizable ? 255 : hw.led_count;
|
||||
|
||||
if(hw.matrix_row_len == 0)
|
||||
{
|
||||
strip.leds_min = 1;
|
||||
strip.leds_max = 255;
|
||||
strip.name = "Govee Strip";
|
||||
strip.type = ZONE_TYPE_LINEAR;
|
||||
}
|
||||
else
|
||||
{
|
||||
strip.leds_min = led_count;
|
||||
strip.leds_max = led_count;
|
||||
strip.name = "Govee Matrix";
|
||||
strip.type = ZONE_TYPE_MATRIX;
|
||||
|
||||
unsigned int width = hw.matrix_row_len;
|
||||
unsigned int height = hw.led_count / width;
|
||||
|
||||
strip.matrix_map.height = height;
|
||||
strip.matrix_map.width = width;
|
||||
strip.matrix_map.map.resize(hw.led_count);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| On H6022, LEDs indexed bottom to top, alternating |
|
||||
| clockwise and counterclockwise for each row. |
|
||||
\*-------------------------------------------------*/
|
||||
for(unsigned int y = 0; y < height; y++)
|
||||
{
|
||||
/*---------------------------------------------*\
|
||||
| LEDs numbered bottom to top, opposite of |
|
||||
| matrix clockwise and counterclockwise for |
|
||||
| each row. |
|
||||
\*---------------------------------------------*/
|
||||
unsigned int led_y = (height - 1) - y;
|
||||
|
||||
for(unsigned int x = 0; x < width; x++)
|
||||
{
|
||||
/*-----------------------------------------*\
|
||||
| LED is right-to-left for even rows, |
|
||||
| including first one |
|
||||
\*-----------------------------------------*/
|
||||
unsigned int led_x = led_y & 1 ? x : (width - 1) - x;
|
||||
strip.matrix_map.map[y * width + x] = led_y * width + led_x;
|
||||
}
|
||||
}
|
||||
}
|
||||
zones.push_back(strip);
|
||||
|
||||
@@ -115,6 +150,11 @@ void RGBController_Govee::SetupZones()
|
||||
|
||||
void RGBController_Govee::DeviceConfigureZone(int zone_idx)
|
||||
{
|
||||
if(zones[zone_idx].type == ZONE_TYPE_MATRIX)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if((size_t)zone_idx < zones.size())
|
||||
{
|
||||
leds.clear();
|
||||
|
||||
+3
-3
@@ -42,13 +42,13 @@ DetectedControllers DetectHYTEMousematControllers()
|
||||
|
||||
for(unsigned int device_id = 0; device_id < HYTE_MOUSEMAT_NUM_DEVICES; device_id++)
|
||||
{
|
||||
std::vector<std::string *> ports = find_usb_serial_port(hyte_mousemat_devices[device_id].vid, hyte_mousemat_devices[device_id].pid);
|
||||
std::vector<std::string> ports = find_usb_serial_port(hyte_mousemat_devices[device_id].vid, hyte_mousemat_devices[device_id].pid);
|
||||
|
||||
for(unsigned int i = 0; i < ports.size(); i++)
|
||||
{
|
||||
if(*ports[i] != "")
|
||||
if(ports[i] != "")
|
||||
{
|
||||
HYTEMousematController * controller = new HYTEMousematController((char *)ports[i]->c_str(), hyte_mousemat_devices[device_id].name);
|
||||
HYTEMousematController * controller = new HYTEMousematController((char *)ports[i].c_str(), hyte_mousemat_devices[device_id].name);
|
||||
RGBController_HYTEMousemat * rgb_controller = new RGBController_HYTEMousemat(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
@@ -38,13 +38,13 @@ DetectedControllers DetectHYTENexusControllers()
|
||||
|
||||
for(unsigned int device_id = 0; device_id < HYTE_NEXUS_NUM_DEVICES; device_id++)
|
||||
{
|
||||
std::vector<std::string *> ports = find_usb_serial_port(hyte_nexus_devices[device_id].vid, hyte_nexus_devices[device_id].pid);
|
||||
std::vector<std::string> ports = find_usb_serial_port(hyte_nexus_devices[device_id].vid, hyte_nexus_devices[device_id].pid);
|
||||
|
||||
for(unsigned int i = 0; i < ports.size(); i++)
|
||||
{
|
||||
if(*ports[i] != "")
|
||||
if(ports[i] != "")
|
||||
{
|
||||
HYTENexusController * controller = new HYTENexusController((char *)ports[i]->c_str(), hyte_nexus_devices[device_id].pid, hyte_nexus_devices[device_id].name);
|
||||
HYTENexusController * controller = new HYTENexusController((char *)ports[i].c_str(), hyte_nexus_devices[device_id].pid, hyte_nexus_devices[device_id].name);
|
||||
RGBController_HYTENexus * rgb_controller = new RGBController_HYTENexus(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HoltekA070ControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Holtek A070 Mouse |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HoltekA070Controller.h"
|
||||
#include "RGBController_HoltekA070.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Holtek Semiconductor Inc. vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HOLTEK_VID 0x04D9
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Mouse product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HOLTEK_A070_PID 0xA070
|
||||
|
||||
DetectedControllers DetectHoltekA070Controllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HoltekA070Controller* controller = new HoltekA070Controller(dev, info->path, name);
|
||||
RGBController_HoltekA070* rgb_controller = new RGBController_HoltekA070(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Holtek USB Gaming Mouse", DetectHoltekA070Controllers, HOLTEK_VID, HOLTEK_A070_PID, 1, 0xFF00, 2);
|
||||
@@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HoltekA1FAControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Holtek A1FA Mousemat |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HoltekA1FAController.h"
|
||||
#include "RGBController_HoltekA1FA.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Holtek Semiconductor Inc. vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HOLTEK_VID 0x04D9
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Mousemats product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HOLTEK_A1FA_PID 0xA1FA
|
||||
|
||||
DetectedControllers DetectHoltekA1FAControllers(hid_device_info *info, const std::string &name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HoltekA1FAController* controller = new HoltekA1FAController(dev, info->path, name);
|
||||
RGBController_HoltekA1FA* rgb_controller = new RGBController_HoltekA1FA(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Holtek Mousemat", DetectHoltekA1FAControllers, HOLTEK_VID, HOLTEK_A1FA_PID, 2, 0xFF00, 0xFF00);
|
||||
@@ -1,67 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HoltekControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Holtek devices |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HoltekA070Controller.h"
|
||||
#include "RGBController_HoltekA070.h"
|
||||
#include "HoltekA1FAController.h"
|
||||
#include "RGBController_HoltekA1FA.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Holtek Semiconductor Inc. vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HOLTEK_VID 0x04D9
|
||||
/*---------------------------------------------------------*\
|
||||
| Mouse product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HOLTEK_A070_PID 0xA070
|
||||
/*---------------------------------------------------------*\
|
||||
| Mousemats product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HOLTEK_A1FA_PID 0xA1FA
|
||||
|
||||
DetectedControllers DetectHoltekControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HoltekA070Controller* controller = new HoltekA070Controller(dev, info->path, name);
|
||||
RGBController_HoltekA070* rgb_controller = new RGBController_HoltekA070(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectHoltekMousemats(hid_device_info *info, const std::string &name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HoltekA1FAController* controller = new HoltekA1FAController(dev, info->path, name);
|
||||
RGBController_HoltekA1FA* rgb_controller = new RGBController_HoltekA1FA(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Holtek USB Gaming Mouse", DetectHoltekControllers, HOLTEK_VID, HOLTEK_A070_PID, 1, 0xFF00, 2);
|
||||
REGISTER_HID_DETECTOR_IPU("Holtek Mousemat", DetectHoltekMousemats, HOLTEK_VID, HOLTEK_A1FA_PID, 2, 0xFF00, 0xFF00);
|
||||
@@ -23,28 +23,9 @@ using namespace std::chrono_literals;
|
||||
|
||||
bool TestForHyperXDRAMController(i2c_smbus_interface* bus, unsigned char address)
|
||||
{
|
||||
bool pass = false;
|
||||
int res = bus->i2c_smbus_read_byte(address);
|
||||
|
||||
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
|
||||
|
||||
LOG_DEBUG("[%s] Writing at address %02X, res=%02X", HYPERX_CONTROLLER_NAME, address, res);
|
||||
|
||||
if (res >= 0)
|
||||
{
|
||||
pass = true;
|
||||
|
||||
for (int i = 0xA0; i < 0xB0; i++)
|
||||
{
|
||||
res = bus->i2c_smbus_read_byte_data(address, i);
|
||||
|
||||
if (res != i)
|
||||
{
|
||||
pass = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(pass);
|
||||
return(res >= 0);
|
||||
}
|
||||
|
||||
DetectedControllers DetectHyperXDRAMControllers(i2c_smbus_interface* bus, std::vector<SPDWrapper*> &slots, const std::string &/*name*/)
|
||||
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperXAlloyElite2ControllerDetect.cpp |
|
||||
| |
|
||||
| Driver for HyperX Alloy Elite 2 keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HyperXAlloyElite2Controller.h"
|
||||
#include "RGBController_HyperXAlloyElite2.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HYPERX_KEYBOARD_VID 0x0951
|
||||
#define HYPERX_ALLOY_ELITE_2_PID 0x1711
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs (HP) |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HP_KEYBOARD_VID 0x03F0
|
||||
#define HYPERX_ALLOY_ELITE_2_HP_PID 0x058F
|
||||
|
||||
DetectedControllers DetectHyperXAlloyElite2(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyElite2Controller* controller = new HyperXAlloyElite2Controller(dev, info->path, name);
|
||||
RGBController_HyperXAlloyElite2* rgb_controller = new RGBController_HyperXAlloyElite2(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
REGISTER_HID_DETECTOR_IP("HyperX Alloy Elite 2", DetectHyperXAlloyElite2, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ELITE_2_PID, 3, 0xFF90);
|
||||
REGISTER_HID_DETECTOR_IP("HyperX Alloy Elite 2 (HP)", DetectHyperXAlloyElite2, HP_KEYBOARD_VID, HYPERX_ALLOY_ELITE_2_HP_PID, 3, 0xFF90);
|
||||
#else
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Elite 2", DetectHyperXAlloyElite2, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ELITE_2_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Elite 2 (HP)", DetectHyperXAlloyElite2, HP_KEYBOARD_VID, HYPERX_ALLOY_ELITE_2_HP_PID, 0);
|
||||
#endif
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperXAlloyEliteControllerDetect.cpp |
|
||||
| |
|
||||
| Driver for HyperX Alloy Elite keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HyperXAlloyEliteController.h"
|
||||
#include "RGBController_HyperXAlloyElite.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HYPERX_KEYBOARD_VID 0x0951
|
||||
#define HYPERX_ALLOY_ELITE_PID 0x16BE
|
||||
|
||||
DetectedControllers DetectHyperXAlloyElite(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyEliteController* controller = new HyperXAlloyEliteController(dev, info->path, name);
|
||||
RGBController_HyperXAlloyElite* rgb_controller = new RGBController_HyperXAlloyElite(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IP("HyperX Alloy Elite RGB", DetectHyperXAlloyElite, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ELITE_PID, 2, 0xFF01);
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperXAlloyFPSControllerDetect.cpp |
|
||||
| |
|
||||
| Driver for HyperX Alloy FPS keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HyperXAlloyFPSController.h"
|
||||
#include "RGBController_HyperXAlloyFPS.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HYPERX_KEYBOARD_VID 0x0951
|
||||
#define HYPERX_ALLOY_FPS_RGB_PID 0x16DC
|
||||
|
||||
DetectedControllers DetectHyperXAlloyFPS(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyFPSController* controller = new HyperXAlloyFPSController(dev, info->path, name);
|
||||
RGBController_HyperXAlloyFPS* rgb_controller = new RGBController_HyperXAlloyFPS(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IP("HyperX Alloy FPS RGB", DetectHyperXAlloyFPS, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_FPS_RGB_PID, 2, 0xFF01);
|
||||
+71
@@ -0,0 +1,71 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperXAlloyOrigins60and65ControllerDetect.cpp |
|
||||
| |
|
||||
| Driver for HyperX Alloy Origins 60 and 65 keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HyperXAlloyOrigins60and65Controller.h"
|
||||
#include "RGBController_HyperXAlloyOrigins60and65.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HYPERX_KEYBOARD_VID 0x0951
|
||||
#define HYPERX_ALLOY_ORIGINS_60_PID 0x1734
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs (HP) |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HP_KEYBOARD_VID 0x03F0
|
||||
#define HYPERX_ALLOY_ORIGINS_60_HP_PID 0x0C8E
|
||||
#define HYPERX_ALLOY_ORIGINS_65_HP_PID 0x038F
|
||||
|
||||
AlloyOrigins60and65MappingLayoutType GetAlloyOrigins60and65MappingLayoutType(int pid)
|
||||
{
|
||||
switch(pid)
|
||||
{
|
||||
case HYPERX_ALLOY_ORIGINS_60_PID:
|
||||
case HYPERX_ALLOY_ORIGINS_60_HP_PID:
|
||||
return ALLOY_ORIGINS_60_LAYOUT;
|
||||
|
||||
case HYPERX_ALLOY_ORIGINS_65_HP_PID:
|
||||
return ALLOY_ORIGINS_65_LAYOUT;
|
||||
|
||||
default:
|
||||
return ALLOY_ORIGINS_60_LAYOUT;
|
||||
}
|
||||
}
|
||||
|
||||
DetectedControllers DetectHyperXAlloyOrigins60and65(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyOrigins60and65Controller* controller = new HyperXAlloyOrigins60and65Controller(dev, info->path, name);
|
||||
AlloyOrigins60and65MappingLayoutType layout = GetAlloyOrigins60and65MappingLayoutType(info->product_id);
|
||||
RGBController_HyperXAlloyOrigins60and65* rgb_controller = new RGBController_HyperXAlloyOrigins60and65(controller, layout);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 60", DetectHyperXAlloyOrigins60and65, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_60_PID, 3);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 60 (HP)", DetectHyperXAlloyOrigins60and65, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_60_HP_PID, 3);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 65 (HP)", DetectHyperXAlloyOrigins60and65, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_65_HP_PID, 3);
|
||||
#else
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 60", DetectHyperXAlloyOrigins60and65, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_60_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 60 (HP)", DetectHyperXAlloyOrigins60and65, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_60_HP_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 65 (HP)", DetectHyperXAlloyOrigins60and65, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_65_HP_PID, 0);
|
||||
#endif
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperXAlloyOriginsControllerDetect.cpp |
|
||||
| |
|
||||
| Driver for HyperX Alloy Origins keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HyperXAlloyOriginsController.h"
|
||||
#include "RGBController_HyperXAlloyOrigins.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HYPERX_KEYBOARD_VID 0x0951
|
||||
#define HYPERX_ALLOY_ORIGINS_PID 0x16E5
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs (HP) |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HP_KEYBOARD_VID 0x03F0
|
||||
#define HYPERX_ALLOY_ORIGINS_HP_PID 0x0591
|
||||
|
||||
DetectedControllers DetectHyperXAlloyOrigins(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyOriginsController* controller = new HyperXAlloyOriginsController(dev, info->path, name);
|
||||
RGBController_HyperXAlloyOrigins* rgb_controller = new RGBController_HyperXAlloyOrigins(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins", DetectHyperXAlloyOrigins, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_PID, 3);
|
||||
REGISTER_HID_DETECTOR_IP("HyperX Alloy Origins (HP)", DetectHyperXAlloyOrigins, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_HP_PID, 3, 0xFF90);
|
||||
#else
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins", DetectHyperXAlloyOrigins, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins (HP)", DetectHyperXAlloyOrigins, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_HP_PID, 0);
|
||||
#endif
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperXAlloyOriginsCoreControllerDetect.cpp |
|
||||
| |
|
||||
| Driver for HyperX Alloy Origins Core keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HyperXAlloyOriginsCoreController.h"
|
||||
#include "RGBController_HyperXAlloyOriginsCore.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HYPERX_KEYBOARD_VID 0x0951
|
||||
#define HYPERX_ALLOY_ORIGINS_CORE_PID 0x16E6
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs (HP) |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HP_KEYBOARD_VID 0x03F0
|
||||
#define HYPERX_ALLOY_ORIGINS_CORE_HP_PID 0x098F
|
||||
|
||||
DetectedControllers DetectHyperXAlloyOriginsCore(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyOriginsCoreController* controller = new HyperXAlloyOriginsCoreController(dev, info, name);
|
||||
RGBController_HyperXAlloyOriginsCore* rgb_controller = new RGBController_HyperXAlloyOriginsCore(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins Core", DetectHyperXAlloyOriginsCore, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_CORE_PID, 2);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins Core (HP)", DetectHyperXAlloyOriginsCore, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_CORE_HP_PID, 2);
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperXEve1800Controller.cpp |
|
||||
| |
|
||||
| Driver for HyperX Eve 1800 keyboard |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include "HyperXEve1800Controller.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
HyperXEve1800Controller::HyperXEve1800Controller(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
HyperXEve1800Controller::~HyperXEve1800Controller()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
std::string HyperXEve1800Controller::GetDeviceLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string HyperXEve1800Controller::GetNameString()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string HyperXEve1800Controller::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
int ret = hid_get_serial_number_string(dev, serial_string, 128);
|
||||
|
||||
if(ret != 0)
|
||||
{
|
||||
return("");
|
||||
}
|
||||
|
||||
return(StringUtils::wstring_to_string(serial_string));
|
||||
}
|
||||
|
||||
void HyperXEve1800Controller::SetBrightness(unsigned int brightness)
|
||||
{
|
||||
unsigned char buf[65];
|
||||
|
||||
memset(buf, 0x00, sizeof(buf));
|
||||
|
||||
buf[0x00] = 0x40;
|
||||
buf[0x01] = 0x01;
|
||||
buf[0x02] = 0x00;
|
||||
buf[0x03] = 0x00;
|
||||
buf[0x04] = brightness & 0xFF;
|
||||
|
||||
hid_write(dev, buf, 65);
|
||||
}
|
||||
|
||||
void HyperXEve1800Controller::SetLEDsDirect(std::vector<RGBColor> colors)
|
||||
{
|
||||
SendDirectInitialization();
|
||||
|
||||
if(colors.empty())
|
||||
{
|
||||
RGBColor temp = 0x00000000;
|
||||
SendDirectColorPacket(&temp, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendDirectColorPacket(&colors[0], (unsigned int)colors.size());
|
||||
}
|
||||
}
|
||||
|
||||
void HyperXEve1800Controller::SendDirectInitialization()
|
||||
{
|
||||
unsigned char buf[65];
|
||||
|
||||
memset(buf, 0x00, sizeof(buf));
|
||||
|
||||
buf[0x00] = 0x44;
|
||||
buf[0x01] = 0x01;
|
||||
buf[0x02] = 0x04;
|
||||
buf[0x03] = 0x00;
|
||||
|
||||
hid_write(dev, buf, 65);
|
||||
}
|
||||
|
||||
void HyperXEve1800Controller::SendDirectColorPacket(RGBColor* color_data, unsigned int color_count)
|
||||
{
|
||||
unsigned char buf[65];
|
||||
|
||||
memset(buf, 0x00, sizeof(buf));
|
||||
|
||||
buf[0x00] = 0x44;
|
||||
buf[0x01] = 0x02;
|
||||
buf[0x02] = 0x00;
|
||||
buf[0x03] = 0x00;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| The Eve 1800 exposes 10 lighting zones, but this |
|
||||
| report format can carry up to 20 RGB triplets. |
|
||||
\*-----------------------------------------------------*/
|
||||
if(color_count > 20)
|
||||
{
|
||||
color_count = 20;
|
||||
}
|
||||
|
||||
for(unsigned int color_idx = 0; color_idx < color_count; color_idx++)
|
||||
{
|
||||
buf[4 + (color_idx * 3)] = RGBGetRValue(color_data[color_idx]);
|
||||
buf[4 + (color_idx * 3) + 1] = RGBGetGValue(color_data[color_idx]);
|
||||
buf[4 + (color_idx * 3) + 2] = RGBGetBValue(color_data[color_idx]);
|
||||
}
|
||||
|
||||
hid_write(dev, buf, 65);
|
||||
}
|
||||
+36
@@ -0,0 +1,36 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperXEve1800Controller.h |
|
||||
| |
|
||||
| Driver for HyperX Eve 1800 keyboard |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <hidapi.h>
|
||||
#include "RGBController.h"
|
||||
|
||||
class HyperXEve1800Controller
|
||||
{
|
||||
public:
|
||||
HyperXEve1800Controller(hid_device* dev_handle, const char* path, std::string dev_name);
|
||||
~HyperXEve1800Controller();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetNameString();
|
||||
std::string GetSerialString();
|
||||
|
||||
void SetBrightness(unsigned int brightness);
|
||||
void SetLEDsDirect(std::vector<RGBColor> colors);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
|
||||
void SendDirectInitialization();
|
||||
void SendDirectColorPacket(RGBColor* color_data, unsigned int color_count);
|
||||
};
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperXEve1800ControllerDetect.cpp |
|
||||
| |
|
||||
| Driver for HyperX Eve 1800 keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HyperXEve1800Controller.h"
|
||||
#include "RGBController_HyperXEve1800.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs (HP) |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HP_KEYBOARD_VID 0x03F0
|
||||
#define HYPERX_EVE_1800_HP_PID 0x08C2
|
||||
|
||||
DetectedControllers DetectHyperXEve1800(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXEve1800Controller* controller = new HyperXEve1800Controller(dev, info->path, name);
|
||||
RGBController_HyperXEve1800* rgb_controller = new RGBController_HyperXEve1800(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return detected_controllers;
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_I("HyperX Eve 1800 (HP)", DetectHyperXEve1800, HP_KEYBOARD_VID, HYPERX_EVE_1800_HP_PID, 2);
|
||||
+123
@@ -0,0 +1,123 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_HyperXEve1800.cpp |
|
||||
| |
|
||||
| RGBController for HyperX Eve 1800 keyboard |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_HyperXEve1800.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
#define HYPERX_EVE_1800_BRIGHTNESS_MIN 0x00
|
||||
#define HYPERX_EVE_1800_BRIGHTNESS_MAX 0xFF
|
||||
#define HYPERX_EVE_1800_ZONE_COUNT 10
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name HyperX Eve 1800
|
||||
@category Keyboard
|
||||
@type USB
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :x:
|
||||
@detectors DetectHyperXEve1800
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_HyperXEve1800::RGBController_HyperXEve1800(HyperXEve1800Controller* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetNameString();
|
||||
vendor = "HyperX";
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
description = "HyperX Eve 1800 Keyboard Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0xFFFF;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Direct.brightness_min = HYPERX_EVE_1800_BRIGHTNESS_MIN;
|
||||
Direct.brightness_max = HYPERX_EVE_1800_BRIGHTNESS_MAX;
|
||||
Direct.brightness = HYPERX_EVE_1800_BRIGHTNESS_MAX;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
|
||||
keepalive_thread_run = 1;
|
||||
keepalive_thread = new std::thread(&RGBController_HyperXEve1800::KeepaliveThread, this);
|
||||
}
|
||||
|
||||
RGBController_HyperXEve1800::~RGBController_HyperXEve1800()
|
||||
{
|
||||
keepalive_thread_run = 0;
|
||||
keepalive_thread->join();
|
||||
delete keepalive_thread;
|
||||
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_HyperXEve1800::SetupZones()
|
||||
{
|
||||
zone new_zone;
|
||||
new_zone.name = "Keyboard";
|
||||
new_zone.type = ZONE_TYPE_LINEAR;
|
||||
new_zone.leds_min = HYPERX_EVE_1800_ZONE_COUNT;
|
||||
new_zone.leds_max = HYPERX_EVE_1800_ZONE_COUNT;
|
||||
new_zone.leds_count = HYPERX_EVE_1800_ZONE_COUNT;
|
||||
zones.push_back(new_zone);
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = "Zone ";
|
||||
new_led.name.append(std::to_string(led_idx + 1));
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_HyperXEve1800::DeviceUpdateLEDs()
|
||||
{
|
||||
controller->SetLEDsDirect(colors);
|
||||
last_update_time = std::chrono::steady_clock::now();
|
||||
}
|
||||
|
||||
void RGBController_HyperXEve1800::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_HyperXEve1800::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_HyperXEve1800::DeviceUpdateMode()
|
||||
{
|
||||
controller->SetBrightness(modes[active_mode].brightness);
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_HyperXEve1800::KeepaliveThread()
|
||||
{
|
||||
while(keepalive_thread_run.load())
|
||||
{
|
||||
if(active_mode == 0)
|
||||
{
|
||||
if((std::chrono::steady_clock::now() - last_update_time) > std::chrono::milliseconds(50))
|
||||
{
|
||||
UpdateLEDs();
|
||||
}
|
||||
}
|
||||
std::this_thread::sleep_for(10ms);
|
||||
}
|
||||
}
|
||||
+37
-41
@@ -1,41 +1,37 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_CorsairWireless.h |
|
||||
| |
|
||||
| RGBController for Corsair wireless keyboard |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 08 May 2021 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "CorsairWirelessController.h"
|
||||
|
||||
class RGBController_CorsairWireless : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_CorsairWireless(CorsairWirelessController* controller_ptr);
|
||||
~RGBController_CorsairWireless();
|
||||
|
||||
int physical_layout;
|
||||
int logical_layout;
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
void KeepaliveThread();
|
||||
|
||||
private:
|
||||
CorsairWirelessController* controller;
|
||||
std::thread* keepalive_thread;
|
||||
std::atomic<bool> keepalive_thread_run;
|
||||
std::chrono::time_point<std::chrono::steady_clock> last_update_time;
|
||||
};
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_HyperXEve1800.h |
|
||||
| |
|
||||
| RGBController for HyperX Eve 1800 keyboard |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include "RGBController.h"
|
||||
#include "HyperXEve1800Controller.h"
|
||||
|
||||
class RGBController_HyperXEve1800 : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_HyperXEve1800(HyperXEve1800Controller* controller_ptr);
|
||||
~RGBController_HyperXEve1800();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
void KeepaliveThread();
|
||||
|
||||
private:
|
||||
HyperXEve1800Controller* controller;
|
||||
std::thread* keepalive_thread;
|
||||
std::atomic<bool> keepalive_thread_run;
|
||||
std::chrono::time_point<std::chrono::steady_clock> last_update_time;
|
||||
};
|
||||
@@ -1,220 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperXKeyboardControllerDetect.cpp |
|
||||
| |
|
||||
| Driver for HyperX keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HyperXAlloyEliteController.h"
|
||||
#include "HyperXAlloyElite2Controller.h"
|
||||
#include "HyperXAlloyFPSController.h"
|
||||
#include "HyperXAlloyOriginsController.h"
|
||||
#include "HyperXAlloyOriginsCoreController.h"
|
||||
#include "HyperXAlloyOrigins60and65Controller.h"
|
||||
#include "HyperXOrigins2_65Controller.h"
|
||||
#include "RGBController_HyperXAlloyElite.h"
|
||||
#include "RGBController_HyperXAlloyElite2.h"
|
||||
#include "RGBController_HyperXAlloyFPS.h"
|
||||
#include "RGBController_HyperXAlloyOrigins.h"
|
||||
#include "RGBController_HyperXAlloyOriginsCore.h"
|
||||
#include "RGBController_HyperXAlloyOrigins60and65.h"
|
||||
#include "RGBController_HyperXOrigins2_65.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HYPERX_KEYBOARD_VID 0x0951
|
||||
|
||||
#define HYPERX_ALLOY_ELITE_PID 0x16BE
|
||||
#define HYPERX_ALLOY_ELITE_2_PID 0x1711
|
||||
#define HYPERX_ALLOY_FPS_RGB_PID 0x16DC
|
||||
#define HYPERX_ALLOY_ORIGINS_PID 0x16E5
|
||||
#define HYPERX_ALLOY_ORIGINS_CORE_PID 0x16E6
|
||||
#define HYPERX_ALLOY_ORIGINS_60_PID 0x1734
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs (HP) |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HP_KEYBOARD_VID 0x03F0
|
||||
|
||||
#define HYPERX_ALLOY_ELITE_2_HP_PID 0x058F
|
||||
#define HYPERX_ALLOY_ORIGINS_60_HP_PID 0x0C8E
|
||||
#define HYPERX_ALLOY_ORIGINS_65_HP_PID 0x038F
|
||||
#define HYPERX_ALLOY_ORIGINS_CORE_HP_PID 0x098F
|
||||
#define HYPERX_ALLOY_ORIGINS_HP_PID 0x0591
|
||||
#define HYPERX_ORIGINS_2_65_HP_PID 0x0CC2
|
||||
|
||||
AlloyOrigins60and65MappingLayoutType GetAlloyOrigins60and65MappingLayoutType(int pid)
|
||||
{
|
||||
switch(pid)
|
||||
{
|
||||
case HYPERX_ALLOY_ORIGINS_60_PID:
|
||||
case HYPERX_ALLOY_ORIGINS_60_HP_PID:
|
||||
return ALLOY_ORIGINS_60_LAYOUT;
|
||||
|
||||
case HYPERX_ALLOY_ORIGINS_65_HP_PID:
|
||||
return ALLOY_ORIGINS_65_LAYOUT;
|
||||
|
||||
default:
|
||||
return ALLOY_ORIGINS_60_LAYOUT;
|
||||
}
|
||||
}
|
||||
|
||||
DetectedControllers DetectHyperXAlloyElite(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyEliteController* controller = new HyperXAlloyEliteController(dev, info->path, name);
|
||||
RGBController_HyperXAlloyElite* rgb_controller = new RGBController_HyperXAlloyElite(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectHyperXAlloyElite2(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyElite2Controller* controller = new HyperXAlloyElite2Controller(dev, info->path, name);
|
||||
RGBController_HyperXAlloyElite2* rgb_controller = new RGBController_HyperXAlloyElite2(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectHyperXAlloyFPS(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyFPSController* controller = new HyperXAlloyFPSController(dev, info->path, name);
|
||||
RGBController_HyperXAlloyFPS* rgb_controller = new RGBController_HyperXAlloyFPS(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectHyperXAlloyOrigins(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyOriginsController* controller = new HyperXAlloyOriginsController(dev, info->path, name);
|
||||
RGBController_HyperXAlloyOrigins* rgb_controller = new RGBController_HyperXAlloyOrigins(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectHyperXAlloyOriginsCore(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyOriginsCoreController* controller = new HyperXAlloyOriginsCoreController(dev, info, name);
|
||||
RGBController_HyperXAlloyOriginsCore* rgb_controller = new RGBController_HyperXAlloyOriginsCore(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectHyperXAlloyOrigins60and65(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXAlloyOrigins60and65Controller* controller = new HyperXAlloyOrigins60and65Controller(dev, info->path, name);
|
||||
AlloyOrigins60and65MappingLayoutType layout = GetAlloyOrigins60and65MappingLayoutType(info->product_id);
|
||||
RGBController_HyperXAlloyOrigins60and65* rgb_controller = new RGBController_HyperXAlloyOrigins60and65(controller, layout);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectHyperXOrigins2_65(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXOrigins2_65Controller* controller = new HyperXOrigins2_65Controller(dev, info->path, name);
|
||||
RGBController_HyperXOrigins2_65* rgb_controller = new RGBController_HyperXOrigins2_65(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IP("HyperX Alloy Elite RGB", DetectHyperXAlloyElite, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ELITE_PID, 2, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("HyperX Alloy FPS RGB", DetectHyperXAlloyFPS, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_FPS_RGB_PID, 2, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins Core", DetectHyperXAlloyOriginsCore, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_CORE_PID, 2);
|
||||
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins Core (HP)", DetectHyperXAlloyOriginsCore, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_CORE_HP_PID, 2);
|
||||
|
||||
REGISTER_HID_DETECTOR_I("HyperX Origins 2 65 (HP)", DetectHyperXOrigins2_65, HP_KEYBOARD_VID, HYPERX_ORIGINS_2_65_HP_PID, 3);
|
||||
|
||||
#ifdef _WIN32
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins", DetectHyperXAlloyOrigins, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_PID, 3);
|
||||
REGISTER_HID_DETECTOR_IP("HyperX Alloy Elite 2", DetectHyperXAlloyElite2, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ELITE_2_PID, 3, 0xFF90);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 60", DetectHyperXAlloyOrigins60and65, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_60_PID, 3);
|
||||
|
||||
REGISTER_HID_DETECTOR_IP("HyperX Alloy Elite 2 (HP)", DetectHyperXAlloyElite2, HP_KEYBOARD_VID, HYPERX_ALLOY_ELITE_2_HP_PID, 3, 0xFF90);
|
||||
REGISTER_HID_DETECTOR_IP("HyperX Alloy Origins (HP)", DetectHyperXAlloyOrigins, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_HP_PID, 3, 0xFF90);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 60 (HP)", DetectHyperXAlloyOrigins60and65, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_60_HP_PID, 3);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 65 (HP)", DetectHyperXAlloyOrigins60and65, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_65_HP_PID, 3);
|
||||
#else
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins", DetectHyperXAlloyOrigins, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Elite 2", DetectHyperXAlloyElite2, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ELITE_2_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 60", DetectHyperXAlloyOrigins60and65, HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_60_PID, 0);
|
||||
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Elite 2 (HP)", DetectHyperXAlloyElite2, HP_KEYBOARD_VID, HYPERX_ALLOY_ELITE_2_HP_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins (HP)", DetectHyperXAlloyOrigins, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_HP_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 60 (HP)", DetectHyperXAlloyOrigins60and65, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_60_HP_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I("HyperX Alloy Origins 65 (HP)", DetectHyperXAlloyOrigins60and65, HP_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_65_HP_PID, 0);
|
||||
#endif
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperXOrigins2_65ControllerDetect.cpp |
|
||||
| |
|
||||
| Driver for HyperX Origins 2 65 keyboards |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "HyperXOrigins2_65Controller.h"
|
||||
#include "RGBController_HyperXOrigins2_65.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HyperX keyboard vendor and product IDs (HP) |
|
||||
\*---------------------------------------------------------*/
|
||||
#define HP_KEYBOARD_VID 0x03F0
|
||||
#define HYPERX_ORIGINS_2_65_HP_PID 0x0CC2
|
||||
|
||||
DetectedControllers DetectHyperXOrigins2_65(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
HyperXOrigins2_65Controller* controller = new HyperXOrigins2_65Controller(dev, info->path, name);
|
||||
RGBController_HyperXOrigins2_65* rgb_controller = new RGBController_HyperXOrigins2_65(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_I("HyperX Origins 2 65 (HP)", DetectHyperXOrigins2_65, HP_KEYBOARD_VID, HYPERX_ORIGINS_2_65_HP_PID, 3);
|
||||
@@ -115,7 +115,7 @@ void RGBController_IntelArcA770LE::SetupZones()
|
||||
for(unsigned int led_idx = 0; led_idx < 16; led_idx++)
|
||||
{
|
||||
led fan_1_led;
|
||||
fan_1_led.name = "Fan 1 LED";
|
||||
fan_1_led.name = "Fan 1 LED " + std::to_string(led_idx + 1);
|
||||
fan_1_led.value = fan_1_leds[led_idx];
|
||||
leds.push_back(fan_1_led);
|
||||
}
|
||||
@@ -123,7 +123,7 @@ void RGBController_IntelArcA770LE::SetupZones()
|
||||
for(unsigned int led_idx = 0; led_idx < 16; led_idx++)
|
||||
{
|
||||
led fan_2_led;
|
||||
fan_2_led.name = "Fan 2 LED";
|
||||
fan_2_led.name = "Fan 2 LED " + std::to_string(led_idx + 1);
|
||||
fan_2_led.value = fan_2_leds[led_idx];
|
||||
leds.push_back(fan_2_led);
|
||||
}
|
||||
@@ -131,7 +131,7 @@ void RGBController_IntelArcA770LE::SetupZones()
|
||||
for(unsigned int led_idx = 0; led_idx < 8; led_idx++)
|
||||
{
|
||||
led back_led;
|
||||
back_led.name = "Back LED";
|
||||
back_led.name = "Back LED " + std::to_string(led_idx + 1);
|
||||
back_led.value = back_leds[led_idx];
|
||||
leds.push_back(back_led);
|
||||
}
|
||||
@@ -139,7 +139,7 @@ void RGBController_IntelArcA770LE::SetupZones()
|
||||
for(unsigned int led_idx = 0; led_idx < 50; led_idx++)
|
||||
{
|
||||
led ring_led;
|
||||
ring_led.name = "Ring LED";
|
||||
ring_led.name = "Ring LED " + std::to_string(led_idx + 1);
|
||||
ring_led.value = ring_leds[led_idx];
|
||||
leds.push_back(ring_led);
|
||||
}
|
||||
@@ -147,7 +147,7 @@ void RGBController_IntelArcA770LE::SetupZones()
|
||||
for(unsigned int led_idx = 0; led_idx < 1; led_idx++)
|
||||
{
|
||||
led logo_led;
|
||||
logo_led.name = "Logo LED";
|
||||
logo_led.name = "Logo LED " + std::to_string(led_idx + 1);
|
||||
logo_led.value = logo_leds[led_idx];
|
||||
leds.push_back(logo_led);
|
||||
}
|
||||
|
||||
+3
-11
@@ -52,7 +52,7 @@ DetectedControllers DetectJGINYUEInternalUSBV2Controller(hid_device_info* info,c
|
||||
if(dev)
|
||||
{
|
||||
serial_port *port = nullptr;
|
||||
std::vector<std::string*> serial_ports = find_usb_serial_port(JGINYUE_VID_V2, JGINYUE_MOTHERBOARD_PID_V2);
|
||||
std::vector<std::string> serial_ports = find_usb_serial_port(JGINYUE_VID_V2, JGINYUE_MOTHERBOARD_PID_V2);
|
||||
|
||||
if(serial_ports.size() == 0)
|
||||
{
|
||||
@@ -66,22 +66,14 @@ DetectedControllers DetectJGINYUEInternalUSBV2Controller(hid_device_info* info,c
|
||||
if(serial_ports.size() >= 1)
|
||||
{
|
||||
port = new serial_port();
|
||||
if(!port->serial_open(serial_ports[0]->c_str(), 115200))
|
||||
if(!port->serial_open(serial_ports[0].c_str(), 115200))
|
||||
{
|
||||
LOG_WARNING("[JGINYUEInternalUSBV2ControllerDetect] Failed to open serial port %s - Direct mode will be unavailable. HID modes will still work.", serial_ports[0]->c_str());
|
||||
LOG_WARNING("[JGINYUEInternalUSBV2ControllerDetect] Failed to open serial port %s - Direct mode will be unavailable. HID modes will still work.", serial_ports[0].c_str());
|
||||
delete port;
|
||||
port = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------*\
|
||||
| Clean up serial port string vector |
|
||||
\*---------------------------------------------*/
|
||||
for(std::string* str_ptr : serial_ports)
|
||||
{
|
||||
delete str_ptr;
|
||||
}
|
||||
|
||||
JGINYUEInternalUSBV2Controller * controller = new JGINYUEInternalUSBV2Controller(dev, info->path, port);
|
||||
RGBController_JGINYUEInternalUSBV2 * rgb_controller = new RGBController_JGINYUEInternalUSBV2(controller);
|
||||
|
||||
|
||||
+1
-1
@@ -408,7 +408,7 @@ void RGBController_LianLiUniHubAL::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = zones[channel_idx].name + ", LED " + std::to_string(led_ch_idx + 1);
|
||||
new_led.value = channel_idx;
|
||||
new_led.value = (unsigned int)channel_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
@@ -285,7 +285,7 @@ void RGBController_LianLiUniHub::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = zones[channel_idx].name + ", LED " + std::to_string(led_ch_idx + 1);
|
||||
new_led.value = channel_idx;
|
||||
new_led.value = (unsigned int)channel_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
+1
-1
@@ -354,7 +354,7 @@ void RGBController_LianLiUniHubSL::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = zones[channel_idx].name + ", LED " + std::to_string(led_ch_idx + 1);
|
||||
new_led.value = channel_idx;
|
||||
new_led.value = (unsigned int)channel_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
+1
-1
@@ -382,7 +382,7 @@ void RGBController_LianLiUniHubSLInfinity::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = zones[channel_idx].name + ", LED " + std::to_string(led_ch_idx + 1);
|
||||
new_led.value = channel_idx;
|
||||
new_led.value = (unsigned int)channel_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
+1
-1
@@ -381,7 +381,7 @@ void RGBController_LianLiUniHubSLV2::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = zones[channel_idx].name + ", LED " + std::to_string(led_ch_idx + 1);
|
||||
new_led.value = channel_idx;
|
||||
new_led.value = (unsigned int)channel_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user