Compare commits
32
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3b7fd1ac02 | ||
|
|
db3351691a | ||
|
|
4051c33557 | ||
|
|
9d04aaad02 | ||
|
|
56b5839cc8 | ||
|
|
170512613a | ||
|
|
22c7b46206 | ||
|
|
494e776957 | ||
|
|
d939257fa4 | ||
|
|
d37240ad46 | ||
|
|
23a369260f | ||
|
|
ba1b68ee8a | ||
|
|
f592b48696 | ||
|
|
8b2940f5f9 | ||
|
|
a65e11dddf | ||
|
|
ef56d80002 | ||
|
|
78458345df | ||
|
|
3e85c6a21e | ||
|
|
7a311b0cca | ||
|
|
a59d4452de | ||
|
|
dfa7e099b4 | ||
|
|
c524dc7f1c | ||
|
|
7d64f0f27b | ||
|
|
b32c5d542e | ||
|
|
715ba426c8 | ||
|
|
029c82294f | ||
|
|
722275236a | ||
|
|
4421c2a824 | ||
|
|
88cccabc86 | ||
|
|
be970e0729 | ||
|
|
ea5aa444d0 | ||
|
|
d06a1d5440 |
+16
-4
@@ -536,7 +536,10 @@ before_script:
|
||||
- macos
|
||||
stage: build
|
||||
script:
|
||||
- ./scripts/build-macos.sh qt6 arm
|
||||
- eval $(/opt/homebrew/bin/brew shellenv)
|
||||
- qmake OpenRGB.pro
|
||||
- make -j16
|
||||
- macdeployqt OpenRGB.app -codesign=OpenRGB
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_MacOS_ARM64_${CI_COMMIT_SHORT_SHA}"
|
||||
@@ -552,7 +555,10 @@ before_script:
|
||||
- macos
|
||||
stage: build
|
||||
script:
|
||||
- ./scripts/build-macos.sh qt5 arm
|
||||
- eval $(/opt/homebrew/bin/brew shellenv)
|
||||
- /opt/homebrew/opt/qt@5/bin/qmake OpenRGB.pro
|
||||
- make -j16
|
||||
- /opt/homebrew/opt/qt@5/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_MacOS_Qt5_ARM64_${CI_COMMIT_SHORT_SHA}"
|
||||
@@ -568,7 +574,10 @@ before_script:
|
||||
- macos
|
||||
stage: build
|
||||
script:
|
||||
- ./scripts/build-macos.sh qt6 intel
|
||||
- eval $(/usr/local/bin/brew shellenv)
|
||||
- arch -x86_64 /usr/local/bin/qmake OpenRGB.pro
|
||||
- arch -x86_64 make -j16
|
||||
- arch -x86_64 /usr/local/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_MacOS_Intel_${CI_COMMIT_SHORT_SHA}"
|
||||
@@ -584,7 +593,10 @@ before_script:
|
||||
- macos
|
||||
stage: build
|
||||
script:
|
||||
- ./scripts/build-macos.sh qt5 intel
|
||||
- eval $(/usr/local/bin/brew shellenv)
|
||||
- arch -x86_64 /usr/local/opt/qt@5/bin/qmake OpenRGB.pro
|
||||
- arch -x86_64 make -j16
|
||||
- arch -x86_64 /usr/local/opt/qt@5/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_MacOS_Intel_Qt5_${CI_COMMIT_SHORT_SHA}"
|
||||
|
||||
+2
-1
@@ -22,12 +22,13 @@ CODEOWNERS @Calcprogrammer1
|
||||
/Controllers/BlinkyTapeController/
|
||||
/Controllers/CoolerMasterController/ @Dr_No
|
||||
/Controllers/CorsairCommanderCoreController/
|
||||
/Controllers/CorsairDRAMController/
|
||||
/Controllers/CorsairDominatorPlatinumController/
|
||||
/Controllers/CorsairHydroController/
|
||||
/Controllers/CorsairHydroPlatinumController/
|
||||
/Controllers/CorsairLightingNodeController/
|
||||
/Controllers/CorsairPeripheralController/
|
||||
/Controllers/CorsairVengeanceController/
|
||||
/Controllers/CorsairVengeanceProController/
|
||||
/Controllers/CorsairWirelessController/
|
||||
/Controllers/CreativeController/
|
||||
/Controllers/CrucialController/
|
||||
|
||||
@@ -69,7 +69,3 @@ OpenRGB is written in C++, uses the Qt framework for UI, and uses the QMake buil
|
||||
|
||||
Translation files are located in [`OpenRGB/qt/i18n/`](https://gitlab.com/CalcProgrammer1/OpenRGB/-/tree/master/qt/i18n), where languages are formatted using ISO 639-1 format: `OpenRGB_xx_XX.ts` — `xx_XX` representing the language code.
|
||||
In order to translate a file, you need to [fork](https://gitlab.com/CalcProgrammer1/OpenRGB/-/forks/new) the project, create a new file for your language with `lupdate` (or edit an exisiting one), edit the file with `qtlinguist`, commit, push, and create a merge request.
|
||||
|
||||
## AI Guidelines
|
||||
|
||||
OpenRGB is an open source project developed by humans for humans. As a general rule, AI generated submissions are not permitted. The licensing behind AI generated code is problematic. If you choose to use AI for assistance in your development process, we can't stop you, but do not credit the AI in commits (no AI authorship/co-authorship). Ultimately, you as a human developer are responsible for the code you submit and it is expected that any code you submit you fully understand and have manually vetted before submission. Merge requests that appear to be straight from an AI output, commits with AI tool authorship or co-authorship tags, or otherwise AI generated submissions are subject to closure.
|
||||
|
||||
@@ -205,6 +205,7 @@ void RGBController_BloodyB820R::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = led_names[led_index];
|
||||
new_led.value = led_index;
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
|
||||
@@ -67,13 +67,13 @@ void BloodyMouseController::InitDevice()
|
||||
hid_send_feature_report(dev, buffer, BLOODYMOUSE_WRITE_PACKET_SIZE);
|
||||
}
|
||||
|
||||
void BloodyMouseController::SetLedsDirect(std::vector<RGBColor> colors, std::vector<uint8_t> offsets)
|
||||
void BloodyMouseController::SetLedsDirect(std::vector<RGBColor> colors)
|
||||
{
|
||||
uint8_t buffer[BLOODYMOUSE_WRITE_PACKET_SIZE] = { 0x07, 0x03, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00 };
|
||||
|
||||
for(uint8_t i = 0; i < colors.size(); i++)
|
||||
{
|
||||
uint8_t offset = 3 * (offsets[i]) + BLOODYMOUSE_DATA_BYTE;
|
||||
uint8_t offset = 3 * (colors[i] >> 24) + BLOODYMOUSE_DATA_BYTE;
|
||||
|
||||
buffer[offset] = RGBGetRValue(colors[i]);
|
||||
buffer[offset + 1] = RGBGetGValue(colors[i]);
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
std::string GetLocation();
|
||||
std::string GetName();
|
||||
|
||||
void SetLedsDirect(std::vector<RGBColor> colors, std::vector<uint8_t> offsets);
|
||||
void SetLedsDirect(std::vector<RGBColor> colors);
|
||||
|
||||
private:
|
||||
uint16_t pid;
|
||||
|
||||
@@ -142,7 +142,7 @@ void RGBController_BloodyMouse::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
|
||||
offsets.push_back(mz.zone_leds[lp_idx]);
|
||||
new_led.value = mz.zone_leds[lp_idx];
|
||||
|
||||
if(bool_single)
|
||||
{
|
||||
@@ -163,7 +163,14 @@ void RGBController_BloodyMouse::SetupZones()
|
||||
|
||||
void RGBController_BloodyMouse::DeviceUpdateLEDs()
|
||||
{
|
||||
controller->SetLedsDirect(colors, offsets);
|
||||
std::vector<RGBColor> colour;
|
||||
for(size_t i = 0; i < colors.size(); i++)
|
||||
{
|
||||
RGBColor c = colors[i] | (leds[i].value << 24);
|
||||
colour.push_back(c);
|
||||
}
|
||||
|
||||
controller->SetLedsDirect(colour);
|
||||
}
|
||||
|
||||
void RGBController_BloodyMouse::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
|
||||
@@ -39,5 +39,4 @@ public:
|
||||
|
||||
private:
|
||||
BloodyMouseController* controller;
|
||||
std::vector<uint8_t> offsets;
|
||||
};
|
||||
|
||||
@@ -186,7 +186,7 @@ void AMBXController::SetLEDColor(unsigned int led, RGBColor color)
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(2));
|
||||
}
|
||||
|
||||
void AMBXController::SetLEDColors(const unsigned int* leds, RGBColor* colors, unsigned int count)
|
||||
void AMBXController::SetLEDColors(unsigned int* leds, RGBColor* colors, unsigned int count)
|
||||
{
|
||||
for(unsigned int i = 0; i < count; i++)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
bool IsInitialized();
|
||||
void SetLEDColor(unsigned int led, RGBColor color);
|
||||
void SetLEDColors(const unsigned int* leds, RGBColor* colors, unsigned int count);
|
||||
void SetLEDColors(unsigned int* leds, RGBColor* colors, unsigned int count);
|
||||
|
||||
private:
|
||||
libusb_context* usb_context;
|
||||
|
||||
@@ -9,15 +9,6 @@
|
||||
|
||||
#include "RGBController_AMBX.h"
|
||||
|
||||
static const unsigned int led_values[] =
|
||||
{
|
||||
AMBX_LIGHT_LEFT,
|
||||
AMBX_LIGHT_RIGHT,
|
||||
AMBX_LIGHT_WALL_LEFT,
|
||||
AMBX_LIGHT_WALL_CENTER,
|
||||
AMBX_LIGHT_WALL_RIGHT
|
||||
};
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Philips amBX
|
||||
@category Accessory
|
||||
@@ -80,22 +71,27 @@ void RGBController_AMBX::SetupZones()
|
||||
// Set up LEDs
|
||||
led left_light;
|
||||
left_light.name = "Left";
|
||||
left_light.value = AMBX_LIGHT_LEFT;
|
||||
leds.push_back(left_light);
|
||||
|
||||
led right_light;
|
||||
right_light.name = "Right";
|
||||
right_light.value = AMBX_LIGHT_RIGHT;
|
||||
leds.push_back(right_light);
|
||||
|
||||
led wall_left;
|
||||
wall_left.name = "Wall Left";
|
||||
wall_left.value = AMBX_LIGHT_WALL_LEFT;
|
||||
leds.push_back(wall_left);
|
||||
|
||||
led wall_center;
|
||||
wall_center.name = "Wall Center";
|
||||
wall_center.value = AMBX_LIGHT_WALL_CENTER;
|
||||
leds.push_back(wall_center);
|
||||
|
||||
led wall_right;
|
||||
wall_right.name = "Wall Right";
|
||||
wall_right.value = AMBX_LIGHT_WALL_RIGHT;
|
||||
leds.push_back(wall_right);
|
||||
|
||||
SetupColors();
|
||||
@@ -108,7 +104,16 @@ void RGBController_AMBX::DeviceUpdateLEDs()
|
||||
return;
|
||||
}
|
||||
|
||||
controller->SetLEDColors(led_values, colors.data(), static_cast<unsigned int>(colors.size()));
|
||||
unsigned int led_values[5];
|
||||
RGBColor led_colors[5];
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
led_values[led_idx] = leds[led_idx].value;
|
||||
led_colors[led_idx] = colors[led_idx];
|
||||
}
|
||||
|
||||
controller->SetLEDColors(led_values, led_colors, static_cast<unsigned int>(leds.size()));
|
||||
}
|
||||
|
||||
void RGBController_AMBX::DeviceUpdateZoneLEDs(int zone)
|
||||
@@ -133,17 +138,17 @@ void RGBController_AMBX::DeviceUpdateZoneLEDs(int zone)
|
||||
start_idx += zones[z_idx].leds_count;
|
||||
}
|
||||
|
||||
unsigned int tmp_values[5];
|
||||
RGBColor tmp_colors[5];
|
||||
unsigned int led_values[5];
|
||||
RGBColor led_colors[5];
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < zone_size; led_idx++)
|
||||
{
|
||||
unsigned int current_idx = start_idx + led_idx;
|
||||
tmp_values[led_idx] = led_values[current_idx];
|
||||
tmp_colors[led_idx] = colors[current_idx];
|
||||
led_values[led_idx] = leds[current_idx].value;
|
||||
led_colors[led_idx] = colors[current_idx];
|
||||
}
|
||||
|
||||
controller->SetLEDColors(tmp_values, tmp_colors, zone_size);
|
||||
controller->SetLEDColors(led_values, led_colors, zone_size);
|
||||
}
|
||||
|
||||
void RGBController_AMBX::DeviceUpdateSingleLED(int led)
|
||||
@@ -153,7 +158,7 @@ void RGBController_AMBX::DeviceUpdateSingleLED(int led)
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int led_value = led_values[led];
|
||||
unsigned int led_value = leds[led].value;
|
||||
RGBColor color = colors[led];
|
||||
controller->SetLEDColor(led_value, color);
|
||||
}
|
||||
|
||||
@@ -11,33 +11,6 @@
|
||||
|
||||
#include "RGBController_AMDWraithPrism.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| LED maps |
|
||||
\*---------------------------------------------------------*/
|
||||
const unsigned char led_values[] =
|
||||
{
|
||||
// Logo
|
||||
0x00,
|
||||
// Fan
|
||||
0x01,
|
||||
// Ring
|
||||
0x08,
|
||||
0x07,
|
||||
0x06,
|
||||
0x05,
|
||||
0x04,
|
||||
0x03,
|
||||
0x02,
|
||||
0x10,
|
||||
0x0F,
|
||||
0x0E,
|
||||
0x0D,
|
||||
0x0C,
|
||||
0x0B,
|
||||
0x0A,
|
||||
0x09
|
||||
};
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name AMD Wraith Prism
|
||||
@category Cooler
|
||||
@@ -166,6 +139,14 @@ RGBController_AMDWraithPrism::~RGBController_AMDWraithPrism()
|
||||
|
||||
void RGBController_AMDWraithPrism::SetupZones()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| LED maps |
|
||||
\*-----------------------------------------------------*/
|
||||
const unsigned int logo_leds[1] = { 0x00 };
|
||||
const unsigned int fan_leds[1] = { 0x01 };
|
||||
const unsigned int ring_leds[15] = { 0x08, 0x07, 0x06, 0x05, 0x04, 0x03, 0x02, 0x10,
|
||||
0x0F, 0x0E, 0x0D, 0x0C, 0x0B, 0x0A, 0x09 };
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up zones |
|
||||
\*-----------------------------------------------------*/
|
||||
@@ -200,6 +181,7 @@ void RGBController_AMDWraithPrism::SetupZones()
|
||||
{
|
||||
led logo_led;
|
||||
logo_led.name = "Logo LED";
|
||||
logo_led.value = logo_leds[led_idx];
|
||||
leds.push_back(logo_led);
|
||||
}
|
||||
|
||||
@@ -207,6 +189,7 @@ void RGBController_AMDWraithPrism::SetupZones()
|
||||
{
|
||||
led fan_led;
|
||||
fan_led.name = "Fan LED";
|
||||
fan_led.value = fan_leds[led_idx];
|
||||
leds.push_back(fan_led);
|
||||
}
|
||||
|
||||
@@ -214,6 +197,7 @@ void RGBController_AMDWraithPrism::SetupZones()
|
||||
{
|
||||
led ring_led;
|
||||
ring_led.name = "Ring LED";
|
||||
ring_led.value = ring_leds[led_idx];
|
||||
leds.push_back(ring_led);
|
||||
}
|
||||
|
||||
@@ -234,7 +218,7 @@ void RGBController_AMDWraithPrism::DeviceUpdateLEDs()
|
||||
leds_count = 0;
|
||||
for(std::size_t led_idx = 0; led_idx < 2; led_idx++)
|
||||
{
|
||||
led_ids[leds_count] = led_values[led_idx];
|
||||
led_ids[leds_count] = (unsigned char)leds[led_idx].value;
|
||||
color_buf[leds_count] = colors[led_idx];
|
||||
|
||||
leds_count++;
|
||||
@@ -247,7 +231,7 @@ void RGBController_AMDWraithPrism::DeviceUpdateLEDs()
|
||||
leds_count = 0;
|
||||
for(std::size_t led_idx = 0; led_idx < ( colors.size() - 2 ); led_idx++)
|
||||
{
|
||||
led_ids[leds_count] = led_values[led_idx + 2];
|
||||
led_ids[leds_count] = (unsigned char)leds[led_idx + 2].value;
|
||||
color_buf[leds_count] = colors[led_idx + 2];
|
||||
|
||||
leds_count++;
|
||||
|
||||
@@ -31,7 +31,7 @@ AOCKeyboardController::~AOCKeyboardController()
|
||||
|
||||
std::string AOCKeyboardController::GetDeviceLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
return("HID " + location);
|
||||
}
|
||||
|
||||
std::string AOCKeyboardController::GetDeviceName()
|
||||
|
||||
@@ -286,7 +286,7 @@ void RGBController_AOCKeyboard::SetupZones()
|
||||
led new_led;
|
||||
|
||||
new_led.name = new_kb.GetKeyNameAt(led_idx);
|
||||
led_values.push_back(new_kb.GetKeyValueAt(led_idx));
|
||||
new_led.value = new_kb.GetKeyValueAt(led_idx);
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ void RGBController_AOCKeyboard::DeviceUpdateLEDs()
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
color_buf[led_values[led_idx]] = colors[led_idx];
|
||||
color_buf[leds[led_idx].value] = colors[led_idx];
|
||||
}
|
||||
|
||||
controller->SetCustom(&color_buf[0]);
|
||||
|
||||
@@ -29,6 +29,5 @@ public:
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
AOCKeyboardController* controller;
|
||||
std::vector<unsigned int> led_values;
|
||||
AOCKeyboardController* controller;
|
||||
};
|
||||
|
||||
@@ -27,7 +27,7 @@ AOCMouseController::~AOCMouseController()
|
||||
|
||||
std::string AOCMouseController::GetDeviceLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
return("HID " + location);
|
||||
}
|
||||
|
||||
std::string AOCMouseController::GetDeviceName()
|
||||
|
||||
@@ -27,7 +27,7 @@ AOCMousematController::~AOCMousematController()
|
||||
|
||||
std::string AOCMousematController::GetDeviceLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
return("HID " + location);
|
||||
}
|
||||
|
||||
std::string AOCMousematController::GetDeviceName()
|
||||
|
||||
@@ -228,8 +228,7 @@ void RGBController_PolychromeUSB::SetupZones()
|
||||
zones[channel_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
}
|
||||
|
||||
if(!(zones[channel_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
@@ -269,9 +268,9 @@ void RGBController_PolychromeUSB::SetupZones()
|
||||
new_led.name = zones[channel_idx].name;
|
||||
new_led.name.append(", LED ");
|
||||
new_led.name.append(std::to_string(led_ch_idx + 1));
|
||||
new_led.value = channel_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
led_values.push_back(channel_idx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,7 +295,7 @@ void RGBController_PolychromeUSB::SetupZones()
|
||||
\*---------------------------------------------------------*/
|
||||
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
unsigned char led = (unsigned char)led_values[led_idx];
|
||||
unsigned char led = (unsigned char)leds[led_idx].value;
|
||||
|
||||
colors[led_idx] = zones_info[led].color;
|
||||
}
|
||||
@@ -359,7 +358,7 @@ void RGBController_PolychromeUSB::DeviceUpdateZoneLEDs(int zone)
|
||||
|
||||
void RGBController_PolychromeUSB::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
unsigned int channel = led_values[led];
|
||||
unsigned int channel = leds[led].value;
|
||||
unsigned char set_mode = zones_info[channel].mode;
|
||||
|
||||
if(set_mode > modes.size())
|
||||
|
||||
@@ -33,7 +33,6 @@ public:
|
||||
|
||||
private:
|
||||
PolychromeUSBController* controller;
|
||||
std::vector<unsigned int> led_values;
|
||||
std::vector<PolychromeZoneInfo> zones_info;
|
||||
|
||||
unsigned char GetDeviceMode(unsigned char zone);
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ ASRockASRRGBSMBusController::~ASRockASRRGBSMBusController()
|
||||
|
||||
std::string ASRockASRRGBSMBusController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
std::string return_string(bus->device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
|
||||
+2
-7
@@ -158,11 +158,6 @@ void RGBController_ASRockASRRGBSMBus::SetupZones()
|
||||
\*---------------------------------------------------------*/
|
||||
leds.push_back(*new_led);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Initialize led_values vector |
|
||||
\*---------------------------------------------------------*/
|
||||
led_values.push_back(0);
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
@@ -189,9 +184,9 @@ void RGBController_ASRockASRRGBSMBus::DeviceUpdateSingleLED(int led)
|
||||
| If the LED value is non-zero, this LED overrides the LED |
|
||||
| index |
|
||||
\*---------------------------------------------------------*/
|
||||
if(led_values[led] != 0)
|
||||
if(leds[led].value != 0)
|
||||
{
|
||||
led = led_values[led];
|
||||
led = leds[led].value;
|
||||
}
|
||||
|
||||
controller->SetColorsAndSpeed(led, red, grn, blu);
|
||||
|
||||
-1
@@ -30,5 +30,4 @@ public:
|
||||
|
||||
private:
|
||||
ASRockASRRGBSMBusController* controller;
|
||||
std::vector<unsigned int> led_values;
|
||||
};
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ ASRockPolychromeV1SMBusController::~ASRockPolychromeV1SMBusController()
|
||||
|
||||
std::string ASRockPolychromeV1SMBusController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
std::string return_string(bus->device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
|
||||
+1
-1
@@ -285,13 +285,13 @@ void RGBController_ASRockPolychromeV1SMBus::SetupZones()
|
||||
led* new_led = new led();
|
||||
|
||||
new_led->name = polychrome_v1_zone_names[zone_idx];
|
||||
new_led->value = zone_idx;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Push new LED to LEDs vector |
|
||||
\*---------------------------------------------------------*/
|
||||
leds.push_back(*new_led);
|
||||
zoneIndexMap.push_back(zone_idx);
|
||||
led_values.push_back(zone_idx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-5
@@ -32,9 +32,7 @@ public:
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
ASRockPolychromeV1SMBusController* controller;
|
||||
std::vector<unsigned int> led_values;
|
||||
std::vector<uint8_t> zoneIndexMap;
|
||||
|
||||
uint8_t getModeIndex(uint8_t mode_value);
|
||||
ASRockPolychromeV1SMBusController* controller;
|
||||
uint8_t getModeIndex(uint8_t mode_value);
|
||||
std::vector<uint8_t> zoneIndexMap;
|
||||
};
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ ASRockPolychromeV2SMBusController::~ASRockPolychromeV2SMBusController()
|
||||
|
||||
std::string ASRockPolychromeV2SMBusController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
std::string return_string(bus->device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
|
||||
+4
-7
@@ -256,14 +256,11 @@ void RGBController_ASRockPolychromeV2SMBus::SetupZones()
|
||||
new_led->name = polychrome_v2_zone_names[zone_idx];
|
||||
|
||||
new_led->name.append(" " + std::to_string(led_idx + 1));
|
||||
new_led->value = 0;
|
||||
|
||||
if(zone_idx == POLYCHROME_V2_ZONE_ADDRESSABLE)
|
||||
{
|
||||
led_values.push_back(0x19);
|
||||
}
|
||||
else
|
||||
{
|
||||
led_values.push_back(0);
|
||||
new_led->value = 0x19;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
@@ -314,9 +311,9 @@ void RGBController_ASRockPolychromeV2SMBus::DeviceUpdateSingleLED(int led)
|
||||
| If the LED value is non-zero, this LED overrides the LED |
|
||||
| index |
|
||||
\*---------------------------------------------------------*/
|
||||
if(led_values[led] != 0)
|
||||
if(leds[led].value != 0)
|
||||
{
|
||||
led = led_values[led];
|
||||
led = leds[led].value;
|
||||
}
|
||||
|
||||
controller->SetColorsAndSpeed(led, red, grn, blu);
|
||||
|
||||
+1
-2
@@ -32,6 +32,5 @@ public:
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
ASRockPolychromeV2SMBusController* controller;
|
||||
std::vector<unsigned int> led_values;
|
||||
ASRockPolychromeV2SMBusController* controller;
|
||||
};
|
||||
|
||||
@@ -85,31 +85,31 @@ uint16_t GetFirmwareVersion(i2c_smbus_interface* bus, uint8_t address)
|
||||
}
|
||||
}
|
||||
|
||||
DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface*>& buses)
|
||||
DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface*>& busses)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
for(unsigned int bus = 0; bus < buses.size(); bus++)
|
||||
for(unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
{
|
||||
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
|
||||
IF_MOBO_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
|
||||
{
|
||||
if(buses[bus]->info.pci_subsystem_vendor == ASROCK_SUB_VEN)
|
||||
if(busses[bus]->pci_subsystem_vendor == ASROCK_SUB_VEN)
|
||||
{
|
||||
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, ASROCK_DETECTOR_NAME, bus, VENDOR_NAME, SMBUS_ADDRESS);
|
||||
// Check for Polychrome controller at 0x6A
|
||||
if(TestForPolychromeSMBusController(buses[bus], SMBUS_ADDRESS))
|
||||
if(TestForPolychromeSMBusController(busses[bus], SMBUS_ADDRESS))
|
||||
{
|
||||
LOG_DEBUG("[%s] Detected a device at address 0x%02X, testing for a known controller", ASROCK_DETECTOR_NAME, SMBUS_ADDRESS);
|
||||
|
||||
u16_to_u8 version;
|
||||
version.u16 = GetFirmwareVersion(buses[bus], SMBUS_ADDRESS);
|
||||
version.u16 = GetFirmwareVersion(busses[bus], SMBUS_ADDRESS);
|
||||
|
||||
switch(version.msb)
|
||||
{
|
||||
case ASROCK_TYPE_ASRLED:
|
||||
{
|
||||
LOG_DEBUG("[%s] Found a ASR RGB LED Controller", ASROCK_DETECTOR_NAME);
|
||||
ASRockASRRGBSMBusController* controller = new ASRockASRRGBSMBusController(buses[bus], SMBUS_ADDRESS);
|
||||
ASRockASRRGBSMBusController* controller = new ASRockASRRGBSMBusController(busses[bus], SMBUS_ADDRESS);
|
||||
controller-> fw_version = version.u16;
|
||||
RGBController_ASRockASRRGBSMBus* rgb_controller = new RGBController_ASRockASRRGBSMBus(controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
@@ -119,7 +119,7 @@ DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface
|
||||
case ASROCK_TYPE_POLYCHROME_V1:
|
||||
{
|
||||
LOG_DEBUG("[%s] Found a Polychrome v1 Controller", ASROCK_DETECTOR_NAME);
|
||||
ASRockPolychromeV1SMBusController* controller = new ASRockPolychromeV1SMBusController(buses[bus], SMBUS_ADDRESS);
|
||||
ASRockPolychromeV1SMBusController* controller = new ASRockPolychromeV1SMBusController(busses[bus], SMBUS_ADDRESS);
|
||||
controller-> fw_version = version.u16;
|
||||
RGBController_ASRockPolychromeV1SMBus* rgb_controller = new RGBController_ASRockPolychromeV1SMBus(controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
@@ -129,7 +129,7 @@ DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface
|
||||
case ASROCK_TYPE_POLYCHROME_V2:
|
||||
{
|
||||
LOG_DEBUG("[%s] Found a Polychrome v2 Controller", ASROCK_DETECTOR_NAME);
|
||||
ASRockPolychromeV2SMBusController* controller = new ASRockPolychromeV2SMBusController(buses[bus], SMBUS_ADDRESS);
|
||||
ASRockPolychromeV2SMBusController* controller = new ASRockPolychromeV2SMBusController(busses[bus], SMBUS_ADDRESS);
|
||||
controller-> fw_version = version.u16;
|
||||
RGBController_ASRockPolychromeV2SMBus* rgb_controller = new RGBController_ASRockPolychromeV2SMBus(controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
+8
-8
@@ -313,7 +313,7 @@ void RGBController_AlienwareAW410K::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = led_names[led_idx].name;
|
||||
led_values.push_back(led_names[led_idx].idx);
|
||||
new_led.value = led_names[led_idx].idx;
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
@@ -329,14 +329,14 @@ void RGBController_AlienwareAW410K::DeviceUpdateLEDs()
|
||||
|
||||
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
SelectedButtons key;
|
||||
SelectedButtons key;
|
||||
|
||||
key.idx = led_values[led_idx];
|
||||
key.red = RGBGetRValue(colors[led_idx]);
|
||||
key.green = RGBGetGValue(colors[led_idx]);
|
||||
key.blue = RGBGetBValue(colors[led_idx]);
|
||||
key.idx = (unsigned char)leds[led_idx].value;
|
||||
key.red = RGBGetRValue(colors[led_idx]);
|
||||
key.green = RGBGetGValue(colors[led_idx]);
|
||||
key.blue = RGBGetBValue(colors[led_idx]);
|
||||
|
||||
frame_buf_keys.push_back(key);
|
||||
frame_buf_keys.push_back(key);
|
||||
}
|
||||
|
||||
controller->SendInitialize();
|
||||
@@ -358,7 +358,7 @@ void RGBController_AlienwareAW410K::DeviceUpdateZoneLEDs(int zone)
|
||||
|
||||
void RGBController_AlienwareAW410K::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
controller->DeviceUpdateSingleLED(led_values[led], RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
|
||||
controller->DeviceUpdateSingleLED(leds[led].value, RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
|
||||
}
|
||||
|
||||
void RGBController_AlienwareAW410K::DeviceUpdateMode()
|
||||
|
||||
-1
@@ -32,5 +32,4 @@ public:
|
||||
private:
|
||||
AlienwareAW410KController* controller;
|
||||
std::vector<RGBColor> current_colors;
|
||||
std::vector<unsigned char> led_values;
|
||||
};
|
||||
|
||||
+23
-9
@@ -312,7 +312,7 @@ void RGBController_AlienwareAW510K::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = led_names[led_idx].name;
|
||||
led_values.push_back(led_names[led_idx].idx);
|
||||
new_led.value = led_names[led_idx].idx;
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
@@ -328,7 +328,7 @@ void RGBController_AlienwareAW510K::DeviceUpdateLEDs()
|
||||
|
||||
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
if(current_colors[led_idx] == new_colors[led_idx])
|
||||
if (current_colors[led_idx]==new_colors[led_idx])
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Don't send if key color is not changed |
|
||||
@@ -336,14 +336,28 @@ void RGBController_AlienwareAW510K::DeviceUpdateLEDs()
|
||||
continue;
|
||||
}
|
||||
|
||||
SelectedKeys key;
|
||||
if(RGBGetRValue(colors[led_idx]) != 0x00 || RGBGetBValue(colors[led_idx]) != 0x00 || RGBGetBValue(colors[led_idx]) != 0x00)
|
||||
{
|
||||
SelectedKeys key;
|
||||
|
||||
key.idx = led_values[led_idx];
|
||||
key.red = RGBGetRValue(colors[led_idx]);
|
||||
key.green = RGBGetGValue(colors[led_idx]);
|
||||
key.blue = RGBGetBValue(colors[led_idx]);
|
||||
key.idx = (unsigned char)leds[led_idx].value;
|
||||
key.red = RGBGetRValue(colors[led_idx]);
|
||||
key.green = RGBGetGValue(colors[led_idx]);
|
||||
key.blue = RGBGetBValue(colors[led_idx]);
|
||||
|
||||
frame_buf_keys.push_back(key);
|
||||
frame_buf_keys.push_back(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
SelectedKeys key;
|
||||
|
||||
key.idx = (unsigned char)leds[led_idx].value;
|
||||
key.red = RGBGetRValue(colors[led_idx]);
|
||||
key.green = RGBGetGValue(colors[led_idx]);
|
||||
key.blue = RGBGetBValue(colors[led_idx]);
|
||||
|
||||
frame_buf_keys.push_back(key);
|
||||
}
|
||||
}
|
||||
|
||||
controller->SendInitialize();
|
||||
@@ -365,7 +379,7 @@ void RGBController_AlienwareAW510K::DeviceUpdateZoneLEDs(int zone)
|
||||
|
||||
void RGBController_AlienwareAW510K::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
controller->DeviceUpdateSingleLED(led_values[led], RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
|
||||
controller->DeviceUpdateSingleLED(leds[led].value, RGBGetRValue(colors[led]), RGBGetGValue(colors[led]), RGBGetBValue(colors[led]));
|
||||
}
|
||||
|
||||
void RGBController_AlienwareAW510K::DeviceUpdateMode()
|
||||
|
||||
-1
@@ -31,5 +31,4 @@ public:
|
||||
private:
|
||||
AlienwareAW510KController* controller;
|
||||
std::vector<RGBColor> current_colors;
|
||||
std::vector<unsigned char> led_values;
|
||||
};
|
||||
|
||||
@@ -11,13 +11,6 @@
|
||||
|
||||
#include "RGBController_AlienwareAW3423DWF.h"
|
||||
|
||||
static const unsigned char led_values[] =
|
||||
{
|
||||
0x01,
|
||||
0x02,
|
||||
0x08
|
||||
};
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name AW3423DWF
|
||||
@category Accessory
|
||||
@@ -70,6 +63,7 @@ void RGBController_AlienwareAW3423DWF::SetupZones()
|
||||
|
||||
led Logo_LED;
|
||||
Logo_LED.name = "Logo";
|
||||
Logo_LED.value = 0x01;
|
||||
leds.push_back(Logo_LED);
|
||||
|
||||
zone Number;
|
||||
@@ -82,6 +76,7 @@ void RGBController_AlienwareAW3423DWF::SetupZones()
|
||||
|
||||
led Number_LED;
|
||||
Number_LED.name = "Number";
|
||||
Number_LED.value = 0x02;
|
||||
leds.push_back(Number_LED);
|
||||
|
||||
zone PowerButton;
|
||||
@@ -94,6 +89,7 @@ void RGBController_AlienwareAW3423DWF::SetupZones()
|
||||
|
||||
led PowerButton_LED;
|
||||
PowerButton_LED.name = "Power Button";
|
||||
PowerButton_LED.value = 0x08;
|
||||
leds.push_back(PowerButton_LED);
|
||||
|
||||
SetupColors();
|
||||
@@ -132,7 +128,7 @@ void RGBController_AlienwareAW3423DWF::DeviceUpdateSingleLED(int led)
|
||||
unsigned char red = RGBGetRValue(colors[led]);
|
||||
unsigned char grn = RGBGetGValue(colors[led]);
|
||||
unsigned char blu = RGBGetBValue(colors[led]);
|
||||
controller->SendColor(led_values[led], red, grn, blu);
|
||||
controller->SendColor(leds[led].value, red, grn, blu);
|
||||
}
|
||||
|
||||
void RGBController_AlienwareAW3423DWF::DeviceUpdateMode()
|
||||
|
||||
@@ -11,13 +11,6 @@
|
||||
|
||||
#include "RGBController_AlienwareMonitor.h"
|
||||
|
||||
static const unsigned char led_values[] =
|
||||
{
|
||||
0x01,
|
||||
0x02,
|
||||
0x08
|
||||
};
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Alienware Monitor
|
||||
@category Accessory
|
||||
@@ -70,6 +63,7 @@ void RGBController_AlienwareMonitor::SetupZones()
|
||||
|
||||
led Logo_LED;
|
||||
Logo_LED.name = "Logo";
|
||||
Logo_LED.value = 0x01;
|
||||
leds.push_back(Logo_LED);
|
||||
|
||||
zone Number;
|
||||
@@ -82,6 +76,7 @@ void RGBController_AlienwareMonitor::SetupZones()
|
||||
|
||||
led Number_LED;
|
||||
Number_LED.name = "Number";
|
||||
Number_LED.value = 0x02;
|
||||
leds.push_back(Number_LED);
|
||||
|
||||
zone PowerButton;
|
||||
@@ -94,6 +89,7 @@ void RGBController_AlienwareMonitor::SetupZones()
|
||||
|
||||
led PowerButton_LED;
|
||||
PowerButton_LED.name = "Power Button";
|
||||
PowerButton_LED.value = 0x08;
|
||||
leds.push_back(PowerButton_LED);
|
||||
|
||||
SetupColors();
|
||||
@@ -132,7 +128,7 @@ void RGBController_AlienwareMonitor::DeviceUpdateSingleLED(int led)
|
||||
unsigned char red = RGBGetRValue(colors[led]);
|
||||
unsigned char grn = RGBGetGValue(colors[led]);
|
||||
unsigned char blu = RGBGetBValue(colors[led]);
|
||||
controller->SendColor(led_values[led], red, grn, blu);
|
||||
controller->SendColor(leds[led].value, red, grn, blu);
|
||||
}
|
||||
|
||||
void RGBController_AlienwareMonitor::DeviceUpdateMode()
|
||||
|
||||
@@ -38,69 +38,76 @@ static const unsigned int zone_sizes[] =
|
||||
LED_COUNT,
|
||||
};
|
||||
|
||||
static const char* led_names[] =
|
||||
typedef struct
|
||||
{
|
||||
KEY_EN_ESCAPE,
|
||||
KEY_EN_1,
|
||||
KEY_EN_2,
|
||||
KEY_EN_3,
|
||||
KEY_EN_4,
|
||||
KEY_EN_5,
|
||||
KEY_EN_6,
|
||||
KEY_EN_7,
|
||||
KEY_EN_8,
|
||||
KEY_EN_9,
|
||||
KEY_EN_0,
|
||||
KEY_EN_MINUS,
|
||||
KEY_EN_EQUALS,
|
||||
KEY_EN_BACKSPACE,
|
||||
KEY_EN_TAB,
|
||||
KEY_EN_Q,
|
||||
KEY_EN_W,
|
||||
KEY_EN_E,
|
||||
KEY_EN_R,
|
||||
KEY_EN_T,
|
||||
KEY_EN_Y,
|
||||
KEY_EN_U,
|
||||
KEY_EN_I,
|
||||
KEY_EN_O,
|
||||
KEY_EN_P,
|
||||
KEY_EN_LEFT_BRACKET,
|
||||
KEY_EN_RIGHT_BRACKET,
|
||||
KEY_EN_ANSI_BACK_SLASH,
|
||||
KEY_EN_CAPS_LOCK,
|
||||
KEY_EN_A,
|
||||
KEY_EN_S,
|
||||
KEY_EN_D,
|
||||
KEY_EN_F,
|
||||
KEY_EN_G,
|
||||
KEY_EN_H,
|
||||
KEY_EN_J,
|
||||
KEY_EN_K,
|
||||
KEY_EN_L,
|
||||
KEY_EN_SEMICOLON,
|
||||
KEY_EN_QUOTE,
|
||||
KEY_EN_ANSI_ENTER,
|
||||
KEY_EN_LEFT_SHIFT,
|
||||
KEY_EN_Z,
|
||||
KEY_EN_X,
|
||||
KEY_EN_C,
|
||||
KEY_EN_V,
|
||||
KEY_EN_B,
|
||||
KEY_EN_N,
|
||||
KEY_EN_M,
|
||||
KEY_EN_COMMA,
|
||||
KEY_EN_PERIOD,
|
||||
KEY_EN_FORWARD_SLASH,
|
||||
KEY_EN_RIGHT_SHIFT,
|
||||
KEY_EN_LEFT_CONTROL,
|
||||
KEY_EN_LEFT_WINDOWS,
|
||||
KEY_EN_LEFT_ALT,
|
||||
KEY_EN_SPACE,
|
||||
KEY_EN_RIGHT_ALT,
|
||||
KEY_EN_RIGHT_FUNCTION,
|
||||
KEY_EN_MENU,
|
||||
KEY_EN_RIGHT_CONTROL,
|
||||
const char * name;
|
||||
const unsigned char idx;
|
||||
} annepro2_led_type;
|
||||
|
||||
static const annepro2_led_type led_names[] =
|
||||
{
|
||||
/* Key Label Index */
|
||||
{ KEY_EN_ESCAPE, 0 },
|
||||
{ KEY_EN_1, 1 },
|
||||
{ KEY_EN_2, 2 },
|
||||
{ KEY_EN_3, 3 },
|
||||
{ KEY_EN_4, 4 },
|
||||
{ KEY_EN_5, 5 },
|
||||
{ KEY_EN_6, 6 },
|
||||
{ KEY_EN_7, 7 },
|
||||
{ KEY_EN_8, 8 },
|
||||
{ KEY_EN_9, 9 },
|
||||
{ KEY_EN_0, 10 },
|
||||
{ KEY_EN_MINUS, 11 },
|
||||
{ KEY_EN_EQUALS, 12 },
|
||||
{ KEY_EN_BACKSPACE, 13 },
|
||||
{ KEY_EN_TAB, 14 },
|
||||
{ KEY_EN_Q, 15 },
|
||||
{ KEY_EN_W, 16 },
|
||||
{ KEY_EN_E, 17 },
|
||||
{ KEY_EN_R, 18 },
|
||||
{ KEY_EN_T, 19 },
|
||||
{ KEY_EN_Y, 20 },
|
||||
{ KEY_EN_U, 21 },
|
||||
{ KEY_EN_I, 22 },
|
||||
{ KEY_EN_O, 23 },
|
||||
{ KEY_EN_P, 24 },
|
||||
{ KEY_EN_LEFT_BRACKET, 25 },
|
||||
{ KEY_EN_RIGHT_BRACKET, 26 },
|
||||
{ KEY_EN_ANSI_BACK_SLASH, 27 },
|
||||
{ KEY_EN_CAPS_LOCK, 28 },
|
||||
{ KEY_EN_A, 29 },
|
||||
{ KEY_EN_S, 30 },
|
||||
{ KEY_EN_D, 31 },
|
||||
{ KEY_EN_F, 32 },
|
||||
{ KEY_EN_G, 33 },
|
||||
{ KEY_EN_H, 34 },
|
||||
{ KEY_EN_J, 35 },
|
||||
{ KEY_EN_K, 36 },
|
||||
{ KEY_EN_L, 37 },
|
||||
{ KEY_EN_SEMICOLON, 38 },
|
||||
{ KEY_EN_QUOTE, 39 },
|
||||
{ KEY_EN_ANSI_ENTER, 40 },
|
||||
{ KEY_EN_LEFT_SHIFT, 41 },
|
||||
{ KEY_EN_Z, 42 },
|
||||
{ KEY_EN_X, 43 },
|
||||
{ KEY_EN_C, 44 },
|
||||
{ KEY_EN_V, 45 },
|
||||
{ KEY_EN_B, 46 },
|
||||
{ KEY_EN_N, 47 },
|
||||
{ KEY_EN_M, 48 },
|
||||
{ KEY_EN_COMMA, 49 },
|
||||
{ KEY_EN_PERIOD, 50 },
|
||||
{ KEY_EN_FORWARD_SLASH, 51 },
|
||||
{ KEY_EN_RIGHT_SHIFT, 52 },
|
||||
{ KEY_EN_LEFT_CONTROL, 53 },
|
||||
{ KEY_EN_LEFT_WINDOWS, 54 },
|
||||
{ KEY_EN_LEFT_ALT, 55 },
|
||||
{ KEY_EN_SPACE, 56 },
|
||||
{ KEY_EN_RIGHT_ALT, 57 },
|
||||
{ KEY_EN_RIGHT_FUNCTION, 58 },
|
||||
{ KEY_EN_MENU, 59 },
|
||||
{ KEY_EN_RIGHT_CONTROL, 60 },
|
||||
};
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@@ -170,7 +177,8 @@ void RGBController_AnnePro2::SetupZones()
|
||||
for(unsigned int led_idx = 0; led_idx < total_led_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = led_names[led_idx];
|
||||
new_led.name = led_names[led_idx].name;
|
||||
new_led.value = led_names[led_idx].idx;
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
@@ -186,7 +194,7 @@ void RGBController_AnnePro2::DeviceUpdateLEDs()
|
||||
| TODO: Send packets with multiple LED frames |
|
||||
\*---------------------------------------------------------*/
|
||||
std::size_t led_real_idx = 0;
|
||||
for(std::size_t led_idx = 0; led_idx < colors.size(); led_idx++)
|
||||
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
frame_buf[(led_real_idx * 3) + 0] = RGBGetRValue(colors[led_idx]);
|
||||
frame_buf[(led_real_idx * 3) + 1] = RGBGetGValue(colors[led_idx]);
|
||||
|
||||
@@ -75,6 +75,7 @@ void RGBController_Arctic::SetupZones()
|
||||
|
||||
led Led;
|
||||
Led.name = LedZone.name + " LED";
|
||||
Led.value = channel;
|
||||
|
||||
zones.push_back(LedZone);
|
||||
leds.push_back(Led);
|
||||
|
||||
+16
-7
@@ -351,14 +351,11 @@ void RGBController_AsusAuraCoreLaptop::SetupZones()
|
||||
new_zone.leds_count = new_kb.GetKeyCount();
|
||||
for(unsigned int led_idx = 0; led_idx < new_zone.leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
unsigned int new_led_value;
|
||||
led new_led;
|
||||
|
||||
new_led.name = new_kb.GetKeyNameAt(led_idx);
|
||||
new_led_value = new_kb.GetKeyValueAt(led_idx);
|
||||
max_led_value = std::max(max_led_value, new_led_value);
|
||||
|
||||
led_values.push_back(new_led_value);
|
||||
new_led.value = new_kb.GetKeyValueAt(led_idx);
|
||||
max_led_value = std::max(max_led_value, new_led.value);
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
}
|
||||
@@ -388,12 +385,24 @@ void RGBController_AsusAuraCoreLaptop::SetupZones()
|
||||
|
||||
for(size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
buffer_map[led_values[led_idx]] = &colors[led_idx];
|
||||
buffer_map[leds[led_idx].value] = &colors[led_idx];
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_AsusAuraCoreLaptop::DeviceUpdateLEDs()
|
||||
{
|
||||
for(size_t i = 85; i < leds.size(); i++)
|
||||
{
|
||||
LOG_DEBUG("[%s] Setting %s @ LED index %d and buffer index %d to R: %02X G: %02X B: %02X",
|
||||
name.c_str(),
|
||||
leds[i].name.c_str(),
|
||||
i,
|
||||
leds[i].value,
|
||||
RGBGetRValue(colors[i]),
|
||||
RGBGetGValue(colors[i]),
|
||||
RGBGetBValue(colors[i]));
|
||||
}
|
||||
|
||||
controller->SetLedsDirect(buffer_map);
|
||||
}
|
||||
|
||||
|
||||
-1
@@ -33,7 +33,6 @@ public:
|
||||
private:
|
||||
RGBColor null_color = 0;
|
||||
std::vector<RGBColor *> buffer_map;
|
||||
std::vector<unsigned int> led_values;
|
||||
|
||||
AsusAuraCoreLaptopController* controller;
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@ std::string AuraGPUController::GetDeviceName()
|
||||
|
||||
std::string AuraGPUController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
std::string return_string(bus->device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
@@ -79,7 +79,7 @@ void AuraGPUController::AuraGPURegisterWrite(unsigned char reg, unsigned char va
|
||||
|
||||
bool AuraGPUController::SaveOnlyApplies()
|
||||
{
|
||||
switch (bus->info.pci_subsystem_device)
|
||||
switch (bus->pci_subsystem_device)
|
||||
{
|
||||
case ASUS_VEGA64_STRIX:
|
||||
return false;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
bool TestForAsusAuraGPUController(i2c_smbus_interface* bus, unsigned char address)
|
||||
{
|
||||
if(bus->info.pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
|
||||
if(bus->pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
+2
-2
@@ -471,8 +471,8 @@ void RGBController_AuraKeyboard::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = led_names[led_idx].name;
|
||||
new_led.value = led_names[led_idx].idx;
|
||||
|
||||
led_values.push_back(led_names[led_idx].idx);
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
@@ -493,7 +493,7 @@ void RGBController_AuraKeyboard::DeviceUpdateLEDs()
|
||||
\*---------------------------------------------------------*/
|
||||
for(std::size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
frame_buf[(led_idx * 4) + 0] = led_values[led_idx];
|
||||
frame_buf[(led_idx * 4) + 0] = leds[led_idx].value;
|
||||
frame_buf[(led_idx * 4) + 1] = RGBGetRValue(colors[led_idx]);
|
||||
frame_buf[(led_idx * 4) + 2] = RGBGetGValue(colors[led_idx]);
|
||||
frame_buf[(led_idx * 4) + 3] = RGBGetBValue(colors[led_idx]);
|
||||
|
||||
-1
@@ -54,5 +54,4 @@ public:
|
||||
private:
|
||||
AuraKeyboardController* controller;
|
||||
AuraKeyboardMappingLayoutType layout;
|
||||
std::vector<unsigned char> led_values;
|
||||
};
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#define AURA_ROG_GLADIUS_II_WIRELESS_1_PID 0x189E
|
||||
#define AURA_ROG_GLADIUS_II_WIRELESS_2_PID 0x18A0
|
||||
#define AURA_ROG_GLADIUS_III_PID 0x197B
|
||||
#define AURA_ROG_GLADIUS_III_CORE_PID 0x1C8D
|
||||
#define AURA_ROG_GLADIUS_III_WIRELESS_USB_PID 0x197D
|
||||
#define AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID 0x197F
|
||||
#define AURA_ROG_GLADIUS_III_WIRELESS_BT_PID 0x1981
|
||||
@@ -218,20 +217,6 @@ static std::map<int,mouse_type> aura_mouse_devices =
|
||||
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
|
||||
}
|
||||
},
|
||||
{
|
||||
AURA_ROG_GLADIUS_III_CORE_PID, // ROG Gladius III Core
|
||||
{
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
100,
|
||||
false,
|
||||
1,
|
||||
false,
|
||||
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
|
||||
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_REACTIVE }
|
||||
}
|
||||
},
|
||||
{
|
||||
AURA_ROG_GLADIUS_III_WIRELESS_USB_PID, // ROG Gladius III Wireless USB
|
||||
{
|
||||
|
||||
+2
-2
@@ -207,8 +207,8 @@ void RGBController_AuraMouse::SetupZones()
|
||||
led mouse_led;
|
||||
|
||||
mouse_led.name = mouse_zone.name + " LED";
|
||||
mouse_led.value = *zone_it;
|
||||
|
||||
led_values.push_back(*zone_it);
|
||||
leds.push_back(mouse_led);
|
||||
}
|
||||
|
||||
@@ -247,7 +247,7 @@ void RGBController_AuraMouse::DeviceUpdateSingleLED(int led)
|
||||
uint8_t grn = RGBGetGValue(colors[led]);
|
||||
uint8_t blu = RGBGetBValue(colors[led]);
|
||||
|
||||
controller->SendUpdate(led_values[led], modes[active_mode].value, red, grn, blu, 0, false, 0, modes[active_mode].brightness);
|
||||
controller->SendUpdate(leds[led].value, modes[active_mode].value, red, grn, blu, 0, false, 0, modes[active_mode].brightness);
|
||||
}
|
||||
|
||||
void RGBController_AuraMouse::DeviceUpdateMode()
|
||||
|
||||
-1
@@ -31,6 +31,5 @@ public:
|
||||
|
||||
private:
|
||||
AuraMouseController* controller;
|
||||
std::vector<uint8_t> led_values;
|
||||
uint16_t pid;
|
||||
};
|
||||
|
||||
+1
@@ -141,6 +141,7 @@ void RGBController_AsusROGSpatha::SetupZones()
|
||||
led spatha_led;
|
||||
|
||||
spatha_led.name = zones_names[i];
|
||||
spatha_led.value = 1;
|
||||
|
||||
leds.push_back(spatha_led);
|
||||
}
|
||||
|
||||
+1
@@ -99,6 +99,7 @@ void RGBController_AsusROGStrixEvolve::SetupZones()
|
||||
led mouse_led;
|
||||
|
||||
mouse_led.name = "Underglow";
|
||||
mouse_led.value = 1;
|
||||
|
||||
leds.push_back(mouse_led);
|
||||
|
||||
|
||||
+1
-4
@@ -19,10 +19,7 @@ AsusAuraRyuoAIOController::AsusAuraRyuoAIOController(hid_device* dev_handle, con
|
||||
| Manually adding device info for now |
|
||||
| TODO: Implement config table accurately |
|
||||
\*-----------------------------------------------------*/
|
||||
uint8_t leds = (dev_name.find("Ryujin") != std::string::npos) ? 5 : 12;
|
||||
|
||||
device_info.push_back({0x00, 0x00, leds, 0, AuraDeviceType::FIXED});
|
||||
|
||||
device_info.push_back({0x00, 0x00, 12, 0, AuraDeviceType::FIXED});
|
||||
}
|
||||
|
||||
AsusAuraRyuoAIOController::~AsusAuraRyuoAIOController()
|
||||
|
||||
+1
@@ -163,6 +163,7 @@ void RGBController_AsusAuraRyuoAIO::SetupZones()
|
||||
|
||||
new_led.name = zones[zone_idx].name;
|
||||
new_led.name.append(" LED " + std::to_string(lp_idx));
|
||||
new_led.value = lp_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
+3
-3
@@ -520,7 +520,7 @@ void RGBController_AuraTUFKeyboard::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = keyboard[layout].led_names[led_id].name;
|
||||
led_values.push_back(keyboard[layout].led_names[led_id].id);
|
||||
new_led.value = keyboard[layout].led_names[led_id].id;
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
@@ -538,7 +538,7 @@ void RGBController_AuraTUFKeyboard::DeviceUpdateLEDs()
|
||||
|
||||
for(size_t i = 0; i < colors.size(); i++)
|
||||
{
|
||||
led_color_list.push_back({ led_values[i], colors[i] });
|
||||
led_color_list.push_back({ leds[i].value, colors[i] });
|
||||
}
|
||||
|
||||
controller->UpdateLeds(led_color_list);
|
||||
@@ -560,7 +560,7 @@ void RGBController_AuraTUFKeyboard::DeviceUpdateSingleLED(int led)
|
||||
unsigned char green = RGBGetGValue(colors[led]);
|
||||
unsigned char blue = RGBGetBValue(colors[led]);
|
||||
|
||||
controller->UpdateSingleLed(led_values[led], red, green, blue);
|
||||
controller->UpdateSingleLed(leds[led].value, red, green, blue);
|
||||
}
|
||||
|
||||
static const uint8_t direction_map[2][6] =
|
||||
|
||||
-1
@@ -53,5 +53,4 @@ public:
|
||||
private:
|
||||
AuraTUFKeyboardController* controller;
|
||||
uint16_t pid;
|
||||
std::vector<uint8_t> led_values;
|
||||
};
|
||||
|
||||
+1
-2
@@ -170,8 +170,7 @@ void RGBController_AuraUSB::SetupZones()
|
||||
zones[channel_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
}
|
||||
|
||||
if(!(zones[channel_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
@@ -120,7 +120,6 @@
|
||||
#define AURA_TERMINAL_PID 0x1889
|
||||
#define ROG_STRIX_LC120_PID 0x879E
|
||||
#define AURA_RYUO_AIO_PID 0x1887
|
||||
#define AURA_RYUJIN_AIO_PID 0x18AE
|
||||
#define ASUS_ROG_ALLY_PID 0x1ABE
|
||||
#define ASUS_ROG_ALLY_X_PID 0x1B4C
|
||||
|
||||
@@ -464,7 +463,6 @@ REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Origin COD",
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_1_PID, 1, 0xFF13);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_2_PID, 2, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Core", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_CORE_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless USB", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_USB_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless 2.4Ghz", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless Bluetooth", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_BT_PID, 0, 0xFF01);
|
||||
@@ -525,7 +523,6 @@ REGISTER_HID_DETECTOR_PU("ASUS ROG PG32UQ", DetectAs
|
||||
REGISTER_HID_DETECTOR ("ASUS ROG AURA Terminal", DetectAsusAuraUSBTerminal, AURA_USB_VID, AURA_TERMINAL_PID);
|
||||
REGISTER_HID_DETECTOR_PU ("ASUS ROG Strix LC", DetectAsusAuraUSBROGStrixLC, AURA_USB_VID, ROG_STRIX_LC120_PID, 0x00FF, 1);
|
||||
REGISTER_HID_DETECTOR_PU ("ASUS ROG Ryuo AIO", DetectAsusAuraUSBRyuoAIO, AURA_USB_VID, AURA_RYUO_AIO_PID, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR_PU ("ASUS ROG Ryujin AIO", DetectAsusAuraUSBRyuoAIO, AURA_USB_VID, AURA_RYUJIN_AIO_PID, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne QI", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_QI_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne QI GUNDAM", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_QI_GUNDAM_PID, 0);
|
||||
|
||||
+1
@@ -164,6 +164,7 @@ void RGBController_AsusROGStrixLC::SetupZones()
|
||||
|
||||
new_led.name = zones[zone_idx].name;
|
||||
new_led.name.append(" LED " + std::to_string(lp_idx));
|
||||
new_led.value = lp_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
+2
@@ -71,6 +71,7 @@ void RGBController_StrixClaw::SetupZones()
|
||||
led scroll_wheel_led;
|
||||
|
||||
scroll_wheel_led.name = "Scroll Wheel LED";
|
||||
scroll_wheel_led.value = 1;
|
||||
|
||||
leds.push_back(scroll_wheel_led);
|
||||
|
||||
@@ -87,6 +88,7 @@ void RGBController_StrixClaw::SetupZones()
|
||||
led logo_led;
|
||||
|
||||
logo_led.name = "Logo LED";
|
||||
logo_led.value = 1;
|
||||
|
||||
leds.push_back(logo_led);
|
||||
|
||||
|
||||
@@ -79,8 +79,7 @@ void RGBController_BlinkyTape::SetupZones()
|
||||
zones[0].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
}
|
||||
|
||||
if(!(zones[0].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
@@ -241,9 +241,9 @@ void RGBController_ClevoKeyboard::SetupZones()
|
||||
led new_led;
|
||||
|
||||
new_led.name = new_kb.GetKeyNameAt(led_idx);
|
||||
new_led.value = new_kb.GetKeyValueAt(led_idx);
|
||||
|
||||
leds.push_back(new_led);
|
||||
led_values.push_back(new_kb.GetKeyValueAt(led_idx));
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
@@ -258,7 +258,7 @@ void RGBController_ClevoKeyboard::SetupZones()
|
||||
|
||||
for(size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
buffer_map[led_values[led_idx]] = &colors[led_idx];
|
||||
buffer_map[leds[led_idx].value] = &colors[led_idx];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,5 @@ public:
|
||||
private:
|
||||
ClevoKeyboardController* controller;
|
||||
std::vector<RGBColor*> buffer_map;
|
||||
std::vector<unsigned int> led_values;
|
||||
RGBColor null_color;
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ ColorfulGPUController::~ColorfulGPUController()
|
||||
|
||||
std::string ColorfulGPUController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
std::string return_string(bus->device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
@@ -45,7 +45,7 @@ void ColorfulGPUController::SetDirect(RGBColor color)
|
||||
uint8_t g = RGBGetGValue(color);
|
||||
uint8_t b = RGBGetBValue(color);
|
||||
|
||||
if(this->bus->info.pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV)
|
||||
if(this->bus->pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV)
|
||||
{
|
||||
uint8_t data_pkt[COLORFUL_PACKET_LENGTH_V2] = { 0xAA, 0xEF, 0x01, 0x04, 0x88, 0x26 };
|
||||
for(int i=6; i < COLORFUL_PACKET_LENGTH_V2 -2; i = i + 3)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*---------------------------------------------------------*\
|
||||
/*---------------------------------------------------------*\
|
||||
| ColorfulGPUControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Colorful GPU |
|
||||
@@ -52,7 +52,7 @@ REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Advanced OC 12G L-V", Detec
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_GA106_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_ADVANCED_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060TI_ADVANCED_OC, 0x61);
|
||||
@@ -76,8 +76,3 @@ REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4080 Ultra W OC-V", Detec
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4080 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4080_ULTRAW_OCV2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_ADVANCED_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_ADVANCED_OCV2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060_ULTRAW_OC, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070_ULTRAW_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070_ULTRAW_OCV2, 0x61);
|
||||
@@ -24,7 +24,7 @@ ColorfulTuringGPUController::~ColorfulTuringGPUController()
|
||||
|
||||
std::string ColorfulTuringGPUController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
std::string return_string(bus->device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
|
||||
@@ -17,7 +17,7 @@ DetectedControllers DetectColorfulTuringGPUControllers(i2c_smbus_interface* bus,
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
if(bus->info.port_id == 1)
|
||||
if(bus->port_id == 1)
|
||||
{
|
||||
ColorfulTuringGPUController* controller = new ColorfulTuringGPUController(bus, i2c_addr, name);
|
||||
RGBController_ColorfulTuringGPU* rgb_controller = new RGBController_ColorfulTuringGPU(controller);
|
||||
|
||||
+1
-2
@@ -406,8 +406,7 @@ void RGBController_CMARGBController::SetupZones()
|
||||
zones[channel_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
}
|
||||
|
||||
if(!(zones[channel_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
+2
-2
@@ -159,7 +159,7 @@ void RGBController_CMGD160Controller::SetupZones()
|
||||
{
|
||||
led l;
|
||||
l.name = "Front LED " + std::to_string(i + 1);
|
||||
|
||||
l.value = i;
|
||||
leds.push_back(l);
|
||||
}
|
||||
|
||||
@@ -175,7 +175,7 @@ void RGBController_CMGD160Controller::SetupZones()
|
||||
{
|
||||
led l;
|
||||
l.name = "Back LED " + std::to_string(i + 1);
|
||||
|
||||
l.value = i;
|
||||
leds.push_back(l);
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -146,10 +146,12 @@ void RGBController_CMMM711Controller::Init_Controller()
|
||||
|
||||
led wheel_led;
|
||||
wheel_led.name = "Scroll Wheel LED";
|
||||
wheel_led.value = 0;
|
||||
leds.push_back(wheel_led);
|
||||
|
||||
led logo_led;
|
||||
logo_led.name = "Logo LED";
|
||||
logo_led.value = 1;
|
||||
leds.push_back(logo_led);
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -139,6 +139,7 @@ void RGBController_CMMM712Controller::Init_Controller()
|
||||
|
||||
led logo_led;
|
||||
logo_led.name = "Logo LED";
|
||||
logo_led.value = 0;
|
||||
leds.push_back(logo_led);
|
||||
}
|
||||
|
||||
|
||||
@@ -183,24 +183,28 @@ void RGBController_CMMMController::Init_Controller()
|
||||
mouse_zone.leds_count = leds_count;
|
||||
zones.push_back(mouse_zone);
|
||||
|
||||
int value = 0;
|
||||
uint16_t pid = controller->GetProductID();
|
||||
|
||||
led wheel_led;
|
||||
wheel_led.name = "Scroll Wheel";
|
||||
|
||||
wheel_led.value = value;
|
||||
leds.push_back(wheel_led);
|
||||
|
||||
value++;
|
||||
|
||||
if(pid == 0x0065 || pid == 0x0097)
|
||||
{
|
||||
led buttons_led;
|
||||
buttons_led.name = "Buttons";
|
||||
|
||||
buttons_led.value = value;
|
||||
leds.push_back(buttons_led);
|
||||
value++;
|
||||
}
|
||||
|
||||
led logo_led;
|
||||
logo_led.name = "Logo";
|
||||
|
||||
logo_led.value = value;
|
||||
leds.push_back(logo_led);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -162,7 +162,7 @@ void RGBController_CMMonitorController::SetupZones()
|
||||
{
|
||||
led l;
|
||||
l.name = std::to_string(i + 1);
|
||||
|
||||
l.value = i;
|
||||
leds.push_back(l);
|
||||
}
|
||||
|
||||
|
||||
+1
@@ -169,6 +169,7 @@ void RGBController_CMR6000Controller::SetupZones()
|
||||
|
||||
led GP_led;
|
||||
GP_led.name = "Logo";
|
||||
GP_led.value = 0;
|
||||
leds.push_back(GP_led);
|
||||
|
||||
SetupColors();
|
||||
|
||||
+1
-2
@@ -217,8 +217,7 @@ void RGBController_CMSmallARGBController::SetupZones()
|
||||
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
}
|
||||
|
||||
if(!(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
@@ -111,8 +111,7 @@ void RGBController_CorsairCommanderCore::SetupZones()
|
||||
zones[0].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
}
|
||||
|
||||
if(!(zones[0].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
@@ -165,8 +164,7 @@ void RGBController_CorsairCommanderCore::SetupZones()
|
||||
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
}
|
||||
|
||||
if(!(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
@@ -1,422 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDRAMController.cpp |
|
||||
| |
|
||||
| Driver for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "CRC.h"
|
||||
#include "CorsairDRAMController.h"
|
||||
#include "LogManager.h"
|
||||
|
||||
#define CORSAIR_DRAM_NAME "Corsair DRAM"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
CorsairDRAMController::CorsairDRAMController(i2c_smbus_interface *bus, corsair_dev_id dev)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Initialize class variables |
|
||||
\*-----------------------------------------------------*/
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
device_index = 0;
|
||||
pid = 0;
|
||||
vid = 0;
|
||||
protocol_version = 0;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Read device information |
|
||||
\*-----------------------------------------------------*/
|
||||
ReadDeviceInfo();
|
||||
}
|
||||
|
||||
CorsairDRAMController::~CorsairDRAMController()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int CorsairDRAMController::GetLEDCount()
|
||||
{
|
||||
return(corsair_dram_device_list[device_index]->led_count);
|
||||
}
|
||||
|
||||
unsigned char CorsairDRAMController::GetProtocolVersion()
|
||||
{
|
||||
return(protocol_version);
|
||||
}
|
||||
|
||||
std::string CorsairDRAMController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
return_string.append(addr);
|
||||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string CorsairDRAMController::GetDeviceName()
|
||||
{
|
||||
return(corsair_dram_device_list[device_index]->name);
|
||||
}
|
||||
|
||||
std::string CorsairDRAMController::GetDeviceVersion()
|
||||
{
|
||||
return(firmware_version);
|
||||
}
|
||||
|
||||
void CorsairDRAMController::SetColorsPerLED(RGBColor* colors)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Get LED count from device list |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned int led_count = corsair_dram_device_list[device_index]->led_count;
|
||||
|
||||
if(direct_mode)
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Sanity check - Direct mode can only be used on |
|
||||
| protocol 4+ |
|
||||
\*-------------------------------------------------*/
|
||||
if(protocol_version < 4)
|
||||
{
|
||||
LOG_ERROR("[%s] Protocol version %d tried to use direct mode, ignoring", CORSAIR_DRAM_NAME, protocol_version);
|
||||
return;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Packet format: |
|
||||
| Size n is (LED count * 3) + 2 |
|
||||
| 0: Command byte (0x0A or 0x0C) |
|
||||
| 1 to (n-2): LED color data in R/G/B order |
|
||||
| (n-1): CRC8 of bytes 0 to (n-2) |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned int direct_packet_size = (led_count * 3) + 2;
|
||||
unsigned char* direct_packet = new unsigned char[direct_packet_size];
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| First byte in packet is LED count |
|
||||
\*-------------------------------------------------*/
|
||||
direct_packet[0] = led_count;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Fill in LED data |
|
||||
\*-------------------------------------------------*/
|
||||
for(unsigned int led_idx = 0; led_idx < led_count; led_idx++)
|
||||
{
|
||||
unsigned int color_index = led_idx;
|
||||
unsigned int offset = (led_idx * 3) + 1;
|
||||
|
||||
if(corsair_dram_device_list[device_index]->reverse)
|
||||
{
|
||||
color_index = (led_count -1) - led_idx;
|
||||
}
|
||||
|
||||
direct_packet[offset + 0] = RGBGetRValue(colors[color_index]);
|
||||
direct_packet[offset + 1] = RGBGetGValue(colors[color_index]);
|
||||
direct_packet[offset + 2] = RGBGetBValue(colors[color_index]);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Last byte in packet is CRC of all data up to it |
|
||||
\*-------------------------------------------------*/
|
||||
direct_packet[direct_packet_size - 1] = CRCPP::CRC::Calculate(direct_packet, (direct_packet_size - 1), CRCPP::CRC::CRC_8());
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Write using block writes, if packet exceeds 32 |
|
||||
| bytes, use a second block write to the second |
|
||||
| block write address for the remaining data |
|
||||
\*-------------------------------------------------*/
|
||||
bus->i2c_smbus_write_block_data(dev, CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_1, 32, direct_packet);
|
||||
|
||||
if(direct_packet_size > 32)
|
||||
{
|
||||
bus->i2c_smbus_write_block_data(dev, CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_2, direct_packet_size - 32, direct_packet + 32);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Remember to delete the data buffer |
|
||||
\*-------------------------------------------------*/
|
||||
delete[] direct_packet;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Local variables |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned char device_crc;
|
||||
unsigned char calc_crc;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Packet format: |
|
||||
| Size n is (LED count * 4) |
|
||||
| Format is 0xRR, 0xGG, 0xBB, 0xFF for each LED |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned int color_data_size = (led_count * 4);
|
||||
unsigned char* color_data_packet = new unsigned char[color_data_size];
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < led_count; led_idx++)
|
||||
{
|
||||
unsigned int color_index = led_idx;
|
||||
|
||||
if(corsair_dram_device_list[device_index]->reverse)
|
||||
{
|
||||
color_index = (led_count -1) - led_idx;
|
||||
}
|
||||
|
||||
color_data_packet[(led_idx * 4) + 0] = RGBGetRValue(colors[color_index]);
|
||||
color_data_packet[(led_idx * 4) + 1] = RGBGetGValue(colors[color_index]);
|
||||
color_data_packet[(led_idx * 4) + 2] = RGBGetBValue(colors[color_index]);
|
||||
color_data_packet[(led_idx * 4) + 3] = 0xFF;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Write LED color data packet |
|
||||
\*-------------------------------------------------*/
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_RESET_BUFFER, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_BINARY_START, 0x00);
|
||||
|
||||
for(unsigned int i = 0; i < color_data_size; i++)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_SET_BINARY_DATA, color_data_packet[i]);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Calculate CRC and read CRC reported by device |
|
||||
\*-------------------------------------------------*/
|
||||
calc_crc = CRCPP::CRC::Calculate(color_data_packet, color_data_size, CRCPP::CRC::CRC_8());
|
||||
device_crc = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_CHECKSUM);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Write effect configuration only if CRCs match |
|
||||
\*-------------------------------------------------*/
|
||||
if(calc_crc == device_crc)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_WRITE_CONFIGURATION, CORSAIR_DRAM_ID_COLOR_DATA);
|
||||
WaitReady();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Remember to delete the data buffer |
|
||||
\*-------------------------------------------------*/
|
||||
delete[] color_data_packet;
|
||||
}
|
||||
}
|
||||
|
||||
void CorsairDRAMController::SetDirect(bool direct)
|
||||
{
|
||||
direct_mode = direct;
|
||||
}
|
||||
|
||||
void CorsairDRAMController::SetEffect
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
bool random,
|
||||
unsigned char brightness,
|
||||
unsigned char red1,
|
||||
unsigned char grn1,
|
||||
unsigned char blu1,
|
||||
unsigned char red2,
|
||||
unsigned char grn2,
|
||||
unsigned char blu2
|
||||
)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Local variables |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned char effect_data[20];
|
||||
unsigned char device_crc;
|
||||
unsigned char calc_crc;
|
||||
unsigned char random_byte;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| If mode is direct (which is a dummy value not |
|
||||
| understood by the hardware), return. Direct mode is |
|
||||
| not set in the effect configuration. |
|
||||
\*-----------------------------------------------------*/
|
||||
direct_mode = (mode == CORSAIR_DRAM_MODE_DIRECT);
|
||||
|
||||
if(direct_mode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Determine random byte |
|
||||
\*-----------------------------------------------------*/
|
||||
if(random)
|
||||
{
|
||||
random_byte = CORSAIR_DRAM_EFFECT_RANDOM_COLORS;
|
||||
}
|
||||
else
|
||||
{
|
||||
random_byte = CORSAIR_DRAM_EFFECT_CUSTOM_COLORS;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Fill in effect packet |
|
||||
\*-----------------------------------------------------*/
|
||||
effect_data[0] = mode; // Mode
|
||||
effect_data[1] = speed; // Speed
|
||||
effect_data[2] = random_byte; // Custom color
|
||||
effect_data[3] = direction; // Direction
|
||||
effect_data[4] = red1; // Custom color 1 red
|
||||
effect_data[5] = grn1; // Custom color 1 green
|
||||
effect_data[6] = blu1; // Custom color 1 blue
|
||||
effect_data[7] = brightness;
|
||||
effect_data[8] = red2; // Custom color 2 red
|
||||
effect_data[9] = grn2; // Custom color 2 green
|
||||
effect_data[10] = blu2; // Custom color 2 blue
|
||||
effect_data[11] = brightness;
|
||||
effect_data[12] = 0x00;
|
||||
effect_data[13] = 0x00;
|
||||
effect_data[14] = 0x00;
|
||||
effect_data[15] = 0x00;
|
||||
effect_data[16] = 0x00;
|
||||
effect_data[17] = 0x00;
|
||||
effect_data[18] = 0x00;
|
||||
effect_data[19] = 0x00;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Write effect packet |
|
||||
\*-----------------------------------------------------*/
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_RESET_BUFFER, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_BINARY_START, 0x00);
|
||||
|
||||
for(unsigned int i = 0; i < 20; i++)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_SET_BINARY_DATA, effect_data[i]);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Calculate CRC and read CRC reported by device |
|
||||
\*-----------------------------------------------------*/
|
||||
calc_crc = CRCPP::CRC::Calculate(effect_data, sizeof(effect_data), CRCPP::CRC::CRC_8());
|
||||
device_crc = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_CHECKSUM);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Write effect configuration only if CRCs match |
|
||||
\*-----------------------------------------------------*/
|
||||
if(calc_crc == device_crc)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_WRITE_CONFIGURATION, CORSAIR_DRAM_ID_EFFECT_CONFIGURATION);
|
||||
WaitReady();
|
||||
}
|
||||
}
|
||||
|
||||
bool CorsairDRAMController::WaitReady()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Poll status register 0x30; bit 3 (0x08) = busy. |
|
||||
| Device is ready when bit 3 is clear. |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int retry = 0; retry < 5; retry++)
|
||||
{
|
||||
int status = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_STATUS);
|
||||
|
||||
if(status >= 0 && (status & 0x08) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(10ms);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CorsairDRAMController::ReadDeviceInfo()
|
||||
{
|
||||
unsigned char device_information_data[32];
|
||||
unsigned char device_crc;
|
||||
unsigned char calc_crc;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Request Device Information Data |
|
||||
\*-----------------------------------------------------*/
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_GET_DEVICE_INFO, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_BINARY_START, 0x00);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Read Device Information Data |
|
||||
\*-----------------------------------------------------*/
|
||||
for(unsigned int i = 0; i < 32; i++)
|
||||
{
|
||||
device_information_data[i] = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_BINARY_DATA);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Compare CRC |
|
||||
\*-----------------------------------------------------*/
|
||||
calc_crc = CRCPP::CRC::Calculate(device_information_data, sizeof(device_information_data), CRCPP::CRC::CRC_8());
|
||||
device_crc = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_CHECKSUM);
|
||||
|
||||
if(calc_crc != device_crc)
|
||||
{
|
||||
LOG_ERROR("[%s] ReadDeviceInfo CRC Mismatch", CORSAIR_DRAM_NAME);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Log Device Information Data |
|
||||
\*-----------------------------------------------------*/
|
||||
if(LogManager::get()->GetLogLevel() >= LL_TRACE)
|
||||
{
|
||||
char device_info_buf[256];
|
||||
unsigned int pos;
|
||||
|
||||
pos = snprintf(device_info_buf, sizeof(device_info_buf), "%02X: ", dev);
|
||||
|
||||
for(unsigned int i = 0; i < 32; i++)
|
||||
{
|
||||
pos += snprintf(&device_info_buf[pos], sizeof(device_info_buf) - pos, "%02X ", device_information_data[i]);
|
||||
}
|
||||
|
||||
LOG_TRACE("[%s] Device Info: %s", CORSAIR_DRAM_NAME, device_info_buf);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Read VID |
|
||||
\*-----------------------------------------------------*/
|
||||
vid = (device_information_data[1] << 8) | device_information_data[0];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Read PID |
|
||||
\*-----------------------------------------------------*/
|
||||
pid = (device_information_data[3] << 8) | device_information_data[2];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Format Firwmare Version |
|
||||
\*-----------------------------------------------------*/
|
||||
firmware_version = std::to_string(device_information_data[9]) + "." + std::to_string(device_information_data[8]) + "." + std::to_string((device_information_data[11] << 8) | device_information_data[10]);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Read Protocol Version |
|
||||
\*-----------------------------------------------------*/
|
||||
protocol_version = device_information_data[28];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Loop through all known devices to look for a PID |
|
||||
| match |
|
||||
\*-----------------------------------------------------*/
|
||||
for(unsigned int i = 0; i < CORSAIR_DRAM_NUM_DEVICES; i++)
|
||||
{
|
||||
for(unsigned int j = 0; j < CORSAIR_DRAM_MAX_PIDS; j++)
|
||||
{
|
||||
if(corsair_dram_device_list[i]->pids[j] == pid)
|
||||
{
|
||||
/*-----------------------------------------*\
|
||||
| Set device ID |
|
||||
\*-----------------------------------------*/
|
||||
device_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDRAMController.h |
|
||||
| |
|
||||
| Driver for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
#include "CorsairDRAMDevices.h"
|
||||
#include "RGBController.h"
|
||||
|
||||
typedef unsigned char corsair_dev_id;
|
||||
|
||||
enum
|
||||
{ /* (*) indicates deprecated registers no longer used by iCue */
|
||||
CORSAIR_DRAM_REG_RESET_BUFFER = 0x0B, /* Reset buffer by writing 0x00 */
|
||||
CORSAIR_DRAM_REG_SET_BINARY_DATA = 0x20, /* Write byte to active binary data buffer */
|
||||
CORSAIR_DRAM_REG_BINARY_START = 0x21, /* Start binary data transfer by writing 0x00 */
|
||||
CORSAIR_DRAM_REG_SWITCH_MODE = 0x23, /* Switch between Bootloader(0x00) and Normal(0x01) */
|
||||
CORSAIR_DRAM_REG_SET_BUFFER = 0x26, /* Select configuration buffer to write by ID (*) */
|
||||
CORSAIR_DRAM_REG_STATUS = 0x30, /* Status register */
|
||||
CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_1 = 0x31, /* Direct color buffer block register 1 */
|
||||
CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_2 = 0x32, /* Direct color buffer block register 2 */
|
||||
CORSAIR_DRAM_REG_GET_BINARY_DATA = 0x40, /* Read byte from active binary data buffer */
|
||||
CORSAIR_DRAM_REG_BUSY_STATUS = 0x41, /* Reads nonzero while busy, zero when ready(*) */
|
||||
CORSAIR_DRAM_REG_GET_CHECKSUM = 0x42, /* Get checksum (CRC8) of active binary data buffer */
|
||||
CORSAIR_DRAM_REG_GET_DEVICE_INFO = 0x61, /* Select device info buffer */
|
||||
CORSAIR_DRAM_REG_GET_CONFIGURATION = 0x63, /* Select configuration buffer to read by ID */
|
||||
CORSAIR_DRAM_REG_WRITE_CONFIGURATION = 0x82, /* Write/Apply configuration by writing buffer ID */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_ID_COMMAND_LIST = 0, /* Command list */
|
||||
CORSAIR_DRAM_ID_EFFECT_CONFIGURATION = 1, /* Effect configuration */
|
||||
CORSAIR_DRAM_ID_COLOR_DATA = 2, /* Color data */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_MODE_DIRECT = 0xDD, /* Arbitrary value to compare against later. Not the actual packet */
|
||||
CORSAIR_DRAM_MODE_COLOR_SHIFT = 0x00, /* Color Shift mode */
|
||||
CORSAIR_DRAM_MODE_COLOR_PULSE = 0x01, /* Color Pulse mode */
|
||||
CORSAIR_DRAM_MODE_RAINBOW_WAVE = 0x03, /* Rainbow Wave mode */
|
||||
CORSAIR_DRAM_MODE_COLOR_WAVE = 0x04, /* Color Wave mode */
|
||||
CORSAIR_DRAM_MODE_VISOR = 0x05, /* Visor mode */
|
||||
CORSAIR_DRAM_MODE_RAIN = 0x06, /* Rain mode */
|
||||
CORSAIR_DRAM_MODE_MARQUEE = 0x07, /* Marquee mode */
|
||||
CORSAIR_DRAM_MODE_RAINBOW = 0x08, /* Rainbow mode */
|
||||
CORSAIR_DRAM_MODE_SEQUENTIAL = 0x09, /* Sequential mode */
|
||||
CORSAIR_DRAM_MODE_STATIC = 0x10, /* Static mode */
|
||||
|
||||
CORSAIR_DRAM_NUMBER_MODES = 10, /* Number of Corsair Pro modes */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_SPEED_SLOW = 0x00, /* Slow speed */
|
||||
CORSAIR_DRAM_SPEED_MEDIUM = 0x01, /* Medium speed */
|
||||
CORSAIR_DRAM_SPEED_FAST = 0x02, /* Fast speed */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_EFFECT_RANDOM_COLORS = 0x00, /* Random colors */
|
||||
CORSAIR_DRAM_EFFECT_CUSTOM_COLORS = 0x01, /* Custom colors */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_DIRECTION_UP = 0x00, /* Up direction */
|
||||
CORSAIR_DRAM_DIRECTION_DOWN = 0x01, /* Down direction */
|
||||
CORSAIR_DRAM_DIRECTION_LEFT = 0x02, /* Left direction */
|
||||
CORSAIR_DRAM_DIRECTION_RIGHT = 0x03, /* Right direction */
|
||||
CORSAIR_DRAM_DIRECTION_VERTICAL = 0x01, /* Vertical direction */
|
||||
CORSAIR_DRAM_DIRECTION_HORIZONTAL = 0x03, /* Horizontal direction */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_BRIGHTNESS_MIN = 0, /* Minimum brightness */
|
||||
CORSAIR_DRAM_BRIGHTNESS_MAX = 255, /* Maximum brightness */
|
||||
CORSAIR_DRAM_BRIGHTNESS_DEFAULT = 255, /* Default brightness */
|
||||
};
|
||||
|
||||
class CorsairDRAMController
|
||||
{
|
||||
public:
|
||||
CorsairDRAMController(i2c_smbus_interface *bus, corsair_dev_id dev);
|
||||
~CorsairDRAMController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceVersion();
|
||||
|
||||
unsigned int GetLEDCount();
|
||||
unsigned char GetProtocolVersion();
|
||||
|
||||
void SetColorsPerLED(RGBColor* colors);
|
||||
void SetDirect(bool direct);
|
||||
void SetEffect(unsigned char mode,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
bool random,
|
||||
unsigned char brightness,
|
||||
unsigned char red1,
|
||||
unsigned char grn1,
|
||||
unsigned char blu1,
|
||||
unsigned char red2,
|
||||
unsigned char grn2,
|
||||
unsigned char blu2);
|
||||
|
||||
bool WaitReady();
|
||||
|
||||
private:
|
||||
/*-----------------------------------------------------*\
|
||||
| I2C |
|
||||
\*-----------------------------------------------------*/
|
||||
i2c_smbus_interface* bus;
|
||||
corsair_dev_id dev;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| State tracking |
|
||||
\*-----------------------------------------------------*/
|
||||
bool direct_mode;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Corsair DRAM information |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned short vid;
|
||||
unsigned short pid;
|
||||
std::string firmware_version;
|
||||
unsigned char protocol_version;
|
||||
|
||||
unsigned int device_index;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Private functions |
|
||||
\*-----------------------------------------------------*/
|
||||
void ReadDeviceInfo();
|
||||
};
|
||||
@@ -1,96 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDRAMControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <vector>
|
||||
#include "CorsairDRAMController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "LogManager.h"
|
||||
#include "pci_ids.h"
|
||||
#include "RGBController_CorsairDRAM.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
#define CORSAIR_DRAM_NAME "Corsair DRAM"
|
||||
|
||||
bool TestForCorsairDRAMController(i2c_smbus_interface *bus, unsigned char address)
|
||||
{
|
||||
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
|
||||
|
||||
LOG_DEBUG("[%s] Trying address %02X", CORSAIR_DRAM_NAME, address);
|
||||
|
||||
if(res < 0)
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: res was %04X", CORSAIR_DRAM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x43);
|
||||
|
||||
if(!(res == 0x1A || res == 0x1B || res == 0x1C))
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: expected 0x1A, 0x1B, or 0x1C, got %04X", CORSAIR_DRAM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x44);
|
||||
|
||||
if(!(res == 0x01 || res == 0x03 || res == 0x04))
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: expected 0x01, 0x03, or 0x04, got %04X", CORSAIR_DRAM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DetectedControllers DetectCorsairDRAMControllers(std::vector<i2c_smbus_interface *> &buses)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
for(unsigned int bus = 0; bus < buses.size(); bus++)
|
||||
{
|
||||
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
|
||||
{
|
||||
LOG_DEBUG("[%s] Testing bus %d", CORSAIR_DRAM_NAME, bus);
|
||||
|
||||
std::vector<unsigned char> addresses;
|
||||
|
||||
for(unsigned char addr = 0x58; addr <= 0x5F; addr++)
|
||||
{
|
||||
addresses.push_back(addr);
|
||||
}
|
||||
|
||||
for(unsigned char addr = 0x18; addr <= 0x1F; addr++)
|
||||
{
|
||||
addresses.push_back(addr);
|
||||
}
|
||||
|
||||
for(unsigned char addr : addresses)
|
||||
{
|
||||
if(TestForCorsairDRAMController(buses[bus], addr))
|
||||
{
|
||||
CorsairDRAMController* controller = new CorsairDRAMController(buses[bus], addr);
|
||||
RGBController_CorsairDRAM* rgb_controller = new RGBController_CorsairDRAM(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(10ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_DETECTOR(CORSAIR_DRAM_NAME, DetectCorsairDRAMControllers);
|
||||
@@ -1,163 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDRAMDevices.cpp |
|
||||
| |
|
||||
| Device list for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 07 Apr 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "CorsairDRAMDevices.h"
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_pro_ddr4_device =
|
||||
{
|
||||
"Corsair Vengeance RGB Pro DDR4",
|
||||
{
|
||||
CORSAIR_VENGEANCE_PRO_DDR4_PID_1,
|
||||
CORSAIR_VENGEANCE_PRO_DDR4_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
10,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_dominator_platinum_ddr4_device =
|
||||
{
|
||||
"Corsair Dominator Platinum RGB DDR4",
|
||||
{
|
||||
CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_1,
|
||||
CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
12,
|
||||
true
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_pro_sl_ddr4_device =
|
||||
{
|
||||
"Corsair Vengeance RGB Pro SL DDR4",
|
||||
{
|
||||
CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_1,
|
||||
CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
10,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_rs_ddr4_device =
|
||||
{
|
||||
"Corsair Vengeance RGB RS DDR4",
|
||||
{
|
||||
CORSAIR_VENGEANCE_RS_DDR4_PID_1,
|
||||
CORSAIR_VENGEANCE_RS_DDR4_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
6,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_dominator_platinum_ddr5_device =
|
||||
{
|
||||
"Corsair Dominator Platinum RGB DDR5",
|
||||
{
|
||||
CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_1,
|
||||
CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
12,
|
||||
true
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_dominator_titanium_ddr5_device =
|
||||
{
|
||||
"Corsair Dominator Titanium RGB DDR5",
|
||||
{
|
||||
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_1,
|
||||
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_2,
|
||||
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_3,
|
||||
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_4,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
12,
|
||||
true
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_ddr5_device =
|
||||
{
|
||||
"Corsair Vengeance RGB DDR5",
|
||||
{
|
||||
CORSAIR_VENGEANCE_DDR5_PID_1,
|
||||
CORSAIR_VENGEANCE_DDR5_PID_2,
|
||||
CORSAIR_VENGEANCE_DDR5_PID_3,
|
||||
CORSAIR_VENGEANCE_DDR5_PID_4,
|
||||
CORSAIR_VENGEANCE_DDR5_PID_5,
|
||||
CORSAIR_VENGEANCE_DDR5_PID_6,
|
||||
},
|
||||
10,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_shugo_series_ddr5_device =
|
||||
{
|
||||
"Corsair Vengeance Shugo Series DDR5",
|
||||
{
|
||||
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_1,
|
||||
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_2,
|
||||
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_3,
|
||||
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_4,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
10,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_rs_ddr5_device =
|
||||
{
|
||||
"Corsair Vengeance RGB RS DDR5",
|
||||
{
|
||||
CORSAIR_VENGEANCE_RS_DDR5_PID_1,
|
||||
CORSAIR_VENGEANCE_RS_DDR5_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
6,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device* device_list[] =
|
||||
{
|
||||
&corsair_vengeance_pro_ddr4_device,
|
||||
&corsair_dominator_platinum_ddr4_device,
|
||||
&corsair_vengeance_pro_sl_ddr4_device,
|
||||
&corsair_vengeance_rs_ddr4_device,
|
||||
&corsair_dominator_platinum_ddr5_device,
|
||||
&corsair_dominator_titanium_ddr5_device,
|
||||
&corsair_vengeance_ddr5_device,
|
||||
&corsair_vengeance_shugo_series_ddr5_device,
|
||||
&corsair_vengeance_rs_ddr5_device,
|
||||
};
|
||||
|
||||
const unsigned int CORSAIR_DRAM_NUM_DEVICES = (sizeof(device_list) / sizeof(device_list[ 0 ]));
|
||||
const corsair_dram_device** corsair_dram_device_list = device_list;
|
||||
@@ -1,68 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDRAMDevices.h |
|
||||
| |
|
||||
| Device list for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 07 Apr 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Maximum number of PIDs for a given DRAM model |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CORSAIR_DRAM_MAX_PIDS 6
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Corsair DRAM vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CORSAIR_DRAM_VID 0x1B1C
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Corsair DRAM product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CORSAIR_VENGEANCE_PRO_DDR4_PID_1 0x0100
|
||||
#define CORSAIR_VENGEANCE_PRO_DDR4_PID_2 0x0101
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_1 0x0200
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_2 0x0201
|
||||
#define CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_1 0x0300
|
||||
#define CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_2 0x0301
|
||||
#define CORSAIR_VENGEANCE_RS_DDR4_PID_1 0x0400
|
||||
#define CORSAIR_VENGEANCE_RS_DDR4_PID_2 0x0401
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_1 0x0600
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_2 0x0601
|
||||
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_1 0x0800
|
||||
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_2 0x0801
|
||||
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_3 0x0810
|
||||
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_4 0x0811
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_1 0x0700
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_2 0x0701
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_3 0x0900
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_4 0x0901
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_5 0x0910
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_6 0x0911
|
||||
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_1 0x0A00
|
||||
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_2 0x0A01
|
||||
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_3 0x0A10
|
||||
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_4 0x0A11
|
||||
#define CORSAIR_VENGEANCE_RS_DDR5_PID_1 0x0B00
|
||||
#define CORSAIR_VENGEANCE_RS_DDR5_PID_2 0x0B01
|
||||
|
||||
typedef struct
|
||||
{
|
||||
std::string name;
|
||||
unsigned short pids[CORSAIR_DRAM_MAX_PIDS];
|
||||
unsigned int led_count;
|
||||
bool reverse;
|
||||
} corsair_dram_device;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| These constant values are defined in RazerDevices.cpp |
|
||||
\*-----------------------------------------------------*/
|
||||
extern const unsigned int CORSAIR_DRAM_NUM_DEVICES;
|
||||
extern const corsair_dram_device** corsair_dram_device_list;
|
||||
@@ -1,324 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_CorsairDRAM.cpp |
|
||||
| |
|
||||
| RGBController for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_CorsairDRAM.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Corsair DRAM
|
||||
@category RAM
|
||||
@type SMBus
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :x:
|
||||
@detectors DetectCorsairDRAMControllers
|
||||
@comment
|
||||
The Corsair DRAM RGB controller chip can be found on several
|
||||
Corsair memory sticks which have different LED counts. This can be controlled
|
||||
by editing the Part Number in OpenRGB.json with values in the below table.
|
||||
|
||||
| Part Number | LED Count |
|
||||
| :---------: | --------: |
|
||||
| CMG | 6 |
|
||||
| CMH | 10 |
|
||||
| CMN | 10 |
|
||||
| CMT | 12 |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_CorsairDRAM::RGBController_CorsairDRAM(CorsairDRAMController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Corsair";
|
||||
type = DEVICE_TYPE_DRAM;
|
||||
description = "Corsair DRAM RGB Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
version = controller->GetDeviceVersion();
|
||||
|
||||
if(controller->GetProtocolVersion() >= 4)
|
||||
{
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = CORSAIR_DRAM_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
}
|
||||
|
||||
mode Custom;
|
||||
Custom.name = "Custom";
|
||||
Custom.value = CORSAIR_DRAM_MODE_STATIC;
|
||||
Custom.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Custom.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Custom);
|
||||
|
||||
mode ColorShift;
|
||||
ColorShift.name = "Color Shift";
|
||||
ColorShift.value = CORSAIR_DRAM_MODE_COLOR_SHIFT;
|
||||
ColorShift.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
ColorShift.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ColorShift.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorShift.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
ColorShift.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorShift.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
ColorShift.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
ColorShift.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
ColorShift.colors_min = 2;
|
||||
ColorShift.colors_max = 2;
|
||||
ColorShift.colors.resize(2);
|
||||
modes.push_back(ColorShift);
|
||||
|
||||
mode ColorPulse;
|
||||
ColorPulse.name = "Color Pulse";
|
||||
ColorPulse.value = CORSAIR_DRAM_MODE_COLOR_PULSE;
|
||||
ColorPulse.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
ColorPulse.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ColorPulse.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorPulse.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
ColorPulse.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorPulse.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
ColorPulse.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
ColorPulse.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
ColorPulse.colors_min = 2;
|
||||
ColorPulse.colors_max = 2;
|
||||
ColorPulse.colors.resize(2);
|
||||
modes.push_back(ColorPulse);
|
||||
|
||||
mode RainbowWave;
|
||||
RainbowWave.name = "Rainbow Wave";
|
||||
RainbowWave.value = CORSAIR_DRAM_MODE_RAINBOW_WAVE;
|
||||
RainbowWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
RainbowWave.color_mode = MODE_COLORS_NONE;
|
||||
RainbowWave.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
RainbowWave.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
RainbowWave.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
RainbowWave.direction = MODE_DIRECTION_DOWN;
|
||||
modes.push_back(RainbowWave);
|
||||
|
||||
mode ColorWave;
|
||||
ColorWave.name = "Color Wave";
|
||||
ColorWave.value = CORSAIR_DRAM_MODE_COLOR_WAVE;
|
||||
ColorWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
ColorWave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ColorWave.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorWave.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
ColorWave.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorWave.direction = MODE_DIRECTION_DOWN;
|
||||
ColorWave.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
ColorWave.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
ColorWave.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
ColorWave.colors_min = 2;
|
||||
ColorWave.colors_max = 2;
|
||||
ColorWave.colors.resize(2);
|
||||
modes.push_back(ColorWave);
|
||||
|
||||
mode Visor;
|
||||
Visor.name = "Visor";
|
||||
Visor.value = CORSAIR_DRAM_MODE_VISOR;
|
||||
Visor.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_HV | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Visor.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Visor.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Visor.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
Visor.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Visor.direction = MODE_DIRECTION_VERTICAL;
|
||||
Visor.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
Visor.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
Visor.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
Visor.colors_min = 2;
|
||||
Visor.colors_max = 2;
|
||||
Visor.colors.resize(2);
|
||||
modes.push_back(Visor);
|
||||
|
||||
mode Rain;
|
||||
Rain.name = "Rain";
|
||||
Rain.value = CORSAIR_DRAM_MODE_RAIN;
|
||||
Rain.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Rain.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Rain.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Rain.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
Rain.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Rain.direction = MODE_DIRECTION_DOWN;
|
||||
Rain.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
Rain.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
Rain.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
Rain.colors_min = 2;
|
||||
Rain.colors_max = 2;
|
||||
Rain.colors.resize(2);
|
||||
modes.push_back(Rain);
|
||||
|
||||
mode Marquee;
|
||||
Marquee.name = "Marquee";
|
||||
Marquee.value = CORSAIR_DRAM_MODE_MARQUEE;
|
||||
Marquee.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Marquee.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Marquee.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Marquee.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
Marquee.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Marquee.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
Marquee.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
Marquee.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
Marquee.colors_min = 1;
|
||||
Marquee.colors_max = 1;
|
||||
Marquee.colors.resize(1);
|
||||
modes.push_back(Marquee);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = CORSAIR_DRAM_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
Rainbow.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Rainbow.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
Rainbow.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
mode Sequential;
|
||||
Sequential.name = "Sequential";
|
||||
Sequential.value = CORSAIR_DRAM_MODE_SEQUENTIAL;
|
||||
Sequential.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Sequential.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Sequential.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Sequential.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
Sequential.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Sequential.direction = MODE_DIRECTION_DOWN;
|
||||
Sequential.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
Sequential.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
Sequential.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
Sequential.colors_min = 1;
|
||||
Sequential.colors_max = 1;
|
||||
Sequential.colors.resize(1);
|
||||
modes.push_back(Sequential);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_CorsairDRAM::~RGBController_CorsairDRAM()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_CorsairDRAM::SetupZones()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up zone |
|
||||
\*-----------------------------------------------------*/
|
||||
zone new_zone;
|
||||
new_zone.name = "Corsair DRAM";
|
||||
new_zone.type = ZONE_TYPE_LINEAR;
|
||||
new_zone.leds_min = controller->GetLEDCount();
|
||||
new_zone.leds_max = controller->GetLEDCount();
|
||||
new_zone.leds_count = controller->GetLEDCount();
|
||||
zones.push_back(new_zone);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up LEDs |
|
||||
\*-----------------------------------------------------*/
|
||||
for(std::size_t led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = "Corsair DRAM LED ";
|
||||
new_led.name.append(std::to_string(led_idx));
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDRAM::DeviceUpdateLEDs()
|
||||
{
|
||||
controller->SetColorsPerLED(colors.data());
|
||||
}
|
||||
|
||||
void RGBController_CorsairDRAM::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDRAM::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDRAM::DeviceUpdateMode()
|
||||
{
|
||||
unsigned int corsair_direction = 0;
|
||||
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
|
||||
unsigned char mode_colors[6];
|
||||
|
||||
switch(modes[active_mode].direction)
|
||||
{
|
||||
case MODE_DIRECTION_LEFT:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_LEFT;
|
||||
break;
|
||||
case MODE_DIRECTION_RIGHT:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_RIGHT;
|
||||
break;
|
||||
case MODE_DIRECTION_UP:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_UP;
|
||||
break;
|
||||
case MODE_DIRECTION_DOWN:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_DOWN;
|
||||
break;
|
||||
case MODE_DIRECTION_HORIZONTAL:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_HORIZONTAL;
|
||||
break;
|
||||
case MODE_DIRECTION_VERTICAL:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_VERTICAL;
|
||||
break;
|
||||
}
|
||||
|
||||
mode_colors[0] = 0;
|
||||
mode_colors[1] = 0;
|
||||
mode_colors[2] = 0;
|
||||
mode_colors[3] = 0;
|
||||
mode_colors[4] = 0;
|
||||
mode_colors[5] = 0;
|
||||
|
||||
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
||||
{
|
||||
mode_colors[0] = RGBGetRValue(modes[active_mode].colors[0]);
|
||||
mode_colors[1] = RGBGetGValue(modes[active_mode].colors[0]);
|
||||
mode_colors[2] = RGBGetBValue(modes[active_mode].colors[0]);
|
||||
|
||||
if(modes[active_mode].colors.size() == 2)
|
||||
{
|
||||
mode_colors[3] = RGBGetRValue(modes[active_mode].colors[1]);
|
||||
mode_colors[4] = RGBGetGValue(modes[active_mode].colors[1]);
|
||||
mode_colors[5] = RGBGetBValue(modes[active_mode].colors[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if(modes[active_mode].name == "Direct")
|
||||
{
|
||||
controller->SetDirect(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
controller->SetDirect(false);
|
||||
}
|
||||
|
||||
controller->SetEffect(modes[active_mode].value,
|
||||
modes[active_mode].speed,
|
||||
corsair_direction,
|
||||
random,
|
||||
(unsigned char)modes[active_mode].brightness,
|
||||
mode_colors[0],
|
||||
mode_colors[1],
|
||||
mode_colors[2],
|
||||
mode_colors[3],
|
||||
mode_colors[4],
|
||||
mode_colors[5]);
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(15));
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDominatorPlatinumController.cpp |
|
||||
| |
|
||||
| Driver for Corsair Dominator Platinum RAM |
|
||||
| |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include <chrono>
|
||||
#include "CorsairDominatorPlatinumController.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
CorsairDominatorPlatinumController::CorsairDominatorPlatinumController(i2c_smbus_interface *bus, corsair_dev_id dev, unsigned int leds_count, std::string dev_name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->leds_count = leds_count;
|
||||
this->name = dev_name;
|
||||
|
||||
led_data[0] = 0xc;
|
||||
}
|
||||
|
||||
CorsairDominatorPlatinumController::~CorsairDominatorPlatinumController()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int CorsairDominatorPlatinumController::GetLEDCount()
|
||||
{
|
||||
return leds_count;
|
||||
}
|
||||
|
||||
std::string CorsairDominatorPlatinumController::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("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string CorsairDominatorPlatinumController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
void CorsairDominatorPlatinumController::SetAllColors
|
||||
(
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
)
|
||||
{
|
||||
for(unsigned int led = 0; led < leds_count; led++)
|
||||
{
|
||||
SetLEDColor(led, red, green, blue);
|
||||
}
|
||||
}
|
||||
|
||||
void CorsairDominatorPlatinumController::SetLEDColor
|
||||
(
|
||||
unsigned int led,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
)
|
||||
{
|
||||
if(led >= leds_count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int offset = (led * 3) + 1;
|
||||
led_data[offset] = red;
|
||||
led_data[offset + 1] = green;
|
||||
led_data[offset + 2] = blue;
|
||||
}
|
||||
|
||||
unsigned char CorsairDominatorPlatinumController::crc8
|
||||
(
|
||||
unsigned char init,
|
||||
unsigned char poly,
|
||||
unsigned char* data,
|
||||
unsigned char len
|
||||
)
|
||||
{
|
||||
unsigned char crc = init;
|
||||
|
||||
for(unsigned int i = 0; i < len; i++)
|
||||
{
|
||||
unsigned char val = data[i];
|
||||
for(unsigned char mask = 0x80; mask != 0; mask >>= 1)
|
||||
{
|
||||
unsigned char bit;
|
||||
if ((val & mask) != 0)
|
||||
{
|
||||
bit = (crc & 0x80) ^ 0x80;
|
||||
}
|
||||
else
|
||||
{
|
||||
bit = crc & 0x80;
|
||||
}
|
||||
|
||||
if (bit == 0)
|
||||
{
|
||||
crc <<= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
crc = (crc << 1) ^ poly;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
void CorsairDominatorPlatinumController::ApplyColors()
|
||||
{
|
||||
unsigned char data[sizeof(led_data)];
|
||||
memcpy(data, led_data, sizeof(led_data));
|
||||
unsigned char crc = crc8(0x0, 0x7, data, sizeof(data) - 1);
|
||||
data[sizeof(data) - 1] = crc;
|
||||
|
||||
bus->i2c_smbus_write_block_data(dev, 0x31, 0x20, data);
|
||||
std::this_thread::sleep_for(800us);
|
||||
bus->i2c_smbus_write_block_data(dev, 0x32, sizeof(data) - 0x20, data + 0x20);
|
||||
std::this_thread::sleep_for(200us);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDominatorPlatinumController.h |
|
||||
| |
|
||||
| Driver for Corsair Dominator Platinum RAM |
|
||||
| |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_DATA_SIZE 38
|
||||
|
||||
typedef unsigned char corsair_dev_id;
|
||||
|
||||
class CorsairDominatorPlatinumController
|
||||
{
|
||||
public:
|
||||
CorsairDominatorPlatinumController(i2c_smbus_interface *bus, corsair_dev_id dev, unsigned int leds_count, std::string dev_name);
|
||||
~CorsairDominatorPlatinumController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
unsigned int GetLEDCount();
|
||||
|
||||
void SetAllColors(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void ApplyColors();
|
||||
bool WaitReady();
|
||||
|
||||
private:
|
||||
unsigned char led_data[CORSAIR_DOMINATOR_PLATINUM_DATA_SIZE];
|
||||
i2c_smbus_interface* bus;
|
||||
corsair_dev_id dev;
|
||||
unsigned int leds_count;
|
||||
std::string name;
|
||||
|
||||
static unsigned char crc8(unsigned char init, unsigned char poly, unsigned char *data, unsigned char len);
|
||||
};
|
||||
+168
@@ -0,0 +1,168 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDominatorPlatinumControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Corsair Dominator Platinum RAM |
|
||||
| |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <vector>
|
||||
#include "CorsairDominatorPlatinumController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "LogManager.h"
|
||||
#include "pci_ids.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "RGBController_CorsairDominatorPlatinum.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
json corsair_dominator_models =
|
||||
{
|
||||
{
|
||||
"CMT",
|
||||
{
|
||||
{"name", "Corsair Dominator Platinum"},
|
||||
{"leds", 12}
|
||||
}
|
||||
},
|
||||
{
|
||||
"CMH",
|
||||
{
|
||||
{"name", "Corsair Vengeance Pro SL"},
|
||||
{"leds", 10}
|
||||
}
|
||||
},
|
||||
{
|
||||
"CMN",
|
||||
{
|
||||
{"name", "Corsair Vengeance RGB RT"},
|
||||
{"leds", 10}
|
||||
}
|
||||
},
|
||||
{
|
||||
"CMG",
|
||||
{
|
||||
{"name", "Corsair Vengeance RGB RS"},
|
||||
{"leds", 6}
|
||||
}
|
||||
},
|
||||
{
|
||||
"CMP",
|
||||
{
|
||||
{"name", "Corsair Dominator Titanium"},
|
||||
{"leds", 11}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_NAME "Corsair Dominator Platinum"
|
||||
|
||||
bool TestForCorsairDominatorPlatinumController(i2c_smbus_interface *bus, unsigned char address)
|
||||
{
|
||||
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
|
||||
|
||||
LOG_DEBUG("[%s] Trying address %02X", CORSAIR_DOMINATOR_PLATINUM_NAME, address);
|
||||
|
||||
if(res < 0)
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: res was %04X", CORSAIR_DOMINATOR_PLATINUM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x43);
|
||||
|
||||
if(!(res == 0x1A || res == 0x1B))
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: expected 0x1a or 0x1b, got %04X", CORSAIR_DOMINATOR_PLATINUM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x44);
|
||||
|
||||
if(res != 0x04)
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: expected 0x04, got %04X", CORSAIR_DOMINATOR_PLATINUM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DetectedControllers DetectCorsairDominatorPlatinumControllers(std::vector<i2c_smbus_interface *> &busses)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
SettingsManager* settings_manager = ResourceManager::get()->GetSettingsManager();
|
||||
json corsair_dominator_settings = settings_manager->GetSettings("CorsairDominatorSettings");
|
||||
|
||||
if(!corsair_dominator_settings.contains("model"))
|
||||
{
|
||||
// Set default value
|
||||
corsair_dominator_settings["model"] = "CMT";
|
||||
settings_manager->SetSettings("CorsairDominatorSettings", corsair_dominator_settings);
|
||||
settings_manager->SaveSettings();
|
||||
}
|
||||
|
||||
std::string model = corsair_dominator_settings["model"];
|
||||
|
||||
for(unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
{
|
||||
IF_DRAM_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
|
||||
{
|
||||
LOG_DEBUG("[%s] Testing bus %d", CORSAIR_DOMINATOR_PLATINUM_NAME, bus);
|
||||
|
||||
std::vector<unsigned char> addresses;
|
||||
|
||||
for(unsigned char addr = 0x58; addr <= 0x5F; addr++)
|
||||
{
|
||||
addresses.push_back(addr);
|
||||
}
|
||||
|
||||
for(unsigned char addr = 0x18; addr <= 0x1F; addr++)
|
||||
{
|
||||
addresses.push_back(addr);
|
||||
}
|
||||
|
||||
for(unsigned char addr : addresses)
|
||||
{
|
||||
if(TestForCorsairDominatorPlatinumController(busses[bus], addr))
|
||||
{
|
||||
unsigned int leds;
|
||||
std::string name;
|
||||
|
||||
if(corsair_dominator_models.contains(model))
|
||||
{
|
||||
leds = corsair_dominator_models[model]["leds"];
|
||||
name = corsair_dominator_models[model]["name"];
|
||||
}
|
||||
else
|
||||
{
|
||||
leds = corsair_dominator_models["CMT"]["leds"];
|
||||
name = corsair_dominator_models["CMT"]["name"];
|
||||
}
|
||||
|
||||
LOG_DEBUG("[%s] Model: %s, Leds: %d", CORSAIR_DOMINATOR_PLATINUM_NAME, name.c_str(), leds);
|
||||
|
||||
CorsairDominatorPlatinumController* controller = new CorsairDominatorPlatinumController(busses[bus], addr, leds, name);
|
||||
RGBController_CorsairDominatorPlatinum* rgb_controller = new RGBController_CorsairDominatorPlatinum(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(10ms);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("[%s] Bus %d is not a DRAM bus", CORSAIR_DOMINATOR_PLATINUM_NAME, bus);
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_DETECTOR(CORSAIR_DOMINATOR_PLATINUM_NAME, DetectCorsairDominatorPlatinumControllers);
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_CorsairDominatorPlatinum.cpp |
|
||||
| |
|
||||
| RGBController for Corsair Dominator Platinum RAM |
|
||||
| |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_CorsairDominatorPlatinum.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Corsair Dominator Platinum
|
||||
@category RAM
|
||||
@type SMBus
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :x:
|
||||
@detectors DetectCorsairDominatorPlatinumControllers
|
||||
@comment
|
||||
The Corsair Dominator controller chip can be found on several
|
||||
Corsair memory sticks which have different LED counts. This can be controlled
|
||||
by editing the Part Number in OpenRGB.json with values in the below table.
|
||||
|
||||
| Part Number | LED Count |
|
||||
| :---------: | --------: |
|
||||
| CMG | 6 |
|
||||
| CMH | 10 |
|
||||
| CMN | 10 |
|
||||
| CMT | 12 |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_CorsairDominatorPlatinum::RGBController_CorsairDominatorPlatinum(CorsairDominatorPlatinumController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Corsair";
|
||||
type = DEVICE_TYPE_DRAM;
|
||||
description = "Corsair RAM RGB Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.speed_min = 0;
|
||||
Direct.speed_max = 0;
|
||||
Direct.speed = 0;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
|
||||
active_mode = 0;
|
||||
}
|
||||
|
||||
RGBController_CorsairDominatorPlatinum::~RGBController_CorsairDominatorPlatinum()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_CorsairDominatorPlatinum::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up zone |
|
||||
\*---------------------------------------------------------*/
|
||||
zone new_zone;
|
||||
new_zone.name = "Corsair RAM Zone";
|
||||
new_zone.type = ZONE_TYPE_LINEAR;
|
||||
new_zone.leds_min = controller->GetLEDCount();
|
||||
new_zone.leds_max = controller->GetLEDCount();
|
||||
new_zone.leds_count = controller->GetLEDCount();
|
||||
zones.push_back(new_zone);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up LEDs |
|
||||
\*---------------------------------------------------------*/
|
||||
for(std::size_t led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = "Corsair RAM LED ";
|
||||
new_led.name.append(std::to_string(led_idx));
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDominatorPlatinum::DeviceUpdateLEDs()
|
||||
{
|
||||
for(unsigned int led = 0; led < (unsigned int)colors.size(); led++)
|
||||
{
|
||||
RGBColor color = colors[led];
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
controller->SetLEDColor(led, red, grn, blu);
|
||||
}
|
||||
|
||||
controller->ApplyColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDominatorPlatinum::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDominatorPlatinum::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
RGBColor color = colors[led];
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
controller->SetLEDColor(led, red, grn, blu);
|
||||
controller->ApplyColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDominatorPlatinum::DeviceUpdateMode()
|
||||
{
|
||||
|
||||
}
|
||||
+7
-8
@@ -1,9 +1,8 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_CorsairDRAM.h |
|
||||
| RGBController_CorsairDominatorPlatinum.h |
|
||||
| |
|
||||
| RGBController for Corsair DRAM RGB controllers |
|
||||
| RGBController for Corsair Dominator Platinum RAM |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
@@ -13,13 +12,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "CorsairDRAMController.h"
|
||||
#include "CorsairDominatorPlatinumController.h"
|
||||
|
||||
class RGBController_CorsairDRAM : public RGBController
|
||||
class RGBController_CorsairDominatorPlatinum : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_CorsairDRAM(CorsairDRAMController* controller_ptr);
|
||||
~RGBController_CorsairDRAM();
|
||||
RGBController_CorsairDominatorPlatinum(CorsairDominatorPlatinumController* controller_ptr);
|
||||
~RGBController_CorsairDominatorPlatinum();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
@@ -30,5 +29,5 @@ public:
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
CorsairDRAMController* controller;
|
||||
CorsairDominatorPlatinumController* controller;
|
||||
};
|
||||
@@ -110,8 +110,7 @@ void RGBController_CorsairHydroPlatinum::SetupZones()
|
||||
zones[1].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
}
|
||||
|
||||
if(!(zones[1].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
@@ -332,8 +332,7 @@ void RGBController_CorsairLightingNode::SetupZones()
|
||||
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
}
|
||||
|
||||
if(!(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
@@ -152,8 +152,8 @@ void RGBController_CorsairV2HW::SetupZones()
|
||||
led new_led;
|
||||
|
||||
new_led.name = new_kb.GetKeyNameAt(led_idx);
|
||||
led_values.push_back(new_kb.GetKeyValueAt(led_idx));
|
||||
max_led_value = std::max(max_led_value, led_values.back());
|
||||
new_led.value = new_kb.GetKeyValueAt(led_idx);
|
||||
max_led_value = std::max(max_led_value, new_led.value);
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
}
|
||||
@@ -176,7 +176,7 @@ void RGBController_CorsairV2HW::SetupZones()
|
||||
|
||||
new_led.name = new_zone.name + " ";
|
||||
new_led.name.append(std::to_string( led_idx ));
|
||||
led_values.push_back((unsigned int)leds.size());
|
||||
new_led.value = (unsigned int)leds.size();
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
@@ -209,7 +209,7 @@ void RGBController_CorsairV2HW::SetupZones()
|
||||
|
||||
for(size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
buffer_map[led_values[led_idx]] = &colors[led_idx];
|
||||
buffer_map[leds[led_idx].value] = &colors[led_idx];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ public:
|
||||
private:
|
||||
CorsairPeripheralV2Controller* controller;
|
||||
|
||||
std::vector<unsigned int> led_values;
|
||||
RGBColor null_color = 0;
|
||||
std::vector<RGBColor *> buffer_map;
|
||||
|
||||
|
||||
@@ -139,8 +139,8 @@ void RGBController_CorsairV2SW::SetupZones()
|
||||
led new_led;
|
||||
|
||||
new_led.name = new_kb.GetKeyNameAt(led_idx);
|
||||
led_values.push_back(new_kb.GetKeyValueAt(led_idx));
|
||||
max_led_value = std::max(max_led_value, led_values.back());
|
||||
new_led.value = new_kb.GetKeyValueAt(led_idx);
|
||||
max_led_value = std::max(max_led_value, new_led.value);
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
}
|
||||
@@ -163,7 +163,7 @@ void RGBController_CorsairV2SW::SetupZones()
|
||||
|
||||
new_led.name = new_zone.name + " ";
|
||||
new_led.name.append(std::to_string( led_idx ));
|
||||
led_values.push_back((unsigned int)leds.size());
|
||||
new_led.value = (unsigned int)leds.size();
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
@@ -196,7 +196,7 @@ void RGBController_CorsairV2SW::SetupZones()
|
||||
|
||||
for(size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
buffer_map[led_values[led_idx]] = &colors[led_idx];
|
||||
buffer_map[leds[led_idx].value] = &colors[led_idx];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ public:
|
||||
private:
|
||||
CorsairPeripheralV2Controller* controller;
|
||||
|
||||
std::vector<unsigned int> led_values;
|
||||
RGBColor null_color = 0;
|
||||
std::vector<RGBColor *> buffer_map;
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ std::string CorsairVengeanceController::GetDeviceName()
|
||||
|
||||
std::string CorsairVengeanceController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
std::string return_string(bus->device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairVengeanceProController.cpp |
|
||||
| |
|
||||
| Driver for Corsair Vengeance Pro RGB RAM |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include <chrono>
|
||||
#include "CorsairVengeanceProController.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
CorsairVengeanceProController::CorsairVengeanceProController(i2c_smbus_interface* bus, corsair_dev_id dev)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
|
||||
strcpy(device_name, "Corsair Vengeance Pro RGB");
|
||||
led_count = CORSAIR_PRO_LED_COUNT;
|
||||
|
||||
direct_mode = false;
|
||||
effect_mode = CORSAIR_PRO_MODE_STATIC;
|
||||
|
||||
for (unsigned int i = 0; i < led_count; i++)
|
||||
{
|
||||
led_red[i] = 0;
|
||||
led_green[i] = 0;
|
||||
led_blue[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
CorsairVengeanceProController::~CorsairVengeanceProController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string CorsairVengeanceProController::GetDeviceName()
|
||||
{
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
std::string CorsairVengeanceProController::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("I2C: " + return_string);
|
||||
}
|
||||
|
||||
unsigned int CorsairVengeanceProController::GetLEDCount()
|
||||
{
|
||||
return(led_count);
|
||||
}
|
||||
|
||||
unsigned char CorsairVengeanceProController::GetEffect()
|
||||
{
|
||||
return(effect_mode);
|
||||
}
|
||||
|
||||
void CorsairVengeanceProController::SetAllColors(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
for (unsigned int i = 0; i < led_count; i++)
|
||||
{
|
||||
led_red[i] = red;
|
||||
led_green[i] = green;
|
||||
led_blue[i] = blue;
|
||||
}
|
||||
}
|
||||
|
||||
void CorsairVengeanceProController::SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
led_red[led] = red;
|
||||
led_green[led] = green;
|
||||
led_blue[led] = blue;
|
||||
}
|
||||
|
||||
void CorsairVengeanceProController::ApplyColors()
|
||||
{
|
||||
if(direct_mode)
|
||||
{
|
||||
unsigned char full_packet[32];
|
||||
unsigned char crc_packet[31];
|
||||
|
||||
full_packet[0] = 0x0A;
|
||||
crc_packet[0] = 0x0A;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
crc_packet[(i * 3) + 1] = led_red[i];
|
||||
full_packet[(i * 3) + 1] = led_red[i];
|
||||
|
||||
crc_packet[(i * 3) + 2] = led_green[i];
|
||||
full_packet[(i * 3) + 2] = led_green[i];
|
||||
|
||||
crc_packet[(i * 3) + 3] = led_blue[i];
|
||||
full_packet[(i * 3) + 3] = led_blue[i];
|
||||
}
|
||||
|
||||
uint8_t footer = CRCPP::CRC::Calculate(crc_packet, 31, CRCPP::CRC::CRC_8());
|
||||
|
||||
full_packet[31] = footer;
|
||||
|
||||
bus->i2c_smbus_write_block_data(dev, CORSAIR_PRO_DIRECT_COMMAND, 32, full_packet);
|
||||
}
|
||||
else
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x26, 0x02);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x21, 0x00);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, led_red[i]);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, led_green[i]);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, led_blue[i]);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0xFF);
|
||||
}
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x82, 0x02);
|
||||
}
|
||||
}
|
||||
|
||||
void CorsairVengeanceProController::SetEffect(unsigned char mode,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
bool random,
|
||||
unsigned char red1,
|
||||
unsigned char grn1,
|
||||
unsigned char blu1,
|
||||
unsigned char red2,
|
||||
unsigned char grn2,
|
||||
unsigned char blu2
|
||||
)
|
||||
{
|
||||
if(mode == effect_mode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
effect_mode = mode;
|
||||
|
||||
direct_mode = (effect_mode == CORSAIR_PRO_MODE_DIRECT);
|
||||
|
||||
if(direct_mode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x26, 0x01);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x21, 0x00);
|
||||
std::this_thread::sleep_for(1ms);
|
||||
|
||||
unsigned char random_byte;
|
||||
|
||||
if(random)
|
||||
{
|
||||
random_byte = CORSAIR_PRO_EFFECT_RANDOM_COLORS;
|
||||
}
|
||||
else
|
||||
{
|
||||
random_byte = CORSAIR_PRO_EFFECT_CUSTOM_COLORS;
|
||||
}
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, effect_mode); // Mode
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, speed); // Speed
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, random_byte); // Custom color
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, direction); // Direction
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, red1); // Custom color 1 red
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, grn1); // Custom color 1 green
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, blu1); // Custom color 1 blue
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0xFF);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, red2); // Custom color 2 red
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, grn2); // Custom color 2 green
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, blu2); // Custom color 2 blue
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0xFF);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_PRO_REG_COMMAND, 0x00);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x82, 0x01);
|
||||
WaitReady();
|
||||
}
|
||||
|
||||
bool CorsairVengeanceProController::WaitReady()
|
||||
{
|
||||
int i = 0;
|
||||
while (bus->i2c_smbus_read_byte_data(dev, 0x41) != 0x00)
|
||||
{
|
||||
i++;
|
||||
std::this_thread::sleep_for(1ms);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CorsairVengeanceProController::SetDirect(bool direct)
|
||||
{
|
||||
direct_mode = direct;
|
||||
}
|
||||
@@ -0,0 +1,109 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairVengeanceProController.h |
|
||||
| |
|
||||
| Driver for Corsair Vengeance Pro RGB RAM |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
#include "CRC.h"
|
||||
|
||||
typedef unsigned char corsair_dev_id;
|
||||
|
||||
#define CORSAIR_PRO_LED_COUNT ( 10 )
|
||||
#define CORSAIR_VENGEANCE_RGB_PRO_NAME "Corsair Vengeance RGB PRO"
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_PRO_REG_COMMAND = 0x20, /* Command write register */
|
||||
CORSAIR_PRO_DIRECT_COMMAND = 0x31, /* Where it writes direct mode colors */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_PRO_MODE_DIRECT = 0xDD, /* Arbitrary value to compare against later. Not the actual packet */
|
||||
CORSAIR_PRO_MODE_COLOR_SHIFT = 0x00, /* Color Shift mode */
|
||||
CORSAIR_PRO_MODE_COLOR_PULSE = 0x01, /* Color Pulse mode */
|
||||
CORSAIR_PRO_MODE_RAINBOW_WAVE = 0x03, /* Rainbow Wave mode */
|
||||
CORSAIR_PRO_MODE_COLOR_WAVE = 0x04, /* Color Wave mode */
|
||||
CORSAIR_PRO_MODE_VISOR = 0x05, /* Visor mode */
|
||||
CORSAIR_PRO_MODE_RAIN = 0x06, /* Rain mode */
|
||||
CORSAIR_PRO_MODE_MARQUEE = 0x07, /* Marquee mode */
|
||||
CORSAIR_PRO_MODE_RAINBOW = 0x08, /* Rainbow mode */
|
||||
CORSAIR_PRO_MODE_SEQUENTIAL = 0x09, /* Sequential mode */
|
||||
CORSAIR_PRO_MODE_STATIC = 0x10, /* Static mode */
|
||||
|
||||
CORSAIR_PRO_NUMBER_MODES = 10, /* Number of Corsair Pro modes */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_PRO_SPEED_SLOW = 0x00, /* Slow speed */
|
||||
CORSAIR_PRO_SPEED_MEDIUM = 0x01, /* Medium speed */
|
||||
CORSAIR_PRO_SPEED_FAST = 0x02, /* Fast speed */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_PRO_EFFECT_RANDOM_COLORS = 0x00, /* Random colors */
|
||||
CORSAIR_PRO_EFFECT_CUSTOM_COLORS = 0x01, /* Custom colors */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_PRO_DIRECTION_UP = 0x00, /* Up direction */
|
||||
CORSAIR_PRO_DIRECTION_DOWN = 0x01, /* Down direction */
|
||||
CORSAIR_PRO_DIRECTION_LEFT = 0x02, /* Left direction */
|
||||
CORSAIR_PRO_DIRECTION_RIGHT = 0x03, /* Right direction */
|
||||
CORSAIR_PRO_DIRECTION_VERTICAL = 0x01, /* Vertical direction */
|
||||
CORSAIR_PRO_DIRECTION_HORIZONTAL = 0x03, /* Horizontal direction */
|
||||
};
|
||||
|
||||
class CorsairVengeanceProController
|
||||
{
|
||||
public:
|
||||
CorsairVengeanceProController(i2c_smbus_interface* bus, corsair_dev_id dev);
|
||||
~CorsairVengeanceProController();
|
||||
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceLocation();
|
||||
unsigned int GetLEDCount();
|
||||
unsigned char GetEffect();
|
||||
void SetEffect(unsigned char mode,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
bool random,
|
||||
unsigned char red1,
|
||||
unsigned char grn1,
|
||||
unsigned char blu1,
|
||||
unsigned char red2,
|
||||
unsigned char grn2,
|
||||
unsigned char blu2
|
||||
);
|
||||
|
||||
void SetAllColors(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void ApplyColors();
|
||||
bool WaitReady();
|
||||
|
||||
void SetDirect(bool direct);
|
||||
|
||||
private:
|
||||
char device_name[32];
|
||||
unsigned int led_count;
|
||||
bool direct_mode;
|
||||
unsigned char effect_mode;
|
||||
unsigned char led_red[CORSAIR_PRO_LED_COUNT];
|
||||
unsigned char led_green[CORSAIR_PRO_LED_COUNT];
|
||||
unsigned char led_blue[CORSAIR_PRO_LED_COUNT];
|
||||
|
||||
i2c_smbus_interface* bus;
|
||||
corsair_dev_id dev;
|
||||
};
|
||||
@@ -0,0 +1,89 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairVengeanceProControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Corsair Vengeance Pro RGB RAM |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <vector>
|
||||
#include "DetectionManager.h"
|
||||
#include "CorsairVengeanceProController.h"
|
||||
#include "RGBController_CorsairVengeancePro.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "pci_ids.h"
|
||||
#include "LogManager.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
bool TestForCorsairVengeanceProController(i2c_smbus_interface* bus, unsigned char address)
|
||||
{
|
||||
bool pass = false;
|
||||
|
||||
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
|
||||
|
||||
LOG_DEBUG("[%s] Trying address %02X", CORSAIR_VENGEANCE_RGB_PRO_NAME, address);
|
||||
|
||||
if(res >= 0)
|
||||
{
|
||||
pass = true;
|
||||
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x43);
|
||||
|
||||
if (res != 0x1C)
|
||||
{
|
||||
pass = false;
|
||||
LOG_DEBUG("[%s] Failed: was expecting 0x1C got %02X", CORSAIR_VENGEANCE_RGB_PRO_NAME, res);
|
||||
}
|
||||
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x44);
|
||||
|
||||
if(!((res == 0x03) || (res == 0x04)))
|
||||
{
|
||||
pass = false;
|
||||
LOG_DEBUG("[%s] Failed: was expecting 0x03 or 0x04 got %02X", CORSAIR_VENGEANCE_RGB_PRO_NAME, res);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: res was %04X", CORSAIR_VENGEANCE_RGB_PRO_NAME, res);
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(10ms);
|
||||
|
||||
return(pass);
|
||||
}
|
||||
|
||||
DetectedControllers DetectCorsairVengeanceProControllers(std::vector<i2c_smbus_interface*> &busses)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
for(unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
{
|
||||
LOG_DEBUG("[%s] Testing bus %d", CORSAIR_VENGEANCE_RGB_PRO_NAME, bus);
|
||||
|
||||
IF_DRAM_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
|
||||
{
|
||||
for(unsigned char addr = 0x58; addr <= 0x5F; addr++)
|
||||
{
|
||||
if(TestForCorsairVengeanceProController(busses[bus], addr))
|
||||
{
|
||||
CorsairVengeanceProController* controller = new CorsairVengeanceProController(busses[bus], addr);
|
||||
RGBController_CorsairVengeancePro* rgb_controller = new RGBController_CorsairVengeancePro(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("[%s] Bus %d is not a DRAM bus", CORSAIR_VENGEANCE_RGB_PRO_NAME, bus);
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_DETECTOR("Corsair Vengeance Pro", DetectCorsairVengeanceProControllers);
|
||||
@@ -0,0 +1,310 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_CorsairVengeancePro.cpp |
|
||||
| |
|
||||
| RGBController for Corsair Vengeance Pro RGB RAM |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_CorsairVengeancePro.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Corsair Vengeance Pro
|
||||
@category RAM
|
||||
@type SMBus
|
||||
@save :robot:
|
||||
@direct :white_check_mark:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectCorsairVengeanceProControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_CorsairVengeancePro::RGBController_CorsairVengeancePro(CorsairVengeanceProController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Corsair";
|
||||
type = DEVICE_TYPE_DRAM;
|
||||
description = "Corsair Vengeance Pro RGB Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = CORSAIR_PRO_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.speed_min = 0;
|
||||
Direct.speed_max = 0;
|
||||
Direct.speed = 0;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = CORSAIR_PRO_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Static.speed_min = 0;
|
||||
Static.speed_max = 0;
|
||||
Static.speed = 0;
|
||||
Static.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Static);
|
||||
|
||||
mode ColorShift;
|
||||
ColorShift.name = "Color Shift";
|
||||
ColorShift.value = CORSAIR_PRO_MODE_COLOR_SHIFT;
|
||||
ColorShift.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
|
||||
ColorShift.speed_min = CORSAIR_PRO_SPEED_SLOW;
|
||||
ColorShift.speed_max = CORSAIR_PRO_SPEED_FAST;
|
||||
ColorShift.colors_min = 2;
|
||||
ColorShift.colors_max = 2;
|
||||
ColorShift.speed = CORSAIR_PRO_SPEED_SLOW;
|
||||
ColorShift.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ColorShift.colors.resize(2);
|
||||
modes.push_back(ColorShift);
|
||||
|
||||
mode ColorPulse;
|
||||
ColorPulse.name = "Color Pulse";
|
||||
ColorPulse.value = CORSAIR_PRO_MODE_COLOR_PULSE;
|
||||
ColorPulse.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
|
||||
ColorPulse.speed_min = CORSAIR_PRO_SPEED_SLOW;
|
||||
ColorPulse.speed_max = CORSAIR_PRO_SPEED_FAST;
|
||||
ColorPulse.colors_min = 2;
|
||||
ColorPulse.colors_max = 2;
|
||||
ColorPulse.speed = CORSAIR_PRO_SPEED_SLOW;
|
||||
ColorPulse.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ColorPulse.colors.resize(2);
|
||||
modes.push_back(ColorPulse);
|
||||
|
||||
mode RainbowWave;
|
||||
RainbowWave.name = "Rainbow Wave";
|
||||
RainbowWave.value = CORSAIR_PRO_MODE_RAINBOW_WAVE;
|
||||
RainbowWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD;
|
||||
RainbowWave.speed_min = CORSAIR_PRO_SPEED_SLOW;
|
||||
RainbowWave.speed_max = CORSAIR_PRO_SPEED_FAST;
|
||||
RainbowWave.speed = CORSAIR_PRO_SPEED_SLOW;
|
||||
RainbowWave.direction = MODE_DIRECTION_DOWN;
|
||||
RainbowWave.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(RainbowWave);
|
||||
|
||||
mode ColorWave;
|
||||
ColorWave.name = "Color Wave";
|
||||
ColorWave.value = CORSAIR_PRO_MODE_COLOR_WAVE;
|
||||
ColorWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
|
||||
ColorWave.speed_min = CORSAIR_PRO_SPEED_SLOW;
|
||||
ColorWave.speed_max = CORSAIR_PRO_SPEED_FAST;
|
||||
ColorWave.colors_min = 2;
|
||||
ColorWave.colors_max = 2;
|
||||
ColorWave.speed = CORSAIR_PRO_SPEED_SLOW;
|
||||
ColorWave.direction = MODE_DIRECTION_DOWN;
|
||||
ColorWave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ColorWave.colors.resize(2);
|
||||
modes.push_back(ColorWave);
|
||||
|
||||
mode Visor;
|
||||
Visor.name = "Visor";
|
||||
Visor.value = CORSAIR_PRO_MODE_VISOR;
|
||||
Visor.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_HV | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
|
||||
Visor.speed_min = CORSAIR_PRO_SPEED_SLOW;
|
||||
Visor.speed_max = CORSAIR_PRO_SPEED_FAST;
|
||||
Visor.colors_min = 2;
|
||||
Visor.colors_max = 2;
|
||||
Visor.speed = CORSAIR_PRO_SPEED_SLOW;
|
||||
Visor.direction = MODE_DIRECTION_VERTICAL;
|
||||
Visor.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Visor.colors.resize(2);
|
||||
modes.push_back(Visor);
|
||||
|
||||
mode Rain;
|
||||
Rain.name = "Rain";
|
||||
Rain.value = CORSAIR_PRO_MODE_RAIN;
|
||||
Rain.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
|
||||
Rain.speed_min = CORSAIR_PRO_SPEED_SLOW;
|
||||
Rain.speed_max = CORSAIR_PRO_SPEED_FAST;
|
||||
Rain.colors_min = 2;
|
||||
Rain.colors_max = 2;
|
||||
Rain.speed = CORSAIR_PRO_SPEED_SLOW;
|
||||
Rain.direction = MODE_DIRECTION_DOWN;
|
||||
Rain.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Rain.colors.resize(2);
|
||||
modes.push_back(Rain);
|
||||
|
||||
mode Marquee;
|
||||
Marquee.name = "Marquee";
|
||||
Marquee.value = CORSAIR_PRO_MODE_MARQUEE;
|
||||
Marquee.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Marquee.speed_min = CORSAIR_PRO_SPEED_SLOW;
|
||||
Marquee.speed_max = CORSAIR_PRO_SPEED_FAST;
|
||||
Marquee.colors_min = 1;
|
||||
Marquee.colors_max = 1;
|
||||
Marquee.speed = CORSAIR_PRO_SPEED_SLOW;
|
||||
Marquee.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Marquee.colors.resize(1);
|
||||
modes.push_back(Marquee);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = CORSAIR_PRO_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_SPEED;
|
||||
Rainbow.speed_min = CORSAIR_PRO_SPEED_SLOW;
|
||||
Rainbow.speed_max = CORSAIR_PRO_SPEED_FAST;
|
||||
Rainbow.speed = CORSAIR_PRO_SPEED_SLOW;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
mode Sequential;
|
||||
Sequential.name = "Sequential";
|
||||
Sequential.value = CORSAIR_PRO_MODE_SEQUENTIAL;
|
||||
Sequential.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
|
||||
Sequential.speed_min = CORSAIR_PRO_SPEED_SLOW;
|
||||
Sequential.speed_max = CORSAIR_PRO_SPEED_FAST;
|
||||
Sequential.colors_min = 1;
|
||||
Sequential.colors_max = 1;
|
||||
Sequential.speed = CORSAIR_PRO_SPEED_SLOW;
|
||||
Sequential.direction = MODE_DIRECTION_DOWN;
|
||||
Sequential.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Sequential.colors.resize(1);
|
||||
modes.push_back(Sequential);
|
||||
|
||||
SetupZones();
|
||||
|
||||
active_mode = 9;
|
||||
}
|
||||
|
||||
RGBController_CorsairVengeancePro::~RGBController_CorsairVengeancePro()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_CorsairVengeancePro::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up zone |
|
||||
\*---------------------------------------------------------*/
|
||||
zone new_zone;
|
||||
new_zone.name = "Corsair Pro Zone";
|
||||
new_zone.type = ZONE_TYPE_LINEAR;
|
||||
new_zone.leds_min = controller->GetLEDCount();
|
||||
new_zone.leds_max = controller->GetLEDCount();
|
||||
new_zone.leds_count = controller->GetLEDCount();
|
||||
zones.push_back(new_zone);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up LEDs |
|
||||
\*---------------------------------------------------------*/
|
||||
for(std::size_t led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
|
||||
{
|
||||
led* new_led = new led();
|
||||
new_led->name = "Corsair Pro LED ";
|
||||
new_led->name.append(std::to_string(led_idx));
|
||||
leds.push_back(*new_led);
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairVengeancePro::DeviceUpdateLEDs()
|
||||
{
|
||||
for(unsigned int led = 0; led < (unsigned int)colors.size(); led++)
|
||||
{
|
||||
RGBColor color = colors[led];
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
controller->SetLEDColor(led, red, grn, blu);
|
||||
}
|
||||
|
||||
controller->ApplyColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairVengeancePro::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_CorsairVengeancePro::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
RGBColor color = colors[led];
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
controller->SetLEDColor(led, red, grn, blu);
|
||||
controller->ApplyColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairVengeancePro::DeviceUpdateMode()
|
||||
{
|
||||
unsigned int corsair_direction = 0;
|
||||
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
|
||||
unsigned char mode_colors[6];
|
||||
|
||||
switch(modes[active_mode].direction)
|
||||
{
|
||||
case MODE_DIRECTION_LEFT:
|
||||
corsair_direction = CORSAIR_PRO_DIRECTION_LEFT;
|
||||
break;
|
||||
case MODE_DIRECTION_RIGHT:
|
||||
corsair_direction = CORSAIR_PRO_DIRECTION_RIGHT;
|
||||
break;
|
||||
case MODE_DIRECTION_UP:
|
||||
corsair_direction = CORSAIR_PRO_DIRECTION_UP;
|
||||
break;
|
||||
case MODE_DIRECTION_DOWN:
|
||||
corsair_direction = CORSAIR_PRO_DIRECTION_DOWN;
|
||||
break;
|
||||
case MODE_DIRECTION_HORIZONTAL:
|
||||
corsair_direction = CORSAIR_PRO_DIRECTION_HORIZONTAL;
|
||||
break;
|
||||
case MODE_DIRECTION_VERTICAL:
|
||||
corsair_direction = CORSAIR_PRO_DIRECTION_VERTICAL;
|
||||
break;
|
||||
}
|
||||
|
||||
mode_colors[0] = 0;
|
||||
mode_colors[1] = 0;
|
||||
mode_colors[2] = 0;
|
||||
mode_colors[3] = 0;
|
||||
mode_colors[4] = 0;
|
||||
mode_colors[5] = 0;
|
||||
|
||||
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
||||
{
|
||||
mode_colors[0] = RGBGetRValue(modes[active_mode].colors[0]);
|
||||
mode_colors[1] = RGBGetGValue(modes[active_mode].colors[0]);
|
||||
mode_colors[2] = RGBGetBValue(modes[active_mode].colors[0]);
|
||||
|
||||
if(modes[active_mode].colors.size() == 2)
|
||||
{
|
||||
mode_colors[3] = RGBGetRValue(modes[active_mode].colors[1]);
|
||||
mode_colors[4] = RGBGetGValue(modes[active_mode].colors[1]);
|
||||
mode_colors[5] = RGBGetBValue(modes[active_mode].colors[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if (modes[active_mode].name == "Direct")
|
||||
{
|
||||
controller->SetDirect(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
controller->SetDirect(false);
|
||||
}
|
||||
|
||||
controller->SetEffect(modes[active_mode].value,
|
||||
modes[active_mode].speed,
|
||||
corsair_direction,
|
||||
random,
|
||||
mode_colors[0],
|
||||
mode_colors[1],
|
||||
mode_colors[2],
|
||||
mode_colors[3],
|
||||
mode_colors[4],
|
||||
mode_colors[5]);
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(15));
|
||||
}
|
||||
+33
-34
@@ -1,34 +1,33 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_ThrustmasterSol.h |
|
||||
| |
|
||||
| RGBController for Thrustmaster Sol series joysticks |
|
||||
| |
|
||||
| Ken Sanislo 02 Apr 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "ThrustmasterSolController.h"
|
||||
|
||||
class RGBController_ThrustmasterSol : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_ThrustmasterSol(ThrustmasterSolController* controller_ptr);
|
||||
~RGBController_ThrustmasterSol();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
void DeviceSaveMode();
|
||||
|
||||
private:
|
||||
ThrustmasterSolController* controller;
|
||||
};
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_CorsairVengeancePro.h |
|
||||
| |
|
||||
| RGBController for Corsair Vengeance Pro RGB RAM |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "CorsairVengeanceProController.h"
|
||||
|
||||
class RGBController_CorsairVengeancePro : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_CorsairVengeancePro(CorsairVengeanceProController* controller_ptr);
|
||||
~RGBController_CorsairVengeancePro();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
CorsairVengeanceProController* controller;
|
||||
};
|
||||
+1
-1
@@ -409,7 +409,7 @@ void RGBController_CougarKeyboard::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = led_names[led_index];
|
||||
|
||||
new_led.value = led_index;
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ CreativeSoundBlasterXG6Controller::~CreativeSoundBlasterXG6Controller()
|
||||
|
||||
std::string CreativeSoundBlasterXG6Controller::GetDeviceLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
return("HID " + location);
|
||||
}
|
||||
|
||||
std::string CreativeSoundBlasterXG6Controller::GetDeviceName()
|
||||
|
||||
@@ -87,8 +87,7 @@ void RGBController_CreativeSoundBlasterAE5::SetupZones()
|
||||
zones[1].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
}
|
||||
|
||||
if(!(zones[1].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
@@ -35,7 +35,7 @@ std::string CrucialController::GetDeviceVersion()
|
||||
|
||||
std::string CrucialController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
std::string return_string(bus->device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
|
||||
@@ -137,19 +137,19 @@ void CrucialRegisterWrite(i2c_smbus_interface* bus, unsigned char dev, unsigned
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x01, val);
|
||||
}
|
||||
|
||||
DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &buses)
|
||||
DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &busses)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
for(unsigned int bus = 0; bus < buses.size(); bus++)
|
||||
for(unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
{
|
||||
int address_list_idx = -1;
|
||||
|
||||
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
|
||||
IF_DRAM_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
|
||||
{
|
||||
for(unsigned int slot = 0; slot < 4; slot++)
|
||||
{
|
||||
int res = buses[bus]->i2c_smbus_write_quick(0x27, I2C_SMBUS_WRITE);
|
||||
int res = busses[bus]->i2c_smbus_write_quick(0x27, I2C_SMBUS_WRITE);
|
||||
|
||||
if(res < 0)
|
||||
{
|
||||
@@ -163,7 +163,7 @@ DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &
|
||||
|
||||
if(address_list_idx < CRUCIAL_ADDRESS_COUNT)
|
||||
{
|
||||
res = buses[bus]->i2c_smbus_write_quick(crucial_addresses[address_list_idx], I2C_SMBUS_WRITE);
|
||||
res = busses[bus]->i2c_smbus_write_quick(crucial_addresses[address_list_idx], I2C_SMBUS_WRITE);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -174,24 +174,24 @@ DetectedControllers DetectCrucialControllers(std::vector<i2c_smbus_interface*> &
|
||||
if(address_list_idx < CRUCIAL_ADDRESS_COUNT)
|
||||
{
|
||||
LOG_DEBUG("[%s] Remapping slot %d to address %02X", CRUCIAL_CONTROLLER_NAME, slot, crucial_addresses[address_list_idx]);
|
||||
CrucialRegisterWrite(buses[bus], 0x27, 0x82EE, slot);
|
||||
CrucialRegisterWrite(buses[bus], 0x27, 0x82EF, (crucial_addresses[address_list_idx] << 1));
|
||||
CrucialRegisterWrite(buses[bus], 0x27, 0x82F0, 0xF0);
|
||||
CrucialRegisterWrite(busses[bus], 0x27, 0x82EE, slot);
|
||||
CrucialRegisterWrite(busses[bus], 0x27, 0x82EF, (crucial_addresses[address_list_idx] << 1));
|
||||
CrucialRegisterWrite(busses[bus], 0x27, 0x82F0, 0xF0);
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(1ms);
|
||||
}
|
||||
|
||||
LOG_DEBUG("[%s] In bus: %02X:%02X looking for devices at [%s]", CRUCIAL_CONTROLLER_NAME, buses[bus]->info.pci_vendor, buses[bus]->info.pci_device, TESTING_ADDRESSES);
|
||||
LOG_DEBUG("[%s] In bus: %02X:%02X looking for devices at [%s]", CRUCIAL_CONTROLLER_NAME, busses[bus]->pci_vendor, busses[bus]->pci_device, TESTING_ADDRESSES);
|
||||
|
||||
// Add Crucial controllers
|
||||
for(unsigned int address_list_idx = 0; address_list_idx < CRUCIAL_ADDRESS_COUNT; address_list_idx++)
|
||||
{
|
||||
LOG_DEBUG("[%s] Testing address %02X to see if there is a device there", CRUCIAL_CONTROLLER_NAME, crucial_addresses[address_list_idx]);
|
||||
|
||||
if(TestForCrucialController(buses[bus], crucial_addresses[address_list_idx]))
|
||||
if(TestForCrucialController(busses[bus], crucial_addresses[address_list_idx]))
|
||||
{
|
||||
CrucialController* controller = new CrucialController(buses[bus], crucial_addresses[address_list_idx]);
|
||||
CrucialController* controller = new CrucialController(busses[bus], crucial_addresses[address_list_idx]);
|
||||
RGBController_Crucial* rgb_controller = new RGBController_Crucial(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user