Fix some issues with the Aura initialization and detection and add a new driver for Patriot Viper RGB RAM
This commit is contained in:
parent
b7b93ad606
commit
a27c614a8b
8 changed files with 470 additions and 7 deletions
|
|
@ -56,6 +56,25 @@ static const unsigned char aura_mobo_addresses[] =
|
|||
0x66
|
||||
};
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* AuraRegisterWrite *
|
||||
* *
|
||||
* A standalone version of the AuraController::AuraRegisterWrite function for access *
|
||||
* to Aura devices without instancing the AuraController class or reading the config *
|
||||
* table from the device. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void AuraRegisterWrite(i2c_smbus_interface* bus, aura_dev_id dev, aura_register reg, unsigned char val)
|
||||
{
|
||||
//Write Aura register
|
||||
bus->i2c_smbus_write_word_data(dev, 0x00, ((reg << 8) & 0xFF00) | ((reg >> 8) & 0x00FF));
|
||||
|
||||
//Write Aura value
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x01, val);
|
||||
}
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* TestForAuraController *
|
||||
|
|
@ -124,15 +143,12 @@ void DetectAuraControllers(std::vector<i2c_smbus_interface*> &busses, std::vecto
|
|||
break;
|
||||
}
|
||||
|
||||
AuraController temp_controller(busses[bus], 0x77);
|
||||
|
||||
do
|
||||
{
|
||||
address_list_idx++;
|
||||
|
||||
if(address_list_idx < AURA_RAM_ADDRESS_COUNT)
|
||||
{
|
||||
res = busses[bus]->i2c_smbus_write_quick(aura_ram_addresses[address_list_idx], I2C_SMBUS_WRITE);
|
||||
address_list_idx++;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -140,9 +156,8 @@ void DetectAuraControllers(std::vector<i2c_smbus_interface*> &busses, std::vecto
|
|||
}
|
||||
} while (res >= 0);
|
||||
|
||||
temp_controller.AuraRegisterWrite(AURA_REG_SLOT_INDEX, slot);
|
||||
temp_controller.AuraRegisterWrite(AURA_REG_I2C_ADDRESS, (aura_ram_addresses[address_list_idx] << 1));
|
||||
address_list_idx++;
|
||||
AuraRegisterWrite(busses[bus], 0x77, AURA_REG_SLOT_INDEX, slot);
|
||||
AuraRegisterWrite(busses[bus], 0x77, AURA_REG_I2C_ADDRESS, (aura_ram_addresses[address_list_idx] << 1));
|
||||
}
|
||||
|
||||
// Add Aura-enabled controllers at their remapped addresses
|
||||
|
|
|
|||
143
Controllers/PatriotViperController/PatriotViperController.cpp
Normal file
143
Controllers/PatriotViperController/PatriotViperController.cpp
Normal file
|
|
@ -0,0 +1,143 @@
|
|||
/*-----------------------------------------*\
|
||||
| PatriotViperController.cpp |
|
||||
| |
|
||||
| Definitions and types for Patriot Viper |
|
||||
| RGB RAM lighting controller |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 1/1/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "PatriotViperController.h"
|
||||
#include <cstring>
|
||||
|
||||
PatriotViperController::PatriotViperController(i2c_smbus_interface* bus, viper_dev_id dev, unsigned char slots)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
slots_valid = slots;
|
||||
|
||||
strcpy(device_name, "Patriot Viper RGB");
|
||||
|
||||
led_count = 0;
|
||||
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
if((slots_valid & (1 << i)) != 0)
|
||||
{
|
||||
led_count += 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PatriotViperController::~PatriotViperController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string PatriotViperController::GetDeviceName()
|
||||
{
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
std::string PatriotViperController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
return_string.append(addr);
|
||||
return(return_string);
|
||||
}
|
||||
|
||||
unsigned int PatriotViperController::GetLEDCount()
|
||||
{
|
||||
return(led_count);
|
||||
}
|
||||
|
||||
unsigned int PatriotViperController::GetSlotCount()
|
||||
{
|
||||
unsigned int slot_count = 0;
|
||||
|
||||
for(int slot = 0; slot < 4; slot++)
|
||||
{
|
||||
if((slots_valid & (1 << slot)) != 0)
|
||||
{
|
||||
slot_count++;
|
||||
}
|
||||
}
|
||||
|
||||
return(slot_count);
|
||||
}
|
||||
|
||||
unsigned int PatriotViperController::GetMode()
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
void PatriotViperController::SetEffectColor(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void PatriotViperController::SetAllColors(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, 0xFF, 0xFF);
|
||||
bus->i2c_smbus_write_byte_data(dev, 0xFF, 0xFF);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x01, 0x04);
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x00, 0x00);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x30, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, green, blue);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x31, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, green, blue);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x32, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, green, blue);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x33, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, green, blue);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x34, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, green, blue);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x35, 0x01);
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x00, 0x00);
|
||||
}
|
||||
|
||||
void PatriotViperController::SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, 0xFF, 0xFF);
|
||||
bus->i2c_smbus_write_byte_data(dev, 0xFF, 0xFF);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x01, 0x04);
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x00, 0x00);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x30 + led, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, green, blue);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x35, 0x01);
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x00, 0x00);
|
||||
}
|
||||
|
||||
|
||||
void PatriotViperController::SetLEDColor(unsigned int slot, unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, 0xFF, 0xFF);
|
||||
bus->i2c_smbus_write_byte_data(dev, 0xFF, 0xFF);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x01, 0x04);
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x00, 0x00);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x30 + led, red);
|
||||
bus->i2c_smbus_write_byte_data(dev, green, blue);
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x35, 0x01);
|
||||
bus->i2c_smbus_write_byte_data(dev, 0x00, 0x00);
|
||||
}
|
||||
|
||||
void PatriotViperController::SetMode(unsigned char new_mode)
|
||||
{
|
||||
|
||||
}
|
||||
43
Controllers/PatriotViperController/PatriotViperController.h
Normal file
43
Controllers/PatriotViperController/PatriotViperController.h
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
/*-----------------------------------------*\
|
||||
| PatriotViperController.h |
|
||||
| |
|
||||
| Definitions and types for Patriot Viper |
|
||||
| RGB RAM lighting controller |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 1/1/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
#pragma once
|
||||
|
||||
typedef unsigned char viper_dev_id;
|
||||
typedef unsigned short viper_register;
|
||||
|
||||
class PatriotViperController
|
||||
{
|
||||
public:
|
||||
PatriotViperController(i2c_smbus_interface* bus, viper_dev_id dev, unsigned char slots);
|
||||
~PatriotViperController();
|
||||
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceLocation();
|
||||
unsigned int GetLEDCount();
|
||||
unsigned int GetSlotCount();
|
||||
unsigned int GetMode();
|
||||
void SetMode(unsigned char new_mode);
|
||||
|
||||
void SetAllColors(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetEffectColor(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetLEDColor(unsigned int slot, unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
|
||||
private:
|
||||
char device_name[32];
|
||||
unsigned int led_count;
|
||||
unsigned char slots_valid;
|
||||
i2c_smbus_interface* bus;
|
||||
viper_dev_id dev;
|
||||
unsigned int mode;
|
||||
};
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
#include "PatriotViperController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_PatriotViper.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
|
||||
static void Sleep(unsigned int milliseconds)
|
||||
{
|
||||
usleep(1000 * milliseconds);
|
||||
}
|
||||
#endif
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectPatriotViperControllers *
|
||||
* *
|
||||
* Detect Patriot Viper RGB controllers on the enumerated I2C busses. *
|
||||
* *
|
||||
* bus - pointer to i2c_smbus_interface where Aura device is connected *
|
||||
* dev - I2C address of Aura device *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectPatriotViperControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers)
|
||||
{
|
||||
PatriotViperController* new_viper;
|
||||
RGBController_PatriotViper* new_controller;
|
||||
|
||||
for (unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
{
|
||||
unsigned char slots_valid = 0x00;
|
||||
|
||||
for(int slot_addr = 0x50; slot_addr <= 0x57; slot_addr++)
|
||||
{
|
||||
// Test for Patriot Viper RGB SPD at slot_addr
|
||||
// This test was copied from Viper RGB software
|
||||
// Tests SPD addresses in order: 0x00, 0x40, 0x41, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68
|
||||
busses[bus]->i2c_smbus_write_byte_data(0x36, 0x00, 0xFF);
|
||||
|
||||
Sleep(1);
|
||||
|
||||
if(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x00) == 0x23)
|
||||
{
|
||||
busses[bus]->i2c_smbus_write_byte_data(0x37, 0x00, 0xFF);
|
||||
|
||||
Sleep(1);
|
||||
|
||||
if((busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x40) == 0x85)
|
||||
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x41) == 0x02)
|
||||
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x61) == 0x4D)
|
||||
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x62) == 0x49)
|
||||
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x63) == 0x43)
|
||||
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x64) == 0x53)
|
||||
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x65) == 0x59)
|
||||
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x66) == 0x53)
|
||||
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x67) == 0x5f)
|
||||
&&(busses[bus]->i2c_smbus_read_byte_data(slot_addr, 0x68) == 0x44))
|
||||
{
|
||||
slots_valid |= (1 << (slot_addr - 0x50));
|
||||
}
|
||||
}
|
||||
|
||||
Sleep(1);
|
||||
}
|
||||
|
||||
if(slots_valid != 0)
|
||||
{
|
||||
new_viper = new PatriotViperController(busses[bus], 0x77, slots_valid);
|
||||
new_controller = new RGBController_PatriotViper(new_viper);
|
||||
rgb_controllers.push_back(new_controller);
|
||||
}
|
||||
}
|
||||
|
||||
} /* DetectPatriotViperControllers() */
|
||||
|
|
@ -321,6 +321,7 @@ void DetectAuraControllers(std::vector<i2c_smbus_interface*> &busses, std::vecto
|
|||
void DetectCorsairControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectCorsairProControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectHyperXControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectPatriotViperControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectPolychromeControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectRGBFusionControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectLEDStripControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
|
|
@ -348,6 +349,7 @@ void DetectRGBControllers(void)
|
|||
DetectCorsairControllers(busses, rgb_controllers);
|
||||
DetectCorsairProControllers(busses, rgb_controllers);
|
||||
DetectHyperXControllers(busses, rgb_controllers);
|
||||
DetectPatriotViperControllers(busses, rgb_controllers);
|
||||
DetectPolychromeControllers(busses, rgb_controllers);
|
||||
DetectRGBFusionControllers(busses, rgb_controllers);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ INCLUDEPATH += \
|
|||
Controllers/HuePlusController/ \
|
||||
Controllers/HyperXController/ \
|
||||
Controllers/LEDStripController/ \
|
||||
Controllers/PatriotViperController/ \
|
||||
Controllers/PolychromeController/ \
|
||||
Controllers/RGBFusionController/ \
|
||||
RGBController/ \
|
||||
|
|
@ -52,6 +53,8 @@ SOURCES += \
|
|||
Controllers/HyperXController/HyperXControllerDetect.cpp \
|
||||
Controllers/LEDStripController/LEDStripController.cpp \
|
||||
Controllers/LEDStripController/LEDStripControllerDetect.cpp \
|
||||
Controllers/PatriotViperController/PatriotViperController.cpp \
|
||||
Controllers/PatriotViperController/PatriotViperControllerDetect.cpp \
|
||||
Controllers/PolychromeController/PolychromeController.cpp \
|
||||
Controllers/PolychromeController/PolychromeControllerDetect.cpp \
|
||||
Controllers/RGBFusionController/RGBFusionController.cpp \
|
||||
|
|
@ -64,6 +67,7 @@ SOURCES += \
|
|||
RGBController/RGBController_HuePlus.cpp \
|
||||
RGBController/RGBController_HyperX.cpp \
|
||||
RGBController/RGBController_LEDStrip.cpp \
|
||||
RGBController/RGBController_PatriotViper.cpp \
|
||||
RGBController/RGBController_Polychrome.cpp \
|
||||
RGBController/RGBController_RGBFusion.cpp
|
||||
|
||||
|
|
@ -86,6 +90,9 @@ HEADERS += \
|
|||
Controllers/HuePlusController/HuePlusController.h \
|
||||
Controllers/HyperXController/HyperXController.h \
|
||||
Controllers/LEDStripController/LEDStripController.h \
|
||||
Controllers/PatriotViperController/PatriotViperController.h \
|
||||
Controllers/PolychromeController/PolychromeController.h \
|
||||
Controllers/RGBFusionController/RGBFusionController.h \
|
||||
RGBController/RGBController.h \
|
||||
RGBController/RGBController_AMDWraithPrism.h \
|
||||
RGBController/RGBController_Aura.h \
|
||||
|
|
@ -94,6 +101,7 @@ HEADERS += \
|
|||
RGBController/RGBController_Hue2.h \
|
||||
RGBController/RGBController_HuePlus.h \
|
||||
RGBController/RGBController_HyperX.h \
|
||||
RGBController/RGBController_PatriotViper.h \
|
||||
RGBController/RGBController_Polychrome.h \
|
||||
RGBController/RGBController_RGBFusion.h
|
||||
|
||||
|
|
|
|||
142
RGBController/RGBController_PatriotViper.cpp
Normal file
142
RGBController/RGBController_PatriotViper.cpp
Normal file
|
|
@ -0,0 +1,142 @@
|
|||
/*-----------------------------------------*\
|
||||
| RGBController_PatriotViper.cpp |
|
||||
| |
|
||||
| Generic RGB Interface for OpenRGB |
|
||||
| Patriot Viper RGB interface |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 1/1/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController_PatriotViper.h"
|
||||
|
||||
int RGBController_PatriotViper::GetMode()
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
void RGBController_PatriotViper::SetMode(int mode)
|
||||
{
|
||||
viper->SetMode(mode);
|
||||
}
|
||||
|
||||
void RGBController_PatriotViper::SetCustomMode()
|
||||
{
|
||||
viper->SetMode(0);
|
||||
}
|
||||
|
||||
void RGBController_PatriotViper::SetAllLEDs(RGBColor color)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
if(viper->GetMode() == 0)
|
||||
{
|
||||
viper->SetAllColors(red, grn, blu);
|
||||
}
|
||||
else
|
||||
{
|
||||
viper->SetEffectColor(red, grn, blu);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void RGBController_PatriotViper::SetAllZoneLEDs(int zone, RGBColor color)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
if(viper->GetMode() == 0)
|
||||
{
|
||||
for (std::size_t x = 0; x < zones[zone].map.size(); x++)
|
||||
{
|
||||
for (std::size_t y = 0; y < zones[zone].map[x].size(); y++)
|
||||
{
|
||||
viper->SetLEDColor(zones[zone].map[x][y], red, grn, blu);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
viper->SetEffectColor(red, grn, blu);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_PatriotViper::SetLED(int led, RGBColor color)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
if(viper->GetMode() == 0)
|
||||
{
|
||||
viper->SetLEDColor(led, red, grn, blu);
|
||||
}
|
||||
else
|
||||
{
|
||||
viper->SetEffectColor(red, grn, blu);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_PatriotViper::UpdateLEDs()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
RGBController_PatriotViper::RGBController_PatriotViper(PatriotViperController* viper_ptr)
|
||||
{
|
||||
viper = viper_ptr;
|
||||
|
||||
name = viper->GetDeviceName();
|
||||
location = viper->GetDeviceLocation();
|
||||
|
||||
type = DEVICE_TYPE_DRAM;
|
||||
|
||||
mode viper_modes[1];
|
||||
|
||||
viper_modes[0].name = "Direct";
|
||||
|
||||
for (int i = 0; i < 1; i++)
|
||||
{
|
||||
modes.push_back(viper_modes[i]);
|
||||
}
|
||||
|
||||
unsigned int led_idx = 0;
|
||||
|
||||
for(unsigned int slot = 0; slot < viper->GetSlotCount(); slot++)
|
||||
{
|
||||
zone* new_zone = new zone;
|
||||
|
||||
char slot_idx_str[3];
|
||||
sprintf(slot_idx_str, "%d", slot);
|
||||
new_zone->name = "Patriot Viper RGB Slot ";
|
||||
new_zone->name.append(slot_idx_str);
|
||||
|
||||
new_zone->type = ZONE_TYPE_LINEAR;
|
||||
|
||||
std::vector<int> *new_zone_map = new std::vector<int>();
|
||||
|
||||
for(int led_slot_idx = 0; led_slot_idx < 5; led_slot_idx++)
|
||||
{
|
||||
colors.push_back(0x00000000);
|
||||
|
||||
led* new_led = new led();
|
||||
|
||||
char led_idx_str[3];
|
||||
sprintf(led_idx_str, "%d", led_slot_idx);
|
||||
new_led->name = "Patriot Viper RGB Slot ";
|
||||
new_led->name.append(slot_idx_str);
|
||||
new_led->name.append(", LED ");
|
||||
new_led->name.append(led_idx_str);
|
||||
|
||||
leds.push_back(*new_led);
|
||||
|
||||
new_zone_map->push_back(led_idx);
|
||||
led_idx++;
|
||||
}
|
||||
|
||||
new_zone->map.push_back(*new_zone_map);
|
||||
zones.push_back(*new_zone);
|
||||
}
|
||||
}
|
||||
29
RGBController/RGBController_PatriotViper.h
Normal file
29
RGBController/RGBController_PatriotViper.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
/*-----------------------------------------*\
|
||||
| RGBController_PatriotViper.h |
|
||||
| |
|
||||
| Generic RGB Interface for OpenRGB |
|
||||
| Patriot Viper RGB interface |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 1/1/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "PatriotViperController.h"
|
||||
|
||||
class RGBController_PatriotViper : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_PatriotViper(PatriotViperController* viper_ptr);
|
||||
int GetMode();
|
||||
void SetMode(int mode);
|
||||
void SetCustomMode();
|
||||
void SetAllLEDs(RGBColor color);
|
||||
void SetAllZoneLEDs(int zone, RGBColor color);
|
||||
void SetLED(int led, RGBColor color);
|
||||
void UpdateLEDs();
|
||||
|
||||
private:
|
||||
PatriotViperController* viper;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue