Compare commits
159
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1177e9fa68 | ||
|
|
91b139987f | ||
|
|
72233ffed6 | ||
|
|
bc31490085 | ||
|
|
fa4d330933 | ||
|
|
346beed0eb | ||
|
|
e74faeb6be | ||
|
|
70c51abff7 | ||
|
|
d2ebd167b3 | ||
|
|
a605d5581a | ||
|
|
759e09b3a3 | ||
|
|
a8b3279c1d | ||
|
|
3f2b925dd0 | ||
|
|
0cab595ef6 | ||
|
|
1a946268ba | ||
|
|
1f1548929d | ||
|
|
3e62c91ed3 | ||
|
|
9be25d1ca4 | ||
|
|
290fddaf55 | ||
|
|
8823e28fa0 | ||
|
|
ec77c658f2 | ||
|
|
be84a60af6 | ||
|
|
e40617e417 | ||
|
|
7556a2872c | ||
|
|
7ccb3cd9e6 | ||
|
|
cbf867c0ee | ||
|
|
b7ee237fbf | ||
|
|
0345eb582b | ||
|
|
f568253c51 | ||
|
|
2251feb701 | ||
|
|
8b8451017e | ||
|
|
94c18fc9b4 | ||
|
|
f741cb7c6b | ||
|
|
d19b5bc87d | ||
|
|
319f19e65d | ||
|
|
ad97bf8c08 | ||
|
|
835a007445 | ||
|
|
66fd8ab394 | ||
|
|
9407ef7f4d | ||
|
|
fb420b3928 | ||
|
|
bc3e351f26 | ||
|
|
edbccc345f | ||
|
|
db3c3e9fb1 | ||
|
|
6af7324840 | ||
|
|
640f7c7cde | ||
|
|
37224a6c4d | ||
|
|
6235bcb2b4 | ||
|
|
90ca955343 | ||
|
|
d38dcc038a | ||
|
|
f577e5ef3c | ||
|
|
877469cd2d | ||
|
|
4d506588b5 | ||
|
|
e972335872 | ||
|
|
9f584b1f76 | ||
|
|
45dc619076 | ||
|
|
81c8ec6684 | ||
|
|
1c7bfdaeb4 | ||
|
|
f6812a5c88 | ||
|
|
c76dbc943f | ||
|
|
cd1ceed5df | ||
|
|
1558ffc61f | ||
|
|
06b75f5ae7 | ||
|
|
95275ebf39 | ||
|
|
d5f86baa73 | ||
|
|
c386a6c571 | ||
|
|
4e95bc55d8 | ||
|
|
ae4c88fef8 | ||
|
|
989dc7fc5d | ||
|
|
1b863fdc7b | ||
|
|
933ea93c25 | ||
|
|
7daa5b6556 | ||
|
|
1598fc8de4 | ||
|
|
b03fce33ca | ||
|
|
6d9aea38a6 | ||
|
|
a2ed9571cf | ||
|
|
ba24efe544 | ||
|
|
f750654b3e | ||
|
|
b0b46dd3a5 | ||
|
|
5e002107ef | ||
|
|
b6824b8a46 | ||
|
|
342d90b82a | ||
|
|
63f005d4fc | ||
|
|
4601b91f1f | ||
|
|
c8ea2ff36f | ||
|
|
7781b1425d | ||
|
|
7977a3ef50 | ||
|
|
3000d625fa | ||
|
|
bbc3c1de5b | ||
|
|
a2a394492b | ||
|
|
c6b10d9316 | ||
|
|
177cd2ec92 | ||
|
|
f787c5e63f | ||
|
|
d3993547c3 | ||
|
|
17f1390f36 | ||
|
|
38f8808bea | ||
|
|
c58d458062 | ||
|
|
d96fd19c6c | ||
|
|
9f91170240 | ||
|
|
2440ab8fc9 | ||
|
|
6ec3cfb1de | ||
|
|
ebae2a3ba3 | ||
|
|
effa243adb | ||
|
|
715099d768 | ||
|
|
e6531e5379 | ||
|
|
41762d4670 | ||
|
|
ce836ce7b6 | ||
|
|
c517257cb0 | ||
|
|
ed368fba12 | ||
|
|
0b7b42b8f5 | ||
|
|
68a16fadc2 | ||
|
|
4f5cf83e47 | ||
|
|
ed01850926 | ||
|
|
29e2626471 | ||
|
|
4f0cf752f5 | ||
|
|
6c52e3ce11 | ||
|
|
53379c5482 | ||
|
|
ff07a488a2 | ||
|
|
73a8a50848 | ||
|
|
78a8a2c4a9 | ||
|
|
9939d7e4f1 | ||
|
|
9cf32593ae | ||
|
|
7294fa8180 | ||
|
|
bd35a83837 | ||
|
|
3da5a4f6ba | ||
|
|
c571ea124f | ||
|
|
9db92e9afa | ||
|
|
634ec9f488 | ||
|
|
9c4e73bbed | ||
|
|
f8af9980fd | ||
|
|
06b2cd87c6 | ||
|
|
f716a05947 | ||
|
|
75899f973b | ||
|
|
e84cb98055 | ||
|
|
aaa2ecddc7 | ||
|
|
7898e9b95d | ||
|
|
5270b46e31 | ||
|
|
d0ab5a4de4 | ||
|
|
9be8ab8371 | ||
|
|
f0be42db38 | ||
|
|
8667211180 | ||
|
|
8168e1cadb | ||
|
|
c15ceaa26c | ||
|
|
ee61b87fe4 | ||
|
|
ddc69778dc | ||
|
|
b3a7b7be81 | ||
|
|
f05df3768b | ||
|
|
1be9f6e460 | ||
|
|
3bbc3da48b | ||
|
|
92f7fe7dc4 | ||
|
|
f1d42d27ce | ||
|
|
f288f63087 | ||
|
|
226045cb8e | ||
|
|
4660870c22 | ||
|
|
412c819699 | ||
|
|
635dcce7f0 | ||
|
|
1457831840 | ||
|
|
00cc6978a2 | ||
|
|
d26e4da9f1 | ||
|
|
0a821526fa |
+19
-3
@@ -21,9 +21,25 @@ before_script:
|
||||
- echo "started by ${GITLAB_USER_NAME}"
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (AppImage) Build Target #
|
||||
# Linux (AppImage) 32-bit Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
build_linux:
|
||||
build_linux_32:
|
||||
image: i386/ubuntu:bionic
|
||||
stage: build
|
||||
script:
|
||||
- apt update
|
||||
- apt install -y build-essential qtcreator qt5-default libusb-1.0-0-dev libhidapi-dev pkgconf wget git
|
||||
- ./scripts/build-appimage-32.sh
|
||||
|
||||
artifacts:
|
||||
paths:
|
||||
- OpenRGB-i386.AppImage
|
||||
expire_in: 1337 years
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Linux (AppImage) 64-bit Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
build_linux_64:
|
||||
image: ubuntu:bionic
|
||||
stage: build
|
||||
script:
|
||||
@@ -35,7 +51,7 @@ build_linux:
|
||||
paths:
|
||||
- OpenRGB-x86_64.AppImage
|
||||
expire_in: 1337 years
|
||||
|
||||
|
||||
#-----------------------------------------------------------------------#
|
||||
# Windows (32-bit) Build Target #
|
||||
#-----------------------------------------------------------------------#
|
||||
|
||||
@@ -19,6 +19,11 @@ KERNEL=="hidraw*", SUBSYSTEM=="hidraw", TAG+="uaccess"
|
||||
#---------------------------------------------------------------#
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0051", TAG+="uaccess"
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# Aorus Devices #
|
||||
#---------------------------------------------------------------#
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="1044", ATTR{idProduct}=="7a42", TAG+="uaccess"
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# ASUS Aura Core Devices #
|
||||
#---------------------------------------------------------------#
|
||||
@@ -43,6 +48,17 @@ SUBSYSTEMS=="usb", ATTR{idVendor}=="0b05", ATTR{idProduct}=="18f3", TAG+="uacces
|
||||
#---------------------------------------------------------------#
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="2516", ATTR{idProduct}=="0109", TAG+="uaccess"
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# Corsair Hydro Series Devices #
|
||||
# #
|
||||
# Corsair H100i Pro RGB #
|
||||
# Corsair H115i Pro RGB #
|
||||
# Corsair H150i Pro RGB #
|
||||
#---------------------------------------------------------------#
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c15", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c13", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="1b1c", ATTR{idProduct}=="0c12", TAG+="uaccess"
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# Corsair Lighting Node Devices #
|
||||
# #
|
||||
@@ -126,12 +142,33 @@ SUBSYSTEMS=="usb", ATTR{idVendor}=="0951", ATTR{idProduct}=="16be", TAG+="uacces
|
||||
# #
|
||||
# Mice: #
|
||||
# Logitech G203 Prodigy #
|
||||
# Logitech G203 Lightsync #
|
||||
# Logitech G403 Prodigy #
|
||||
# Logitech G403 Hero #
|
||||
# Logitech G502 Proteus Spectrum #
|
||||
# Logitech G Lightspeed Wireless Gaming Mouse #
|
||||
# Logitech G Pro Wireless Gaming Mouse (Wired) #
|
||||
# Logitech G Powerplay Mousepad with Lightspeed #
|
||||
# #
|
||||
# Keyboards: #
|
||||
# Logitech G512 #
|
||||
# Logitech G512 RGB #
|
||||
# Logitech G810 #1 #
|
||||
# Logitech G810 #2 #
|
||||
#---------------------------------------------------------------#
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c084", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c092", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c083", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c08f", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c332", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c539", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c088", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c53a", TAG+="uaccess"
|
||||
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c342", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c33c", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c337", TAG+="uaccess"
|
||||
SUBSYSTEMS=="usb", ATTR{idVendor}=="046d", ATTR{idProduct}=="c331", TAG+="uaccess"
|
||||
|
||||
#---------------------------------------------------------------#
|
||||
# MSI Mysticlight #
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "AMDWraithPrismController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_AMDWraithPrism.h"
|
||||
@@ -49,3 +50,5 @@ void DetectAMDWraithPrismControllers(std::vector<RGBController*>& rgb_controller
|
||||
info = info->next;
|
||||
}
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("AMD Wraith Prism", DetectAMDWraithPrismControllers);
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
/*-----------------------------------------*\
|
||||
| ATC800Controller.cpp |
|
||||
| |
|
||||
| Driver for Aorus ATC800 CPU Cooler |
|
||||
| |
|
||||
| |
|
||||
| Felipe Cavalcanti 08/13/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "ATC800Controller.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
ATC800Controller::ATC800Controller(hid_device* dev_handle)
|
||||
{
|
||||
dev = dev_handle;
|
||||
}
|
||||
|
||||
ATC800Controller::~ATC800Controller()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
void ATC800Controller::SendCoolerMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short /*speed*/,
|
||||
unsigned char channel,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
)
|
||||
{
|
||||
unsigned char usb_buf[9];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Lighting Control packet |
|
||||
\*-----------------------------------------------------*/
|
||||
if (channel == AORUS_ATC800_TOP_ZONE)
|
||||
{
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0xbe;
|
||||
usb_buf[0x08] = 0xcc;
|
||||
|
||||
hid_send_feature_report(dev, usb_buf, 9);
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0xc9;
|
||||
usb_buf[0x02] = mode;
|
||||
usb_buf[0x03] = 0x3c;
|
||||
usb_buf[0x04] = 0x02;
|
||||
usb_buf[0x05] = 0x00;
|
||||
usb_buf[0x06] = 0x00;
|
||||
|
||||
hid_send_feature_report(dev, usb_buf, 9);
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0xbc;
|
||||
usb_buf[0x02] = red;
|
||||
usb_buf[0x03] = green;
|
||||
usb_buf[0x04] = blue;
|
||||
|
||||
hid_send_feature_report(dev, usb_buf, 9);
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0xb6;
|
||||
}
|
||||
else if (channel == AORUS_ATC800_FANS_ZONE)
|
||||
{
|
||||
hid_send_feature_report(dev, usb_buf, 9);
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0xc9;
|
||||
usb_buf[0x02] = mode;
|
||||
usb_buf[0x03] = 0x3c;
|
||||
usb_buf[0x04] = 0x02;
|
||||
usb_buf[0x05] = 0x00;
|
||||
usb_buf[0x06] = 0x01;
|
||||
|
||||
hid_send_feature_report(dev, usb_buf, 9);
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0xb0;
|
||||
usb_buf[0x02] = mode;
|
||||
usb_buf[0x03] = red;
|
||||
usb_buf[0x04] = green;
|
||||
usb_buf[0x05] = blue;
|
||||
|
||||
usb_buf[0x06] = red;
|
||||
|
||||
usb_buf[0x07] = green;
|
||||
usb_buf[0x08] = blue;
|
||||
|
||||
for(int i = 0xb0; i <= 0xb3; i++)
|
||||
{
|
||||
usb_buf[0x01] = i; //zone b0->b3
|
||||
hid_send_feature_report(dev, usb_buf, 9);
|
||||
}
|
||||
}
|
||||
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0xb6;
|
||||
|
||||
hid_send_feature_report(dev, usb_buf, 9);
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/*-----------------------------------------*\
|
||||
| ATC800Controller.h |
|
||||
| |
|
||||
| Definitions and types for ATC800 CPU |
|
||||
| Cooler |
|
||||
| |
|
||||
| Felipe Cavalcanti 08/13/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController.h"
|
||||
|
||||
#include <string>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
AORUS_ATC800_MODE_OFF = 0x00,
|
||||
AORUS_ATC800_MODE_STATIC = 0x01,
|
||||
AORUS_ATC800_MODE_PULSE = 0x02,
|
||||
AORUS_ATC800_MODE_FLASHING = 0x04,
|
||||
AORUS_ATC800_MODE_DOUBLE_FLASH = 0x05,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
AORUS_ATC800_SPEED_SLOWEST = 0x00, /* Slowest speed */
|
||||
AORUS_ATC800_SPEED_SLOW = 0x01, /* Slow speed */
|
||||
AORUS_ATC800_SPEED_NORMAL = 0x02, /* Normal speed */
|
||||
AORUS_ATC800_SPEED_FAST = 0x03, /* Fast speed */
|
||||
AORUS_ATC800_SPEED_FASTEST = 0x04, /* Fastest speed */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
AORUS_ATC800_FANS_ZONE = 0,
|
||||
AORUS_ATC800_TOP_ZONE = 1
|
||||
};
|
||||
|
||||
class ATC800Controller
|
||||
{
|
||||
public:
|
||||
ATC800Controller(hid_device* dev_handle);
|
||||
~ATC800Controller();
|
||||
|
||||
void SendCoolerMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char channel,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
};
|
||||
@@ -0,0 +1,87 @@
|
||||
#include "Detector.h"
|
||||
#include "RGBController.h"
|
||||
#include "ATC800Controller.h"
|
||||
#include "RGBController_AorusATC800.h"
|
||||
#include <vector>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Vendor ID |
|
||||
\*-----------------------------------------------------*/
|
||||
#define HOLTEK_VID 0x1044
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Controller product ids |
|
||||
\*-----------------------------------------------------*/
|
||||
#define ATC_800_CONTROLLER_PID 0x7A42
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short usb_vid;
|
||||
unsigned short usb_pid;
|
||||
char usb_interface;
|
||||
device_type type;
|
||||
const char * name;
|
||||
} device;
|
||||
|
||||
#define NUM_DEVICES (sizeof(device_list) / sizeof(device_list[ 0 ]))
|
||||
|
||||
static const device device_list[] =
|
||||
{
|
||||
{ HOLTEK_VID, ATC_800_CONTROLLER_PID, 0, DEVICE_TYPE_KEYBOARD, "Aorus ATC800 CPU Cooler" },
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectAorusCPUCoolerControllers *
|
||||
* *
|
||||
* Tests the USB address to see if a Aorus RGB CPU Cooler exists there. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectAorusCPUCoolerControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
{
|
||||
hid_init();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < NUM_DEVICES; device_idx++)
|
||||
{
|
||||
hid_device_info* info = hid_enumerate(device_list[device_idx].usb_vid, device_list[device_idx].usb_pid);
|
||||
|
||||
while(info)
|
||||
{
|
||||
if((info->vendor_id == device_list[device_idx].usb_vid)
|
||||
&&(info->product_id == device_list[device_idx].usb_pid)
|
||||
#ifdef USE_HID_USAGE
|
||||
&&(info->interface_number == device_list[device_idx].usb_interface)
|
||||
&&(info->usage_page == 0xFF01)
|
||||
&&(info->usage == 1))
|
||||
#else
|
||||
&&(info->interface_number == device_list[device_idx].usb_interface))
|
||||
#endif
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
switch(device_list[device_idx].usb_pid)
|
||||
{
|
||||
case ATC_800_CONTROLLER_PID:
|
||||
{
|
||||
ATC800Controller* controller = new ATC800Controller(dev);
|
||||
|
||||
RGBController_AorusATC800* rgb_controller = new RGBController_AorusATC800(controller);
|
||||
|
||||
rgb_controller->name = device_list[device_idx].name;
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
info = info->next;
|
||||
}
|
||||
hid_free_enumeration(info);
|
||||
}
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("Aorus CPU Coolers", DetectAorusCPUCoolerControllers);
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "AuraCoreController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_AuraCore.h"
|
||||
@@ -43,3 +44,5 @@ void DetectAuraCoreControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("ASUS Aura Core", DetectAuraCoreControllers);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
| Jan Rettig (Klapstuhl) 14.02.2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "Detector.h"
|
||||
#include "AuraGPUController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_AuraGPU.h"
|
||||
@@ -82,4 +83,6 @@ void DetectAuraGPUControllers(std::vector<i2c_smbus_interface*> &busses, std::ve
|
||||
std::this_thread::sleep_for(1ms);
|
||||
}
|
||||
}
|
||||
} /* DetectAuraGPUControllers() */
|
||||
} /* DetectAuraGPUControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("ASUS Aura GPU", DetectAuraGPUControllers);
|
||||
|
||||
@@ -10,6 +10,21 @@
|
||||
#include "AuraSMBusController.h"
|
||||
#include <cstring>
|
||||
|
||||
static const char* aura_channels[] = /* Aura channel strings */
|
||||
{
|
||||
"Audio",
|
||||
"Backplate",
|
||||
"Back I/O",
|
||||
"Center",
|
||||
"Center",
|
||||
"DRAM",
|
||||
"PCIe",
|
||||
"RGB Header",
|
||||
"RGB Header 2",
|
||||
"RGB Header",
|
||||
"Unknown",
|
||||
};
|
||||
|
||||
AuraSMBusController::AuraSMBusController(i2c_smbus_interface* bus, aura_dev_id dev)
|
||||
{
|
||||
this->bus = bus;
|
||||
@@ -45,7 +60,7 @@ AuraSMBusController::AuraSMBusController(i2c_smbus_interface* bus, aura_dev_id d
|
||||
{
|
||||
direct_reg = AURA_REG_COLORS_DIRECT_V2;
|
||||
effect_reg = AURA_REG_COLORS_EFFECT_V2;
|
||||
channel_cfg = AURA_CONFIG_CHANNEL_V2;
|
||||
channel_cfg = AURA_CONFIG_CHANNEL_V1;
|
||||
}
|
||||
// AUMA0-E6K5-0106 - Second generation motherboard controller
|
||||
else if (strcmp(device_name, "AUMA0-E6K5-0106") == 0)
|
||||
@@ -68,6 +83,13 @@ AuraSMBusController::AuraSMBusController(i2c_smbus_interface* bus, aura_dev_id d
|
||||
effect_reg = AURA_REG_COLORS_EFFECT_V2;
|
||||
channel_cfg = AURA_CONFIG_CHANNEL_V2;
|
||||
}
|
||||
// AUMA0-E8K4-0101 - Second generation motherboard controller
|
||||
else if (strcmp(device_name, "AUMA0-E8K4-0101") == 0)
|
||||
{
|
||||
direct_reg = AURA_REG_COLORS_DIRECT_V2;
|
||||
effect_reg = AURA_REG_COLORS_EFFECT_V2;
|
||||
channel_cfg = AURA_CONFIG_CHANNEL_V2;
|
||||
}
|
||||
// Assume first generation controller if string does not match
|
||||
else
|
||||
{
|
||||
|
||||
@@ -66,21 +66,6 @@ enum
|
||||
AURA_LED_CHANNEL_RGB_HEADER_3 = 0x91, /* RGB Header 3 LED channel */
|
||||
};
|
||||
|
||||
static const char* aura_channels[] = /* Aura channel strings */
|
||||
{
|
||||
"Audio",
|
||||
"Backplate",
|
||||
"Back I/O",
|
||||
"Center",
|
||||
"Center",
|
||||
"DRAM",
|
||||
"PCIe",
|
||||
"RGB Header",
|
||||
"RGB Header 2",
|
||||
"RGB Header",
|
||||
"Unknown",
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
AURA_CONFIG_LED_COUNT = 0x02, /* LED Count configuration offset */
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "AuraSMBusController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_AuraSMBus.h"
|
||||
@@ -188,3 +189,5 @@ void DetectAuraSMBusControllers(std::vector<i2c_smbus_interface*> &busses, std::
|
||||
}
|
||||
|
||||
} /* DetectAuraSMBusControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("ASUS Aura SMBus", DetectAuraSMBusControllers);
|
||||
|
||||
@@ -40,7 +40,7 @@ void AuraAddressableController::SetChannelLEDs(unsigned char channel, RGBColor *
|
||||
leds_to_send = num_colors - leds_sent;
|
||||
}
|
||||
|
||||
for(int led_idx = 0; led_idx < leds_to_send; led_idx++)
|
||||
for(unsigned int led_idx = 0; led_idx < leds_to_send; led_idx++)
|
||||
{
|
||||
led_data[(led_idx * 3) + 0] = RGBGetRValue(colors[led_idx + leds_sent]);
|
||||
led_data[(led_idx * 3) + 1] = RGBGetGValue(colors[led_idx + leds_sent]);
|
||||
|
||||
@@ -44,7 +44,7 @@ void AuraMainboardController::SetChannelLEDs(unsigned char channel, RGBColor * c
|
||||
leds_to_send = num_colors - leds_sent;
|
||||
}
|
||||
|
||||
for(int led_idx = 0; led_idx < leds_to_send; led_idx++)
|
||||
for(unsigned int led_idx = 0; led_idx < leds_to_send; led_idx++)
|
||||
{
|
||||
led_data[(led_idx * 3) + 0] = RGBGetRValue(colors[led_idx + leds_sent]);
|
||||
led_data[(led_idx * 3) + 1] = RGBGetGValue(colors[led_idx + leds_sent]);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "AuraAddressableController.h"
|
||||
#include "AuraMainboardController.h"
|
||||
#include "RGBController.h"
|
||||
@@ -74,4 +75,6 @@ void DetectAuraUSBControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* DetectAuraUSBControllers() */
|
||||
|
||||
REGISTER_DETECTOR("ASUS Aura USB", DetectAuraUSBControllers);
|
||||
|
||||
@@ -9,18 +9,38 @@
|
||||
|
||||
#include "CMMP750Controller.h"
|
||||
|
||||
static unsigned char colour_mode_data[][6] =
|
||||
{
|
||||
{ 0x01, 0x04, 0xFF, 0x00, 0xFF, 0x00 }, /* Static */
|
||||
{ 0x02, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Blinking */
|
||||
{ 0x03, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Breathing */
|
||||
{ 0x04, 0x04, 0x80, 0x00, 0x00, 0x00 }, /* Colour Cycle */
|
||||
{ 0x05, 0x04, 0x80, 0x00, 0x00, 0x00 } /* Colour Breath */
|
||||
};
|
||||
|
||||
static unsigned char speed_mode_data[][9] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },/* Static */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Blinking */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Breathing */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Colour Cycle */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 } /* Colour Breath */
|
||||
};
|
||||
|
||||
CMMP750Controller::CMMP750Controller(hid_device* dev_handle, wchar_t *_vendor, wchar_t *_device_name, char *_path)
|
||||
{
|
||||
int tmp_size = wcslen(_vendor);
|
||||
dev = dev_handle;
|
||||
location = _path;
|
||||
std::size_t tmp_size = wcslen(_vendor);
|
||||
dev = dev_handle;
|
||||
location = _path;
|
||||
|
||||
for (int i=0; ( i<tmp_size && i<CM_DEVICE_NAME_SIZE); i++)
|
||||
for(std::size_t i = 0; (i < tmp_size) && (i < CM_DEVICE_NAME_SIZE); i++)
|
||||
{
|
||||
device_name[i] = (char)_vendor[i];
|
||||
}
|
||||
for (int j=0; ( j<wcslen(_vendor) && tmp_size+j<CM_DEVICE_NAME_SIZE); j++)
|
||||
device_name[tmp_size+j] = (char)_device_name[j];
|
||||
for(std::size_t j = 0; (j < wcslen(_vendor)) && (tmp_size + j < CM_DEVICE_NAME_SIZE); j++)
|
||||
{
|
||||
device_name[tmp_size + j] = (char)_device_name[j];
|
||||
}
|
||||
|
||||
GetStatus(); //When setting up device get current status
|
||||
}
|
||||
@@ -39,20 +59,22 @@ void CMMP750Controller::GetStatus()
|
||||
hid_write(dev, buffer, buffer_size);
|
||||
hid_read(dev, buffer, buffer_size);
|
||||
|
||||
if( buffer[0] == 0x80 && buffer[1] == 0x05 )
|
||||
if((buffer[0] == 0x80) && (buffer[1] == 0x05))
|
||||
{
|
||||
current_mode = buffer[2] - 1;
|
||||
current_red = buffer[3];
|
||||
current_green = buffer[4];
|
||||
current_blue = buffer[5];
|
||||
|
||||
for( int i = 0; speed_mode_data[current_mode][i] >= buffer[6]; i++)
|
||||
for(int i = 0; speed_mode_data[current_mode][i] >= buffer[6]; i++)
|
||||
{
|
||||
current_speed = i;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Code should never reach here however just in case there is a failure set something
|
||||
current_mode = MP750_MODE_COLOR_CYCLE; //Unicorn Spew
|
||||
current_mode = MP750_MODE_COLOR_CYCLE; //Unicorn Spew
|
||||
current_red = 0xFF;
|
||||
current_green = 0xFF;
|
||||
current_blue = 0xFF;
|
||||
@@ -122,7 +144,7 @@ void CMMP750Controller::SendUpdate()
|
||||
unsigned char buffer[0x40] = { 0x00 };
|
||||
int buffer_size = (sizeof(buffer) / sizeof(buffer[0]));
|
||||
|
||||
for(int i = 0; i < CM_COLOUR_MODE_DATA_SIZE; i++)
|
||||
for(std::size_t i = 0; i < CM_COLOUR_MODE_DATA_SIZE; i++)
|
||||
{
|
||||
buffer[i] = colour_mode_data[current_mode][i];
|
||||
}
|
||||
@@ -130,16 +152,16 @@ void CMMP750Controller::SendUpdate()
|
||||
if(current_mode > MP750_MODE_BREATHING)
|
||||
{
|
||||
//If the mode is random colours set SPEED at BYTE2
|
||||
buffer[CM_RED_BYTE] = speed_mode_data[current_mode][current_speed];
|
||||
buffer[CM_RED_BYTE] = speed_mode_data[current_mode][current_speed];
|
||||
}
|
||||
else
|
||||
{
|
||||
//Otherwise SPEED is BYTE5
|
||||
buffer[CM_RED_BYTE] = current_red;
|
||||
buffer[CM_GREEN_BYTE] = current_green;
|
||||
buffer[CM_BLUE_BYTE] = current_blue;
|
||||
buffer[CM_SPEED_BYTE] = speed_mode_data[current_mode][current_speed];
|
||||
buffer[CM_RED_BYTE] = current_red;
|
||||
buffer[CM_GREEN_BYTE] = current_green;
|
||||
buffer[CM_BLUE_BYTE] = current_blue;
|
||||
buffer[CM_SPEED_BYTE] = speed_mode_data[current_mode][current_speed];
|
||||
}
|
||||
|
||||
hid_write(dev, buffer, buffer_size);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,24 +44,6 @@ enum
|
||||
MP750_MODE_BREATH_CYCLE = 0x04 //Breathing Cycle Mode
|
||||
};
|
||||
|
||||
static unsigned char colour_mode_data[][6] =
|
||||
{
|
||||
{ 0x01, 0x04, 0xFF, 0x00, 0xFF, 0x00 }, /* Static */
|
||||
{ 0x02, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Blinking */
|
||||
{ 0x03, 0x04, 0xFF, 0x00, 0xFF, 0x80 }, /* Breathing */
|
||||
{ 0x04, 0x04, 0x80, 0x00, 0x00, 0x00 }, /* Colour Cycle */
|
||||
{ 0x05, 0x04, 0x80, 0x00, 0x00, 0x00 } /* Colour Breath */
|
||||
};
|
||||
|
||||
static unsigned char speed_mode_data[][9] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 },/* Static */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Blinking */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Breathing */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 },/* Colour Cycle */
|
||||
{ 0xFF, 0xE0, 0xC0, 0xA0, 0x80, 0x60, 0x40, 0x20, 0x00 } /* Colour Breath */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
MP750_SPEED_SLOWEST = 0x00, /* Slowest speed */
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "CMMP750Controller.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_CMMP750Controller.h"
|
||||
@@ -43,7 +44,7 @@ void DetectCoolerMasterControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
hid_device* dev = NULL;
|
||||
if(info->vendor_id == COOLERMASTER_VID)
|
||||
{
|
||||
for(int cm_pid_idx = 0; cm_pid_idx < COOLERMASTER_NUM_DEVICES; cm_pid_idx++)
|
||||
for(unsigned int cm_pid_idx = 0; cm_pid_idx < COOLERMASTER_NUM_DEVICES; cm_pid_idx++)
|
||||
{
|
||||
if((info->product_id == cm_pids[cm_pid_idx][CM_PID])
|
||||
&&(info->interface_number == cm_pids[cm_pid_idx][CM_INTERFACE]))
|
||||
@@ -63,4 +64,6 @@ void DetectCoolerMasterControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
info = info->next;
|
||||
}
|
||||
hid_free_enumeration(info);
|
||||
}
|
||||
} /* DetectCoolerMasterControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Cooler Master", DetectCoolerMasterControllers);
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| Processing Code for Corsair Hydro Series |
|
||||
| |
|
||||
| Adam Honse ([email protected]), 8/17/2020 |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "CorsairHydroController.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
CorsairHydroController::CorsairHydroController(libusb_device_handle* dev_handle)
|
||||
{
|
||||
dev = dev_handle;
|
||||
|
||||
SendInit();
|
||||
|
||||
SendFirmwareRequest();
|
||||
}
|
||||
|
||||
std::string CorsairHydroController::GetFirmwareString()
|
||||
{
|
||||
return(firmware_version);
|
||||
}
|
||||
|
||||
void CorsairHydroController::SetBlink
|
||||
(
|
||||
std::vector<RGBColor> & colors,
|
||||
unsigned char speed
|
||||
)
|
||||
{
|
||||
SendColors(colors);
|
||||
SendSpeed(speed);
|
||||
SendApplyBlink();
|
||||
}
|
||||
|
||||
void CorsairHydroController::SetFixed
|
||||
(
|
||||
std::vector<RGBColor> & colors
|
||||
)
|
||||
{
|
||||
SendColors(colors);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Fixed mode seems to just be shift mode with the same |
|
||||
| value for both colors |
|
||||
\*-----------------------------------------------------*/
|
||||
SendApplyShift();
|
||||
}
|
||||
|
||||
void CorsairHydroController::SetPulse
|
||||
(
|
||||
std::vector<RGBColor> & colors,
|
||||
unsigned char speed
|
||||
)
|
||||
{
|
||||
SendColors(colors);
|
||||
SendSpeed(speed);
|
||||
SendApplyPulse();
|
||||
}
|
||||
|
||||
void CorsairHydroController::SetShift
|
||||
(
|
||||
std::vector<RGBColor> & colors,
|
||||
unsigned char speed
|
||||
)
|
||||
{
|
||||
SendColors(colors);
|
||||
SendSpeed(speed);
|
||||
SendApplyShift();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------------------------------*\
|
||||
| Private packet sending functions. |
|
||||
\*-------------------------------------------------------------------------------------------------*/
|
||||
|
||||
void CorsairHydroController::SendApplyBlink()
|
||||
{
|
||||
unsigned char usb_buf[3];
|
||||
int actual;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Apply Blink packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0] = 0x58;
|
||||
usb_buf[1] = 0x01;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
libusb_bulk_transfer(dev, 0x01, usb_buf, 2, &actual, 1000);
|
||||
libusb_bulk_transfer(dev, 0x81, usb_buf, 3, &actual, 1000);
|
||||
}
|
||||
|
||||
void CorsairHydroController::SendApplyPulse()
|
||||
{
|
||||
unsigned char usb_buf[3];
|
||||
int actual;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Apply Pulse packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0] = 0x52;
|
||||
usb_buf[1] = 0x01;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
libusb_bulk_transfer(dev, 0x01, usb_buf, 2, &actual, 1000);
|
||||
libusb_bulk_transfer(dev, 0x81, usb_buf, 3, &actual, 1000);
|
||||
}
|
||||
|
||||
void CorsairHydroController::SendApplyShift()
|
||||
{
|
||||
unsigned char usb_buf[3];
|
||||
int actual;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Apply Shift packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0] = 0x55;
|
||||
usb_buf[1] = 0x01;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
libusb_bulk_transfer(dev, 0x01, usb_buf, 2, &actual, 1000);
|
||||
libusb_bulk_transfer(dev, 0x81, usb_buf, 3, &actual, 1000);
|
||||
}
|
||||
|
||||
void CorsairHydroController::SendFirmwareRequest()
|
||||
{
|
||||
unsigned char usb_buf[8];
|
||||
int actual;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Firmware Request packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0] = 0xAA;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
libusb_bulk_transfer(dev, 0x01, usb_buf, 1, &actual, 1000);
|
||||
libusb_bulk_transfer(dev, 0x81, usb_buf, 7, &actual, 1000);
|
||||
|
||||
firmware_version = std::to_string(usb_buf[3]) + "." + std::to_string(usb_buf[4]) + "." + std::to_string(usb_buf[5]) + "." + std::to_string(usb_buf[6]);
|
||||
}
|
||||
|
||||
void CorsairHydroController::SendColors
|
||||
(
|
||||
std::vector<RGBColor> & colors
|
||||
)
|
||||
{
|
||||
unsigned char usb_buf[23];
|
||||
int actual;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Send Colors packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0] = 0x56;
|
||||
usb_buf[1] = colors.size();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Fill in colors from vector |
|
||||
\*---------------------------------------------------------*/
|
||||
for(std::size_t color_idx = 0; color_idx < colors.size(); color_idx++)
|
||||
{
|
||||
usb_buf[(color_idx * 3) + 2] = RGBGetRValue(colors[color_idx]);
|
||||
usb_buf[(color_idx * 3) + 3] = RGBGetGValue(colors[color_idx]);
|
||||
usb_buf[(color_idx * 3) + 4] = RGBGetBValue(colors[color_idx]);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| If the color vector only has one entry, duplicate it, as |
|
||||
| the controller appears to require two colors in order to |
|
||||
| update. |
|
||||
\*---------------------------------------------------------*/
|
||||
if((color_idx == 0) && colors.size() == 1)
|
||||
{
|
||||
usb_buf[1] = colors.size() + 1;
|
||||
usb_buf[(color_idx * 3) + 5] = RGBGetRValue(colors[color_idx]);
|
||||
usb_buf[(color_idx * 3) + 6] = RGBGetGValue(colors[color_idx]);
|
||||
usb_buf[(color_idx * 3) + 7] = RGBGetBValue(colors[color_idx]);
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
libusb_bulk_transfer(dev, 0x01, usb_buf, 2 + (usb_buf[1] * 3), &actual, 1000);
|
||||
libusb_bulk_transfer(dev, 0x81, usb_buf, 3, &actual, 1000);
|
||||
}
|
||||
|
||||
void CorsairHydroController::SendInit()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
libusb_control_transfer( dev, 0x40, 0x00, 0xffff, 0x0000, NULL, 0, 0 );
|
||||
libusb_control_transfer( dev, 0x40, 0x02, 0x0002, 0x0000, NULL, 0, 0 );
|
||||
}
|
||||
|
||||
void CorsairHydroController::SendSpeed
|
||||
(
|
||||
unsigned char speed
|
||||
)
|
||||
{
|
||||
unsigned char usb_buf[3];
|
||||
int actual;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Send Speed packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0] = 0x53;
|
||||
usb_buf[1] = speed;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
libusb_bulk_transfer(dev, 0x01, usb_buf, 2, &actual, 1000);
|
||||
libusb_bulk_transfer(dev, 0x81, usb_buf, 3, &actual, 1000);
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| Definitions for Corsair Hydro Series |
|
||||
| |
|
||||
| Adam Honse ([email protected]), 8/17/2020 |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController.h"
|
||||
#include <vector>
|
||||
#include <libusb-1.0/libusb.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_HYDRO_CMD_READ_PUMP_SPEED = 0x31,
|
||||
CORSAIR_HYDRO_CMD_WRITE_PUMP_MODE = 0x32,
|
||||
CORSAIR_HYDRO_CMD_READ_PUMP_MODE = 0x33,
|
||||
CORSAIR_HYDRO_CMD_READ_FAN_SPEED = 0x41,
|
||||
CORSAIR_HYDRO_CMD_READ_AIO_TEMP = 0xA9,
|
||||
CORSAIR_HYDRO_CMD_READ_FIRMWARE = 0xAA,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_HYDRO_PUMP_MODE_QUIET = 0x00,
|
||||
CORSAIR_HYDRO_PUMP_MODE_BALANCED = 0x01,
|
||||
CORSAIR_HYDRO_PUMP_MODE_PERFORMANCE = 0x02,
|
||||
};
|
||||
|
||||
class CorsairHydroController
|
||||
{
|
||||
public:
|
||||
CorsairHydroController(libusb_device_handle* dev_handle);
|
||||
~CorsairHydroController();
|
||||
|
||||
unsigned char GetFanPercent(unsigned char fan_channel);
|
||||
|
||||
unsigned short GetFanRPM(unsigned char fan_channel);
|
||||
|
||||
std::string GetFirmwareString();
|
||||
|
||||
void SetBlink
|
||||
(
|
||||
std::vector<RGBColor> & colors,
|
||||
unsigned char speed
|
||||
);
|
||||
|
||||
void SetFixed
|
||||
(
|
||||
std::vector<RGBColor> & colors
|
||||
);
|
||||
|
||||
void SetPulse
|
||||
(
|
||||
std::vector<RGBColor> & colors,
|
||||
unsigned char speed
|
||||
);
|
||||
|
||||
void SetShift
|
||||
(
|
||||
std::vector<RGBColor> & colors,
|
||||
unsigned char speed
|
||||
);
|
||||
|
||||
private:
|
||||
libusb_device_handle* dev;
|
||||
std::string firmware_version;
|
||||
|
||||
void SendApplyBlink();
|
||||
void SendApplyPulse();
|
||||
void SendApplyShift();
|
||||
|
||||
void SendColors
|
||||
(
|
||||
std::vector<RGBColor> & colors
|
||||
);
|
||||
|
||||
void SendFirmwareRequest();
|
||||
|
||||
void SendInit();
|
||||
|
||||
void SendSpeed
|
||||
(
|
||||
unsigned char speed
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,74 @@
|
||||
#include "Detector.h"
|
||||
#include "CorsairHydroController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_CorsairHydro.h"
|
||||
#include <vector>
|
||||
#include <libusb-1.0/libusb.h>
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Corsair vendor ID |
|
||||
\*-----------------------------------------------------*/
|
||||
#define CORSAIR_VID 0x1B1C
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Keyboard Hydro Series product IDs |
|
||||
\*-----------------------------------------------------*/
|
||||
#define CORSAIR_H115I_PRO_RGB_PID 0x0C13
|
||||
#define CORSAIR_H100I_PRO_RGB_PID 0x0C15
|
||||
#define CORSAIR_H150I_PRO_RGB_PID 0x0C12
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short usb_vid;
|
||||
unsigned short usb_pid;
|
||||
unsigned char usb_interface;
|
||||
const char * name;
|
||||
} corsair_hydro_device;
|
||||
|
||||
#define CORSAIR_NUM_DEVICES (sizeof(device_list) / sizeof(device_list[ 0 ]))
|
||||
|
||||
static const corsair_hydro_device device_list[] =
|
||||
{
|
||||
/*-----------------------------------------------------------------------------------------------------*\
|
||||
| Coolers |
|
||||
\*-----------------------------------------------------------------------------------------------------*/
|
||||
{ CORSAIR_VID, CORSAIR_H100I_PRO_RGB_PID, 0, "Corsair H100i PRO RGB" },
|
||||
{ CORSAIR_VID, CORSAIR_H115I_PRO_RGB_PID, 0, "Corsair H115i PRO RGB" },
|
||||
{ CORSAIR_VID, CORSAIR_H150I_PRO_RGB_PID, 0, "Corsair H150i PRO RGB" },
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectCorsairHydroControllers *
|
||||
* *
|
||||
* Tests the USB address to see if a Corsair RGB Cooler controller exists there. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectCorsairHydroControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
{
|
||||
libusb_context * ctx;
|
||||
libusb_init(&ctx);
|
||||
|
||||
for(std::size_t device_idx = 0; device_idx < CORSAIR_NUM_DEVICES; device_idx++)
|
||||
{
|
||||
libusb_device_handle * dev = libusb_open_device_with_vid_pid(ctx, device_list[device_idx].usb_vid, device_list[device_idx].usb_pid);
|
||||
|
||||
//Look for Corsair RGB Peripheral
|
||||
if(dev)
|
||||
{
|
||||
libusb_detach_kernel_driver(dev, 0);
|
||||
libusb_claim_interface(dev, 0);
|
||||
|
||||
CorsairHydroController* controller = new CorsairHydroController(dev);//, device_list[device_idx].usb_endpoint);
|
||||
|
||||
RGBController_CorsairHydro* rgb_controller = new RGBController_CorsairHydro(controller);
|
||||
|
||||
rgb_controller->name = device_list[device_idx].name;
|
||||
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
} /* DetectCorsairHydroControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Corsair Hydro Series", DetectCorsairHydroControllers);
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "CorsairLightingNodeController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_CorsairLightingNode.h"
|
||||
@@ -77,3 +78,5 @@ void DetectCorsairLightingNodeControllers(std::vector<RGBController*> &rgb_contr
|
||||
}
|
||||
}
|
||||
} /* DetectCorsairLightingNodeControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Corsair Lighting Node", DetectCorsairLightingNodeControllers);
|
||||
|
||||
@@ -22,6 +22,30 @@ static unsigned int keys[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x
|
||||
116, 117, 120, 121, 122, 123, 124, 126, 127, 128, 129, 132, 133, 134, 135,
|
||||
136, 137, 139, 140, 141};
|
||||
|
||||
|
||||
static unsigned int keys_k95_plat[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0C, 0x0D, 0x0E, 0x0F, 0x11, 0x12,
|
||||
0x14, 0x15, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x24, 0x25, 0x26,
|
||||
0x27, 0x28, 0x2A, 0x2B, 0x2C, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
|
||||
0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x42, 0x43, 0x44, 0x45, 0x48, 73, 74, 75, 76, 78,
|
||||
79, 80, 81, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 96, 97,
|
||||
98, 99, 100, 101, 102, 103, 104, 105, 108, 109, 110, 111, 112, 113, 115,
|
||||
116, 117, 120, 121, 122, 123, 124, 126, 127, 128, 129, 132, 133, 134, 135,
|
||||
136, 137, 139, 140, 141,
|
||||
0x10, 114, 0x0a, 0x16, 0x22, 0x2e, 0x3a, 0x46,
|
||||
144, 145, 146, 158, 160, 147, 148, 149, 150, 151, 152, 153,
|
||||
154, 155, 159, 162, 161, 156, 157};
|
||||
|
||||
static unsigned int keys_k95[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0C, 0x0D, 0x0E, 0x0F, 0x11, 0x12,
|
||||
0x14, 0x15, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, 0x20, 0x21, 0x24, 0x25, 0x26,
|
||||
0x27, 0x28, 0x2A, 0x2B, 0x2C, 0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39,
|
||||
0x3C, 0x3D, 0x3E, 0x3F, 0x40, 0x42, 0x43, 0x44, 0x45, 0x48, 73, 74, 75, 76, 78,
|
||||
79, 80, 81, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 96, 97,
|
||||
98, 99, 100, 101, 102, 103, 104, 105, 108, 109, 110, 111, 112, 113, 115,
|
||||
116, 117, 120, 121, 122, 123, 124, 126, 127, 128, 129, 132, 133, 134, 135,
|
||||
136, 137, 139, 140, 141,
|
||||
0x10, 114, 0x0a, 0x16, 0x22, 0x2e, 0x3a, 0x46, 0x52, 0x5e, 0x6a, 0x76, 0x3b, 0x47, 0x53,
|
||||
0x5f, 0x6b, 0x77, 0x83, 0x8f, 0x0b, 0x17, 0x23, 0x2f};
|
||||
|
||||
static unsigned int st100[] = { 0x00, 0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x08, 0x04 };
|
||||
|
||||
CorsairPeripheralController::CorsairPeripheralController(hid_device* dev_handle)
|
||||
@@ -43,6 +67,16 @@ device_type CorsairPeripheralController::GetDeviceType()
|
||||
return type;
|
||||
}
|
||||
|
||||
int CorsairPeripheralController::GetPhysicalLayout()
|
||||
{
|
||||
return physical_layout;
|
||||
}
|
||||
|
||||
int CorsairPeripheralController::GetLogicalLayout()
|
||||
{
|
||||
return logical_layout;
|
||||
}
|
||||
|
||||
std::string CorsairPeripheralController::GetFirmwareString()
|
||||
{
|
||||
return firmware_version;
|
||||
@@ -88,9 +122,9 @@ void CorsairPeripheralController::SetLEDs(std::vector<RGBColor>colors)
|
||||
|
||||
void CorsairPeripheralController::SetLEDsKeyboardFull(std::vector<RGBColor> colors)
|
||||
{
|
||||
unsigned char red_val[144];
|
||||
unsigned char grn_val[144];
|
||||
unsigned char blu_val[144];
|
||||
unsigned char red_val[168];
|
||||
unsigned char grn_val[168];
|
||||
unsigned char blu_val[168];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffers |
|
||||
@@ -105,9 +139,24 @@ void CorsairPeripheralController::SetLEDsKeyboardFull(std::vector<RGBColor> colo
|
||||
for(std::size_t color_idx = 0; color_idx < colors.size(); color_idx++)
|
||||
{
|
||||
RGBColor color = colors[color_idx];
|
||||
red_val[keys[color_idx]] = RGBGetRValue(color);
|
||||
grn_val[keys[color_idx]] = RGBGetGValue(color);
|
||||
blu_val[keys[color_idx]] = RGBGetBValue(color);
|
||||
if (logical_layout == CORSAIR_TYPE_K95_PLAT)
|
||||
{
|
||||
red_val[keys_k95_plat[color_idx]] = RGBGetRValue(color);
|
||||
grn_val[keys_k95_plat[color_idx]] = RGBGetGValue(color);
|
||||
blu_val[keys_k95_plat[color_idx]] = RGBGetBValue(color);
|
||||
}
|
||||
else if (logical_layout == CORSAIR_TYPE_K95)
|
||||
{
|
||||
red_val[keys_k95[color_idx]] = RGBGetRValue(color);
|
||||
grn_val[keys_k95[color_idx]] = RGBGetGValue(color);
|
||||
blu_val[keys_k95[color_idx]] = RGBGetBValue(color);
|
||||
}
|
||||
else
|
||||
{
|
||||
red_val[keys[color_idx]] = RGBGetRValue(color);
|
||||
grn_val[keys[color_idx]] = RGBGetGValue(color);
|
||||
blu_val[keys[color_idx]] = RGBGetBValue(color);
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -115,7 +164,7 @@ void CorsairPeripheralController::SetLEDsKeyboardFull(std::vector<RGBColor> colo
|
||||
\*-----------------------------------------------------*/
|
||||
StreamPacket(1, 60, &red_val[0]);
|
||||
StreamPacket(2, 60, &red_val[60]);
|
||||
StreamPacket(3, 24, &red_val[120]);
|
||||
StreamPacket(3, 48, &red_val[120]);
|
||||
SubmitKeyboardFullColors(1, 3, 1);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -123,7 +172,7 @@ void CorsairPeripheralController::SetLEDsKeyboardFull(std::vector<RGBColor> colo
|
||||
\*-----------------------------------------------------*/
|
||||
StreamPacket(1, 60, &grn_val[0]);
|
||||
StreamPacket(2, 60, &grn_val[60]);
|
||||
StreamPacket(3, 24, &grn_val[120]);
|
||||
StreamPacket(3, 48, &grn_val[120]);
|
||||
SubmitKeyboardFullColors(2, 3, 1);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -131,7 +180,7 @@ void CorsairPeripheralController::SetLEDsKeyboardFull(std::vector<RGBColor> colo
|
||||
\*-----------------------------------------------------*/
|
||||
StreamPacket(1, 60, &blu_val[0]);
|
||||
StreamPacket(2, 60, &blu_val[60]);
|
||||
StreamPacket(3, 24, &blu_val[120]);
|
||||
StreamPacket(3, 48, &blu_val[120]);
|
||||
SubmitKeyboardFullColors(3, 3, 2);
|
||||
}
|
||||
|
||||
@@ -286,6 +335,7 @@ void CorsairPeripheralController::SpecialFunctionControl()
|
||||
hid_write(dev, (unsigned char *)usb_buf, 65);
|
||||
}
|
||||
|
||||
|
||||
void CorsairPeripheralController::ReadFirmwareInfo()
|
||||
{
|
||||
int actual;
|
||||
@@ -340,6 +390,23 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
||||
switch((unsigned char)usb_buf[0x14 + offset])
|
||||
{
|
||||
case 0xC0:
|
||||
{
|
||||
unsigned short pid = (unsigned short)(usb_buf[0x0F] << 8) + (unsigned char)(usb_buf[0x0E]);
|
||||
|
||||
switch(pid)
|
||||
{
|
||||
case 0x2D1B:
|
||||
logical_layout = CORSAIR_TYPE_K95_PLAT;
|
||||
break;
|
||||
|
||||
case 0x1B11:
|
||||
logical_layout = CORSAIR_TYPE_K95;
|
||||
break;
|
||||
|
||||
default:
|
||||
logical_layout = CORSAIR_TYPE_NORMAL;
|
||||
}
|
||||
}
|
||||
type = DEVICE_TYPE_KEYBOARD;
|
||||
break;
|
||||
|
||||
@@ -379,6 +446,21 @@ void CorsairPeripheralController::ReadFirmwareInfo()
|
||||
{
|
||||
firmware_version = std::to_string(usb_buf[0x09 + offset]) + "." + std::to_string(usb_buf[0x08 + offset]);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Get the correct Keyboard Layout |
|
||||
\*-----------------------------------------------------*/
|
||||
switch((unsigned char)usb_buf[0x17 + offset])
|
||||
{
|
||||
case CORSAIR_LAYOUT_ANSI:
|
||||
physical_layout = CORSAIR_LAYOUT_ANSI;
|
||||
break;
|
||||
case CORSAIR_LAYOUT_ISO:
|
||||
physical_layout = CORSAIR_LAYOUT_ISO;
|
||||
break;
|
||||
default:
|
||||
physical_layout = CORSAIR_LAYOUT_ANSI;
|
||||
}
|
||||
}
|
||||
|
||||
void CorsairPeripheralController::StreamPacket
|
||||
|
||||
@@ -47,12 +47,30 @@ enum
|
||||
CORSAIR_COLOR_CHANNEL_BLUE = 0x03
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_LAYOUT_ANSI = 0x00,
|
||||
CORSAIR_LAYOUT_ISO = 0x01,
|
||||
CORSAIR_LAYOUT_ABNT = 0x02,
|
||||
CORSAIR_LAYOUT_JIS = 0x03,
|
||||
CORSAIR_LAYOUT_DUBEOLSIK = 0x04
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_TYPE_NORMAL = 0,
|
||||
CORSAIR_TYPE_K95_PLAT = 1,
|
||||
CORSAIR_TYPE_K95 = 2
|
||||
};
|
||||
|
||||
class CorsairPeripheralController
|
||||
{
|
||||
public:
|
||||
CorsairPeripheralController(hid_device* dev_handle);
|
||||
~CorsairPeripheralController();
|
||||
|
||||
int GetLogicalLayout();
|
||||
int GetPhysicalLayout();
|
||||
device_type GetDeviceType();
|
||||
std::string GetFirmwareString();
|
||||
|
||||
@@ -67,6 +85,8 @@ private:
|
||||
|
||||
std::string firmware_version;
|
||||
device_type type;
|
||||
int physical_layout; //ANSI, ISO, etc.
|
||||
int logical_layout; //Normal, K95 or K95 Platinum
|
||||
|
||||
void LightingControl();
|
||||
void SpecialFunctionControl();
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "CorsairPeripheralController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_CorsairPeripheral.h"
|
||||
@@ -44,6 +45,8 @@
|
||||
#define CORSAIR_HARPOON_RGB_PRO_PID 0x1B75
|
||||
#define CORSAIR_M65_PRO_PID 0x1B2E
|
||||
#define CORSAIR_M65_RGB_ELITE_PID 0x1B5A
|
||||
#define CORSAIR_SCIMITAR_PRO_RGB_PID 0x1B3E
|
||||
#define CORSAIR_SABRE_RGB_PID 0x1B2F
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Mousepad product IDs |
|
||||
@@ -95,6 +98,8 @@ static const corsair_node_device device_list[] =
|
||||
{ CORSAIR_VID, CORSAIR_HARPOON_RGB_PRO_PID, 1, "Corsair Harpoon RGB PRO" },
|
||||
{ CORSAIR_VID, CORSAIR_M65_PRO_PID, 1, "Corsair M65 PRO" },
|
||||
{ CORSAIR_VID, CORSAIR_M65_RGB_ELITE_PID, 1, "Corsair M65 RGB Elite" },
|
||||
{ CORSAIR_VID, CORSAIR_SCIMITAR_PRO_RGB_PID, 1, "Corsair Scimitar PRO RGB" },
|
||||
{ CORSAIR_VID, CORSAIR_SABRE_RGB_PID, 1, "Corsair Sabre RGB" },
|
||||
/*-----------------------------------------------------------------------------------------------------*\
|
||||
| Mousemats |
|
||||
\*-----------------------------------------------------------------------------------------------------*/
|
||||
@@ -157,4 +162,6 @@ void DetectCorsairPeripheralControllers(std::vector<RGBController*>& rgb_control
|
||||
info = info->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* DetectCorsairPeripheralControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Corsair Peripheral", DetectCorsairPeripheralControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "CorsairVengeanceController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_CorsairVengeance.h"
|
||||
@@ -122,4 +123,6 @@ void DetectCorsairVengeanceControllers(std::vector<i2c_smbus_interface*> &busses
|
||||
}
|
||||
}
|
||||
|
||||
} /* DetectCorsairVengeanceControllers() */
|
||||
} /* DetectCorsairVengeanceControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("Corsair Vengeance", DetectCorsairVengeanceControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "CorsairVengeanceProController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_CorsairVengeancePro.h"
|
||||
@@ -130,4 +131,6 @@ void DetectCorsairVengeanceProControllers(std::vector<i2c_smbus_interface*> &bus
|
||||
}
|
||||
}
|
||||
|
||||
} /* DetectCorsairVengeanceProControllers() */
|
||||
} /* DetectCorsairVengeanceProControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("Corsair Vengeance Pro", DetectCorsairVengeanceProControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "CrucialController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_Crucial.h"
|
||||
@@ -86,3 +87,5 @@ void DetectCrucialControllers(std::vector<i2c_smbus_interface*> &busses, std::ve
|
||||
}
|
||||
|
||||
} /* DetectCrucialControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("Crucial", DetectCrucialControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "DuckyKeyboardController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_DuckyKeyboard.h"
|
||||
@@ -78,4 +79,6 @@ void DetectDuckyKeyboardControllers(std::vector<RGBController*>& rgb_controllers
|
||||
info = info->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* DetectDuckyKeyboardControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Ducky Keyboard", DetectDuckyKeyboardControllers);
|
||||
|
||||
@@ -9,31 +9,69 @@
|
||||
|
||||
#include "EKController.h"
|
||||
|
||||
static unsigned char colour_mode_data[][16] =
|
||||
{
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x01, 0x00, 0xFF, 0x64}, // Static
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x02, 0x00, 0xFF, 0x64}, // Breathing
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x03, 0xFF, 0xFF, 0x64}, // Fading
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x04, 0x00, 0xFF, 0x64}, // Marquee
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x05, 0x00, 0xFF, 0x64}, // Covering Marquee
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x06, 0x00, 0xFF, 0x64}, // Pulse
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x07, 0x00, 0xFF, 0x64}, // Wave
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x08, 0x00, 0xFF, 0x64}, // Alternating
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x09, 0x00, 0xFF, 0x64}, // Candle
|
||||
};
|
||||
|
||||
static unsigned char speed_mode_data[][9] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Static
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Breathing
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Fading
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Marquee
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Covering Marquee
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Pulse
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Wave
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Alternating
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 } // Candle
|
||||
};
|
||||
|
||||
EKController::EKController(hid_device* dev_handle, wchar_t *_vendor, wchar_t *_device_name, char *_path)
|
||||
{
|
||||
int tmp_size = wcslen(_vendor);
|
||||
std::size_t tmp_size = wcslen(_vendor);
|
||||
|
||||
dev = dev_handle;
|
||||
|
||||
for(int i=0; (i < tmp_size) && (i < EK_DEVICE_NAME_SIZE); i++)
|
||||
for(std::size_t i = 0; (i < tmp_size) && (i < EK_DEVICE_NAME_SIZE); i++)
|
||||
{
|
||||
device_name[i] = (char)_vendor[i];
|
||||
}
|
||||
|
||||
for(int j=0; (j < wcslen(_vendor)) && ((tmp_size + j) < EK_DEVICE_NAME_SIZE); j++)
|
||||
for(std::size_t j = 0; (j < wcslen(_vendor)) && ((tmp_size + j) < EK_DEVICE_NAME_SIZE); j++)
|
||||
{
|
||||
device_name[tmp_size+j] = (char)_device_name[j];
|
||||
device_name[tmp_size + j] = (char)_device_name[j];
|
||||
}
|
||||
|
||||
location = _path;
|
||||
|
||||
current_mode = EK_MODE_STATIC;
|
||||
current_mode = EK_MODE_STATIC;
|
||||
current_speed = EK_SPEED_NORMAL;
|
||||
}
|
||||
|
||||
EKController::~EKController()
|
||||
{
|
||||
hid_close(dev);
|
||||
if(dev)
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
}
|
||||
|
||||
char* EKController::GetDeviceName()
|
||||
@@ -73,15 +111,15 @@ void EKController::SendUpdate()
|
||||
unsigned char buffer[EK_PACKET_LENGTH] = { 0x00 };
|
||||
int buffer_size = (sizeof(buffer) / sizeof(buffer[0]));
|
||||
|
||||
for(int i = 0; i < EK_COLOUR_MODE_DATA_SIZE; i++)
|
||||
for(std::size_t i = 0; i < EK_COLOUR_MODE_DATA_SIZE; i++)
|
||||
{
|
||||
buffer[i] = colour_mode_data[current_mode][i];
|
||||
}
|
||||
|
||||
//Set the relevant colour info
|
||||
buffer[EK_RED_BYTE] = current_red;
|
||||
buffer[EK_RED_BYTE] = current_red;
|
||||
buffer[EK_GREEN_BYTE] = current_green;
|
||||
buffer[EK_BLUE_BYTE] = current_blue;
|
||||
buffer[EK_BLUE_BYTE] = current_blue;
|
||||
buffer[EK_SPEED_BYTE] = speed_mode_data[current_mode][current_speed];
|
||||
|
||||
buffer[10] = 0x10;
|
||||
|
||||
@@ -39,41 +39,6 @@ enum
|
||||
EK_MODE_CANDLE = 0x08 //Candle Mode
|
||||
};
|
||||
|
||||
static unsigned char colour_mode_data[][16] =
|
||||
{
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x01, 0x00, 0xFF, 0x64}, // Static
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x02, 0x00, 0xFF, 0x64}, // Breathing
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x03, 0xFF, 0xFF, 0x64}, // Fading
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x04, 0x00, 0xFF, 0x64}, // Marquee
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x05, 0x00, 0xFF, 0x64}, // Covering Marquee
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x06, 0x00, 0xFF, 0x64}, // Pulse
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x07, 0x00, 0xFF, 0x64}, // Wave
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x08, 0x00, 0xFF, 0x64}, // Alternating
|
||||
{ 0x10, 0x12, 0x29, 0xAA, 0x01, 0x10, 0xA2, 0x60,
|
||||
0x00, 0x10, 0x20, 0x01, 0x09, 0x00, 0xFF, 0x64}, // Candle
|
||||
};
|
||||
|
||||
static unsigned char speed_mode_data[][9] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Static
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Breathing
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Fading
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Marquee
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Covering Marquee
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Pulse
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Wave
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 }, // Alternating
|
||||
{ 0x00, 0x0C, 0x19, 0x25, 0x32, 0x3E, 0x4B, 0x57, 0x64 } // Candle
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
EK_SPEED_SLOWEST = 0x00, // Slowest speed
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "EKController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_EKController.h"
|
||||
@@ -30,18 +31,18 @@ static const unsigned int ek_pids[][2] =
|
||||
|
||||
void DetectEKControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
{
|
||||
hid_device_info* info;
|
||||
hid_device_info* info = NULL;
|
||||
|
||||
//Look for the passed in cm_pids
|
||||
hid_init();
|
||||
info = hid_enumerate(0x0, 0x0);
|
||||
info = hid_enumerate(EK_VID, 0x0);
|
||||
|
||||
while(info)
|
||||
{
|
||||
hid_device* dev = NULL;
|
||||
if(info->vendor_id == EK_VID)
|
||||
{
|
||||
for(int ek_pid_idx = 0; ek_pid_idx < EK_NUM_DEVICES; ek_pid_idx++)
|
||||
for(unsigned int ek_pid_idx = 0; ek_pid_idx < EK_NUM_DEVICES; ek_pid_idx++)
|
||||
{
|
||||
if((info->product_id == ek_pids[ek_pid_idx][EK_PID])
|
||||
&&(info->interface_number == ek_pids[ek_pid_idx][EK_INTERFACE]))
|
||||
@@ -61,4 +62,6 @@ void DetectEKControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
info = info->next;
|
||||
}
|
||||
hid_free_enumeration(info);
|
||||
}
|
||||
} /* DetectEKControllers() */
|
||||
|
||||
REGISTER_DETECTOR("EK", DetectEKControllers);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
| Niels Westphal (crashniels) 12.07.2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "Detector.h"
|
||||
#include "GalaxGPUController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_GalaxGPU.h"
|
||||
@@ -66,3 +67,5 @@ void DetectGalaxGPUControllers(std::vector<i2c_smbus_interface*> &busses, std::v
|
||||
}
|
||||
|
||||
} /* DetectGalaxGPUControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("Galax GPU", DetectGalaxGPUControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "GloriousModelOController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_GloriousModelO.h"
|
||||
@@ -21,9 +22,6 @@ void DetectGloriousModelOControllers(std::vector<RGBController*>& rgb_controller
|
||||
hid_device* dev = NULL;
|
||||
|
||||
hid_init();
|
||||
|
||||
dev = NULL;
|
||||
|
||||
info = hid_enumerate(Glorious_Model_O_VID, Glorious_Model_O_PID);
|
||||
|
||||
//Look for Glorious Model O
|
||||
@@ -57,4 +55,6 @@ void DetectGloriousModelOControllers(std::vector<RGBController*>& rgb_controller
|
||||
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
} /* DetectGloriousModelOControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Glorious Model O", DetectGloriousModelOControllers);
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
/*-----------------------------------------------*\
|
||||
| HoltekA070Controller.cpp |
|
||||
| |
|
||||
| Driver for Holtek USB Gaming Mouse [04d9:a070] |
|
||||
| |
|
||||
| Santeri Pikarinen (santeri3700) 8/01/2020 |
|
||||
\*-----------------------------------------------*/
|
||||
|
||||
#include "HoltekA070Controller.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
HoltekA070Controller::HoltekA070Controller(hid_device* dev_handle)
|
||||
{
|
||||
dev = dev_handle;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------------------------------*\
|
||||
| Private packet sending functions. |
|
||||
\*-------------------------------------------------------------------------------------------------*/
|
||||
|
||||
void HoltekA070Controller::SendCustomColor
|
||||
(
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
)
|
||||
{
|
||||
char usb_buf[8];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up RGB Control packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0x07; // PACKET SIZE?
|
||||
usb_buf[0x01] = 0x0a; // SET RGB
|
||||
usb_buf[0x02] = 0x00; // SAVE (does not work with SET RGB)
|
||||
usb_buf[0x03] = red; // RED
|
||||
usb_buf[0x04] = green; // GREEN
|
||||
usb_buf[0x05] = blue; // BLUE
|
||||
usb_buf[0x06] = 0x00; // PADDING?
|
||||
usb_buf[0x07] = 0x00; // PADDING?
|
||||
|
||||
// So far no saving function has been discovered for the "SET RGB" command.
|
||||
// Such functionality might not even exist for the A070 series.
|
||||
// The chosen RGB color will therefore reset after a power cycle.
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, (unsigned char *)usb_buf, sizeof(usb_buf));
|
||||
}
|
||||
|
||||
void HoltekA070Controller::SendMode
|
||||
(
|
||||
unsigned char mode
|
||||
)
|
||||
{
|
||||
|
||||
char usb_buf[8];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up lighting mode control packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0x07; // PACKET SIZE?
|
||||
usb_buf[0x01] = 0x0b; // SET LIGHTING MODE
|
||||
usb_buf[0x02] = 0x01; // SAVE
|
||||
usb_buf[0x03] = mode; // MODE 01-04
|
||||
usb_buf[0x04] = 0x00; // PADDING?
|
||||
usb_buf[0x05] = 0x00; // PADDING?
|
||||
usb_buf[0x06] = 0x00; // PADDING?
|
||||
usb_buf[0x07] = 0x00; // PADDING?
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, (unsigned char *)usb_buf, sizeof(usb_buf));
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*---------------------------------------------------------------*\
|
||||
| HoltekA070Controller.h |
|
||||
| |
|
||||
| Definitions and types for Holtek USB Gaming Mouse [04d9:a070] |
|
||||
| |
|
||||
| Santeri Pikarinen (santeri3700) 8/01/2020 |
|
||||
\*---------------------------------------------------------------*/
|
||||
|
||||
#include "RGBController.h"
|
||||
|
||||
#include <string>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
HOLTEK_A070_MODE_STATIC = 0x01,
|
||||
HOLTEK_A070_MODE_BREATHING_SLOW = 0x02,
|
||||
HOLTEK_A070_MODE_BREATHING_MEDIUM = 0x03,
|
||||
HOLTEK_A070_MODE_BREATHING_FAST = 0x04
|
||||
};
|
||||
|
||||
class HoltekA070Controller
|
||||
{
|
||||
public:
|
||||
HoltekA070Controller(hid_device* dev_handle);
|
||||
~HoltekA070Controller();
|
||||
|
||||
void SendCustomColor
|
||||
(
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
);
|
||||
|
||||
void SendMode
|
||||
(
|
||||
unsigned char mode
|
||||
);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
};
|
||||
@@ -0,0 +1,89 @@
|
||||
#include "Detector.h"
|
||||
#include "HoltekA070Controller.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_HoltekA070.h"
|
||||
#include <vector>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Holtek Semiconductor Inc. vendor ID |
|
||||
\*-----------------------------------------------------*/
|
||||
#define HOLTEK_VID 0x04D9
|
||||
/*-----------------------------------------------------*\
|
||||
| Mouse product IDs |
|
||||
\*-----------------------------------------------------*/
|
||||
#define HOLTEK_A070_PID 0xA070
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short usb_vid;
|
||||
unsigned short usb_pid;
|
||||
unsigned char usb_interface;
|
||||
device_type type;
|
||||
const char * name;
|
||||
} holtek_device;
|
||||
|
||||
#define HOLTEK_NUM_DEVICES (sizeof(device_list) / sizeof(device_list[ 0 ]))
|
||||
|
||||
static const holtek_device device_list[] =
|
||||
{
|
||||
/*-------------------------------------------------------------------------------------------------------------*\
|
||||
| Mice |
|
||||
\*-------------------------------------------------------------------------------------------------------------*/
|
||||
{ HOLTEK_VID, HOLTEK_A070_PID, 1, DEVICE_TYPE_MOUSE, "Holtek USB Gaming Mouse" },
|
||||
};
|
||||
|
||||
void DetectHoltekControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
{
|
||||
hid_init();
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < HOLTEK_NUM_DEVICES; device_idx++)
|
||||
{
|
||||
switch(device_list[device_idx].type)
|
||||
{
|
||||
case DEVICE_TYPE_MOUSE:
|
||||
{
|
||||
hid_device_info* info = hid_enumerate(device_list[device_idx].usb_vid, device_list[device_idx].usb_pid);
|
||||
|
||||
while(info)
|
||||
{
|
||||
if((info->vendor_id == device_list[device_idx].usb_vid)
|
||||
&&(info->product_id == device_list[device_idx].usb_pid)
|
||||
#ifdef USE_HID_USAGE
|
||||
&&(info->interface_number == device_list[device_idx].usb_interface)
|
||||
&&(info->usage_page == 0xFF00)
|
||||
&&(info->usage == 2))
|
||||
#else
|
||||
&&(info->interface_number == device_list[device_idx].usb_interface))
|
||||
#endif
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
switch(device_list[device_idx].usb_pid)
|
||||
{
|
||||
case HOLTEK_A070_PID:
|
||||
{
|
||||
HoltekA070Controller* controller = new HoltekA070Controller(dev);
|
||||
|
||||
RGBController_HoltekA070* rgb_controller = new RGBController_HoltekA070(controller);
|
||||
|
||||
rgb_controller->name = device_list[device_idx].name;
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
info = info->next;
|
||||
}
|
||||
hid_free_enumeration(info);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
} /* DetectHoltekControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Holtek", DetectHoltekControllers);
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "HuePlusController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_HuePlus.h"
|
||||
@@ -17,16 +18,23 @@
|
||||
|
||||
void DetectHuePlusControllers(std::vector<RGBController*> &rgb_controllers)
|
||||
{
|
||||
size_t i;
|
||||
HuePlusController* new_hueplus;
|
||||
RGBController_HuePlus* new_controller;
|
||||
|
||||
std::string portname = find_usb_serial_port(NZXT_HUE_PLUS_VID, NZXT_HUE_PLUS_PID);
|
||||
if( portname != "" )
|
||||
{
|
||||
new_hueplus = new HuePlusController();
|
||||
new_hueplus->Initialize((char *)portname.c_str());
|
||||
std::vector<std::string *> ports = find_usb_serial_port(NZXT_HUE_PLUS_VID, NZXT_HUE_PLUS_PID);
|
||||
|
||||
new_controller = new RGBController_HuePlus(new_hueplus);
|
||||
rgb_controllers.push_back(new_controller);
|
||||
for (i = 0; i < ports.size(); i++)
|
||||
{
|
||||
if( *ports[i] != "" )
|
||||
{
|
||||
new_hueplus = new HuePlusController();
|
||||
new_hueplus->Initialize((char *)ports[i]->c_str());
|
||||
|
||||
new_controller = new RGBController_HuePlus(new_hueplus);
|
||||
rgb_controllers.push_back(new_controller);
|
||||
}
|
||||
}
|
||||
} /* DetectHuePlusControllers() */
|
||||
|
||||
REGISTER_DETECTOR("NZXT Hue+", DetectHuePlusControllers);
|
||||
|
||||
@@ -188,8 +188,8 @@ enum
|
||||
static const unsigned char slot_base[4] =
|
||||
{
|
||||
HYPERX_REG_SLOT0_LED0_RED, /* SPD 0x50 maps to slot 0 */
|
||||
HYPERX_REG_SLOT1_LED0_RED, /* SPD 0x51 maps to slot 1 */
|
||||
HYPERX_REG_SLOT2_LED0_RED, /* SPD 0x52 maps to slot 2 */
|
||||
HYPERX_REG_SLOT2_LED0_RED, /* SPD 0x51 maps to slot 2 */
|
||||
HYPERX_REG_SLOT1_LED0_RED, /* SPD 0x52 maps to slot 1 */
|
||||
HYPERX_REG_SLOT3_LED0_RED /* SPD 0x53 maps to slot 3 */
|
||||
};
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "HyperXDRAMController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_HyperXDRAM.h"
|
||||
@@ -93,3 +94,5 @@ void DetectHyperXDRAMControllers(std::vector<i2c_smbus_interface*> &busses, std:
|
||||
}
|
||||
|
||||
} /* DetectHyperXDRAMControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("HyperX DRAM", DetectHyperXDRAMControllers);
|
||||
|
||||
@@ -116,7 +116,7 @@ void HyperXAlloyOriginsController::SendDirectColorPacket
|
||||
/*-----------------------------------------------------*\
|
||||
| Copy in color data |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int color_idx = 0; color_idx < color_count; color_idx++)
|
||||
for(unsigned int color_idx = 0; color_idx < color_count; color_idx++)
|
||||
{
|
||||
buf[(color_idx * 4) + 1] = 0x81;
|
||||
buf[(color_idx * 4) + 2] = RGBGetRValue(color_data[color_idx]);
|
||||
@@ -128,4 +128,4 @@ void HyperXAlloyOriginsController::SendDirectColorPacket
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, buf, 65);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -401,7 +401,7 @@ void HyperXKeyboardController::SendExtendedColor
|
||||
/*-----------------------------------------------------*\
|
||||
| Fill in color data |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int i = 0x08; i <= 0x93; i++)
|
||||
for(int i = 0x08; i < 0x94; i++)
|
||||
{
|
||||
buf[i] = color_data[i];
|
||||
}
|
||||
@@ -470,7 +470,7 @@ void HyperXKeyboardController::SendDirectExtended
|
||||
/*-----------------------------------------------------*\
|
||||
| Fill in color data |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int i = 0x08; i <= 0x93; i++)
|
||||
for(int i = 0x08; i < 0x94; i++)
|
||||
{
|
||||
buf[i] = color_data[i];
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "HyperXAlloyOriginsController.h"
|
||||
#include "HyperXKeyboardController.h"
|
||||
#include "RGBController.h"
|
||||
@@ -9,10 +10,11 @@
|
||||
/*-----------------------------------------------------*\
|
||||
| HyperX keyboard vendor IDs |
|
||||
\*-----------------------------------------------------*/
|
||||
#define HYPERX_KEYBOARD_VID 0x0951
|
||||
#define HYPERX_ALLOY_ELITE_PID 0x16BE
|
||||
#define HYPERX_ALLOY_FPS_RGB_PID 0x16DC
|
||||
#define HYPERX_ALLOY_ORIGINS_PID 0x16E5
|
||||
#define HYPERX_KEYBOARD_VID 0x0951
|
||||
#define HYPERX_ALLOY_ELITE_PID 0x16BE
|
||||
#define HYPERX_ALLOY_FPS_RGB_PID 0x16DC
|
||||
#define HYPERX_ALLOY_ORIGINS_PID 0x16E5
|
||||
#define HYPERX_ALLOY_ORIGINS_CORE_PID 0x16E6
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -29,9 +31,10 @@ static const hyperx_device device_list[] =
|
||||
/*-----------------------------------------------------------------------------------------------------*\
|
||||
| Keyboards |
|
||||
\*-----------------------------------------------------------------------------------------------------*/
|
||||
{ HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ELITE_PID, 2, "HyperX Alloy Elite RGB" },
|
||||
{ HYPERX_KEYBOARD_VID, HYPERX_ALLOY_FPS_RGB_PID, 2, "HyperX Alloy FPS RGB" },
|
||||
{ HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_PID, 3, "HyperX Alloy Origins" },
|
||||
{ HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ELITE_PID, 2, "HyperX Alloy Elite RGB" },
|
||||
{ HYPERX_KEYBOARD_VID, HYPERX_ALLOY_FPS_RGB_PID, 2, "HyperX Alloy FPS RGB" },
|
||||
{ HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_PID, 3, "HyperX Alloy Origins" },
|
||||
{ HYPERX_KEYBOARD_VID, HYPERX_ALLOY_ORIGINS_CORE_PID, 3, "HyperX Alloy Origins Core" },
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
@@ -104,4 +107,6 @@ void DetectHyperXKeyboardControllers(std::vector<RGBController*>& rgb_controller
|
||||
info = info->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* DetectHyperXKeyboardControllers() */
|
||||
|
||||
REGISTER_DETECTOR("HyperX Keyboard", DetectHyperXKeyboardControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "HyperXPulsefireSurgeController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_HyperXPulsefireSurge.h"
|
||||
@@ -54,7 +55,12 @@ void DetectHyperXMouseControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
{
|
||||
if((info->vendor_id == device_list[device_idx].usb_vid)
|
||||
&&(info->product_id == device_list[device_idx].usb_pid)
|
||||
&&(info->interface_number == device_list[device_idx].usb_interface))
|
||||
#ifdef USE_HID_USAGE
|
||||
&&(info->interface_number == device_list[device_idx].usb_interface)
|
||||
&&(info->usage_page == 0xFF01))
|
||||
#else
|
||||
&&(info->interface_number == device_list[device_idx].usb_interface))
|
||||
#endif
|
||||
{
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
@@ -73,4 +79,6 @@ void DetectHyperXMouseControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
info = info->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* DetectHyperXMouseControllers() */
|
||||
|
||||
REGISTER_DETECTOR("HyperX Mouse", DetectHyperXMouseControllers);
|
||||
|
||||
@@ -19,4 +19,107 @@ HyperXPulsefireSurgeController::HyperXPulsefireSurgeController(hid_device* dev_h
|
||||
HyperXPulsefireSurgeController::~HyperXPulsefireSurgeController()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------------------------------*\
|
||||
| Private packet sending functions. |
|
||||
\*-------------------------------------------------------------------------------------------------*/
|
||||
|
||||
void HyperXPulsefireSurgeController::SelectProfile
|
||||
(
|
||||
unsigned char profile
|
||||
)
|
||||
{
|
||||
unsigned char buf[264];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(buf, 0x00, sizeof(buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Select Profile packet |
|
||||
\*-----------------------------------------------------*/
|
||||
buf[0x00] = 0x07;
|
||||
buf[0x01] = HYPERX_PULSEFIRE_SURGE_PACKET_ID_SELECT_PROFILE;
|
||||
buf[0x02] = profile;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, buf, 264);
|
||||
}
|
||||
|
||||
void HyperXPulsefireSurgeController::SetProfileBrightness
|
||||
(
|
||||
unsigned char profile,
|
||||
unsigned char brightness
|
||||
)
|
||||
{
|
||||
unsigned char buf[264];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(buf, 0x00, sizeof(buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Select Profile packet |
|
||||
\*-----------------------------------------------------*/
|
||||
buf[0x00] = 0x07;
|
||||
buf[0x01] = HYPERX_PULSEFIRE_SURGE_PACKET_ID_SET_BRIGHTNESS;
|
||||
buf[0x02] = profile;
|
||||
buf[0x03] = 0x01;
|
||||
buf[0x04] = 0x01;
|
||||
buf[0x05] = 0x01;
|
||||
buf[0x06] = brightness;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, buf, 264);
|
||||
}
|
||||
|
||||
void HyperXPulsefireSurgeController::SendDirect
|
||||
(
|
||||
RGBColor* color_data
|
||||
)
|
||||
{
|
||||
unsigned char buf[264];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(buf, 0x00, sizeof(buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Select Profile packet |
|
||||
\*-----------------------------------------------------*/
|
||||
buf[0x00] = 0x07;
|
||||
buf[0x01] = HYPERX_PULSEFIRE_SURGE_PACKET_ID_DIRECT;
|
||||
buf[0x03] = 0xA0;
|
||||
|
||||
for(int red_idx = 0; red_idx < 32; red_idx++)
|
||||
{
|
||||
buf[0x08 + red_idx] = RGBGetRValue(color_data[red_idx]);
|
||||
}
|
||||
|
||||
for(int grn_idx = 0; grn_idx < 32; grn_idx++)
|
||||
{
|
||||
buf[0x28 + grn_idx] = RGBGetGValue(color_data[grn_idx]);
|
||||
}
|
||||
|
||||
for(int blu_idx = 0; blu_idx < 32; blu_idx++)
|
||||
{
|
||||
buf[0x48 + blu_idx] = RGBGetBValue(color_data[blu_idx]);
|
||||
}
|
||||
|
||||
buf[0x6C] = RGBGetRValue(color_data[32]);
|
||||
buf[0x6D] = RGBGetGValue(color_data[32]);
|
||||
buf[0x6E] = RGBGetBValue(color_data[32]);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, buf, 264);
|
||||
}
|
||||
|
||||
@@ -14,12 +14,45 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
HYPERX_PULSEFIRE_SURGE_PACKET_ID_SET_CONFIGURATION = 0x01, /* Set profile configuration packet */
|
||||
HYPERX_PULSEFIRE_SURGE_PACKET_ID_SET_BRIGHTNESS = 0x03, /* Set profile settings and brightness */
|
||||
HYPERX_PULSEFIRE_SURGE_PACKET_ID_SELECT_PROFILE = 0x07, /* Select profile */
|
||||
HYPERX_PULSEFIRE_SURGE_PACKET_ID_DIRECT = 0x14, /* Direct control packet */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
HYPERX_PULSEFIRE_SURGE_MODE_SOLID = 0x00, /* Solid color mode */
|
||||
HYPERX_PULSEFIRE_SURGE_MODE_CYCLE = 0x01, /* Spectrum cycle mode */
|
||||
HYPERX_PULSEFIRE_SURGE_MODE_BREATHING = 0x02, /* Breathing mode */
|
||||
HYPERX_PULSEFIRE_SURGE_MODE_WAVE = 0x03, /* Wave mode */
|
||||
HYPERX_PULSEFIRE_SURGE_MODE_TRIGGER = 0x04, /* Trigger mode */
|
||||
};
|
||||
|
||||
class HyperXPulsefireSurgeController
|
||||
{
|
||||
public:
|
||||
HyperXPulsefireSurgeController(hid_device* dev_handle);
|
||||
~HyperXPulsefireSurgeController();
|
||||
|
||||
void SelectProfile
|
||||
(
|
||||
unsigned char profile
|
||||
);
|
||||
|
||||
void SetProfileBrightness
|
||||
(
|
||||
unsigned char profile,
|
||||
unsigned char brightness
|
||||
);
|
||||
|
||||
void SendDirect
|
||||
(
|
||||
RGBColor* color_data
|
||||
);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "LEDStripController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_LEDStrip.h"
|
||||
@@ -21,7 +22,7 @@
|
||||
* DetectLEDStripControllers *
|
||||
* *
|
||||
* Detect devices supported by the LEDStrip driver *
|
||||
* * *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectLEDStripControllers(std::vector<RGBController*> &rgb_controllers)
|
||||
@@ -29,24 +30,11 @@ void DetectLEDStripControllers(std::vector<RGBController*> &rgb_controllers)
|
||||
LEDStripController* new_ledstrip;
|
||||
RGBController_LEDStrip* new_controller;
|
||||
|
||||
//Get file path in executable directory
|
||||
std::ifstream infile;
|
||||
char filename[2048];
|
||||
char arg1[64];
|
||||
|
||||
#ifdef WIN32
|
||||
GetModuleFileName(NULL, filename, 2048);
|
||||
strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str());
|
||||
strcat(filename, "\\ledstrip.txt");
|
||||
#else
|
||||
snprintf(arg1, 64, "/proc/%d/exe", getpid());
|
||||
readlink(arg1, filename, 1024);
|
||||
strcpy(filename, std::string(filename).substr(0, std::string(filename).find_last_of("\\/")).c_str());
|
||||
strcat(filename, "/ledstrip.txt");
|
||||
#endif
|
||||
|
||||
//Open settings file
|
||||
infile.open(filename);
|
||||
infile.open("ledstrip.txt");
|
||||
|
||||
if (infile.good())
|
||||
{
|
||||
@@ -84,5 +72,6 @@ void DetectLEDStripControllers(std::vector<RGBController*> &rgb_controllers)
|
||||
}
|
||||
}
|
||||
|
||||
} /* DetectLEDStripControllers() */
|
||||
|
||||
} /* DetectLEDStripControllers() */
|
||||
REGISTER_DETECTOR("LED Strip", DetectLEDStripControllers);
|
||||
|
||||
@@ -1,29 +1,45 @@
|
||||
#include "Detector.h"
|
||||
#include "LogitechG203Controller.h"
|
||||
#include "LogitechG203LController.h"
|
||||
#include "LogitechG403Controller.h"
|
||||
#include "LogitechG502PSController.h"
|
||||
#include "LogitechG810Controller.h"
|
||||
#include "LogitechGProWirelessController.h"
|
||||
#include "LogitechGPowerPlayController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_LogitechG203.h"
|
||||
#include "RGBController_LogitechG203L.h"
|
||||
#include "RGBController_LogitechG403.h"
|
||||
#include "RGBController_LogitechG502PS.h"
|
||||
#include "RGBController_LogitechG810.h"
|
||||
#include "RGBController_LogitechGProWireless.h"
|
||||
#include "RGBController_LogitechGPowerPlay.h"
|
||||
#include <vector>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Logitech vendor ID |
|
||||
\*-----------------------------------------------------*/
|
||||
#define LOGITECH_VID 0x046D
|
||||
#define LOGITECH_VID 0x046D
|
||||
/*-----------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*-----------------------------------------------------*/
|
||||
#define LOGITECH_G810_1_PID 0xC337
|
||||
#define LOGITECH_G810_2_PID 0xC331
|
||||
#define LOGITECH_G512_PID 0xC342
|
||||
#define LOGITECH_G810_1_PID 0xC337
|
||||
#define LOGITECH_G810_2_PID 0xC331
|
||||
#define LOGITECH_G512_PID 0xC342
|
||||
#define LOGITECH_G512_RGB_PID 0xC33C
|
||||
/*-----------------------------------------------------*\
|
||||
| Mouse product IDs |
|
||||
\*-----------------------------------------------------*/
|
||||
#define LOGITECH_G203_PID 0xC084
|
||||
#define LOGITECH_G403_PID 0xC083
|
||||
#define LOGITECH_G403H_PID 0xC08F
|
||||
#define LOGITECH_G203_PID 0xC084
|
||||
#define LOGITECH_G203L_PID 0xC092
|
||||
#define LOGITECH_G403_PID 0xC083
|
||||
#define LOGITECH_G403H_PID 0xC08F
|
||||
#define LOGITECH_G502_PS_PID 0xC332
|
||||
#define LOGITECH_G502H_PID 0xC08B
|
||||
#define LOGITECH_G_LIGHTSPEED_WIRELESS_PID 0xC539
|
||||
#define LOGITECH_GPRO_WIRELESS_PID 0xC088
|
||||
#define LOGITECH_G_LIGHTSPEED_POWERPLAY_PID 0xC53A
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -38,21 +54,28 @@ typedef struct
|
||||
|
||||
static const logitech_device device_list[] =
|
||||
{
|
||||
/*-------------------------------------------------------------------------------------------------------------*\
|
||||
| Keyboards |
|
||||
\*-------------------------------------------------------------------------------------------------------------*/
|
||||
{ LOGITECH_VID, LOGITECH_G810_1_PID, 1, DEVICE_TYPE_KEYBOARD, "Logitech G810 Orion Spectrum" },
|
||||
{ LOGITECH_VID, LOGITECH_G810_2_PID, 1, DEVICE_TYPE_KEYBOARD, "Logitech G810 Orion Spectrum" },
|
||||
{ LOGITECH_VID, LOGITECH_G512_PID, 1, DEVICE_TYPE_KEYBOARD, "Logitech G512" },
|
||||
/*-------------------------------------------------------------------------------------------------------------*\
|
||||
| Mice |
|
||||
\*-------------------------------------------------------------------------------------------------------------*/
|
||||
{ LOGITECH_VID, LOGITECH_G203_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G203 Prodigy" },
|
||||
{ LOGITECH_VID, LOGITECH_G403_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G403 Prodigy" },
|
||||
{ LOGITECH_VID, LOGITECH_G403H_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G403 Hero" },
|
||||
/*-------------------------------------------------------------------------------------------------------------*\
|
||||
| Mousemats |
|
||||
\*-------------------------------------------------------------------------------------------------------------*/
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------*\
|
||||
| Keyboards |
|
||||
\*-------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
{ LOGITECH_VID, LOGITECH_G810_1_PID, 1, DEVICE_TYPE_KEYBOARD, "Logitech G810 Orion Spectrum" },
|
||||
{ LOGITECH_VID, LOGITECH_G810_2_PID, 1, DEVICE_TYPE_KEYBOARD, "Logitech G810 Orion Spectrum" },
|
||||
{ LOGITECH_VID, LOGITECH_G512_PID, 1, DEVICE_TYPE_KEYBOARD, "Logitech G512" },
|
||||
{ LOGITECH_VID, LOGITECH_G512_RGB_PID, 1, DEVICE_TYPE_KEYBOARD, "Logitech G512 RGB" },
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------*\
|
||||
| Mice |
|
||||
\*-------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
{ LOGITECH_VID, LOGITECH_G203_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G203 Prodigy" },
|
||||
{ LOGITECH_VID, LOGITECH_G203L_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G203 Lightsync" },
|
||||
{ LOGITECH_VID, LOGITECH_G403_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G403 Prodigy" },
|
||||
{ LOGITECH_VID, LOGITECH_G403H_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G403 Hero" },
|
||||
{ LOGITECH_VID, LOGITECH_G502_PS_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G502 Proteus Spectrum" },
|
||||
{ LOGITECH_VID, LOGITECH_G502H_PID, 1, DEVICE_TYPE_MOUSE, "Logitech G502 Hero" },
|
||||
{ LOGITECH_VID, LOGITECH_G_LIGHTSPEED_WIRELESS_PID, 2, DEVICE_TYPE_MOUSE, "Logitech G Lightspeed Wireless Gaming Mouse" },
|
||||
{ LOGITECH_VID, LOGITECH_GPRO_WIRELESS_PID, 2, DEVICE_TYPE_MOUSE, "Logitech G Pro Wireless Gaming Mouse (Wired)" },
|
||||
{ LOGITECH_VID, LOGITECH_G_LIGHTSPEED_POWERPLAY_PID, 2, DEVICE_TYPE_MOUSE, "Logitech G Powerplay Mousepad with Lightspeed" },
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------------------*\
|
||||
| Mousemats |
|
||||
\*-------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
@@ -67,7 +90,7 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
{
|
||||
hid_init();
|
||||
|
||||
for(int device_idx = 0; device_idx < LOGITECH_NUM_DEVICES; device_idx++)
|
||||
for(unsigned int device_idx = 0; device_idx < LOGITECH_NUM_DEVICES; device_idx++)
|
||||
{
|
||||
switch(device_list[device_idx].type)
|
||||
{
|
||||
@@ -172,6 +195,17 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
}
|
||||
break;
|
||||
|
||||
case LOGITECH_G203L_PID:
|
||||
{
|
||||
LogitechG203LController* controller = new LogitechG203LController(dev);
|
||||
|
||||
RGBController_LogitechG203L* rgb_controller = new RGBController_LogitechG203L(controller);
|
||||
|
||||
rgb_controller->name = device_list[device_idx].name;
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
break;
|
||||
|
||||
case LOGITECH_G403_PID:
|
||||
case LOGITECH_G403H_PID:
|
||||
{
|
||||
@@ -182,6 +216,50 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
rgb_controller->name = device_list[device_idx].name;
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
break;
|
||||
|
||||
case LOGITECH_G502_PS_PID:
|
||||
case LOGITECH_G502H_PID:
|
||||
{
|
||||
LogitechG502PSController* controller = new LogitechG502PSController(dev);
|
||||
|
||||
RGBController_LogitechG502PS* rgb_controller = new RGBController_LogitechG502PS(controller);
|
||||
|
||||
rgb_controller->name = device_list[device_idx].name;
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
break;
|
||||
|
||||
case LOGITECH_GPRO_WIRELESS_PID:
|
||||
case LOGITECH_G_LIGHTSPEED_WIRELESS_PID:
|
||||
{
|
||||
LogitechGProWirelessController* controller = new LogitechGProWirelessController(dev);
|
||||
|
||||
RGBController_LogitechGProWireless* rgb_controller = new RGBController_LogitechGProWireless(controller);
|
||||
|
||||
rgb_controller->name = device_list[device_idx].name;
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
break;
|
||||
case LOGITECH_G_LIGHTSPEED_POWERPLAY_PID:
|
||||
{
|
||||
//Add mouse
|
||||
LogitechGProWirelessController* mouse_controller = new LogitechGProWirelessController(dev);
|
||||
|
||||
RGBController_LogitechGProWireless* mouse_rgb_controller = new RGBController_LogitechGProWireless(mouse_controller);
|
||||
|
||||
mouse_rgb_controller->name = device_list[device_idx].name;
|
||||
rgb_controllers.push_back(mouse_rgb_controller);
|
||||
|
||||
//Add Powerplay mousemat
|
||||
LogitechGPowerPlayController* mousemat_controller = new LogitechGPowerPlayController(dev);
|
||||
|
||||
RGBController_LogitechGPowerPlay* mousemat_rgb_controller = new RGBController_LogitechGPowerPlay(mousemat_controller);
|
||||
|
||||
mousemat_rgb_controller->name = device_list[device_idx].name;
|
||||
rgb_controllers.push_back(mousemat_rgb_controller);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,4 +271,6 @@ void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} /* DetectLogitechControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Logitech", DetectLogitechControllers);
|
||||
|
||||
@@ -51,7 +51,7 @@ void LogitechG203Controller::SendMouseMode
|
||||
usb_buf[0x07] = green;
|
||||
usb_buf[0x08] = blue;
|
||||
|
||||
speed = 1000 + 4750 * (LOGITECH_G203_SPEED_FASTEST - speed);
|
||||
speed = 100 * speed;
|
||||
if(mode == LOGITECH_G203_MODE_CYCLE)
|
||||
{
|
||||
usb_buf[0x0B] = speed >> 8;
|
||||
|
||||
@@ -22,13 +22,15 @@ enum
|
||||
LOGITECH_G203_MODE_BREATHING = 0x03,
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------------------------*\
|
||||
| Speed is 1000 for fast and 20000 for slow. |
|
||||
| Values are mutipled by 100 later to give lots of GUI steps. |
|
||||
\*---------------------------------------------------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
LOGITECH_G203_SPEED_SLOWEST = 0x00, /* Slowest speed */
|
||||
LOGITECH_G203_SPEED_SLOW = 0x01, /* Slow speed */
|
||||
LOGITECH_G203_SPEED_NORMAL = 0x02, /* Normal speed */
|
||||
LOGITECH_G203_SPEED_FAST = 0x03, /* Fast speed */
|
||||
LOGITECH_G203_SPEED_FASTEST = 0x04, /* Fastest speed */
|
||||
LOGITECH_G203_SPEED_SLOWEST = 0xC8, /* Slowest speed */
|
||||
LOGITECH_G203_SPEED_NORMAL = 0x32, /* Normal speed */
|
||||
LOGITECH_G203_SPEED_FASTEST = 0x0A, /* Fastest speed */
|
||||
};
|
||||
|
||||
class LogitechG203Controller
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
#include "LogitechG203LController.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
LogitechG203LController::LogitechG203LController(hid_device* dev_handle)
|
||||
{
|
||||
dev = dev_handle;
|
||||
}
|
||||
|
||||
void LogitechG203LController::SendApply()
|
||||
{
|
||||
unsigned char usb_buf[20];
|
||||
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
usb_buf[0x00] = 0x11;
|
||||
usb_buf[0x01] = 0xFF;
|
||||
usb_buf[0x02] = 0x12;
|
||||
usb_buf[0x03] = 0x7A;
|
||||
|
||||
hid_write(dev, usb_buf, 20);
|
||||
hid_read(dev, usb_buf, 20);
|
||||
}
|
||||
|
||||
void LogitechG203LController::SetSingleLED(int led, unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
unsigned char usb_buf[20];
|
||||
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
usb_buf[0x00] = 0x11;
|
||||
usb_buf[0x01] = 0xFF;
|
||||
usb_buf[0x02] = 0x12;
|
||||
usb_buf[0x03] = 0x19;
|
||||
|
||||
usb_buf[0x04] = (unsigned char)led;
|
||||
usb_buf[0x05] = red;
|
||||
usb_buf[0x06] = green;
|
||||
usb_buf[0x07] = blue;
|
||||
|
||||
usb_buf[0x08] = 0xFF;
|
||||
|
||||
hid_write(dev, usb_buf, 20);
|
||||
hid_read(dev, usb_buf, 20);
|
||||
|
||||
SendApply();
|
||||
}
|
||||
|
||||
void LogitechG203LController::SetMode(
|
||||
int mode,
|
||||
int speed,
|
||||
unsigned char bright,
|
||||
unsigned char dir,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue)
|
||||
{
|
||||
unsigned char usb_buf[20];
|
||||
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
//Header
|
||||
usb_buf[0x00] = 0x11;
|
||||
usb_buf[0x01] = 0xFF;
|
||||
usb_buf[0x02] = 0x0E;
|
||||
usb_buf[0x03] = 0x1A;
|
||||
//Common Data
|
||||
usb_buf[0x04] = 0x00;
|
||||
usb_buf[0x05] = (unsigned char)mode;
|
||||
usb_buf[0x06] = red;
|
||||
usb_buf[0x07] = green;
|
||||
usb_buf[0x08] = blue;
|
||||
//mode specific Data and position
|
||||
if(mode == LOGITECH_G203L_MODE_STATIC) usb_buf[0x09] = 0x02;
|
||||
if(mode == LOGITECH_G203L_MODE_CYCLE)
|
||||
{
|
||||
usb_buf[0x0B] = (unsigned char)((speed>>8) & 0x000000FF);
|
||||
usb_buf[0x0C] = (unsigned char)(speed & 0x000000FF);
|
||||
usb_buf[0x0D] = bright;
|
||||
}
|
||||
if(mode == LOGITECH_G203L_MODE_BREATHING)
|
||||
{
|
||||
usb_buf[0x09] = (unsigned char)((speed>>8) & 0x000000FF);
|
||||
usb_buf[0x0A] = (unsigned char)(speed & 0x000000FF);
|
||||
usb_buf[0x0C] = bright;
|
||||
}
|
||||
if(mode == LOGITECH_G203L_MODE_WAVE)
|
||||
{
|
||||
usb_buf[0x0C] = (unsigned char)(speed & 0x000000FF);
|
||||
usb_buf[0x0D] = dir ? 0x01 : 0x06; //0x01: Left->Right 0x06: Right->Left
|
||||
usb_buf[0x0E] = bright;
|
||||
usb_buf[0x0F] = (unsigned char)((speed>>8) & 0x000000FF);
|
||||
}
|
||||
if(mode == LOGITECH_G203L_MODE_COLORMIXING)
|
||||
{
|
||||
usb_buf[0x0C] = (unsigned char)(speed & 0x000000FF);
|
||||
usb_buf[0x0D] = (unsigned char)((speed>>8) & 0x000000FF);
|
||||
usb_buf[0x0E] = bright;
|
||||
}
|
||||
|
||||
//END BYTE
|
||||
usb_buf[0x10] = 0x01;
|
||||
|
||||
hid_write(dev, usb_buf, 20);
|
||||
hid_read(dev, usb_buf, 20);
|
||||
}
|
||||
|
||||
void LogitechG203LController::SetDevice(std::vector<RGBColor> colors)
|
||||
{
|
||||
unsigned char usb_buf[20];
|
||||
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
usb_buf[0x00] = 0x11;
|
||||
usb_buf[0x01] = 0xFF;
|
||||
usb_buf[0x02] = 0x12;
|
||||
usb_buf[0x03] = 0x1A;
|
||||
|
||||
usb_buf[0x04] = 0x01;
|
||||
usb_buf[0x05] = RGBGetRValue(colors[0]);
|
||||
usb_buf[0x06] = RGBGetGValue(colors[0]);
|
||||
usb_buf[0x07] = RGBGetBValue(colors[0]);
|
||||
|
||||
usb_buf[0x08] = 0x02;
|
||||
usb_buf[0x09] = RGBGetRValue(colors[1]);
|
||||
usb_buf[0x0A] = RGBGetGValue(colors[1]);
|
||||
usb_buf[0x0B] = RGBGetBValue(colors[1]);
|
||||
|
||||
usb_buf[0x0C] = 0x03;
|
||||
usb_buf[0x0D] = RGBGetRValue(colors[2]);
|
||||
usb_buf[0x0E] = RGBGetGValue(colors[2]);
|
||||
usb_buf[0x0F] = RGBGetBValue(colors[2]);
|
||||
|
||||
usb_buf[0x10] = 0xFF;
|
||||
|
||||
hid_write(dev, usb_buf, 20);
|
||||
hid_read(dev, usb_buf, 20);
|
||||
|
||||
SendApply();
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#include "RGBController.h"
|
||||
|
||||
#include <string>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
LOGITECH_G203L_MODE_DIRECT = 0x07,
|
||||
LOGITECH_G203L_MODE_OFF = 0x00,
|
||||
LOGITECH_G203L_MODE_STATIC = 0x01,
|
||||
LOGITECH_G203L_MODE_CYCLE = 0x02,
|
||||
LOGITECH_G203L_MODE_WAVE = 0x03,
|
||||
LOGITECH_G203L_MODE_BREATHING = 0x04,
|
||||
LOGITECH_G203L_MODE_COLORMIXING = 0x06,
|
||||
};
|
||||
|
||||
class LogitechG203LController
|
||||
{
|
||||
public:
|
||||
LogitechG203LController(hid_device* dev_handle);
|
||||
~LogitechG203LController();
|
||||
|
||||
void SetSingleLED(int led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetMode(int mode, int speed, unsigned char brightness, unsigned char dir, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetDevice(std::vector<RGBColor> colors);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
void SendApply();
|
||||
};
|
||||
@@ -53,7 +53,7 @@ void LogitechG403Controller::SendMouseMode
|
||||
usb_buf[0x07] = green;
|
||||
usb_buf[0x08] = blue;
|
||||
|
||||
speed = 1000 + 4750 * (LOGITECH_G403_SPEED_FASTEST - speed);
|
||||
speed = 100 * speed;
|
||||
if(mode == LOGITECH_G403_MODE_CYCLE)
|
||||
{
|
||||
usb_buf[0x0B] = speed >> 8;
|
||||
|
||||
@@ -22,13 +22,15 @@ enum
|
||||
LOGITECH_G403_MODE_BREATHING = 0x03,
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------------------------*\
|
||||
| Speed is 1000 for fast and 20000 for slow. |
|
||||
| Values are mutipled by 100 later to give lots of GUI steps. |
|
||||
\*---------------------------------------------------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
LOGITECH_G403_SPEED_SLOWEST = 0x00, /* Slowest speed */
|
||||
LOGITECH_G403_SPEED_SLOW = 0x01, /* Slow speed */
|
||||
LOGITECH_G403_SPEED_NORMAL = 0x02, /* Normal speed */
|
||||
LOGITECH_G403_SPEED_FAST = 0x03, /* Fast speed */
|
||||
LOGITECH_G403_SPEED_FASTEST = 0x04, /* Fastest speed */
|
||||
LOGITECH_G403_SPEED_SLOWEST = 0xC8, /* Slowest speed */
|
||||
LOGITECH_G403_SPEED_NORMAL = 0x32, /* Normal speed */
|
||||
LOGITECH_G403_SPEED_FASTEST = 0x0A, /* Fastest speed */
|
||||
};
|
||||
|
||||
class LogitechG403Controller
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
/*-----------------------------------------*\
|
||||
| Logitech502PSController.cpp |
|
||||
| |
|
||||
| Driver for Logitech G502 Proteus |
|
||||
| Spectrum mouse lighting controller |
|
||||
| |
|
||||
| kernzerfall 07/28/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "LogitechG502PSController.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
LogitechG502PSController::LogitechG502PSController(hid_device* dev_handle)
|
||||
{
|
||||
dev = dev_handle;
|
||||
}
|
||||
|
||||
LogitechG502PSController::~LogitechG502PSController()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
void LogitechG502PSController::SendMouseMode
|
||||
(
|
||||
unsigned char mode,
|
||||
std::uint16_t speed,
|
||||
unsigned char channel,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
)
|
||||
{
|
||||
unsigned char usb_buf[20];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Lighting Control packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0x11;
|
||||
usb_buf[0x01] = 0xFF;
|
||||
usb_buf[0x02] = 0x02;
|
||||
usb_buf[0x03] = 0x3A;
|
||||
usb_buf[0x04] = channel;
|
||||
|
||||
usb_buf[0x05] = mode;
|
||||
|
||||
usb_buf[0x06] = red;
|
||||
usb_buf[0x07] = green;
|
||||
usb_buf[0x08] = blue;
|
||||
|
||||
speed = 100 * speed;
|
||||
if(mode == LOGITECH_G502_PS_MODE_CYCLE)
|
||||
{
|
||||
usb_buf[0x0B] = speed >> 8;
|
||||
usb_buf[0x0C] = speed & 0xFF;
|
||||
usb_buf[0x0D] = 0x64;
|
||||
}
|
||||
else if(mode == LOGITECH_G502_PS_MODE_BREATHING)
|
||||
{
|
||||
usb_buf[0x09] = speed >> 8;
|
||||
usb_buf[0x0A] = speed & 0xFF;
|
||||
usb_buf[0x0C] = 0x64;
|
||||
}else if(mode == LOGITECH_G502_PS_MODE_STATIC){
|
||||
usb_buf[0x09] = 0x02;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, usb_buf, 20);
|
||||
hid_read(dev, usb_buf, 20);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*-----------------------------------------*\
|
||||
| Logitech502PSController.h |
|
||||
| |
|
||||
| Definitions and types for Logitech |
|
||||
| G502 Proteus Spectrum mouse lighting |
|
||||
| controller |
|
||||
| |
|
||||
| kernzerfall 07/28/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController.h"
|
||||
|
||||
#include <string>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
LOGITECH_G502_PS_MODE_OFF = 0x00,
|
||||
LOGITECH_G502_PS_MODE_STATIC = 0x01,
|
||||
LOGITECH_G502_PS_MODE_CYCLE = 0x03,
|
||||
LOGITECH_G502_PS_MODE_BREATHING = 0x02
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------------------------*\
|
||||
| Speed is 1000 for fast and 20000 for slow. |
|
||||
| Values are mutipled by 100 later to give lots of GUI steps. |
|
||||
\*---------------------------------------------------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
LOGITECH_G502_PS_SPEED_SLOWEST = 0xC8, /* Slowest speed */
|
||||
LOGITECH_G502_PS_SPEED_NORMAL = 0x32, /* Normal speed */
|
||||
LOGITECH_G502_PS_SPEED_FASTEST = 0x0A, /* Fastest speed */
|
||||
};
|
||||
|
||||
class LogitechG502PSController
|
||||
{
|
||||
public:
|
||||
LogitechG502PSController(hid_device* dev_handle);
|
||||
~LogitechG502PSController();
|
||||
|
||||
void SendMouseMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char channel,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
};
|
||||
@@ -0,0 +1,82 @@
|
||||
/*-----------------------------------------*\
|
||||
| LogitechGPowerPlayController.cpp |
|
||||
| |
|
||||
| Driver for Logitech G PowerPlay Wireless |
|
||||
| Charging System |
|
||||
| |
|
||||
| TheRogueZeta 8/31/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "LogitechGPowerPlayController.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
LogitechGPowerPlayController::LogitechGPowerPlayController(hid_device* dev_handle)
|
||||
{
|
||||
dev = dev_handle;
|
||||
}
|
||||
|
||||
LogitechGPowerPlayController::~LogitechGPowerPlayController()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
void LogitechGPowerPlayController::SendMouseMatMode
|
||||
(
|
||||
unsigned char mode,
|
||||
std::uint16_t speed,
|
||||
unsigned char zone,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
// unsigned char brightness
|
||||
)
|
||||
{
|
||||
unsigned char usb_buf[20];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Lighting Control packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0x11;
|
||||
usb_buf[0x01] = 0x07;
|
||||
usb_buf[0x02] = 0x0B;
|
||||
usb_buf[0x03] = 0x3E;
|
||||
|
||||
usb_buf[0x04] = zone;
|
||||
usb_buf[0x05] = mode;
|
||||
|
||||
usb_buf[0x06] = red;
|
||||
usb_buf[0x07] = green;
|
||||
usb_buf[0x08] = blue;
|
||||
|
||||
speed = 100 * speed;
|
||||
if(mode == LOGITECH_G_POWERPLAY_MODE_STATIC)
|
||||
{
|
||||
usb_buf[0x09] = 0x02;
|
||||
}
|
||||
if(mode == LOGITECH_G_POWERPLAY_MODE_CYCLE)
|
||||
{
|
||||
usb_buf[0x0B] = speed >> 8;
|
||||
usb_buf[0x0C] = speed & 0xFF;
|
||||
//usb_buf[0x0D] = brightness;
|
||||
usb_buf[0x0D] = 0x64;
|
||||
}
|
||||
else if(mode == LOGITECH_G_POWERPLAY_MODE_BREATHING)
|
||||
{
|
||||
usb_buf[0x09] = speed >> 8;
|
||||
usb_buf[0x0A] = speed & 0xFF;
|
||||
//usb_buf[0x0C] = brightness;
|
||||
usb_buf[0x0C] = 0x64;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, usb_buf, 20);
|
||||
hid_read(dev, usb_buf, 20);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*-----------------------------------------*\
|
||||
| LogitechGPowerPlayController.h |
|
||||
| |
|
||||
| Definitions and types for Logitech G |
|
||||
| PowerPlay Wireless lighting controller |
|
||||
| |
|
||||
| TheRogueZeta 8/31/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController.h"
|
||||
|
||||
#include <string>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
LOGITECH_G_POWERPLAY_MODE_OFF = 0x00,
|
||||
LOGITECH_G_POWERPLAY_MODE_STATIC = 0x01,
|
||||
LOGITECH_G_POWERPLAY_MODE_CYCLE = 0x02,
|
||||
LOGITECH_G_POWERPLAY_MODE_BREATHING = 0x03,
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------------------------*\
|
||||
| Speed is 1000 for fast and 20000 for slow. |
|
||||
| Values are mutipled by 100 later to give lots of GUI steps. |
|
||||
\*---------------------------------------------------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
LOGITECH_G_POWERPLAY_SPEED_SLOWEST = 0xC8, /* Slowest speed */
|
||||
LOGITECH_G_POWERPLAY_SPEED_NORMAL = 0x32, /* Normal speed */
|
||||
LOGITECH_G_POWERPLAY_SPEED_FASTEST = 0x0A, /* Fastest speed */
|
||||
};
|
||||
|
||||
class LogitechGPowerPlayController
|
||||
{
|
||||
public:
|
||||
LogitechGPowerPlayController(hid_device* dev_handle);
|
||||
~LogitechGPowerPlayController();
|
||||
|
||||
void SendMouseMatMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char zone,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
// unsigned char brightness
|
||||
);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
};
|
||||
@@ -0,0 +1,82 @@
|
||||
/*-----------------------------------------*\
|
||||
| LogitechGProWirelessController.cpp |
|
||||
| |
|
||||
| Driver for Logitech G Pro Wireless Gaming|
|
||||
| Mouse lighting controller |
|
||||
| |
|
||||
| TheRogueZeta 8/5/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "LogitechGProWirelessController.h"
|
||||
|
||||
#include <cstring>
|
||||
|
||||
LogitechGProWirelessController::LogitechGProWirelessController(hid_device* dev_handle)
|
||||
{
|
||||
dev = dev_handle;
|
||||
}
|
||||
|
||||
LogitechGProWirelessController::~LogitechGProWirelessController()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
void LogitechGProWirelessController::SendMouseMode
|
||||
(
|
||||
unsigned char mode,
|
||||
std::uint16_t speed,
|
||||
unsigned char zone,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
// unsigned char brightness
|
||||
)
|
||||
{
|
||||
unsigned char usb_buf[20];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up Lighting Control packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0x11;
|
||||
usb_buf[0x01] = 0x01;
|
||||
usb_buf[0x02] = 0x07;
|
||||
usb_buf[0x03] = 0x3C;
|
||||
|
||||
usb_buf[0x04] = zone;
|
||||
usb_buf[0x05] = mode;
|
||||
|
||||
usb_buf[0x06] = red;
|
||||
usb_buf[0x07] = green;
|
||||
usb_buf[0x08] = blue;
|
||||
|
||||
speed = 100 * speed;
|
||||
if(mode == LOGITECH_G_PRO_WIRELESS_MODE_STATIC)
|
||||
{
|
||||
usb_buf[0x09] = 0x02;
|
||||
}
|
||||
if(mode == LOGITECH_G_PRO_WIRELESS_MODE_CYCLE)
|
||||
{
|
||||
usb_buf[0x0B] = speed >> 8;
|
||||
usb_buf[0x0C] = speed & 0xFF;
|
||||
//usb_buf[0x0D] = brightness;
|
||||
usb_buf[0x0D] = 0x64;
|
||||
}
|
||||
else if(mode == LOGITECH_G_PRO_WIRELESS_MODE_BREATHING)
|
||||
{
|
||||
usb_buf[0x09] = speed >> 8;
|
||||
usb_buf[0x0A] = speed & 0xFF;
|
||||
//usb_buf[0x0C] = brightness;
|
||||
usb_buf[0x0C] = 0x64;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_write(dev, usb_buf, 20);
|
||||
hid_read(dev, usb_buf, 20);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*-----------------------------------------*\
|
||||
| LogitechGProWirelessController.h |
|
||||
| |
|
||||
| Definitions and types for Logitech G Pro |
|
||||
| Wireless Gaming Mouse lighting controller|
|
||||
| |
|
||||
| TheRogueZeta 8/5/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController.h"
|
||||
|
||||
#include <string>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
LOGITECH_G_PRO_WIRELESS_MODE_OFF = 0x00,
|
||||
LOGITECH_G_PRO_WIRELESS_MODE_STATIC = 0x01,
|
||||
LOGITECH_G_PRO_WIRELESS_MODE_CYCLE = 0x02,
|
||||
LOGITECH_G_PRO_WIRELESS_MODE_BREATHING = 0x03,
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------------------------------------------*\
|
||||
| Speed is 1000 for fast and 20000 for slow. |
|
||||
| Values are mutipled by 100 later to give lots of GUI steps. |
|
||||
\*---------------------------------------------------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
LOGITECH_G_PRO_WIRELESS_SPEED_SLOWEST = 0xC8, /* Slowest speed */
|
||||
LOGITECH_G_PRO_WIRELESS_SPEED_NORMAL = 0x32, /* Normal speed */
|
||||
LOGITECH_G_PRO_WIRELESS_SPEED_FASTEST = 0x0A, /* Fastest speed */
|
||||
};
|
||||
|
||||
class LogitechGProWirelessController
|
||||
{
|
||||
public:
|
||||
LogitechGProWirelessController(hid_device* dev_handle);
|
||||
~LogitechGProWirelessController();
|
||||
|
||||
void SendMouseMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned short speed,
|
||||
unsigned char zone,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
// unsigned char brightness
|
||||
);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
};
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "MSI3ZoneController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_MSI3Zone.h"
|
||||
@@ -33,4 +34,6 @@ void DetectMSI3ZoneControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
} /* DetectMSI3ZoneControllers() */
|
||||
|
||||
REGISTER_DETECTOR("MSI 3-Zone Laptop", DetectMSI3ZoneControllers);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
| |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "Detector.h"
|
||||
#include "MSIGPUController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_MSIGPU.h"
|
||||
@@ -21,6 +22,7 @@
|
||||
/*-----------------------------------------------------*\
|
||||
| NVidia device IDs |
|
||||
\*-----------------------------------------------------*/
|
||||
#define NVIDIA_GTX1070_DEV 0x1B81
|
||||
#define NVIDIA_RTX2060_DEV 0x1F08
|
||||
#define NVIDIA_RTX2060S_DEV 0x1F06
|
||||
#define NVIDIA_RTX2070_DEV 0x1F02
|
||||
@@ -37,6 +39,7 @@
|
||||
/*-----------------------------------------------------*\
|
||||
| MSI sub-device IDs |
|
||||
\*-----------------------------------------------------*/
|
||||
#define MSI_GTX1070_GAMING_X_SUB_DEV 0x3306
|
||||
#define MSI_RTX2060S_GAMING_X_SUB_DEV 0xC752
|
||||
#define MSI_RTX2070S_GAMING_X_SUB_DEV 0x373e
|
||||
#define MSI_RTX2070S_GAMING_X_TRIO_SUB_DEV 0xC726
|
||||
@@ -44,6 +47,7 @@
|
||||
#define MSI_RTX2080S_GAMING_X_TRIO_SUB_DEV 0xC724
|
||||
#define MSI_RTX2080TI_GAMING_X_TRIO_SUB_DEV 0x3715
|
||||
#define MSI_RTX2060_GAMING_Z_6G_SUB_DEV 0x3754
|
||||
#define MSI_RTX2060_GAMING_Z_6G_SUB_DEV_2 0x3752
|
||||
#define MSI_RTX2070_ARMOR_SUB_DEV 0x3734
|
||||
#define MSI_RTX2060S_ARMOR_OC_SUB_DEV 0xC754
|
||||
#define MSI_RTX2080_SEA_HAWK_EK_X_SUB_DEV 0x3728
|
||||
@@ -62,6 +66,7 @@ typedef struct
|
||||
|
||||
static const msi_gpu_pci_device device_list[] =
|
||||
{
|
||||
{ NVIDIA_VEN, NVIDIA_GTX1070_DEV, MSI_SUB_VEN, MSI_GTX1070_GAMING_X_SUB_DEV, "MSI GeForce GTX 1070 Gaming X" },
|
||||
{ NVIDIA_VEN, NVIDIA_RTX2060S_DEV, MSI_SUB_VEN, MSI_RTX2060S_GAMING_X_SUB_DEV, "MSI GeForce RTX 2060 Super Gaming X" },
|
||||
{ NVIDIA_VEN, NVIDIA_RTX2070S_DEV, MSI_SUB_VEN, MSI_RTX2070S_GAMING_X_SUB_DEV, "MSI GeForce RTX 2070 Super Gaming X" },
|
||||
{ NVIDIA_VEN, NVIDIA_RTX2070S_DEV, MSI_SUB_VEN, MSI_RTX2070S_GAMING_X_TRIO_SUB_DEV, "MSI GeForce RTX 2070 Super Gaming X Trio" },
|
||||
@@ -69,6 +74,7 @@ static const msi_gpu_pci_device device_list[] =
|
||||
{ NVIDIA_VEN, NVIDIA_RTX2080S_DEV, MSI_SUB_VEN, MSI_RTX2080S_GAMING_X_TRIO_SUB_DEV, "MSI GeForce RTX 2080 Super Gaming X Trio" },
|
||||
{ NVIDIA_VEN, NVIDIA_RTX2080TI_DEV, MSI_SUB_VEN, MSI_RTX2080TI_GAMING_X_TRIO_SUB_DEV, "MSI GeForce RTX 2080Ti Gaming X Trio" },
|
||||
{ NVIDIA_VEN, NVIDIA_RTX2060_DEV, MSI_SUB_VEN, MSI_RTX2060_GAMING_Z_6G_SUB_DEV, "MSI GeForce RTX 2060 Gaming Z 6G" },
|
||||
{ NVIDIA_VEN, NVIDIA_RTX2060_DEV, MSI_SUB_VEN, MSI_RTX2060_GAMING_Z_6G_SUB_DEV_2, "MSI GeForce RTX 2060 Gaming Z 6G" },
|
||||
{ NVIDIA_VEN, NVIDIA_RTX2060S_DEV, MSI_SUB_VEN, MSI_RTX2060S_ARMOR_OC_SUB_DEV, "MSI GeForce RTX 2060 Super ARMOR OC" },
|
||||
{ NVIDIA_VEN, NVIDIA_RTX2070_DEV, MSI_SUB_VEN, MSI_RTX2070_ARMOR_SUB_DEV, "MSI GeForce RTX 2070 ARMOR" },
|
||||
{ NVIDIA_VEN, NVIDIA_RTX2080_DEV, MSI_SUB_VEN, MSI_RTX2080_SEA_HAWK_EK_X_SUB_DEV, "MSI GeForce RTX 2080 Sea Hawk EK X" },
|
||||
@@ -111,3 +117,5 @@ void DetectMSIGPUControllers(std::vector<i2c_smbus_interface*> &busses, std::vec
|
||||
}
|
||||
}
|
||||
} /* DetectMSIGPUControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("MSI GPU", DetectMSIGPUControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "MSIMysticLightController.h"
|
||||
#include "RGBController_MSIMysticLight.h"
|
||||
|
||||
@@ -98,4 +99,8 @@ void DetectMSIMysticLightControllers(std::vector<RGBController*> &rgb_controller
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* DetectMSIMysticLightControllers() */
|
||||
|
||||
// The MSI Mystic Light controller is disabled due to bricking risk
|
||||
// Uncomment this line to enable. Do so at your own risk.
|
||||
//REGISTER_DETECTOR("MSI Mystic Light", DetectMSIMysticLightControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "MSIRGBController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_MSIRGB.h"
|
||||
@@ -38,3 +39,5 @@ void DetectMSIRGBControllers(std::vector<RGBController*> &rgb_controllers)
|
||||
}
|
||||
}
|
||||
} /* DetectMSIRGBControllers() */
|
||||
|
||||
REGISTER_DETECTOR("MSI-RGB", DetectMSIRGBControllers);
|
||||
|
||||
@@ -65,7 +65,7 @@ std::string NZXTHue2Controller::GetFirmwareVersion()
|
||||
void NZXTHue2Controller::SendFan
|
||||
(
|
||||
unsigned char port,
|
||||
unsigned char mode,
|
||||
unsigned char /*mode*/,
|
||||
unsigned char speed
|
||||
)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ void NZXTHue2Controller::UpdateDeviceList()
|
||||
ret_val = hid_read(dev, usb_buf, sizeof(usb_buf));
|
||||
} while( (ret_val != 64) || (usb_buf[0] != 0x21) || (usb_buf[1] != 0x03) );
|
||||
|
||||
for(int chan = 0; chan < num_rgb_channels; chan++)
|
||||
for(unsigned int chan = 0; chan < num_rgb_channels; chan++)
|
||||
{
|
||||
unsigned int start = 0x0F + (6 * chan);
|
||||
unsigned int num_leds_on_channel = 0;
|
||||
@@ -179,7 +179,7 @@ void NZXTHue2Controller::UpdateStatus()
|
||||
/*-----------------------------------------------------*\
|
||||
| Extract fan information |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int fan_idx = 0; fan_idx < num_fan_channels; fan_idx++)
|
||||
for(unsigned int fan_idx = 0; fan_idx < num_fan_channels; fan_idx++)
|
||||
{
|
||||
unsigned char cmd;
|
||||
unsigned short rpm;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "NZXTHue2Controller.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_NZXTHue2.h"
|
||||
@@ -76,3 +77,5 @@ void DetectNZXTHue2Controllers(std::vector<RGBController*> &rgb_controllers)
|
||||
}
|
||||
}
|
||||
} /* DetectNZXTHue2Controllers() */
|
||||
|
||||
REGISTER_DETECTOR("NZXT Hue 2", DetectNZXTHue2Controllers);
|
||||
|
||||
@@ -1,18 +1,38 @@
|
||||
#include "Detector.h"
|
||||
#include "NZXTKrakenController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_NZXTKraken.h"
|
||||
#include <vector>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#define NZXT_KRAKEN_VID 0x1E71
|
||||
#define NZXT_KRAKEN_PID 0x170E
|
||||
#define NZXT_KRAKEN_VID 0x1E71
|
||||
#define NZXT_KRAKEN_X2_PID 0x170E
|
||||
#define NZXT_KRAKEN_M2_PID 0x1715
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned short usb_vid;
|
||||
unsigned short usb_pid;
|
||||
const char * name;
|
||||
} nzxt_kraken_device;
|
||||
|
||||
#define NZXT_KRAKEN_NUM_DEVICES (sizeof(device_list) / sizeof(device_list[ 0 ]))
|
||||
|
||||
static const nzxt_kraken_device device_list[] =
|
||||
{
|
||||
/*-----------------------------------------------------------------------------------------------------*\
|
||||
| NZXT Hue 2 devices |
|
||||
\*-----------------------------------------------------------------------------------------------------*/
|
||||
{ NZXT_KRAKEN_VID, NZXT_KRAKEN_X2_PID, "NZXT Kraken X2" },
|
||||
{ NZXT_KRAKEN_VID, NZXT_KRAKEN_M2_PID, "NZXT Kraken M2" },
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectNZXTKrakenControllers *
|
||||
* *
|
||||
* Detect devices supported by the NZXTKraken driver *
|
||||
* * *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectNZXTKrakenControllers(std::vector<RGBController*> &rgb_controllers)
|
||||
@@ -22,17 +42,17 @@ void DetectNZXTKrakenControllers(std::vector<RGBController*> &rgb_controllers)
|
||||
|
||||
hid_init();
|
||||
|
||||
for(std::size_t device_idx = 0; device_idx < 1; device_idx++)
|
||||
for(std::size_t device_idx = 0; device_idx < NZXT_KRAKEN_NUM_DEVICES; device_idx++)
|
||||
{
|
||||
dev = NULL;
|
||||
|
||||
info = hid_enumerate(NZXT_KRAKEN_VID, NZXT_KRAKEN_PID);
|
||||
info = hid_enumerate(device_list[device_idx].usb_vid, device_list[device_idx].usb_pid);
|
||||
|
||||
//Look for NZXT Kraken devices
|
||||
while(info)
|
||||
{
|
||||
if((info->vendor_id == NZXT_KRAKEN_VID)
|
||||
&&(info->product_id == NZXT_KRAKEN_PID))
|
||||
if((info->vendor_id == device_list[device_idx].usb_vid)
|
||||
&&(info->product_id == device_list[device_idx].usb_pid))
|
||||
{
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
@@ -42,10 +62,14 @@ void DetectNZXTKrakenControllers(std::vector<RGBController*> &rgb_controllers)
|
||||
|
||||
RGBController_NZXTKraken* rgb_controller = new RGBController_NZXTKraken(controller);
|
||||
|
||||
rgb_controller->name = device_list[device_idx].name;
|
||||
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
info = info->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* DetectNZXTKrakenControllers() */
|
||||
|
||||
REGISTER_DETECTOR("NZXT Kraken", DetectNZXTKrakenControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "PatriotViperController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_PatriotViper.h"
|
||||
@@ -70,3 +71,5 @@ void DetectPatriotViperControllers(std::vector<i2c_smbus_interface*> &busses, st
|
||||
}
|
||||
|
||||
} /* DetectPatriotViperControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("Patriot Viper", DetectPatriotViperControllers);
|
||||
|
||||
@@ -10,14 +10,15 @@
|
||||
#include "PolychromeController.h"
|
||||
#include <cstring>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
PolychromeController::PolychromeController(i2c_smbus_interface* bus, polychrome_dev_id dev)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
|
||||
unsigned short fw_version = GetFirmwareVersion();
|
||||
|
||||
unsigned short fw_version = ReadFirmwareVersion();
|
||||
unsigned char major_version = fw_version >> 8;
|
||||
unsigned char minor_version = fw_version & 0xFF;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Determine whether the device uses ASR LED or |
|
||||
@@ -25,23 +26,30 @@ PolychromeController::PolychromeController(i2c_smbus_interface* bus, polychrome_
|
||||
| Versions 1.xx and 2.xx use ASR LED, 3.xx uses |
|
||||
| Polychrome |
|
||||
\*-----------------------------------------------------*/
|
||||
if((major_version < 0x03) && (major_version > 0x00))
|
||||
switch(major_version)
|
||||
{
|
||||
snprintf(device_name, 32, "ASRock ASR LED FW %d.%02d", major_version, minor_version);
|
||||
led_count = 1;
|
||||
asr_led = true;
|
||||
case ASROCK_TYPE_ASRLED:
|
||||
device_name = "ASRock ASR LED";
|
||||
asrock_type = ASROCK_TYPE_ASRLED;
|
||||
memset(zone_led_count, 0, sizeof(zone_led_count));
|
||||
break;
|
||||
|
||||
case ASROCK_TYPE_POLYCHROME_V1:
|
||||
device_name = "ASRock Polychrome V1";
|
||||
asrock_type = ASROCK_TYPE_POLYCHROME_V1;
|
||||
ReadLEDConfiguration();
|
||||
break;
|
||||
|
||||
case ASROCK_TYPE_POLYCHROME_V2:
|
||||
device_name = "ASRock Polychrome V2";
|
||||
asrock_type = ASROCK_TYPE_POLYCHROME_V2;
|
||||
ReadLEDConfiguration();
|
||||
break;
|
||||
|
||||
default:
|
||||
asrock_type = ASROCK_TYPE_UNKNOWN;
|
||||
break;
|
||||
}
|
||||
else if(major_version == 0x03)
|
||||
{
|
||||
snprintf(device_name, 32, "ASRock Polychrome FW %d.%02d", major_version, minor_version);
|
||||
led_count = 1;
|
||||
asr_led = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
led_count = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
PolychromeController::~PolychromeController()
|
||||
@@ -49,18 +57,44 @@ PolychromeController::~PolychromeController()
|
||||
|
||||
}
|
||||
|
||||
char* PolychromeController::GetDeviceName()
|
||||
unsigned int PolychromeController::GetASRockType()
|
||||
{
|
||||
return(asrock_type);
|
||||
}
|
||||
|
||||
std::string PolychromeController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
return_string.append(addr);
|
||||
return(return_string);
|
||||
}
|
||||
|
||||
std::string PolychromeController::GetDeviceName()
|
||||
{
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
unsigned short PolychromeController::GetFirmwareVersion()
|
||||
std::string PolychromeController::GetFirmwareVersion()
|
||||
{
|
||||
unsigned short fw_version = ReadFirmwareVersion();
|
||||
unsigned char major_version = fw_version >> 8;
|
||||
unsigned char minor_version = fw_version & 0xFF;
|
||||
|
||||
return(std::to_string(major_version) + "." + std::to_string(minor_version));
|
||||
}
|
||||
|
||||
unsigned short PolychromeController::ReadFirmwareVersion()
|
||||
{
|
||||
// The firmware register holds two bytes, so the first read should return 2
|
||||
// If not, report invalid firmware revision FFFF
|
||||
if (bus->i2c_smbus_read_byte_data(dev, POLYCHROME_REG_FIRMWARE_VER) == 0x02)
|
||||
if (bus->i2c_smbus_read_byte_data(dev, ASROCK_REG_FIRMWARE_VER) == 0x02)
|
||||
{
|
||||
std::this_thread::sleep_for(1ms);
|
||||
unsigned char major = bus->i2c_smbus_read_byte(dev);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
unsigned char minor = bus->i2c_smbus_read_byte(dev);
|
||||
|
||||
return((major << 8) | minor);
|
||||
@@ -71,9 +105,31 @@ unsigned short PolychromeController::GetFirmwareVersion()
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int PolychromeController::GetLEDCount()
|
||||
void PolychromeController::ReadLEDConfiguration()
|
||||
{
|
||||
return(led_count);
|
||||
/*---------------------------------------------------------------------------------*\
|
||||
| The LED configuration register holds 6 bytes, so the first read should return 6 |
|
||||
| If not, set all zone sizes to zero |
|
||||
\*---------------------------------------------------------------------------------*/
|
||||
if (bus->i2c_smbus_read_byte_data(dev, POLYCHROME_REG_LED_CONFIG) == 0x06)
|
||||
{
|
||||
std::this_thread::sleep_for(1ms);
|
||||
zone_led_count[POLYCHROME_ZONE_1] = bus->i2c_smbus_read_byte(dev);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
zone_led_count[POLYCHROME_ZONE_2] = bus->i2c_smbus_read_byte(dev);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
zone_led_count[POLYCHROME_ZONE_3] = bus->i2c_smbus_read_byte(dev);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
zone_led_count[POLYCHROME_ZONE_4] = bus->i2c_smbus_read_byte(dev);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
zone_led_count[POLYCHROME_ZONE_5] = bus->i2c_smbus_read_byte(dev);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
zone_led_count[POLYCHROME_ZONE_ADDRESSABLE] = bus->i2c_smbus_read_byte(dev);
|
||||
}
|
||||
else
|
||||
{
|
||||
memset(zone_led_count, 0, sizeof(zone_led_count));
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int PolychromeController::GetMode()
|
||||
@@ -81,89 +137,203 @@ unsigned int PolychromeController::GetMode()
|
||||
return(active_mode);
|
||||
}
|
||||
|
||||
bool PolychromeController::IsAsrLed()
|
||||
void PolychromeController::SetColorsAndSpeed(unsigned char led, unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
return(asr_led);
|
||||
}
|
||||
|
||||
void PolychromeController::SetColorsAndSpeed(unsigned char red, unsigned char green, unsigned char blue, unsigned char speed)
|
||||
{
|
||||
unsigned char color_speed_pkt[4] = { red, green, blue, speed };
|
||||
|
||||
if (asr_led)
|
||||
unsigned char color_speed_pkt[4] = { red, green, blue, active_speed };
|
||||
unsigned char select_led_pkt[1] = { led };
|
||||
|
||||
switch(asrock_type)
|
||||
{
|
||||
switch(active_mode)
|
||||
{
|
||||
case ASROCK_TYPE_ASRLED:
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take 4 bytes in R/G/B/S order |
|
||||
| Select LED |
|
||||
\*-----------------------------------------------------*/
|
||||
case ASRLED_MODE_BREATHING:
|
||||
case ASRLED_MODE_FLASHING:
|
||||
case ASRLED_MODE_SPECTRUM_CYCLE:
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 4, color_speed_pkt);
|
||||
break;
|
||||
if(active_mode != ASRLED_MODE_OFF)
|
||||
{
|
||||
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, select_led_pkt);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
}
|
||||
|
||||
switch(active_mode)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take 4 bytes in R/G/B/S order |
|
||||
\*-----------------------------------------------------*/
|
||||
case ASRLED_MODE_BREATHING:
|
||||
case ASRLED_MODE_STROBE:
|
||||
case ASRLED_MODE_SPECTRUM_CYCLE:
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 4, color_speed_pkt);
|
||||
break;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take 3 bytes in R/G/B order |
|
||||
\*-----------------------------------------------------*/
|
||||
default:
|
||||
case ASRLED_MODE_STATIC:
|
||||
case ASRLED_MODE_MUSIC:
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 3, color_speed_pkt);
|
||||
break;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take 1 byte - speed |
|
||||
\*-----------------------------------------------------*/
|
||||
case ASRLED_MODE_RANDOM:
|
||||
case ASRLED_MODE_WAVE:
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 1, &active_speed);
|
||||
break;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take no bytes |
|
||||
\*-----------------------------------------------------*/
|
||||
case ASRLED_MODE_OFF:
|
||||
break;
|
||||
}
|
||||
std::this_thread::sleep_for(1ms);
|
||||
break;
|
||||
|
||||
case ASROCK_TYPE_POLYCHROME_V1:
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take 3 bytes in R/G/B order |
|
||||
| Select LED |
|
||||
\*-----------------------------------------------------*/
|
||||
default:
|
||||
case ASRLED_MODE_STATIC:
|
||||
case ASRLED_MODE_MUSIC:
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 3, color_speed_pkt);
|
||||
break;
|
||||
if(active_mode != ASRLED_MODE_OFF)
|
||||
{
|
||||
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, select_led_pkt);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
}
|
||||
|
||||
switch(active_mode)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take 4 bytes in R/G/B/S order |
|
||||
\*-----------------------------------------------------*/
|
||||
case POLYCHROME_V1_MODE_BREATHING:
|
||||
case POLYCHROME_V1_MODE_STROBE:
|
||||
case POLYCHROME_V1_MODE_SPECTRUM_CYCLE:
|
||||
case POLYCHROME_V1_MODE_SPRING:
|
||||
case POLYCHROME_V1_MODE_METEOR:
|
||||
case POLYCHROME_V1_MODE_STACK:
|
||||
case POLYCHROME_V1_MODE_CRAM:
|
||||
case POLYCHROME_V1_MODE_SCAN:
|
||||
case POLYCHROME_V1_MODE_NEON:
|
||||
case POLYCHROME_V1_MODE_WATER:
|
||||
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 4, color_speed_pkt);
|
||||
break;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take 3 bytes in R/G/B order |
|
||||
\*-----------------------------------------------------*/
|
||||
default:
|
||||
case POLYCHROME_V1_MODE_STATIC:
|
||||
case POLYCHROME_V1_MODE_MUSIC:
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 3, color_speed_pkt);
|
||||
break;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take 1 byte - speed |
|
||||
\*-----------------------------------------------------*/
|
||||
case POLYCHROME_V1_MODE_RANDOM:
|
||||
case POLYCHROME_V1_MODE_WAVE:
|
||||
case POLYCHROME_V1_MODE_RAINBOW:
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 1, &active_speed);
|
||||
break;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take no bytes |
|
||||
\*-----------------------------------------------------*/
|
||||
case POLYCHROME_V1_MODE_OFF:
|
||||
break;
|
||||
}
|
||||
std::this_thread::sleep_for(1ms);
|
||||
break;
|
||||
|
||||
case ASROCK_TYPE_POLYCHROME_V2:
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take 1 byte - speed |
|
||||
| Select LED |
|
||||
\*-----------------------------------------------------*/
|
||||
case ASRLED_MODE_RANDOM:
|
||||
case ASRLED_MODE_WAVE:
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 1, &speed);
|
||||
break;
|
||||
switch(active_mode)
|
||||
{
|
||||
case POLYCHROME_V2_MODE_OFF:
|
||||
case POLYCHROME_V2_MODE_RAINBOW:
|
||||
case POLYCHROME_V2_MODE_SPECTRUM_CYCLE:
|
||||
break;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes take no bytes |
|
||||
\*-----------------------------------------------------*/
|
||||
case ASRLED_MODE_OFF:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Polychrome firmware always writes color to fixed reg |
|
||||
\*-----------------------------------------------------*/
|
||||
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_COLOR, 3, color_speed_pkt);
|
||||
|
||||
switch(active_mode)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes don't take a speed |
|
||||
\*-----------------------------------------------------*/
|
||||
POLYCHROME_MODE_OFF:
|
||||
POLYCHROME_MODE_STATIC:
|
||||
break;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| All other modes, write speed to active mode register |
|
||||
\*-----------------------------------------------------*/
|
||||
default:
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 1, &speed);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, select_led_pkt);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Polychrome firmware always writes color to fixed reg |
|
||||
\*-----------------------------------------------------*/
|
||||
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V2_REG_COLOR, 3, color_speed_pkt);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void PolychromeController::SetMode(unsigned char mode)
|
||||
void PolychromeController::SetMode(unsigned char zone,unsigned char mode, unsigned char speed)
|
||||
{
|
||||
active_mode = mode;
|
||||
unsigned char led_count_pkt[1] = { 0x00 };
|
||||
active_zone = zone;
|
||||
active_mode = mode;
|
||||
active_speed = speed;
|
||||
|
||||
if (asr_led)
|
||||
switch(asrock_type)
|
||||
{
|
||||
bus->i2c_smbus_write_block_data(dev, ASRLED_REG_MODE, 1, &active_mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_MODE, 1, &active_mode);
|
||||
case ASROCK_TYPE_ASRLED:
|
||||
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_MODE, 1, &active_mode);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
break;
|
||||
|
||||
case ASROCK_TYPE_POLYCHROME_V1:
|
||||
/*-----------------------------------------------------*\
|
||||
| Make sure set all register is set to 0 |
|
||||
\*-----------------------------------------------------*/
|
||||
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V1_REG_SET_ALL, 1, led_count_pkt);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set the zone we are working on |
|
||||
\*-----------------------------------------------------*/
|
||||
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_LED_SELECT, 1, &active_zone);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Write the mode |
|
||||
\*-----------------------------------------------------*/
|
||||
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_MODE, 1, &active_mode);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
break;
|
||||
|
||||
case ASROCK_TYPE_POLYCHROME_V2:
|
||||
bus->i2c_smbus_write_block_data(dev, ASROCK_REG_MODE, 1, &active_mode);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Select a single LED |
|
||||
\*-----------------------------------------------------*/
|
||||
bus->i2c_smbus_write_block_data(dev, POLYCHROME_V2_REG_LED_COUNT, 0, led_count_pkt);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
switch(active_mode)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| These modes don't take a speed |
|
||||
\*-----------------------------------------------------*/
|
||||
case POLYCHROME_V2_MODE_OFF:
|
||||
case POLYCHROME_V2_MODE_STATIC:
|
||||
break;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| All other modes, write speed to active mode register |
|
||||
\*-----------------------------------------------------*/
|
||||
default:
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 1, &speed);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "i2c_smbus.h"
|
||||
#include <string>
|
||||
|
||||
#pragma once
|
||||
|
||||
@@ -16,63 +17,178 @@ typedef unsigned char polychrome_dev_id;
|
||||
|
||||
enum
|
||||
{
|
||||
ASRLED_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
|
||||
ASRLED_REG_MODE = 0x30, /* Mode selection register */
|
||||
};
|
||||
|
||||
#define ASRLED_NUM_MODES 8 /* Number of ASR LED modes */
|
||||
|
||||
enum
|
||||
{
|
||||
ASRLED_MODE_OFF = 0x10, /* OFF mode */
|
||||
ASRLED_MODE_STATIC = 0x11, /* Static color mode */
|
||||
ASRLED_MODE_BREATHING = 0x12, /* Breathing effect mode */
|
||||
ASRLED_MODE_FLASHING = 0x13, /* Flashing effect mode */
|
||||
ASRLED_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
|
||||
ASRLED_MODE_RANDOM = 0x15, /* Random effect mode */
|
||||
ASRLED_MODE_MUSIC = 0x17, /* Music effect mode */
|
||||
ASRLED_MODE_WAVE = 0x18, /* Wave effect mode */
|
||||
ASROCK_TYPE_UNKNOWN = 0x00, /* Unknown Type or Not ASRock Device */
|
||||
ASROCK_TYPE_ASRLED = 0x01, /* ASRock Firmware 1.x - ASR LED */
|
||||
ASROCK_TYPE_POLYCHROME_V1 = 0x02, /* ASRock Firmware 2.x - Polychrome V1 */
|
||||
ASROCK_TYPE_POLYCHROME_V2 = 0x03, /* ASRock Firmware 3.x - Polychrome V2 */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
ASRLED_SPEED_MIN = 0x05, /* Slowest speed */
|
||||
ASRLED_SPEED_DEFAULT = 0x03, /* Default speed */
|
||||
ASRLED_SPEED_MAX = 0x00, /* Fastest speed */
|
||||
/*------------------------------------------------------------------------------------------*\
|
||||
| ASRock Common Registers |
|
||||
\*------------------------------------------------------------------------------------------*/
|
||||
ASROCK_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
|
||||
ASROCK_REG_MODE = 0x30, /* Mode selection register */
|
||||
ASROCK_REG_LED_SELECT = 0x31, /* LED selection register */
|
||||
/*------------------------------------------------------------------------------------------*\
|
||||
| ASRock Polychrome V1/V2 Common Registers |
|
||||
\*------------------------------------------------------------------------------------------*/
|
||||
POLYCHROME_REG_LED_CONFIG = 0x33, /* LED configuration register */
|
||||
/*------------------------------------------------------------------------------------------*\
|
||||
| ASRock Polychrome V1 (Firmware 2.x) Registers |
|
||||
\*------------------------------------------------------------------------------------------*/
|
||||
POLYCHROME_V1_REG_SET_ALL = 0x32, /* Set All register 0x1 = set all */
|
||||
POLYCHROME_V1_REG_ARGB_GRB = 0x35, /* ARGB bistream reversing register */
|
||||
/*------------------------------------------------------------------------------------------*\
|
||||
| ASRock Polychrome V2 (Firmware 3.x) Registers |
|
||||
\*------------------------------------------------------------------------------------------*/
|
||||
POLYCHROME_V2_REG_LED_COUNT = 0x32, /* Additional LED count register */
|
||||
POLYCHROME_V2_REG_COLOR = 0x34, /* Color register: Red, Green, Blue */
|
||||
POLYCHROME_V2_REG_ARGB_GRB = 0x35, /* ARGB bistream reversing register */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
POLYCHROME_REG_FIRMWARE_VER = 0x00, /* Firmware version Major.Minor */
|
||||
POLYCHROME_REG_MODE = 0x30, /* Mode selection register */
|
||||
POLYCHROME_REG_COLOR = 0x34, /* Color register: Red, Green, Blue */
|
||||
POLYCHROME_ZONE_1 = 0x00, /* RGB LED 1 Header */
|
||||
POLYCHROME_ZONE_2 = 0x01, /* RGB LED 2 Header */
|
||||
POLYCHROME_ZONE_3 = 0x02, /* Audio/PCH Zone LEDs */
|
||||
POLYCHROME_ZONE_4 = 0x03, /* Audio/PCH Zone LEDs */
|
||||
POLYCHROME_ZONE_5 = 0x04, /* IO Cover Zone LEDs */
|
||||
POLYCHROME_ZONE_ADDRESSABLE = 0x05, /* Addressable LED header */
|
||||
POLYCHROME_ZONE_COUNT = 0x06, /* Total number of zones */
|
||||
POLYCHROME_ZONE_ADDRESSABLE_MAX = 0x64, /* Maxinum number of ARGB LEDs */
|
||||
};
|
||||
|
||||
#define POLYCHROME_NUM_MODES 14 /* Number of Polychrome modes */
|
||||
/*----------------------------------------------------------------------------------------------*\
|
||||
| Definitions for ASR LED |
|
||||
\*----------------------------------------------------------------------------------------------*/
|
||||
#define ASRLED_NUM_MODES 8 /* Number of ASR LED modes */
|
||||
|
||||
enum
|
||||
{
|
||||
POLYCHROME_MODE_OFF = 0x10, /* OFF mode */
|
||||
POLYCHROME_MODE_STATIC = 0x11, /* Static color mode */
|
||||
POLYCHROME_MODE_BREATHING = 0x12, /* Breating effect mode */
|
||||
POLYCHROME_MODE_FLASHING = 0x13, /* Flashing effect mode */
|
||||
POLYCHROME_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
|
||||
POLYCHROME_MODE_RANDOM = 0x15, /* Random effect mode */
|
||||
POLYCHROME_MODE_WAVE = 0x17, /* Wave effect mode */
|
||||
POLYCHROME_MODE_SPRING = 0x18, /* Spring effect mode */
|
||||
POLYCHROME_MODE_STACK = 0x19, /* Stack effect mode */
|
||||
POLYCHROME_MODE_CRAM = 0x1A, /* Cram effect mode */
|
||||
POLYCHROME_MODE_SCAN = 0x1B, /* Scan effect mode */
|
||||
POLYCHROME_MODE_NEON = 0x1C, /* Neon effect mode */
|
||||
POLYCHROME_MODE_WATER = 0x1D, /* Water effect mode */
|
||||
POLYCHROME_MODE_RAINBOW = 0x1E, /* Rainbow effect mode */
|
||||
ASRLED_MODE_OFF = 0x10, /* OFF mode */
|
||||
ASRLED_MODE_STATIC = 0x11, /* Static color mode */
|
||||
ASRLED_MODE_BREATHING = 0x12, /* Breathing effect mode */
|
||||
ASRLED_MODE_STROBE = 0x13, /* Strobe effect mode */
|
||||
ASRLED_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
|
||||
ASRLED_MODE_RANDOM = 0x15, /* Random effect mode */
|
||||
ASRLED_MODE_MUSIC = 0x17, /* Music effect mode */
|
||||
ASRLED_MODE_WAVE = 0x18, /* Wave effect mode */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
POLYCHROME_SPEED_MIN = 0x05, /* Slowest speed */
|
||||
POLYCHROME_SPEED_DEFAULT = 0x03, /* Default speed */
|
||||
POLYCHROME_SPEED_MAX = 0x00, /* Fastest speed */
|
||||
ASRLED_SPEED_MIN = 0x05, /* Slowest speed */
|
||||
ASRLED_SPEED_DEFAULT = 0x03, /* Default speed */
|
||||
ASRLED_SPEED_MAX = 0x00, /* Fastest speed */
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------------------------*\
|
||||
| Definitions for Polychrome V1 |
|
||||
\*----------------------------------------------------------------------------------------------*/
|
||||
#define POLYCHROME_V1_NUM_MODES 16 /* Number of Polychrome V1 modes */
|
||||
|
||||
enum
|
||||
{
|
||||
POLYCHROME_V1_MODE_OFF = 0x10, /* OFF mode */
|
||||
POLYCHROME_V1_MODE_STATIC = 0x11, /* Static color mode */
|
||||
POLYCHROME_V1_MODE_BREATHING = 0x12, /* Breating effect mode */
|
||||
POLYCHROME_V1_MODE_STROBE = 0x13, /* Strobe effect mode */
|
||||
POLYCHROME_V1_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
|
||||
POLYCHROME_V1_MODE_RANDOM = 0x15, /* Random effect mode */
|
||||
POLYCHROME_V1_MODE_MUSIC = 0x17, /* Music effect mode */
|
||||
POLYCHROME_V1_MODE_WAVE = 0x18, /* Wave effect mode */
|
||||
/*------------------------------------------------------------------------------------------*\
|
||||
| Modes only available on ARGB headers |
|
||||
\*------------------------------------------------------------------------------------------*/
|
||||
POLYCHROME_V1_MODE_SPRING = 0x19, /* Spring effect mode */
|
||||
POLYCHROME_V1_MODE_METEOR = 0x1A, /* Meteor effect mode */
|
||||
POLYCHROME_V1_MODE_STACK = 0x1B, /* Stack effect mode */
|
||||
POLYCHROME_V1_MODE_CRAM = 0x1C, /* Cram effect mode */
|
||||
POLYCHROME_V1_MODE_SCAN = 0x1D, /* Scan effect mode */
|
||||
POLYCHROME_V1_MODE_NEON = 0x1E, /* Neon effect mode */
|
||||
POLYCHROME_V1_MODE_WATER = 0x1F, /* Water effect mode */
|
||||
POLYCHROME_V1_MODE_RAINBOW = 0x20, /* Rainbow chase effect mode */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
/*------------------------------------------------------------------------------------------*\
|
||||
| POLYCHROME_V1_MODE_BREATHING |
|
||||
\*------------------------------------------------------------------------------------------*/
|
||||
POLYCHROME_V1_SPEED_MIN_BREATHING = 0x0A, /* Slowest speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_BREATHING = 0x02, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_MAX_BREATHING = 0x02, /* Fastest speed */
|
||||
/*------------------------------------------------------------------------------------------*\
|
||||
| POLYCHROME_V1_MODE_STROBE |
|
||||
\*------------------------------------------------------------------------------------------*/
|
||||
POLYCHROME_V1_SPEED_MIN_STROBE = 0xA0, /* Slowest speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_STROBE = 0x14, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_MAX_STROBE = 0x05, /* Fastest speed */
|
||||
/*------------------------------------------------------------------------------------------*\
|
||||
| POLYCHROME_V1_MODE_SPECTRUM_CYCLE |
|
||||
\*------------------------------------------------------------------------------------------*/
|
||||
POLYCHROME_V1_SPEED_MIN_CYCLE = 0xA0, /* Slowest speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_CYCLE = 0x14, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_MAX_CYCLE = 0x0A, /* Fastest speed */
|
||||
/*------------------------------------------------------------------------------------------*\
|
||||
| POLYCHROME_V1_MODE_RANDOM |
|
||||
\*------------------------------------------------------------------------------------------*/
|
||||
POLYCHROME_V1_SPEED_MIN_RANDOM = 0xA0, /* Slowest speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_RANDOM = 0x28, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_MAX_RANDOM = 0x05, /* Fastest speed */
|
||||
/*------------------------------------------------------------------------------------------*\
|
||||
| POLYCHROME_V1_MODE_WAVE |
|
||||
\*------------------------------------------------------------------------------------------*/
|
||||
POLYCHROME_V1_SPEED_MIN_WAVE = 0x06, /* Slowest speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_WAVE = 0x02, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_MAX_WAVE = 0x01, /* Fastest speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_SPRING = 0x04, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_METEOR = 0x0A, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_STACK = 0x04, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_CRAM = 0x04, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_SCAN = 0x0A, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_NEON = 0x20, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_WATER = 0x0A, /* Default speed */
|
||||
/*------------------------------------------------------------------------------------------*\
|
||||
| POLYCHROME_V1_MODE_RAINBOW |
|
||||
\*------------------------------------------------------------------------------------------*/
|
||||
POLYCHROME_V1_SPEED_MIN_RAINBOW = 0x12, /* Slowest speed */
|
||||
POLYCHROME_V1_SPEED_DEFAULT_RAINBOW = 0x0A, /* Default speed */
|
||||
POLYCHROME_V1_SPEED_MAX_RAINBOW = 0x01, /* Fastest speed */
|
||||
POLYCHROME_V1_SPEED_MIN_ARGB = 0x20, /* Slowest speed */
|
||||
POLYCHROME_V1_SPEED_MAX_ARGB = 0x02, /* Fastest speed */
|
||||
};
|
||||
|
||||
/*----------------------------------------------------------------------------------------------*\
|
||||
| Definitions for Polychrome V2 |
|
||||
\*----------------------------------------------------------------------------------------------*/
|
||||
#define POLYCHROME_V2_NUM_MODES 14 /* Number of Polychrome V2 modes */
|
||||
|
||||
enum
|
||||
{
|
||||
POLYCHROME_V2_MODE_OFF = 0x10, /* OFF mode */
|
||||
POLYCHROME_V2_MODE_STATIC = 0x11, /* Static color mode */
|
||||
POLYCHROME_V2_MODE_BREATHING = 0x12, /* Breating effect mode */
|
||||
POLYCHROME_V2_MODE_STROBE = 0x13, /* Strobe effect mode */
|
||||
POLYCHROME_V2_MODE_SPECTRUM_CYCLE = 0x14, /* Spectrum Cycle effect mode */
|
||||
POLYCHROME_V2_MODE_RANDOM = 0x15, /* Random effect mode */
|
||||
POLYCHROME_V2_MODE_WAVE = 0x17, /* Wave effect mode */
|
||||
POLYCHROME_V2_MODE_SPRING = 0x18, /* Spring effect mode */
|
||||
POLYCHROME_V2_MODE_STACK = 0x19, /* Stack effect mode */
|
||||
POLYCHROME_V2_MODE_CRAM = 0x1A, /* Cram effect mode */
|
||||
POLYCHROME_V2_MODE_SCAN = 0x1B, /* Scan effect mode */
|
||||
POLYCHROME_V2_MODE_NEON = 0x1C, /* Neon effect mode */
|
||||
POLYCHROME_V2_MODE_WATER = 0x1D, /* Water effect mode */
|
||||
POLYCHROME_V2_MODE_RAINBOW = 0x1E, /* Rainbow effect mode */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
POLYCHROME_V2_SPEED_MIN = 0x05, /* Slowest speed */
|
||||
POLYCHROME_V2_SPEED_DEFAULT = 0x03, /* Default speed */
|
||||
POLYCHROME_V2_SPEED_MAX = 0x00, /* Fastest speed */
|
||||
};
|
||||
|
||||
class PolychromeController
|
||||
@@ -81,20 +197,25 @@ public:
|
||||
PolychromeController(i2c_smbus_interface* bus, polychrome_dev_id dev);
|
||||
~PolychromeController();
|
||||
|
||||
char* GetDeviceName();
|
||||
unsigned int GetLEDCount();
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetFirmwareVersion();
|
||||
unsigned int GetMode();
|
||||
bool IsAsrLed();
|
||||
void SetColorsAndSpeed(unsigned char red, unsigned char green, unsigned char blue, unsigned char speed);
|
||||
void SetMode(unsigned char mode);
|
||||
unsigned short GetFirmwareVersion();
|
||||
unsigned int GetASRockType();
|
||||
void SetColorsAndSpeed(unsigned char led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetMode(unsigned char zone, unsigned char mode, unsigned char speed);
|
||||
|
||||
unsigned char zone_led_count[6];
|
||||
|
||||
private:
|
||||
bool asr_led;
|
||||
char device_name[32];
|
||||
unsigned int led_count;
|
||||
unsigned int asrock_type;
|
||||
std::string device_name;
|
||||
unsigned char active_zone;
|
||||
unsigned char active_mode;
|
||||
unsigned char active_speed;
|
||||
i2c_smbus_interface* bus;
|
||||
polychrome_dev_id dev;
|
||||
|
||||
unsigned short ReadFirmwareVersion();
|
||||
void ReadLEDConfiguration();
|
||||
};
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "PolychromeController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_Polychrome.h"
|
||||
@@ -54,7 +55,7 @@ void DetectPolychromeControllers(std::vector<i2c_smbus_interface*>& busses, std:
|
||||
{
|
||||
new_polychrome = new PolychromeController(busses[bus], 0x6A);
|
||||
|
||||
if(new_polychrome->GetLEDCount() != 0)
|
||||
if(new_polychrome->GetASRockType() != ASROCK_TYPE_UNKNOWN)
|
||||
{
|
||||
new_controller = new RGBController_Polychrome(new_polychrome);
|
||||
rgb_controllers.push_back(new_controller);
|
||||
@@ -62,8 +63,10 @@ void DetectPolychromeControllers(std::vector<i2c_smbus_interface*>& busses, std:
|
||||
else
|
||||
{
|
||||
delete new_polychrome;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} /* DetectPolychromeControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("ASRock Polychrome", DetectPolychromeControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "PoseidonZRGBController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_PoseidonZRGB.h"
|
||||
@@ -50,5 +51,6 @@ void DetectPoseidonZRGBControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
info = info->next;
|
||||
}
|
||||
|
||||
} /* DetectPoseidonZRGBControllers() */
|
||||
|
||||
}
|
||||
REGISTER_DETECTOR("Thermaltake Poseidon Z RGB", DetectPoseidonZRGBControllers);
|
||||
|
||||
@@ -61,9 +61,9 @@ void RGBFusion2DRAMController::Apply()
|
||||
|
||||
void RGBFusion2DRAMController::SetLEDEffect
|
||||
(
|
||||
unsigned int led,
|
||||
unsigned int /*led*/,
|
||||
int mode,
|
||||
unsigned int speed,
|
||||
unsigned int /*speed*/,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
@@ -75,4 +75,4 @@ void RGBFusion2DRAMController::SetLEDEffect
|
||||
led_data[RGB_FUSION_2_DRAM_IDX_BLUE] = blue;
|
||||
|
||||
bus->i2c_smbus_write_block_data(dev, RGB_FUSION_2_DRAM_LED_START_ADDR, 32, led_data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "RGBFusion2DRAMController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_RGBFusion2DRAM.h"
|
||||
@@ -65,3 +66,6 @@ void DetectRGBFusion2DRAMControllers(std::vector<i2c_smbus_interface*>& busses,
|
||||
}
|
||||
|
||||
} /* DetectRGBFusion2DRAMControllers() */
|
||||
|
||||
// This detector is disabled as proper detection isn't implemented
|
||||
//REGISTER_I2C_DETECTOR("Gigabyte RGB Fusion 2 DRAM", DetectRGBFusion2DRAMControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "RGBFusion2SMBusController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_RGBFusion2SMBus.h"
|
||||
@@ -6,6 +7,29 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string>
|
||||
#include "dependencies/dmiinfo.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const std::string manufacturer;
|
||||
const std::string motherboard;
|
||||
} motherboard_info;
|
||||
|
||||
#define RGB_FUSION_2_SMBUS_NUM_DEVICES (sizeof(rgb_fusion_2_smbus_motherboards) / sizeof(rgb_fusion_2_smbus_motherboards[ 0 ]))
|
||||
|
||||
const motherboard_info rgb_fusion_2_smbus_motherboards[] =
|
||||
{
|
||||
{ "Gigabyte Technology Co., Ltd.", "B450 AORUS ELITE" },
|
||||
{ "Gigabyte Technology Co., Ltd.", "X470 AORUS ULTRA GAMING-CF" },
|
||||
{ "Gigabyte Technology Co., Ltd.", "X470 AORUS ULTRA GAMING" },
|
||||
{ "Gigabyte Technology Co., Ltd.", "X470 AORUS GAMING 5 WIFI" },
|
||||
{ "Gigabyte Technology Co., Ltd.", "B450 AORUS M" },
|
||||
{ "Gigabyte Technology Co., Ltd.", "X399 AORUS XTREME-CF" },
|
||||
{ "Gigabyte Technology Co., Ltd.", "X399 DESIGNARE EX-CF" },
|
||||
{ "Gigabyte Technology Co., Ltd.", "B450 I AORUS PRO WIFI-CF" },
|
||||
{ "Gigabyte Technology Co., Ltd.", "B450 AORUS PRO-CF4" },
|
||||
{ "Gigabyte Technology Co., Ltd.", "X470 AORUS GAMING 7 WIFI-CF" },
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
@@ -21,18 +45,12 @@ bool TestForRGBFusion2SMBusController(i2c_smbus_interface* bus, unsigned char ad
|
||||
bool pass = false;
|
||||
|
||||
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
|
||||
|
||||
if (res >= 0)
|
||||
{
|
||||
pass = true;
|
||||
|
||||
// res = bus->i2c_smbus_read_byte_data(address, 0xF2);
|
||||
|
||||
// if (res != 0xC4)
|
||||
// {
|
||||
// pass = false;
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
return(pass);
|
||||
|
||||
} /* TestForRGBFusion2SMBusController() */
|
||||
@@ -53,21 +71,38 @@ void DetectRGBFusion2SMBusControllers(std::vector<i2c_smbus_interface*>& busses,
|
||||
RGBFusion2SMBusController* new_rgb_fusion;
|
||||
RGBController_RGBFusion2SMBus* new_controller;
|
||||
|
||||
for (unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
DMIInfo dmi;
|
||||
bool found = false;
|
||||
|
||||
for(unsigned int mb_idx = 0; mb_idx < RGB_FUSION_2_SMBUS_NUM_DEVICES; mb_idx++)
|
||||
{
|
||||
// TODO - Is this necessary? Or an artifact of my own system?
|
||||
// Skip dmcd devices
|
||||
std::string device_name = std::string(busses[bus]->device_name);
|
||||
if (device_name.find("dmdc") == std::string::npos)
|
||||
if( ( dmi.getManufacturer() == rgb_fusion_2_smbus_motherboards[mb_idx].manufacturer )
|
||||
&& ( dmi.getMainboard() == rgb_fusion_2_smbus_motherboards[mb_idx].motherboard ) )
|
||||
{
|
||||
// Check for RGB Fusion 2 controller at 0x68
|
||||
if (TestForRGBFusion2SMBusController(busses[bus], 0x68))
|
||||
found = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(found)
|
||||
{
|
||||
for (unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
{
|
||||
// TODO - Is this necessary? Or an artifact of my own system?
|
||||
// Skip dmcd devices
|
||||
std::string device_name = std::string(busses[bus]->device_name);
|
||||
if (device_name.find("dmdc") == std::string::npos)
|
||||
{
|
||||
new_rgb_fusion = new RGBFusion2SMBusController(busses[bus], 0x68);
|
||||
new_controller = new RGBController_RGBFusion2SMBus(new_rgb_fusion);
|
||||
rgb_controllers.push_back(new_controller);
|
||||
// Check for RGB Fusion 2 controller at 0x68
|
||||
if (TestForRGBFusion2SMBusController(busses[bus], 0x68))
|
||||
{
|
||||
new_rgb_fusion = new RGBFusion2SMBusController(busses[bus], 0x68);
|
||||
new_controller = new RGBController_RGBFusion2SMBus(new_rgb_fusion);
|
||||
rgb_controllers.push_back(new_controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} /* DetectRGBFusion2SMBusControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("Gigabyte RGB Fusion 2 SMBus", DetectRGBFusion2SMBusControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "RGBFusion2USBController.h"
|
||||
#include "RGBController_RGBFusion2USB.h"
|
||||
#include "dependencies/dmiinfo.h"
|
||||
@@ -34,7 +35,7 @@ void DetectRGBFusion2USBControllers(std::vector<RGBController*> &rgb_controllers
|
||||
return;
|
||||
}
|
||||
|
||||
for(int dev_idx = 0; dev_idx < COUNT_RGBFUSION2_PIDS; dev_idx++)
|
||||
for(unsigned int dev_idx = 0; dev_idx < COUNT_RGBFUSION2_PIDS; dev_idx++)
|
||||
{
|
||||
dev = NULL;
|
||||
|
||||
@@ -53,13 +54,13 @@ void DetectRGBFusion2USBControllers(std::vector<RGBController*> &rgb_controllers
|
||||
&&(info->product_id == tmpPID))
|
||||
#endif
|
||||
{
|
||||
hid_device * dev = hid_open_path(info->path);
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if (dev)
|
||||
{
|
||||
RGBFusion2USBController * controller = new RGBFusion2USBController(dev, info->path, MB_info.getMainboard());
|
||||
RGBController_RGBFusion2USB * rgb_controller = new RGBController_RGBFusion2USB(controller);
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
break;
|
||||
}
|
||||
}
|
||||
info = info->next;
|
||||
@@ -67,4 +68,6 @@ void DetectRGBFusion2USBControllers(std::vector<RGBController*> &rgb_controllers
|
||||
}
|
||||
|
||||
hid_free_enumeration(info);
|
||||
}
|
||||
} /* DetectRGBFusion2USBControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Gigabyte RGB Fusion 2 USB", DetectRGBFusion2USBControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "RGBFusionController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_RGBFusion.h"
|
||||
@@ -64,4 +65,6 @@ void DetectRGBFusionControllers(std::vector<i2c_smbus_interface*>& busses, std::
|
||||
}
|
||||
}
|
||||
|
||||
} /* DetectRGBFusionControllers() */
|
||||
} /* DetectRGBFusionControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("Gigabyte RGB Fusion", DetectRGBFusionControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "RGBFusionGPUController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_RGBFusionGPU.h"
|
||||
@@ -81,3 +82,5 @@ void DetectRGBFusionGPUControllers(std::vector<i2c_smbus_interface*>& busses, st
|
||||
}
|
||||
|
||||
} /* DetectRGBFusionGPUControllers() */
|
||||
|
||||
REGISTER_I2C_DETECTOR("Gigabyte RGB Fusion GPU", DetectRGBFusionGPUControllers);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "RedragonK556Controller.h"
|
||||
#include "RedragonM711Controller.h"
|
||||
#include "RGBController.h"
|
||||
@@ -72,7 +73,7 @@ void DetectRedragonControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
|
||||
hid_init();
|
||||
|
||||
for(int device_idx = 0; device_idx < REDRAGON_NUM_DEVICES; device_idx++)
|
||||
for(unsigned int device_idx = 0; device_idx < REDRAGON_NUM_DEVICES; device_idx++)
|
||||
{
|
||||
dev = NULL;
|
||||
|
||||
@@ -123,4 +124,6 @@ void DetectRedragonControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
info = info->next;
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* DetectRedragonControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Redragon Peripheral", DetectRedragonControllers);
|
||||
|
||||
@@ -52,7 +52,7 @@ void SapphireGPUController::SetColor(unsigned char red, unsigned char green, uns
|
||||
bus->i2c_smbus_write_byte_data(dev, SAPPHIRE_GPU_REG_BLUE, blue);
|
||||
}
|
||||
|
||||
void SapphireGPUController::SetMode(unsigned char mode, unsigned char speed)
|
||||
void SapphireGPUController::SetMode(unsigned char mode, unsigned char /*speed*/)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, SAPPHIRE_GPU_REG_MODE, mode);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "SapphireGPUController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_SapphireGPU.h"
|
||||
@@ -17,12 +18,12 @@
|
||||
|
||||
bool TestForSapphireGPUController(i2c_smbus_interface* bus, unsigned char address)
|
||||
{
|
||||
bool pass = false;
|
||||
int res;
|
||||
//bool pass = false;
|
||||
//int res;
|
||||
|
||||
if(bus->i2c_smbus_read_byte_data(address, 0x06) == 0xCC)
|
||||
{
|
||||
pass = true;
|
||||
//pass = true;
|
||||
}
|
||||
|
||||
return(false); //TODO - better detection, leaving disabled for now
|
||||
@@ -57,3 +58,6 @@ void DetectSapphireGPUControllers(std::vector<i2c_smbus_interface*>& busses, std
|
||||
}
|
||||
|
||||
} /* DetectSapphireGPUControllers() */
|
||||
|
||||
// This detector is disabled as it does not properly detect
|
||||
//REGISTER_I2C_DETECTOR("Sapphire GPU", DetectSapphireGPUControllers);
|
||||
|
||||
@@ -21,11 +21,20 @@ static unsigned int keys[] = {0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x
|
||||
0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52,
|
||||
0x53, 0x54, 0x55, 0x56, 0x57, 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
|
||||
0x60, 0x61, 0x62, 0x63, 0x64, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
|
||||
0xf0 };
|
||||
0xf0, 0x31 };
|
||||
|
||||
SteelSeriesApexController::SteelSeriesApexController(hid_device* dev_handle)
|
||||
static unsigned int keys_tkl[] = {0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10,
|
||||
0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d,
|
||||
0x1e, 0x1f, 0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a,
|
||||
0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38,
|
||||
0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x44, 0x45,
|
||||
0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52,
|
||||
0x64, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xf0, 0x31 };
|
||||
|
||||
SteelSeriesApexController::SteelSeriesApexController(hid_device* dev_handle, steelseries_type type)
|
||||
{
|
||||
dev = dev_handle;
|
||||
proto_type = type;
|
||||
}
|
||||
|
||||
SteelSeriesApexController::~SteelSeriesApexController()
|
||||
@@ -36,7 +45,7 @@ SteelSeriesApexController::~SteelSeriesApexController()
|
||||
void SteelSeriesApexController::SetMode
|
||||
(
|
||||
unsigned char mode,
|
||||
std::vector<RGBColor> colors
|
||||
std::vector<RGBColor> /*colors*/
|
||||
)
|
||||
{
|
||||
unsigned char mode_colors[9];
|
||||
@@ -50,7 +59,16 @@ void SteelSeriesApexController::SetMode
|
||||
void SteelSeriesApexController::SetLEDsDirect(std::vector<RGBColor> colors)
|
||||
{
|
||||
unsigned char buf[643];
|
||||
int num_keys = sizeof(keys)/sizeof(*keys);
|
||||
int num_keys = 0;
|
||||
|
||||
if(proto_type == APEX)
|
||||
{
|
||||
num_keys = sizeof(keys) / sizeof(*keys);
|
||||
}
|
||||
else
|
||||
{
|
||||
num_keys = sizeof(keys_tkl) / sizeof(*keys_tkl);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
@@ -61,7 +79,7 @@ void SteelSeriesApexController::SetLEDsDirect(std::vector<RGBColor> colors)
|
||||
| Set up Direct packet |
|
||||
\*-----------------------------------------------------*/
|
||||
buf[0x00] = 0;
|
||||
buf[0x01] = APEX7_PACKET_ID_DIRECT;
|
||||
buf[0x01] = APEX_PACKET_ID_DIRECT;
|
||||
buf[0x02] = num_keys;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -69,7 +87,14 @@ void SteelSeriesApexController::SetLEDsDirect(std::vector<RGBColor> colors)
|
||||
\*-----------------------------------------------------*/
|
||||
for(int i = 0; i < num_keys; i++)
|
||||
{
|
||||
buf[(i*4)+3] = keys[i];
|
||||
if(proto_type == APEX)
|
||||
{
|
||||
buf[(i*4)+3] = keys[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
buf[(i*4)+3] = keys_tkl[i];
|
||||
}
|
||||
buf[(i*4)+4] = RGBGetRValue(colors[i]);
|
||||
buf[(i*4)+5] = RGBGetGValue(colors[i]);
|
||||
buf[(i*4)+6] = RGBGetBValue(colors[i]);
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "SteelSeriesGeneric.h"
|
||||
|
||||
#include <string>
|
||||
#include <hidapi/hidapi.h>
|
||||
@@ -16,15 +17,17 @@
|
||||
|
||||
enum
|
||||
{
|
||||
APEX7_PACKET_ID_DIRECT = 0x3a, /* Direct mode */
|
||||
APEX_PACKET_ID_DIRECT = 0x3a, /* Direct mode */
|
||||
};
|
||||
|
||||
class SteelSeriesApexController
|
||||
{
|
||||
public:
|
||||
SteelSeriesApexController(hid_device* dev_handle);
|
||||
SteelSeriesApexController(hid_device* dev_handle, steelseries_type type);
|
||||
~SteelSeriesApexController();
|
||||
|
||||
steelseries_type proto_type;
|
||||
|
||||
void SetMode
|
||||
(
|
||||
unsigned char mode,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "SteelSeriesRivalController.h"
|
||||
#include "SteelSeriesSiberiaController.h"
|
||||
#include "SteelSeriesApexController.h"
|
||||
@@ -35,7 +36,10 @@
|
||||
/*-----------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*-----------------------------------------------------*/
|
||||
#define STEELSERIES_APEX_5_PID 0x161C
|
||||
#define STEELSERIES_APEX_7_PID 0x1612
|
||||
#define STEELSERIES_APEX_7_TKL_PID 0x1618
|
||||
#define STEELSERIES_APEX_PRO_PID 0x1610
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@@ -73,7 +77,10 @@ static const steelseries_device device_list[] =
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------------------*\
|
||||
| Keyboards |
|
||||
\*-----------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
{ STEELSERIES_VID, STEELSERIES_APEX_7_PID, 1, DEVICE_TYPE_KEYBOARD, APEX_7, "SteelSeries Apex 7" },
|
||||
{ STEELSERIES_VID, STEELSERIES_APEX_5_PID, 1, DEVICE_TYPE_KEYBOARD, APEX, "SteelSeries Apex 5" },
|
||||
{ STEELSERIES_VID, STEELSERIES_APEX_7_PID, 1, DEVICE_TYPE_KEYBOARD, APEX, "SteelSeries Apex 7" },
|
||||
{ STEELSERIES_VID, STEELSERIES_APEX_7_TKL_PID, 1, DEVICE_TYPE_KEYBOARD, APEX_TKL, "SteelSeries Apex 7 TKL" },
|
||||
{ STEELSERIES_VID, STEELSERIES_APEX_PRO_PID, 1, DEVICE_TYPE_KEYBOARD, APEX, "SteelSeries Apex Pro" },
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
@@ -91,7 +98,7 @@ void DetectSteelSeriesControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
|
||||
hid_init();
|
||||
|
||||
for(int device_idx = 0; device_idx < STEELSERIES_NUM_DEVICES; device_idx++)
|
||||
for(unsigned int device_idx = 0; device_idx < STEELSERIES_NUM_DEVICES; device_idx++)
|
||||
{
|
||||
dev = NULL;
|
||||
|
||||
@@ -119,7 +126,7 @@ void DetectSteelSeriesControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
{
|
||||
case DEVICE_TYPE_KEYBOARD:
|
||||
{
|
||||
SteelSeriesApexController* controller = new SteelSeriesApexController(dev);
|
||||
SteelSeriesApexController* controller = new SteelSeriesApexController(dev, device_list[device_idx].proto_type);
|
||||
|
||||
RGBController_SteelSeriesApex* rgb_controller = new RGBController_SteelSeriesApex(controller);
|
||||
rgb_controller->name = device_list[device_idx].name;
|
||||
@@ -153,4 +160,6 @@ void DetectSteelSeriesControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* DetectSteelSeriesControllers() */
|
||||
|
||||
REGISTER_DETECTOR("SteelSeries", DetectSteelSeriesControllers);
|
||||
|
||||
@@ -20,6 +20,7 @@ typedef enum
|
||||
RIVAL_100 = 0x00,
|
||||
RIVAL_300 = 0x01,
|
||||
SIBERIA_350 = 0x03,
|
||||
APEX_7 = 0x04,
|
||||
APEX = 0x04,
|
||||
APEX_TKL = 0x05,
|
||||
} steelseries_type;
|
||||
|
||||
|
||||
@@ -70,15 +70,20 @@ void SteelSeriesRivalController::SetLightEffect
|
||||
{
|
||||
char usb_buf[9];
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
switch (proto) {
|
||||
switch (proto)
|
||||
{
|
||||
case RIVAL_100:
|
||||
usb_buf[0x00] = 0x07;
|
||||
usb_buf[0x01] = 0x00;
|
||||
break;
|
||||
|
||||
case RIVAL_300:
|
||||
usb_buf[0x00] = 0x07;
|
||||
usb_buf[0x01] = zone_id + 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
usb_buf[0x02] = effect;
|
||||
send_usb_msg(dev, usb_buf, 9);
|
||||
@@ -100,8 +105,10 @@ void SteelSeriesRivalController::SetLightEffectAll
|
||||
SetLightEffect(0, effect);
|
||||
SetLightEffect(1, effect);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -126,7 +133,11 @@ void SteelSeriesRivalController::SetColor
|
||||
usb_buf[0x00] = 0x08;
|
||||
usb_buf[0x01] = zone_id + 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
usb_buf[0x02] = red;
|
||||
usb_buf[0x03] = green;
|
||||
usb_buf[0x04] = blue;
|
||||
@@ -151,6 +162,9 @@ void SteelSeriesRivalController::SetColorAll
|
||||
SetColor(0, red, green, blue);
|
||||
SetColor(1, red, green, blue);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
static void send_usb_msg(hid_device* dev, char * data_pkt, unsigned int size)
|
||||
{
|
||||
char* usb_pkt = new char[16];
|
||||
unsigned char usb_pkt[16];
|
||||
memset(usb_pkt, 0x00, sizeof(usb_pkt));
|
||||
|
||||
// Report number
|
||||
@@ -30,9 +30,7 @@ static void send_usb_msg(hid_device* dev, char * data_pkt, unsigned int size)
|
||||
usb_pkt[4 + i] = data_pkt[1 + i];
|
||||
}
|
||||
|
||||
hid_write(dev, (unsigned char *)usb_pkt, 16);
|
||||
|
||||
delete[] usb_pkt;
|
||||
hid_write(dev, usb_pkt, 16);
|
||||
}
|
||||
|
||||
SteelSeriesSiberiaController::SteelSeriesSiberiaController
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
/*-------------------------------------------------------------------*\
|
||||
| TecknetController.cpp |
|
||||
| |
|
||||
| Driver for Technet Devices |
|
||||
| |
|
||||
| Chris M (Dr_No) 29th Jul 2020 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
#include "TecknetController.h"
|
||||
|
||||
static unsigned char tecknet_colour_mode_data[][16] =
|
||||
{
|
||||
{ 0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00 }, // Static
|
||||
{ 0x02, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00 }, // Breathing
|
||||
};
|
||||
|
||||
static unsigned char tecknet_speed_mode_data[][9] =
|
||||
{
|
||||
{ 0x00, 0x00, 0x00, 0x00 }, // Static
|
||||
{ 0x00, 0x06, 0x03, 0x01 }, // Breathing
|
||||
};
|
||||
|
||||
TecknetController::TecknetController(hid_device* dev_handle, char *_path)
|
||||
{
|
||||
const int szTemp = 256;
|
||||
wchar_t tmpName[szTemp];
|
||||
|
||||
dev = dev_handle;
|
||||
|
||||
hid_get_manufacturer_string(dev, tmpName, szTemp);
|
||||
std::wstring wName = std::wstring(tmpName);
|
||||
device_name = std::string(wName.begin(), wName.end());
|
||||
|
||||
hid_get_product_string(dev, tmpName, szTemp);
|
||||
wName = std::wstring(tmpName);
|
||||
device_name.append(" ").append(std::string(wName.begin(), wName.end()));
|
||||
|
||||
hid_get_serial_number_string(dev, tmpName, szTemp);
|
||||
wName = std::wstring(tmpName);
|
||||
serial = std::string(wName.begin(), wName.end());
|
||||
|
||||
location = _path;
|
||||
|
||||
current_mode = TECKNET_MODE_STATIC;
|
||||
current_speed = TECKNET_SPEED_NORMAL;
|
||||
current_brightness = TECKNET_BRIGHTNESS_HIGH;
|
||||
}
|
||||
|
||||
TecknetController::~TecknetController()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
std::string TecknetController::GetDeviceName()
|
||||
{
|
||||
return device_name;
|
||||
}
|
||||
|
||||
std::string TecknetController::GetSerial()
|
||||
{
|
||||
return serial;
|
||||
}
|
||||
|
||||
std::string TecknetController::GetLocation()
|
||||
{
|
||||
return location;
|
||||
}
|
||||
|
||||
void TecknetController::SetMode(unsigned char mode, unsigned char speed, unsigned char brightness)
|
||||
{
|
||||
current_mode = mode;
|
||||
current_speed = speed;
|
||||
current_brightness = brightness;
|
||||
|
||||
SendUpdate();
|
||||
}
|
||||
|
||||
void TecknetController::SetColor(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
//The Tecknet mouse expects inverted colours in sent packets
|
||||
current_red = 255 - red;
|
||||
current_green = 255 - green;
|
||||
current_blue = 255 - blue;
|
||||
|
||||
SendUpdate();
|
||||
}
|
||||
|
||||
void TecknetController::SendUpdate()
|
||||
{
|
||||
unsigned char buffer[TECKNET_PACKET_LENGTH] = { 0x00 };
|
||||
int buffer_size = (sizeof(buffer) / sizeof(buffer[0]));
|
||||
|
||||
for(std::size_t i = 0; i < TECKNET_COLOUR_MODE_DATA_SIZE; i++)
|
||||
{
|
||||
buffer[i] = tecknet_colour_mode_data[current_mode][i];
|
||||
}
|
||||
|
||||
//Set the relevant colour info
|
||||
buffer[TECKNET_RED_BYTE] = current_red;
|
||||
buffer[TECKNET_GREEN_BYTE] = current_green;
|
||||
buffer[TECKNET_BLUE_BYTE] = current_blue;
|
||||
buffer[TECKNET_BRIGHTNESS_BYTE] = current_brightness;
|
||||
buffer[TECKNET_SPEED_BYTE] = tecknet_speed_mode_data[current_mode][current_speed];
|
||||
|
||||
hid_send_feature_report(dev, buffer, buffer_size);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/*-------------------------------------------------------------------*\
|
||||
| TecknetController.h |
|
||||
| |
|
||||
| Driver for Tecknet Devices |
|
||||
| |
|
||||
| Chris M (Dr_No) 29th Jul 2020 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TECKNETCONTROLLER_H
|
||||
#define TECKNETCONTROLLER_H
|
||||
|
||||
#include <string>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#define TECKNET_COLOUR_MODE_DATA_SIZE (sizeof(tecknet_colour_mode_data[0]) / sizeof(tecknet_colour_mode_data[0][0]))
|
||||
#define TECKNET_DEVICE_NAME_SIZE (sizeof(device_name) / sizeof(device_name[ 0 ]))
|
||||
#define TECKNET_PACKET_LENGTH 0x10 //16 bytes
|
||||
|
||||
enum
|
||||
{
|
||||
TECKNET_RED_BYTE = 2,
|
||||
TECKNET_GREEN_BYTE = 3,
|
||||
TECKNET_BLUE_BYTE = 4,
|
||||
TECKNET_BRIGHTNESS_BYTE = 5,
|
||||
TECKNET_SPEED_BYTE = 6
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
TECKNET_MODE_OFF = 0xFF, //LEDs Off
|
||||
TECKNET_MODE_STATIC = 0x00, //Static Mode
|
||||
TECKNET_MODE_BREATHING = 0x01, //Breathing Mode
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
TECKNET_BRIGHTNESS_OFF = 0x00,
|
||||
TECKNET_BRIGHTNESS_LOW = 0x01,
|
||||
TECKNET_BRIGHTNESS_MED = 0x02,
|
||||
TECKNET_BRIGHTNESS_HIGH = 0x03
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
TECKNET_SPEED_OFF = 0x00, // Breathe Off
|
||||
TECKNET_SPEED_SLOW = 0x01, // Breathe Slow speed
|
||||
TECKNET_SPEED_NORMAL = 0x02, // Breathe Normal speed
|
||||
TECKNET_SPEED_FAST = 0x03, // Breathe Fast speed
|
||||
};
|
||||
|
||||
class TecknetController
|
||||
{
|
||||
public:
|
||||
TecknetController(hid_device *dev_handle, char *_path);
|
||||
~TecknetController();
|
||||
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerial();
|
||||
std::string GetLocation();
|
||||
|
||||
void SetMode(unsigned char mode, unsigned char speed, unsigned char brightness);
|
||||
void SetColor(unsigned char red, unsigned char green, unsigned char blue);
|
||||
|
||||
private:
|
||||
std::string device_name;
|
||||
std::string serial;
|
||||
std::string location;
|
||||
hid_device* dev;
|
||||
|
||||
unsigned char current_mode;
|
||||
unsigned char current_speed;
|
||||
unsigned char current_brightness;
|
||||
|
||||
unsigned char current_red;
|
||||
unsigned char current_green;
|
||||
unsigned char current_blue;
|
||||
|
||||
void SendUpdate();
|
||||
};
|
||||
|
||||
#endif // TECKNETCONTROLLER_H
|
||||
@@ -0,0 +1,87 @@
|
||||
/*-------------------------------------------------------------------*\
|
||||
| TecknetControllerDetect.cpp |
|
||||
| |
|
||||
| Driver for Tecknet Devices |
|
||||
| |
|
||||
| Chris M (Dr_No) 29th Jul 2020 |
|
||||
| |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
#include "Detector.h"
|
||||
#include "TecknetController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_Tecknet.h"
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#define TECKNET_VID 0x04D9
|
||||
|
||||
#define TECKNET_M0008_PID 0xFC05
|
||||
#define TECKNET_M0008_U 0x01 //Usage 01
|
||||
#define TECKNET_M0008_UPG 0xFFA0 //Vendor Defined Usage Page
|
||||
|
||||
#define TECKNET_NUM_DEVICES (sizeof(tecknet_pids) / sizeof(tecknet_pids[ 0 ]))
|
||||
|
||||
enum
|
||||
{
|
||||
TECKNET_PID = 0,
|
||||
TECKNET_INTERFACE = 1,
|
||||
TECKNET_USAGE = 2,
|
||||
TECKNET_USAGE_PAGE = 3
|
||||
};
|
||||
|
||||
static const int tecknet_pids[][4] =
|
||||
{ // PID, Interface, Usage, Usage_Page
|
||||
{ TECKNET_M0008_PID, 0, TECKNET_M0008_U, TECKNET_M0008_UPG } //Tecknet M008 Mouse
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectTecknetControllers *
|
||||
* *
|
||||
* Tests the USB address to see if any Tecknet Controllers. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectTecknetControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
{
|
||||
hid_device_info* info;
|
||||
|
||||
//Look for the passed in tecknet_pids
|
||||
hid_init();
|
||||
info = hid_enumerate(TECKNET_VID, 0x0);
|
||||
|
||||
while(info)
|
||||
{
|
||||
hid_device* dev = NULL;
|
||||
if(info->vendor_id == TECKNET_VID)
|
||||
{
|
||||
for(unsigned int pid_idx = 0; pid_idx < TECKNET_NUM_DEVICES; pid_idx++)
|
||||
{
|
||||
if((info->vendor_id == TECKNET_VID)
|
||||
#ifdef USE_HID_USAGE
|
||||
&&(info->usage == tecknet_pids[pid_idx][TECKNET_USAGE])
|
||||
&&(info->usage_page == tecknet_pids[pid_idx][TECKNET_USAGE_PAGE])
|
||||
&&(info->product_id == tecknet_pids[pid_idx][TECKNET_PID]))
|
||||
#else
|
||||
&&(info->interface_number == tecknet_pids[pid_idx][TECKNET_INTERFACE]) //Interface is only valid on Windows where there is > 1 interface
|
||||
&&(info->product_id == tecknet_pids[pid_idx][TECKNET_PID]))
|
||||
#endif
|
||||
{
|
||||
dev = hid_open_path(info->path);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(dev)
|
||||
{
|
||||
TecknetController* controller = new TecknetController(dev, info->path);
|
||||
RGBController_Tecknet* rgb_controller = new RGBController_Tecknet(controller);
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
info = info->next;
|
||||
}
|
||||
hid_free_enumeration(info);
|
||||
} /* DetectTecknetControllers) */
|
||||
|
||||
REGISTER_DETECTOR("Tecknet", DetectTecknetControllers);
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "Detector.h"
|
||||
#include "ThermaltakeRiingController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_ThermaltakeRiing.h"
|
||||
@@ -53,4 +54,6 @@ void DetectThermaltakeRiingControllers(std::vector<RGBController*>& rgb_controll
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* DetectThermaltakeRiingControllers() */
|
||||
|
||||
REGISTER_DETECTOR("Thermaltake Riing", DetectThermaltakeRiingControllers);
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "DeviceDetector.h"
|
||||
|
||||
#define REGISTER_DETECTOR(name, func) static DeviceDetector device_detector_obj(name, func)
|
||||
#define REGISTER_I2C_DETECTOR(name, func) static I2CDeviceDetector device_detector_obj(name, func)
|
||||
#define REGISTER_I2C_BUS_DETECTOR(func) static I2CBusDetector device_detector_obj(func)
|
||||
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "ResourceManager.h"
|
||||
|
||||
class DeviceDetector
|
||||
{
|
||||
public:
|
||||
DeviceDetector(std::string name, DeviceDetectorFunction detector)
|
||||
{
|
||||
ResourceManager::get()->RegisterDeviceDetector(name, detector);
|
||||
}
|
||||
};
|
||||
|
||||
class I2CDeviceDetector
|
||||
{
|
||||
public:
|
||||
I2CDeviceDetector(std::string name, I2CDeviceDetectorFunction detector)
|
||||
{
|
||||
ResourceManager::get()->RegisterI2CDeviceDetector(name, detector);
|
||||
}
|
||||
};
|
||||
|
||||
class I2CBusDetector
|
||||
{
|
||||
public:
|
||||
I2CBusDetector(I2CBusDetectorFunction detector)
|
||||
{
|
||||
ResourceManager::get()->RegisterI2CBusDetector(detector);
|
||||
}
|
||||
};
|
||||
+17
-7
@@ -31,6 +31,7 @@ NetworkClient::NetworkClient(std::vector<RGBController *>& control) : controller
|
||||
{
|
||||
strcpy(port_ip, "127.0.0.1");
|
||||
port_num = OPENRGB_SDK_PORT;
|
||||
client_sock = -1;
|
||||
server_connected = false;
|
||||
server_controller_count = 0;
|
||||
|
||||
@@ -38,6 +39,11 @@ NetworkClient::NetworkClient(std::vector<RGBController *>& control) : controller
|
||||
ConnectionThread = NULL;
|
||||
}
|
||||
|
||||
NetworkClient::~NetworkClient()
|
||||
{
|
||||
delete ConnectionThread;
|
||||
}
|
||||
|
||||
void NetworkClient::ClientInfoChanged()
|
||||
{
|
||||
ClientInfoChangeMutex.lock();
|
||||
@@ -129,8 +135,12 @@ void NetworkClient::StopClient()
|
||||
server_connected = false;
|
||||
client_active = false;
|
||||
|
||||
shutdown(client_sock, SD_RECEIVE);
|
||||
closesocket(client_sock);
|
||||
if (server_connected)
|
||||
{
|
||||
shutdown(client_sock, SD_RECEIVE);
|
||||
closesocket(client_sock);
|
||||
}
|
||||
|
||||
if(ListenThread)
|
||||
ListenThread->join();
|
||||
ConnectionThread->join();
|
||||
@@ -363,7 +373,7 @@ void NetworkClient::ListenThreadFunction()
|
||||
{
|
||||
int tmp_bytes_read = 0;
|
||||
|
||||
tmp_bytes_read = recv_select(client_sock, &data[bytes_read], header.pkt_size - bytes_read, 0);
|
||||
tmp_bytes_read = recv_select(client_sock, &data[(unsigned int)bytes_read], header.pkt_size - bytes_read, 0);
|
||||
|
||||
if(tmp_bytes_read <= 0)
|
||||
{
|
||||
@@ -371,7 +381,7 @@ void NetworkClient::ListenThreadFunction()
|
||||
}
|
||||
bytes_read += tmp_bytes_read;
|
||||
|
||||
} while (bytes_read < header.pkt_size);
|
||||
} while ((unsigned int)bytes_read < header.pkt_size);
|
||||
}
|
||||
|
||||
//Entire request received, select functionality based on request ID
|
||||
@@ -394,9 +404,9 @@ listen_done:
|
||||
server_initialized = false;
|
||||
server_connected = false;
|
||||
|
||||
for(int server_controller_idx = 0; server_controller_idx < server_controllers.size(); server_controller_idx++)
|
||||
for(size_t server_controller_idx = 0; server_controller_idx < server_controllers.size(); server_controller_idx++)
|
||||
{
|
||||
for(int controller_idx = 0; controller_idx < controllers.size(); controller_idx++)
|
||||
for(size_t controller_idx = 0; controller_idx < controllers.size(); controller_idx++)
|
||||
{
|
||||
if(controllers[controller_idx] == server_controllers[server_controller_idx])
|
||||
{
|
||||
@@ -438,7 +448,7 @@ void NetworkClient::ProcessReply_ControllerCount(unsigned int data_size, char *
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkClient::ProcessReply_ControllerData(unsigned int data_size, char * data, unsigned int dev_idx)
|
||||
void NetworkClient::ProcessReply_ControllerData(unsigned int /*data_size*/, char * data, unsigned int dev_idx)
|
||||
{
|
||||
RGBController_Network * new_controller = new RGBController_Network(this, dev_idx);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ class NetworkClient
|
||||
{
|
||||
public:
|
||||
NetworkClient(std::vector<RGBController *>& control);
|
||||
~NetworkClient();
|
||||
|
||||
void ClientInfoChanged();
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ typedef struct NetPacketHeader
|
||||
unsigned int pkt_dev_idx; /* Device index */
|
||||
unsigned int pkt_id; /* Packet ID */
|
||||
unsigned int pkt_size; /* Packet size */
|
||||
};
|
||||
} NetPacketHeader;
|
||||
|
||||
enum
|
||||
{
|
||||
|
||||
+3
-3
@@ -438,7 +438,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
|
||||
{
|
||||
int tmp_bytes_read = 0;
|
||||
|
||||
tmp_bytes_read = recv_select(client_sock, &data[bytes_read], header.pkt_size - bytes_read, 0);
|
||||
tmp_bytes_read = recv_select(client_sock, &data[(unsigned int)bytes_read], header.pkt_size - bytes_read, 0);
|
||||
|
||||
if(tmp_bytes_read <= 0)
|
||||
{
|
||||
@@ -446,7 +446,7 @@ void NetworkServer::ListenThreadFunction(NetworkClientInfo * client_info)
|
||||
}
|
||||
bytes_read += tmp_bytes_read;
|
||||
|
||||
} while (bytes_read < header.pkt_size);
|
||||
} while ((unsigned int)bytes_read < header.pkt_size);
|
||||
}
|
||||
|
||||
//Entire request received, select functionality based on request ID
|
||||
@@ -584,7 +584,7 @@ listen_done:
|
||||
ClientInfoChanged();
|
||||
}
|
||||
|
||||
void NetworkServer::ProcessRequest_ClientString(SOCKET client_sock, unsigned int data_size, char * data)
|
||||
void NetworkServer::ProcessRequest_ClientString(SOCKET client_sock, unsigned int /*data_size*/, char * data)
|
||||
{
|
||||
ServerClientsMutex.lock();
|
||||
for(unsigned int this_idx = 0; this_idx < ServerClients.size(); this_idx++)
|
||||
|
||||
-529
@@ -1,529 +0,0 @@
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* OpenRGB.cpp *
|
||||
* *
|
||||
* Functions for communicating with RGBController API devices on Windows and Linux *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <regex>
|
||||
#include "i2c_smbus_piix4.h"
|
||||
#include "i2c_smbus_i801.h"
|
||||
#include "i2c_smbus_nct6775.h"
|
||||
#include "i2c_smbus_nvapi.h"
|
||||
#include "i2c_smbus_amdadl.h"
|
||||
#include "super_io.h"
|
||||
#include "wmi.h"
|
||||
#else /* WIN32 */
|
||||
|
||||
#include "i2c_smbus_linux.h"
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <dirent.h>
|
||||
#include <string.h>
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
||||
std::vector<i2c_smbus_interface*> busses;
|
||||
std::vector<RGBController*> rgb_controllers;
|
||||
|
||||
#ifdef WIN32
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectNuvotonI2CBusses (Windows) *
|
||||
* *
|
||||
* Detects available Nuvoton Super IO SMBUS adapters and enumerates *
|
||||
* i2c_smbus_interface objects for them *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectNuvotonI2CBusses()
|
||||
{
|
||||
i2c_smbus_interface* bus;
|
||||
int sioaddr = 0x2E;
|
||||
superio_enter(sioaddr);
|
||||
|
||||
int val = (superio_inb(sioaddr, SIO_REG_DEVID) << 8) | superio_inb(sioaddr, SIO_REG_DEVID + 1);
|
||||
|
||||
switch (val & SIO_ID_MASK)
|
||||
{
|
||||
case SIO_NCT5577_ID:
|
||||
case SIO_NCT6102_ID:
|
||||
case SIO_NCT6793_ID:
|
||||
case SIO_NCT6796_ID:
|
||||
case SIO_NCT6798_ID:
|
||||
bus = new i2c_smbus_nct6775();
|
||||
|
||||
// Set logical device register to get SMBus base address
|
||||
superio_outb(sioaddr, SIO_REG_LOGDEV, SIO_LOGDEV_SMBUS);
|
||||
|
||||
// Get SMBus base address from configuration register
|
||||
int smba = (superio_inb(sioaddr, SIO_REG_SMBA) << 8) | superio_inb(sioaddr, SIO_REG_SMBA + 1);
|
||||
((i2c_smbus_nct6775*)bus)->nct6775_smba = smba;
|
||||
|
||||
// Set device name string
|
||||
switch (val & SIO_ID_MASK)
|
||||
{
|
||||
case SIO_NCT5577_ID:
|
||||
sprintf(bus->device_name, "Nuvoton NCT5577D SMBus at %X", smba);
|
||||
break;
|
||||
case SIO_NCT6102_ID:
|
||||
sprintf(bus->device_name, "Nuvoton NCT6102D/NCT6106D SMBus at %X", smba);
|
||||
break;
|
||||
case SIO_NCT6793_ID:
|
||||
sprintf(bus->device_name, "Nuvoton NCT6793D SMBus at %X", smba);
|
||||
break;
|
||||
case SIO_NCT6796_ID:
|
||||
sprintf(bus->device_name, "Nuvoton NCT6796D SMBus at %X", smba);
|
||||
break;
|
||||
case SIO_NCT6798_ID:
|
||||
sprintf(bus->device_name, "Nuvoton NCT6798D SMBus at %X", smba);
|
||||
break;
|
||||
}
|
||||
|
||||
busses.push_back(bus);
|
||||
}
|
||||
|
||||
} /* DetectNuvotonI2CBusses() */
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectNvAPII2CBusses (Windows) *
|
||||
* *
|
||||
* Detects available NVidia NvAPI I2C adapters and enumerates *
|
||||
* i2c_smbus_interface objects for them. Only enumerates the first bus for each GPU *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectNvAPII2CBusses()
|
||||
{
|
||||
static NV_PHYSICAL_GPU_HANDLE gpu_handles[64];
|
||||
static NV_S32 gpu_count = 0;
|
||||
NV_U32 device_id;
|
||||
NV_U32 ext_device_id;
|
||||
NV_STATUS res;
|
||||
NV_U32 revision_id;
|
||||
NV_U32 sub_system_id;
|
||||
|
||||
NV_STATUS initialize = NvAPI_Initialize();
|
||||
|
||||
NvAPI_EnumPhysicalGPUs(gpu_handles, &gpu_count);
|
||||
|
||||
for(NV_S32 gpu_idx = 0; gpu_idx < gpu_count; gpu_idx++)
|
||||
{
|
||||
i2c_smbus_nvapi * nvapi_bus = new i2c_smbus_nvapi(gpu_handles[gpu_idx]);
|
||||
|
||||
sprintf(nvapi_bus->device_name, "NVidia NvAPI I2C on GPU %d", gpu_idx);
|
||||
|
||||
res = NvAPI_GPU_GetPCIIdentifiers(gpu_handles[gpu_idx], &device_id, &sub_system_id, &revision_id, &ext_device_id);
|
||||
|
||||
if (res == 0)
|
||||
{
|
||||
nvapi_bus->pci_device = device_id >> 16;
|
||||
nvapi_bus->pci_vendor = device_id & 0xffff;
|
||||
nvapi_bus->pci_subsystem_device = sub_system_id >> 16;
|
||||
nvapi_bus->pci_subsystem_vendor = sub_system_id & 0xffff;
|
||||
nvapi_bus->port_id = 1;
|
||||
}
|
||||
|
||||
busses.push_back(nvapi_bus);
|
||||
}
|
||||
} /* DetectNvAPII2CBusses() */
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectAMDADLI2CBusses (Windows) *
|
||||
* *
|
||||
* Detects available AMD ADL I2C adapters and enumerates *
|
||||
* i2c_smbus_interface objects for them. Only enumerates Bus Nr 1 *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectADLI2C()
|
||||
{
|
||||
int adl_status;
|
||||
int gpu_count = 0;
|
||||
ADL_CONTEXT_HANDLE gpu_handle;
|
||||
|
||||
i2c_smbus_amdadl * adl_bus = new i2c_smbus_amdadl(gpu_handle);
|
||||
|
||||
adl_status = adl_bus->ADL_Initialize();
|
||||
|
||||
if(0 != adl_status)
|
||||
{
|
||||
printf_s("ADL Status %d \n", adl_status);
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf(adl_bus->device_name, "AMD ADL I2C on GPU %d", gpu_count);
|
||||
busses.push_back(adl_bus);
|
||||
}
|
||||
} /* DetectAMDADLI2CBusses() */
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectI2CBusses (Windows) *
|
||||
* *
|
||||
* Detects available AMD and Intel SMBUS adapters and enumerates i2c_smbus_interface *
|
||||
* objects for them *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectI2CBusses()
|
||||
{
|
||||
i2c_smbus_interface * bus;
|
||||
HRESULT hres;
|
||||
Wmi wmi;
|
||||
wmi.init();
|
||||
|
||||
// Query WMI for Win32_PnPSignedDriver entries with names matching "SMBUS" or "SM BUS"
|
||||
// These devices may be browsed under Device Manager -> System Devices
|
||||
std::vector<QueryObj> q_res_PnPSignedDriver;
|
||||
hres = wmi.query("SELECT * FROM Win32_PnPSignedDriver WHERE Description LIKE '\%SMBUS\%' OR Description LIKE '\%SM BUS\%'", q_res_PnPSignedDriver);
|
||||
|
||||
if (hres)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// For each detected SMBus adapter, try enumerating it as either AMD or Intel
|
||||
for (QueryObj &i : q_res_PnPSignedDriver)
|
||||
{
|
||||
// AMD SMBus controllers do not show any I/O resources allocated in Device Manager
|
||||
// Analysis of many AMD boards has shown that AMD SMBus controllers have two adapters with fixed I/O spaces at 0x0B00 and 0x0B20
|
||||
// AMD SMBus adapters use the PIIX4 driver
|
||||
if (i["Manufacturer"].find("Advanced Micro Devices, Inc") != std::string::npos)
|
||||
{
|
||||
bus = new i2c_smbus_piix4();
|
||||
strcpy(bus->device_name, i["Description"].c_str());
|
||||
strcat(bus->device_name, " at 0x0B00");
|
||||
((i2c_smbus_piix4 *)bus)->piix4_smba = 0x0B00;
|
||||
busses.push_back(bus);
|
||||
|
||||
bus = new i2c_smbus_piix4();
|
||||
((i2c_smbus_piix4 *)bus)->piix4_smba = 0x0B20;
|
||||
strcpy(bus->device_name, i["Description"].c_str());
|
||||
strcat(bus->device_name, " at 0x0B20");
|
||||
busses.push_back(bus);
|
||||
}
|
||||
|
||||
// Intel SMBus controllers do show I/O resources in Device Manager
|
||||
// Analysis of many Intel boards has shown that Intel SMBus adapter I/O space varies between boards
|
||||
// We can query Win32_PnPAllocatedResource entries and look up the PCI device ID to find the allocated I/O space
|
||||
// Intel SMBus adapters use the i801 driver
|
||||
else if ((i["Manufacturer"].find("Intel") != std::string::npos)
|
||||
|| (i["Manufacturer"].find("INTEL") != std::string::npos))
|
||||
{
|
||||
std::string rgx1 = ".+" + q_res_PnPSignedDriver[0]["DeviceID"].substr(4, 33) + ".+";
|
||||
|
||||
AdditionalFilters filters;
|
||||
filters.emplace("Dependent", rgx1);
|
||||
filters.emplace("Antecedent", ".*Port.*");
|
||||
|
||||
std::vector<QueryObj> q_res_PNPAllocatedResource;
|
||||
hres = wmi.query("SELECT * FROM Win32_PnPAllocatedResource", q_res_PNPAllocatedResource, &filters);
|
||||
|
||||
std::regex rgx2(".*StartingAddress=\"(\\d+)\".*");
|
||||
std::smatch matches;
|
||||
|
||||
// Query the StartingAddress for the matching device ID and use it to enumerate the bus
|
||||
if (std::regex_search(q_res_PNPAllocatedResource[0]["Antecedent"], matches, rgx2))
|
||||
{
|
||||
unsigned int IORangeStart = std::stoi(matches[1].str());
|
||||
|
||||
bus = new i2c_smbus_i801();
|
||||
strcpy(bus->device_name, i["Description"].c_str());
|
||||
((i2c_smbus_i801 *)bus)->i801_smba = IORangeStart;
|
||||
busses.push_back(bus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Detect Nuvoton Super IO SMBus adapters
|
||||
DetectNuvotonI2CBusses();
|
||||
|
||||
// Detect NVidia NvAPI I2C adapters
|
||||
DetectNvAPII2CBusses();
|
||||
|
||||
// Detect AMD ADL I2C adadpters
|
||||
DetectADLI2C();
|
||||
|
||||
} /* DetectI2CBusses() */
|
||||
|
||||
#else /* WIN32 */
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectI2CBusses (Linux) *
|
||||
* *
|
||||
* Detects available SMBUS adapters and enumerates i2c_smbus_interface objects for *
|
||||
* them *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectI2CBusses()
|
||||
{
|
||||
i2c_smbus_linux * bus;
|
||||
char device_string[1024];
|
||||
DIR * dir;
|
||||
char driver_path[512];
|
||||
struct dirent * ent;
|
||||
int test_fd;
|
||||
char path[1024];
|
||||
char buff[100];
|
||||
unsigned short pci_device, pci_vendor, pci_subsystem_device, pci_subsystem_vendor;
|
||||
unsigned short port_id;
|
||||
bool info;
|
||||
|
||||
// Start looking for I2C adapters in /sys/bus/i2c/devices/
|
||||
strcpy(driver_path, "/sys/bus/i2c/devices/");
|
||||
dir = opendir(driver_path);
|
||||
|
||||
if(dir == NULL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Loop through all entries in i2c-adapter list
|
||||
ent = readdir(dir);
|
||||
while(ent != NULL)
|
||||
{
|
||||
if(ent->d_type == DT_DIR || ent->d_type == DT_LNK)
|
||||
{
|
||||
if(strncmp(ent->d_name, "i2c-", 4) == 0)
|
||||
{
|
||||
strcpy(device_string, driver_path);
|
||||
strcat(device_string, ent->d_name);
|
||||
strcat(device_string, "/name");
|
||||
test_fd = open(device_string, O_RDONLY);
|
||||
|
||||
if(test_fd)
|
||||
{
|
||||
memset(device_string, 0x00, sizeof(device_string));
|
||||
read(test_fd, device_string, sizeof(device_string));
|
||||
device_string[strlen(device_string) - 1] = 0x00;
|
||||
|
||||
close(test_fd);
|
||||
|
||||
// For now, only get PCI information from nVidia GPUs
|
||||
// PCI IDs are not currently obtained from the Nouveau driver
|
||||
// and GPUs using PCI IDs for detection will not work with it.
|
||||
if (sscanf(device_string, "NVIDIA i2c adapter %hu at", &port_id) == 1)
|
||||
{
|
||||
info = true;
|
||||
|
||||
// Get PCI Device
|
||||
snprintf(path, sizeof(path), "%s%s%s", driver_path, ent->d_name, "/device/device");
|
||||
test_fd = open(path, O_RDONLY);
|
||||
if (test_fd < 0)
|
||||
{
|
||||
ent = readdir(dir);
|
||||
continue;
|
||||
}
|
||||
memset(buff, 0x00, sizeof(buff));
|
||||
read(test_fd, buff, sizeof(buff));
|
||||
buff[strlen(buff) - 1] = 0x00;
|
||||
pci_device = strtoul(buff, NULL, 16);
|
||||
close(test_fd);
|
||||
|
||||
// Get PCI Vendor
|
||||
snprintf(path, sizeof(path), "%s%s%s", driver_path, ent->d_name, "/device/vendor");
|
||||
test_fd = open(path, O_RDONLY);
|
||||
if (test_fd < 0)
|
||||
{
|
||||
ent = readdir(dir);
|
||||
continue;
|
||||
}
|
||||
memset(buff, 0x00, sizeof(buff));
|
||||
read(test_fd, buff, sizeof(buff));
|
||||
buff[strlen(buff) - 1] = 0x00;
|
||||
pci_vendor = strtoul(buff, NULL, 16);
|
||||
close(test_fd);
|
||||
|
||||
// Get PCI Subsystem Device
|
||||
snprintf(path, sizeof(path), "%s%s%s", driver_path, ent->d_name, "/device/subsystem_device");
|
||||
test_fd = open(path, O_RDONLY);
|
||||
if (test_fd < 0)
|
||||
{
|
||||
ent = readdir(dir);
|
||||
continue;
|
||||
}
|
||||
memset(buff, 0x00, sizeof(buff));
|
||||
read(test_fd, buff, sizeof(buff));
|
||||
buff[strlen(buff) - 1] = 0x00;
|
||||
pci_subsystem_device = strtoul(buff, NULL, 16);
|
||||
close(test_fd);
|
||||
|
||||
// Get PCI Subsystem Vendor
|
||||
snprintf(path, sizeof(path), "%s%s%s", driver_path, ent->d_name, "/device/subsystem_vendor");
|
||||
test_fd = open(path, O_RDONLY);
|
||||
if (test_fd < 0)
|
||||
{
|
||||
ent = readdir(dir);
|
||||
continue;
|
||||
}
|
||||
memset(buff, 0x00, sizeof(buff));
|
||||
read(test_fd, buff, sizeof(buff));
|
||||
buff[strlen(buff) - 1] = 0x00;
|
||||
pci_subsystem_vendor = strtoul(buff, NULL, 16);
|
||||
close(test_fd);
|
||||
}
|
||||
else
|
||||
{
|
||||
info = false;
|
||||
}
|
||||
|
||||
strcpy(device_string, "/dev/");
|
||||
strcat(device_string, ent->d_name);
|
||||
test_fd = open(device_string, O_RDWR);
|
||||
|
||||
if (test_fd < 0)
|
||||
{
|
||||
ent = readdir(dir);
|
||||
continue;
|
||||
}
|
||||
|
||||
bus = new i2c_smbus_linux();
|
||||
strcpy(bus->device_name, device_string);
|
||||
bus->handle = test_fd;
|
||||
if (info) {
|
||||
bus->pci_device = pci_device;
|
||||
bus->pci_vendor = pci_vendor;
|
||||
bus->pci_subsystem_device = pci_subsystem_device;
|
||||
bus->pci_subsystem_vendor = pci_subsystem_vendor;
|
||||
bus->port_id = port_id;
|
||||
}
|
||||
busses.push_back(bus);
|
||||
}
|
||||
}
|
||||
}
|
||||
ent = readdir(dir);
|
||||
}
|
||||
|
||||
} /* DetectI2CBusses() */
|
||||
|
||||
#endif /* WIN32 */
|
||||
|
||||
void DetectAuraSMBusControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectAuraGPUControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectCorsairVengeanceControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectCorsairVengeanceProControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectCrucialControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectHyperXDRAMControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectPatriotViperControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectPolychromeControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectRGBFusionControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectRGBFusionGPUControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectRGBFusion2SMBusControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectRGBFusion2DRAMControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectMSIGPUControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectSapphireGPUControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectGalaxGPUControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectMSIMysticLightControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectMSIRGBControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectAuraUSBControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectAuraCoreControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectLEDStripControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectNZXTHue2Controllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectHuePlusControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectOpenRazerControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectE131Controllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectAMDWraithPrismControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectCoolerMasterControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectMSI3ZoneControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectPoseidonZRGBControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectCorsairPeripheralControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectCorsairLightingNodeControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectFaustusControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectHyperXKeyboardControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectHyperXMouseControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectThermaltakeRiingControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectRGBFusion2USBControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectRedragonControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectLogitechControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectNZXTKrakenControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectSteelSeriesControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectGloriousModelOControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectDuckyKeyboardControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectEKControllers(std::vector<RGBController*>& rgb_controllers);
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectRGBConrollers *
|
||||
* *
|
||||
* Detect and populate RGB Controllers vector *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectRGBControllers(void)
|
||||
{
|
||||
DetectI2CBusses();
|
||||
|
||||
DetectAuraSMBusControllers(busses, rgb_controllers);
|
||||
DetectAuraGPUControllers(busses, rgb_controllers);
|
||||
DetectCorsairVengeanceControllers(busses, rgb_controllers);
|
||||
DetectCorsairVengeanceProControllers(busses, rgb_controllers);
|
||||
DetectCrucialControllers(busses, rgb_controllers);
|
||||
DetectGalaxGPUControllers(busses, rgb_controllers);
|
||||
DetectHyperXDRAMControllers(busses, rgb_controllers);
|
||||
DetectPatriotViperControllers(busses, rgb_controllers);
|
||||
DetectPolychromeControllers(busses, rgb_controllers);
|
||||
DetectRGBFusionGPUControllers(busses, rgb_controllers);
|
||||
DetectMSIGPUControllers(busses, rgb_controllers);
|
||||
DetectSapphireGPUControllers(busses, rgb_controllers);
|
||||
|
||||
//TODO: Implement better detection before enabling these controllers
|
||||
//DetectRGBFusion2SMBusControllers(busses, rgb_controllers);
|
||||
//DetectRGBFusion2DRAMControllers(busses, rgb_controllers);
|
||||
|
||||
DetectRGBFusionControllers(busses, rgb_controllers);
|
||||
//DetectMSIMysticLightControllers(rgb_controllers);
|
||||
DetectMSIRGBControllers(rgb_controllers);
|
||||
|
||||
DetectAuraUSBControllers(rgb_controllers);
|
||||
DetectAuraCoreControllers(rgb_controllers);
|
||||
DetectLEDStripControllers(rgb_controllers);
|
||||
DetectNZXTHue2Controllers(rgb_controllers);
|
||||
DetectHuePlusControllers(rgb_controllers);
|
||||
|
||||
DetectAMDWraithPrismControllers(rgb_controllers);
|
||||
DetectCoolerMasterControllers(rgb_controllers);
|
||||
DetectMSI3ZoneControllers(rgb_controllers);
|
||||
DetectPoseidonZRGBControllers(rgb_controllers);
|
||||
DetectHyperXKeyboardControllers(rgb_controllers);
|
||||
//DetectHyperXMouseControllers(rgb_controllers);
|
||||
DetectCorsairPeripheralControllers(rgb_controllers);
|
||||
DetectCorsairLightingNodeControllers(rgb_controllers);
|
||||
DetectThermaltakeRiingControllers(rgb_controllers);
|
||||
DetectRGBFusion2USBControllers(rgb_controllers);
|
||||
DetectRedragonControllers(rgb_controllers);
|
||||
DetectLogitechControllers(rgb_controllers);
|
||||
DetectNZXTKrakenControllers(rgb_controllers);
|
||||
DetectSteelSeriesControllers(rgb_controllers);
|
||||
DetectGloriousModelOControllers(rgb_controllers);
|
||||
DetectDuckyKeyboardControllers(rgb_controllers);
|
||||
DetectEKControllers(rgb_controllers);
|
||||
|
||||
DetectE131Controllers(rgb_controllers);
|
||||
|
||||
DetectOpenRazerControllers(rgb_controllers);
|
||||
|
||||
/*-------------------------------------*\
|
||||
| Windows-only devices |
|
||||
\*-------------------------------------*/
|
||||
#ifdef WIN32
|
||||
/*-------------------------------------*\
|
||||
| Linux-only devices |
|
||||
\*-------------------------------------*/
|
||||
#else
|
||||
DetectFaustusControllers(rgb_controllers);
|
||||
#endif
|
||||
|
||||
} /* DetectRGBControllers() */
|
||||
+51
-4
@@ -16,7 +16,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
||||
#-----------------------------------------------------------------------#
|
||||
# Application Configuration #
|
||||
#-----------------------------------------------------------------------#
|
||||
VERSION = 0.31
|
||||
VERSION = 0.4
|
||||
TARGET = OpenRGB
|
||||
TEMPLATE = app
|
||||
|
||||
@@ -47,12 +47,14 @@ INCLUDEPATH += \
|
||||
net_port/ \
|
||||
serial_port/ \
|
||||
super_io/ \
|
||||
Controllers/AorusCPUCoolerController/ \
|
||||
Controllers/AMDWraithPrismController/ \
|
||||
Controllers/AuraUSBController/ \
|
||||
Controllers/AuraCoreController/ \
|
||||
Controllers/AuraGPUController/ \
|
||||
Controllers/AuraSMBusController/ \
|
||||
Controllers/CoolerMasterController/ \
|
||||
Controllers/CorsairHydroController/ \
|
||||
Controllers/CorsairPeripheralController/ \
|
||||
Controllers/CorsairLightingNodeController/ \
|
||||
Controllers/CorsairVengeanceController/ \
|
||||
@@ -61,6 +63,7 @@ INCLUDEPATH += \
|
||||
Controllers/DuckyKeyboardController/ \
|
||||
Controllers/GalaxGPUController/ \
|
||||
Controllers/GloriousModelOController/ \
|
||||
Controllers/HoltekController/ \
|
||||
Controllers/HuePlusController/ \
|
||||
Controllers/HyperXDRAMController/ \
|
||||
Controllers/HyperXKeyboardController/ \
|
||||
@@ -84,6 +87,7 @@ INCLUDEPATH += \
|
||||
Controllers/RGBFusionGPUController/ \
|
||||
Controllers/SapphireGPUController/ \
|
||||
Controllers/SteelSeriesController/ \
|
||||
Controllers/TecknetController/ \
|
||||
Controllers/ThermaltakeRiingController/ \
|
||||
RGBController/ \
|
||||
qt/
|
||||
@@ -94,6 +98,9 @@ HEADERS += \
|
||||
NetworkProtocol.h \
|
||||
NetworkServer.h \
|
||||
ProfileManager.h \
|
||||
ResourceManager.h \
|
||||
Detector.h \
|
||||
DeviceDetector.h \
|
||||
qt/OpenRGBClientInfoPage.h \
|
||||
qt/OpenRGBDeviceInfoPage.h \
|
||||
qt/OpenRGBDevicePage.h \
|
||||
@@ -101,6 +108,7 @@ HEADERS += \
|
||||
i2c_smbus/i2c_smbus.h \
|
||||
i2c_tools/i2c_tools.h \
|
||||
net_port/net_port.h \
|
||||
qt/DeviceView.h \
|
||||
qt/OpenRGBDialog2.h \
|
||||
qt/OpenRGBProfileSaveDialog.h \
|
||||
qt/OpenRGBServerInfoPage.h \
|
||||
@@ -111,6 +119,7 @@ HEADERS += \
|
||||
serial_port/serial_port.h \
|
||||
super_io/super_io.h \
|
||||
Controllers/AMDWraithPrismController/AMDWraithPrismController.h \
|
||||
Controllers/AorusCPUCoolerController/ATC800Controller.h \
|
||||
Controllers/AuraUSBController/AuraUSBController.h \
|
||||
Controllers/AuraUSBController/AuraAddressableController.h \
|
||||
Controllers/AuraUSBController/AuraMainboardController.h \
|
||||
@@ -118,6 +127,7 @@ HEADERS += \
|
||||
Controllers/AuraGPUController/AuraGPUController.h \
|
||||
Controllers/AuraSMBusController/AuraSMBusController.h \
|
||||
Controllers/CoolerMasterController/CMMP750Controller.h \
|
||||
Controllers/CorsairHydroController/CorsairHydroController.h \
|
||||
Controllers/CorsairLightingNodeController/CorsairLightingNodeController.h \
|
||||
Controllers/CorsairPeripheralController/CorsairPeripheralController.h \
|
||||
Controllers/CorsairVengeanceController/CorsairVengeanceController.h \
|
||||
@@ -125,17 +135,22 @@ HEADERS += \
|
||||
Controllers/CrucialController/CrucialController.h \
|
||||
Controllers/DuckyKeyboardController/DuckyKeyboardController.h \
|
||||
Controllers/EKController/EKController.h \
|
||||
Controllers/GalaxGPUController/GalaxGPUController.h \
|
||||
Controllers/GalaxGPUController/GalaxGPUController.h \
|
||||
Controllers/GloriousModelOController/GloriousModelOController.h \
|
||||
Controllers/HoltekController/HoltekA070Controller.h \
|
||||
Controllers/HuePlusController/HuePlusController.h \
|
||||
Controllers/HyperXDRAMController/HyperXDRAMController.h \
|
||||
Controllers/HyperXKeyboardController/HyperXAlloyOriginsController.h \
|
||||
Controllers/HyperXKeyboardController/HyperXKeyboardController.h \
|
||||
Controllers/HyperXMouseController/HyperXPulsefireSurgeController..h \
|
||||
Controllers/HyperXMouseController/HyperXPulsefireSurgeController.h \
|
||||
Controllers/LEDStripController/LEDStripController.h \
|
||||
Controllers/LogitechController/LogitechG203Controller.h \
|
||||
Controllers/LogitechController/LogitechG203LController.h \
|
||||
Controllers/LogitechController/LogitechG403Controller.h \
|
||||
Controllers/LogitechController/LogitechG502PSController.h \
|
||||
Controllers/LogitechController/LogitechG810Controller.h \
|
||||
Controllers/LogitechController/LogitechGPowerPlayController.h \
|
||||
Controllers/LogitechController/LogitechGProWirelessController.h \
|
||||
Controllers/MSI3ZoneController/MSI3ZoneController.h \
|
||||
Controllers/MSIGPUController/MSIGPUController.h \
|
||||
Controllers/MSIMysticLightController/MSIMysticLightController.h \
|
||||
@@ -156,14 +171,17 @@ HEADERS += \
|
||||
Controllers/SteelSeriesController/SteelSeriesRivalController.h \
|
||||
Controllers/SteelSeriesController/SteelSeriesSiberiaController.h \
|
||||
Controllers/SteelSeriesController/SteelSeriesApexController.h \
|
||||
Controllers/TecknetController/TecknetController.h \
|
||||
Controllers/ThermaltakeRiingController/ThermaltakeRiingController.h \
|
||||
RGBController/RGBController.h \
|
||||
RGBController/RGBController_AMDWraithPrism.h \
|
||||
RGBController/RGBController_AorusATC800.h \
|
||||
RGBController/RGBController_AuraUSB.h \
|
||||
RGBController/RGBController_AuraCore.h \
|
||||
RGBController/RGBController_AuraGPU.h \
|
||||
RGBController/RGBController_AuraSMBus.h \
|
||||
RGBController/RGBController_CMMP750Controller.h \
|
||||
RGBController/RGBController_CorsairHydro.h \
|
||||
RGBController/RGBController_CorsairLightingNode.h \
|
||||
RGBController/RGBController_CorsairPeripheral.h \
|
||||
RGBController/RGBController_CorsairVengeance.h \
|
||||
@@ -175,6 +193,7 @@ HEADERS += \
|
||||
RGBController/RGBController_E131.h \
|
||||
RGBController/RGBController_GalaxGPU.h \
|
||||
RGBController/RGBController_GloriousModelO.h \
|
||||
RGBController/RGBController_HoltekA070.h \
|
||||
RGBController/RGBController_HuePlus.h \
|
||||
RGBController/RGBController_HyperXAlloyOrigins.h \
|
||||
RGBController/RGBController_HyperXDRAM.h \
|
||||
@@ -182,8 +201,12 @@ HEADERS += \
|
||||
RGBController/RGBController_HyperXPulsefireSurge.h \
|
||||
RGBController/RGBController_LEDStrip.h \
|
||||
RGBController/RGBController_LogitechG203.h \
|
||||
RGBController/RGBController_LogitechG203L.h \
|
||||
RGBController/RGBController_LogitechG403.h \
|
||||
RGBController/RGBController_LogitechG502PS.h \
|
||||
RGBController/RGBController_LogitechG810.h \
|
||||
RGBController/RGBController_LogitechGPowerPlay.h \
|
||||
RGBController/RGBController_LogitechGProWireless.h \
|
||||
RGBController/RGBController_MSI3Zone.h \
|
||||
RGBController/RGBController_MSIGPU.h \
|
||||
RGBController/RGBController_MSIGPU.h \
|
||||
@@ -206,7 +229,9 @@ HEADERS += \
|
||||
RGBController/RGBController_SteelSeriesRival.h \
|
||||
RGBController/RGBController_SteelSeriesSiberia.h \
|
||||
RGBController/RGBController_SteelSeriesApex.h \
|
||||
RGBController/RGBController_Tecknet.h \
|
||||
RGBController/RGBController_ThermaltakeRiing.h \
|
||||
RGBController/OpenRazerDevices.h \
|
||||
|
||||
SOURCES += \
|
||||
dependencies/dmiinfo.cpp \
|
||||
@@ -214,10 +239,10 @@ SOURCES += \
|
||||
dependencies/libe131/src/e131.c \
|
||||
main.cpp \
|
||||
cli.cpp \
|
||||
OpenRGB.cpp \
|
||||
NetworkClient.cpp \
|
||||
NetworkServer.cpp \
|
||||
ProfileManager.cpp \
|
||||
ResourceManager.cpp \
|
||||
qt/OpenRGBClientInfoPage.cpp \
|
||||
qt/OpenRGBDeviceInfoPage.cpp \
|
||||
qt/OpenRGBDevicePage.cpp \
|
||||
@@ -225,6 +250,7 @@ SOURCES += \
|
||||
i2c_smbus/i2c_smbus.cpp \
|
||||
i2c_tools/i2c_tools.cpp \
|
||||
net_port/net_port.cpp \
|
||||
qt/DeviceView.cpp \
|
||||
qt/OpenRGBDialog2.cpp \
|
||||
qt/OpenRGBProfileSaveDialog.cpp \
|
||||
qt/OpenRGBServerInfoPage.cpp \
|
||||
@@ -236,6 +262,8 @@ SOURCES += \
|
||||
super_io/super_io.cpp \
|
||||
Controllers/AMDWraithPrismController/AMDWraithPrismController.cpp \
|
||||
Controllers/AMDWraithPrismController/AMDWraithPrismControllerDetect.cpp \
|
||||
Controllers/AorusCPUCoolerController/ATC800Controller.cpp \
|
||||
Controllers/AorusCPUCoolerController/AorusCPUCoolerControllerDetect.cpp \
|
||||
Controllers/AuraUSBController/AuraUSBController.cpp \
|
||||
Controllers/AuraUSBController/AuraAddressableController.cpp \
|
||||
Controllers/AuraUSBController/AuraMainboardController.cpp \
|
||||
@@ -248,6 +276,8 @@ SOURCES += \
|
||||
Controllers/AuraSMBusController/AuraSMBusControllerDetect.cpp \
|
||||
Controllers/CoolerMasterController/CMMP750Controller.cpp \
|
||||
Controllers/CoolerMasterController/CoolerMasterControllerDetect.cpp \
|
||||
Controllers/CorsairHydroController/CorsairHydroController.cpp \
|
||||
Controllers/CorsairHydroController/CorsairHydroControllerDetect.cpp \
|
||||
Controllers/CorsairLightingNodeController/CorsairLightingNodeController.cpp \
|
||||
Controllers/CorsairLightingNodeController/CorsairLightingNodeControllerDetect.cpp \
|
||||
Controllers/CorsairPeripheralController/CorsairPeripheralController.cpp \
|
||||
@@ -266,6 +296,8 @@ SOURCES += \
|
||||
Controllers/GalaxGPUController/GalaxGPUControllerDetect.cpp \
|
||||
Controllers/GloriousModelOController/GloriousModelOController.cpp \
|
||||
Controllers/GloriousModelOController/GloriousModelOControllerDetect.cpp \
|
||||
Controllers/HoltekController/HoltekA070Controller.cpp \
|
||||
Controllers/HoltekController/HoltekControllerDetect.cpp \
|
||||
Controllers/HuePlusController/HuePlusController.cpp \
|
||||
Controllers/HuePlusController/HuePlusControllerDetect.cpp \
|
||||
Controllers/HyperXDRAMController/HyperXDRAMController.cpp \
|
||||
@@ -279,8 +311,12 @@ SOURCES += \
|
||||
Controllers/LEDStripController/LEDStripControllerDetect.cpp \
|
||||
Controllers/LogitechController/LogitechControllerDetect.cpp \
|
||||
Controllers/LogitechController/LogitechG203Controller.cpp \
|
||||
Controllers/LogitechController/LogitechG203LController.cpp \
|
||||
Controllers/LogitechController/LogitechG403Controller.cpp \
|
||||
Controllers/LogitechController/LogitechG502PSController.cpp \
|
||||
Controllers/LogitechController/LogitechG810Controller.cpp \
|
||||
Controllers/LogitechController/LogitechGPowerPlayController.cpp \
|
||||
Controllers/LogitechController/LogitechGProWirelessController.cpp \
|
||||
Controllers/MSI3ZoneController/MSI3ZoneController.cpp \
|
||||
Controllers/MSI3ZoneController/MSI3ZoneControllerDetect.cpp \
|
||||
Controllers/MSIGPUController/MSIGPUController.cpp \
|
||||
@@ -318,16 +354,21 @@ SOURCES += \
|
||||
Controllers/SteelSeriesController/SteelSeriesSiberiaController.cpp \
|
||||
Controllers/SteelSeriesController/SteelSeriesApexController.cpp \
|
||||
Controllers/SteelSeriesController/SteelSeriesControllerDetect.cpp \
|
||||
Controllers/TecknetController/TecknetController.cpp \
|
||||
Controllers/TecknetController/TecknetControllerDetect.cpp \
|
||||
Controllers/ThermaltakeRiingController/ThermaltakeRiingController.cpp \
|
||||
Controllers/ThermaltakeRiingController/ThermaltakeRiingControllerDetect.cpp \
|
||||
RGBController/RGBController.cpp \
|
||||
RGBController/DebugControllerDetect.cpp \
|
||||
RGBController/E131ControllerDetect.cpp \
|
||||
RGBController/RGBController_AMDWraithPrism.cpp \
|
||||
RGBController/RGBController_AorusATC800.cpp \
|
||||
RGBController/RGBController_AuraUSB.cpp \
|
||||
RGBController/RGBController_AuraCore.cpp \
|
||||
RGBController/RGBController_AuraGPU.cpp \
|
||||
RGBController/RGBController_AuraSMBus.cpp \
|
||||
RGBController/RGBController_CMMP750Controller.cpp \
|
||||
RGBController/RGBController_CorsairHydro.cpp \
|
||||
RGBController/RGBController_CorsairLightingNode.cpp \
|
||||
RGBController/RGBController_CorsairPeripheral.cpp \
|
||||
RGBController/RGBController_CorsairVengeance.cpp \
|
||||
@@ -338,6 +379,7 @@ SOURCES += \
|
||||
RGBController/RGBController_EKController.cpp \
|
||||
RGBController/RGBController_GalaxGPU.cpp \
|
||||
RGBController/RGBController_GloriousModelO.cpp \
|
||||
RGBController/RGBController_HoltekA070.cpp \
|
||||
RGBController/RGBController_HuePlus.cpp \
|
||||
RGBController/RGBController_HyperXAlloyOrigins.cpp \
|
||||
RGBController/RGBController_HyperXDRAM.cpp \
|
||||
@@ -346,8 +388,12 @@ SOURCES += \
|
||||
RGBController/RGBController_E131.cpp \
|
||||
RGBController/RGBController_LEDStrip.cpp \
|
||||
RGBController/RGBController_LogitechG203.cpp \
|
||||
RGBController/RGBController_LogitechG203L.cpp \
|
||||
RGBController/RGBController_LogitechG403.cpp \
|
||||
RGBController/RGBController_LogitechG502PS.cpp \
|
||||
RGBController/RGBController_LogitechG810.cpp \
|
||||
RGBController/RGBController_LogitechGPowerPlay.cpp \
|
||||
RGBController/RGBController_LogitechGProWireless.cpp \
|
||||
RGBController/RGBController_MSI3Zone.cpp \
|
||||
RGBController/RGBController_MSIGPU.cpp \
|
||||
RGBController/RGBController_MSIMysticLight.cpp \
|
||||
@@ -369,6 +415,7 @@ SOURCES += \
|
||||
RGBController/RGBController_SteelSeriesRival.cpp \
|
||||
RGBController/RGBController_SteelSeriesSiberia.cpp \
|
||||
RGBController/RGBController_SteelSeriesApex.cpp \
|
||||
RGBController/RGBController_Tecknet.cpp \
|
||||
RGBController/RGBController_ThermaltakeRiing.cpp \
|
||||
|
||||
RESOURCES += \
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ bool ProfileManager::LoadProfileWithOptions
|
||||
/*---------------------------------------------------------*\
|
||||
| Read and verify file header |
|
||||
\*---------------------------------------------------------*/
|
||||
char header_string[16];
|
||||
char header_string[16]{};
|
||||
unsigned int header_version;
|
||||
|
||||
controller_file.read(header_string, 16);
|
||||
|
||||
@@ -12,6 +12,7 @@ One of the biggest complaints about RGB is the software ecosystem surrounding it
|
||||
* Can operate standalone or in a client/headless server configuration
|
||||
* View device information
|
||||
* No official/manufacturer software required
|
||||
* Graphical view of device LEDs makes creating custom patterns easy
|
||||
|
||||
## Supported Devices
|
||||
|
||||
@@ -27,11 +28,12 @@ There have been two instances of hardware damage in OpenRGB's development and we
|
||||
* There were reports of bricked Gigabyte Aorus Z390 motherboards caused by dumping SMBus address 0x68 in an attempt to reverse engineer the RGB. Due to this, the SMBus Tools page on OpenRGB is hidden by default now as it has no real use to non-developers. Additionally, the RGB Fusion 2 SMBus code is disabled by default because, although it works on boards it is meant for, probing this address (0x68) could damage Gigabyte Z390 boards.
|
||||
* To enable the MSI Mystic Light or Gigabyte RGB Fusion 2 SMBus code, you must uncomment the functions in main.cpp and recompile.
|
||||
|
||||

|
||||

|
||||
|
||||
## Windows
|
||||
|
||||
* Pre-built binaries are available under the Releases section on GitLab.
|
||||
- You will need the **Microsoft Visual 2019 C++ runtime** installed. You can get it [here](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)
|
||||
* If you wish to build the application yourself:
|
||||
1. Download the latest Visual Studio Community Edition and Qt Creator.
|
||||
2. Open the OpenRGB.pro project in Qt Creator.
|
||||
@@ -45,7 +47,7 @@ There have been two instances of hardware damage in OpenRGB's development and we
|
||||
|
||||
## Linux
|
||||
|
||||
* Pre-built binaries are not currently available for Linux
|
||||
* Pre-built binaries in AppImage format are available under the Releases section on GitLab.
|
||||
* You can build the project using Qt Creator or on the command line.
|
||||
1. Install build dependencies
|
||||
- Debian: sudo apt install build-essential qtcreator qt5-default libusb-1.0-0-dev libhidapi-dev pkgconf
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user