iGame Turing GPU with Direct mode without persistence

This commit is contained in:
Lucas Mindêllo de Andrade 2023-10-07 02:24:13 +00:00 committed by Adam Honse
parent 9e75a68008
commit f7eb61614e
6 changed files with 30 additions and 8 deletions

View file

@ -65,12 +65,19 @@ void ColorfulTuringGPUController::SetStateDisplay(RGBColor color)
bus->i2c_write_block(dev, COLORFUL_COLOR_PACKET_LENGTH, data_pkt);
}
void ColorfulTuringGPUController::SetDirect(RGBColor color)
void ColorfulTuringGPUController::SetDirect(RGBColor color, bool save)
{
uint8_t r = RGBGetRValue(color);
uint8_t g = RGBGetGValue(color);
uint8_t b = RGBGetBValue(color);
uint8_t data_pkt[COLORFUL_COLOR_PACKET_LENGTH] = { 0x88, 0x02, 0x32, 0x02, r, g, b};
uint8_t data_pkt[COLORFUL_COLOR_PACKET_LENGTH] = { 0x08, 0x0, 0x20, 0x10, r, g, b};
if(save)
{
data_pkt[0] = 0x88;
data_pkt[1] = 0x02;
data_pkt[2] = 0x32;
data_pkt[3] = 0x02;
}
int crc = 1;

View file

@ -28,7 +28,7 @@ public:
std::string GetDeviceLocation();
int GetMode();
RGBColor GetColor();
void SetDirect(RGBColor color);
void SetDirect(RGBColor color, bool save);
void SetStateDisplay(RGBColor color);
void SetBreathing(RGBColor color);
void SetOff();

View file

@ -20,4 +20,5 @@ void DetectColorfulTuringGPUControllers(i2c_smbus_interface* bus, uint8_t i2c_ad
}
}
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 2070 SUPER Advanced OC-V", DetectColorfulTuringGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_2070_SUPER_ADVANCED_OCV, 0x50);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 2070 SUPER Advanced OC-V", DetectColorfulTuringGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_2070_SUPER_ADVANCED_OCV, 0x50);
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 2070 SUPER Advanced OC-V", DetectColorfulTuringGPUControllers, NVIDIA_VEN, NVIDIA_RTX2070S_OC_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_2070_SUPER_ADVANCED_OCV2, 0x50);

View file

@ -31,7 +31,7 @@ RGBController_ColorfulTuringGPU::RGBController_ColorfulTuringGPU(ColorfulTuringG
mode Direct;
Direct.name = "Direct";
Direct.value = COLORFUL_TURING_GPU_RGB_MODE_STATIC;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_MANUAL_SAVE;
Direct.color_mode = MODE_COLORS_PER_LED;
modes.push_back(Direct);
@ -86,7 +86,7 @@ void RGBController_ColorfulTuringGPU::SetupZones()
zone new_zone;
new_zone.name = "GPU";
new_zone.type = ZONE_TYPE_LINEAR;
new_zone.type = ZONE_TYPE_SINGLE;
new_zone.leds_min = 1;
new_zone.leds_max = 1;
new_zone.leds_count = 1;
@ -122,10 +122,10 @@ void RGBController_ColorfulTuringGPU::DeviceUpdateLEDs()
controller->SetStateDisplay(colors[0]);
break;
case COLORFUL_TURING_GPU_RGB_MODE_STATIC:
controller->SetDirect(colors[0]);
controller->SetDirect(colors[0], false);
break;
default:
controller->SetDirect(colors[0]);
controller->SetDirect(colors[0], false);
}
}
@ -143,3 +143,15 @@ void RGBController_ColorfulTuringGPU::DeviceUpdateMode()
{
DeviceUpdateLEDs();
}
void RGBController_ColorfulTuringGPU::DeviceSaveMode()
{
switch(modes[active_mode].value)
{
case COLORFUL_TURING_GPU_RGB_MODE_STATIC:
controller->SetDirect(colors[0], true);
break;
default:
DeviceUpdateLEDs();
}
}

View file

@ -15,6 +15,7 @@ public:
void UpdateZoneLEDs(int zone);
void UpdateSingleLED(int led);
void DeviceUpdateMode();
void DeviceSaveMode();
private:
ColorfulTuringGPUController* controller;

View file

@ -296,6 +296,7 @@
| Colorful Sub-Device IDs |
\*-----------------------------------------------------*/
#define COLORFUL_IGAME_RTX_2070_SUPER_ADVANCED_OCV 0X1401
#define COLORFUL_IGAME_RTX_2070_SUPER_ADVANCED_OCV2 0X140A
#define COLORFUL_IGAME_RTX_3060_ADVANCED_OC_12G_LV 0x140A
#define COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G 0x150A
#define COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2 0x1501