mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-04-27 09:23:57 -04:00
Rename HyperXController to HyperXDRAMController
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
/*-----------------------------------------*\
|
||||
| HyperXController.cpp |
|
||||
| HyperXDRAMController.cpp |
|
||||
| |
|
||||
| Definitions and types for HyperX Predator|
|
||||
| RGB RAM lighting controller |
|
||||
| and Fury RGB RAM lighting controller |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 6/29/2019 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "HyperXController.h"
|
||||
#include "HyperXDRAMController.h"
|
||||
#include <cstring>
|
||||
|
||||
HyperXController::HyperXController(i2c_smbus_interface* bus, hyperx_dev_id dev, unsigned char slots)
|
||||
HyperXDRAMController::HyperXDRAMController(i2c_smbus_interface* bus, hyperx_dev_id dev, unsigned char slots)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
@@ -31,17 +31,17 @@ HyperXController::HyperXController(i2c_smbus_interface* bus, hyperx_dev_id dev,
|
||||
mode = HYPERX_MODE_DIRECT;
|
||||
}
|
||||
|
||||
HyperXController::~HyperXController()
|
||||
HyperXDRAMController::~HyperXDRAMController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string HyperXController::GetDeviceName()
|
||||
std::string HyperXDRAMController::GetDeviceName()
|
||||
{
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
std::string HyperXController::GetDeviceLocation()
|
||||
std::string HyperXDRAMController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->device_name);
|
||||
char addr[5];
|
||||
@@ -51,12 +51,12 @@ std::string HyperXController::GetDeviceLocation()
|
||||
return(return_string);
|
||||
}
|
||||
|
||||
unsigned int HyperXController::GetLEDCount()
|
||||
unsigned int HyperXDRAMController::GetLEDCount()
|
||||
{
|
||||
return(led_count);
|
||||
}
|
||||
|
||||
unsigned int HyperXController::GetSlotCount()
|
||||
unsigned int HyperXDRAMController::GetSlotCount()
|
||||
{
|
||||
unsigned int slot_count = 0;
|
||||
|
||||
@@ -71,12 +71,12 @@ unsigned int HyperXController::GetSlotCount()
|
||||
return(slot_count);
|
||||
}
|
||||
|
||||
unsigned int HyperXController::GetMode()
|
||||
unsigned int HyperXDRAMController::GetMode()
|
||||
{
|
||||
return(mode);
|
||||
}
|
||||
|
||||
void HyperXController::SetEffectColor(unsigned char red, unsigned char green, unsigned char blue)
|
||||
void HyperXDRAMController::SetEffectColor(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x01);
|
||||
|
||||
@@ -89,7 +89,7 @@ void HyperXController::SetEffectColor(unsigned char red, unsigned char green, un
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x03);
|
||||
}
|
||||
|
||||
void HyperXController::SetAllColors(unsigned char red, unsigned char green, unsigned char blue)
|
||||
void HyperXDRAMController::SetAllColors(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x01);
|
||||
|
||||
@@ -126,7 +126,7 @@ void HyperXController::SetAllColors(unsigned char red, unsigned char green, unsi
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x03);
|
||||
}
|
||||
|
||||
void HyperXController::SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
|
||||
void HyperXDRAMController::SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| led_slot - the unmapped slot ID for the given LED |
|
||||
@@ -175,7 +175,7 @@ void HyperXController::SetLEDColor(unsigned int led, unsigned char red, unsigned
|
||||
}
|
||||
|
||||
|
||||
void HyperXController::SetLEDColor(unsigned int slot, unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
|
||||
void HyperXDRAMController::SetLEDColor(unsigned int slot, unsigned int led, unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
unsigned char base = slot_base[slot];
|
||||
unsigned char red_base = base + 0x00;
|
||||
@@ -194,7 +194,7 @@ void HyperXController::SetLEDColor(unsigned int slot, unsigned int led, unsigned
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x03);
|
||||
}
|
||||
|
||||
void HyperXController::SetMode(unsigned char new_mode, bool random, unsigned short new_speed)
|
||||
void HyperXDRAMController::SetMode(unsigned char new_mode, bool random, unsigned short new_speed)
|
||||
{
|
||||
mode = new_mode;
|
||||
speed = new_speed;
|
||||
@@ -1,8 +1,8 @@
|
||||
/*-----------------------------------------*\
|
||||
| HyperXController.h |
|
||||
| HyperXDRAMController.h |
|
||||
| |
|
||||
| Definitions and types for HyperX Predator|
|
||||
| RGB RAM lighting controller |
|
||||
| and Fury RGB RAM lighting controller |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 6/29/2019 |
|
||||
\*-----------------------------------------*/
|
||||
@@ -193,11 +193,11 @@ static const unsigned char slot_base[4] =
|
||||
HYPERX_REG_SLOT3_LED0_RED /* SPD 0x53 maps to slot 3 */
|
||||
};
|
||||
|
||||
class HyperXController
|
||||
class HyperXDRAMController
|
||||
{
|
||||
public:
|
||||
HyperXController(i2c_smbus_interface* bus, hyperx_dev_id dev, unsigned char slots);
|
||||
~HyperXController();
|
||||
HyperXDRAMController(i2c_smbus_interface* bus, hyperx_dev_id dev, unsigned char slots);
|
||||
~HyperXDRAMController();
|
||||
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceLocation();
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "HyperXController.h"
|
||||
#include "HyperXDRAMController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_HyperX.h"
|
||||
#include "RGBController_HyperXDRAM.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
@@ -19,13 +19,13 @@ static void Sleep(unsigned int milliseconds)
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* TestForHyperXController *
|
||||
* TestForHyperXDRAMController *
|
||||
* *
|
||||
* Tests the given address to see if a HyperX controller exists there. *
|
||||
* Tests the given address to see if a HyperX controller exists there. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
bool TestForHyperXController(i2c_smbus_interface* bus, unsigned char address)
|
||||
bool TestForHyperXDRAMController(i2c_smbus_interface* bus, unsigned char address)
|
||||
{
|
||||
bool pass = false;
|
||||
|
||||
@@ -48,31 +48,31 @@ bool TestForHyperXController(i2c_smbus_interface* bus, unsigned char address)
|
||||
|
||||
return(pass);
|
||||
|
||||
} /* TestForHyperXController() */
|
||||
} /* TestForHyperXDRAMController() */
|
||||
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectHyperXControllers *
|
||||
* DetectHyperXDRAMControllers *
|
||||
* *
|
||||
* Detect HyperX controllers on the enumerated I2C busses. *
|
||||
* Detect HyperX DRAM controllers on the enumerated I2C busses. *
|
||||
* *
|
||||
* bus - pointer to i2c_smbus_interface where Aura device is connected *
|
||||
* dev - I2C address of Aura device *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectHyperXControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers)
|
||||
void DetectHyperXDRAMControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers)
|
||||
{
|
||||
HyperXController* new_hyperx;
|
||||
RGBController_HyperX* new_controller;
|
||||
HyperXDRAMController* new_hyperx;
|
||||
RGBController_HyperXDRAM* new_controller;
|
||||
|
||||
for (unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
{
|
||||
unsigned char slots_valid = 0x00;
|
||||
|
||||
// Check for HyperX controller at 0x27
|
||||
if (TestForHyperXController(busses[bus], 0x27))
|
||||
if (TestForHyperXDRAMController(busses[bus], 0x27))
|
||||
{
|
||||
busses[bus]->i2c_smbus_write_byte_data(0x37, 0x00, 0xFF);
|
||||
|
||||
@@ -94,11 +94,11 @@ void DetectHyperXControllers(std::vector<i2c_smbus_interface*> &busses, std::vec
|
||||
|
||||
if(slots_valid != 0)
|
||||
{
|
||||
new_hyperx = new HyperXController(busses[bus], 0x27, slots_valid);
|
||||
new_controller = new RGBController_HyperX(new_hyperx);
|
||||
new_hyperx = new HyperXDRAMController(busses[bus], 0x27, slots_valid);
|
||||
new_controller = new RGBController_HyperXDRAM(new_hyperx);
|
||||
rgb_controllers.push_back(new_controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} /* DetectHyperXControllers() */
|
||||
} /* DetectHyperXDRAMControllers() */
|
||||
@@ -281,7 +281,7 @@ void DetectAuraGPUControllers(std::vector<i2c_smbus_interface*> &busses, std::ve
|
||||
void DetectCorsairVengeanceControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectCorsairVengeanceProControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectCrucialControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectHyperXControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectHyperXDRAMControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectPatriotViperControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectPolychromeControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
void DetectRGBFusionControllers(std::vector<i2c_smbus_interface*>& busses, std::vector<RGBController*>& rgb_controllers);
|
||||
@@ -319,7 +319,7 @@ void DetectRGBControllers(void)
|
||||
DetectCorsairVengeanceControllers(busses, rgb_controllers);
|
||||
DetectCorsairVengeanceProControllers(busses, rgb_controllers);
|
||||
DetectCrucialControllers(busses, rgb_controllers);
|
||||
DetectHyperXControllers(busses, rgb_controllers);
|
||||
DetectHyperXDRAMControllers(busses, rgb_controllers);
|
||||
DetectPatriotViperControllers(busses, rgb_controllers);
|
||||
DetectPolychromeControllers(busses, rgb_controllers);
|
||||
DetectRGBFusionGPUControllers(busses, rgb_controllers);
|
||||
|
||||
12
OpenRGB.pro
12
OpenRGB.pro
@@ -39,7 +39,7 @@ INCLUDEPATH += \
|
||||
Controllers/CrucialController/ \
|
||||
Controllers/Hue2Controller/ \
|
||||
Controllers/HuePlusController/ \
|
||||
Controllers/HyperXController/ \
|
||||
Controllers/HyperXDRAMController/ \
|
||||
Controllers/HyperXKeyboardController/ \
|
||||
Controllers/LEDStripController/ \
|
||||
Controllers/MSI3ZoneController/ \
|
||||
@@ -95,8 +95,8 @@ SOURCES += \
|
||||
Controllers/Hue2Controller/Hue2ControllerDetect.cpp \
|
||||
Controllers/HuePlusController/HuePlusController.cpp \
|
||||
Controllers/HuePlusController/HuePlusControllerDetect.cpp \
|
||||
Controllers/HyperXController/HyperXController.cpp \
|
||||
Controllers/HyperXController/HyperXControllerDetect.cpp \
|
||||
Controllers/HyperXDRAMController/HyperXDRAMController.cpp \
|
||||
Controllers/HyperXDRAMController/HyperXDRAMControllerDetect.cpp \
|
||||
Controllers/HyperXKeyboardController/HyperXKeyboardController.cpp \
|
||||
Controllers/HyperXKeyboardController/HyperXKeyboardControllerDetect.cpp \
|
||||
Controllers/LEDStripController/LEDStripController.cpp \
|
||||
@@ -132,7 +132,7 @@ SOURCES += \
|
||||
RGBController/RGBController_Dummy.cpp \
|
||||
RGBController/RGBController_Hue2.cpp \
|
||||
RGBController/RGBController_HuePlus.cpp \
|
||||
RGBController/RGBController_HyperX.cpp \
|
||||
RGBController/RGBController_HyperXDRAM.cpp \
|
||||
RGBController/RGBController_HyperXKeyboard.cpp \
|
||||
RGBController/RGBController_E131.cpp \
|
||||
RGBController/RGBController_LEDStrip.cpp \
|
||||
@@ -172,7 +172,7 @@ HEADERS += \
|
||||
Controllers/CrucialController/CrucialController.h \
|
||||
Controllers/Hue2Controller/Hue2Controller.h \
|
||||
Controllers/HuePlusController/HuePlusController.h \
|
||||
Controllers/HyperXController/HyperXController.h \
|
||||
Controllers/HyperXDRAMController/HyperXDRAMController.h \
|
||||
Controllers/HyperXKeyboardController/HyperXKeyboardController.h \
|
||||
Controllers/LEDStripController/LEDStripController.h \
|
||||
Controllers/MSI3ZoneController/MSI3ZoneController.h \
|
||||
@@ -197,7 +197,7 @@ HEADERS += \
|
||||
RGBController/RGBController_E131.h \
|
||||
RGBController/RGBController_Hue2.h \
|
||||
RGBController/RGBController_HuePlus.h \
|
||||
RGBController/RGBController_HyperX.h \
|
||||
RGBController/RGBController_HyperXDRAM.h \
|
||||
RGBController/RGBController_HyperXKeyboard.h \
|
||||
RGBController/RGBController_LEDStrip.h \
|
||||
RGBController/RGBController_MSI3Zone.h \
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
/*-----------------------------------------*\
|
||||
| RGBController_HyperX.cpp |
|
||||
| RGBController_HyperXDRAM.cpp |
|
||||
| |
|
||||
| Generic RGB Interface for OpenAuraSDK |
|
||||
| HyperX Predator RGB interface |
|
||||
| HyperX Predator and Fury RGB interface |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 6/29/2019 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController_HyperX.h"
|
||||
#include "RGBController_HyperXDRAM.h"
|
||||
|
||||
|
||||
RGBController_HyperX::RGBController_HyperX(HyperXController* hyperx_ptr)
|
||||
RGBController_HyperXDRAM::RGBController_HyperXDRAM(HyperXDRAMController* hyperx_ptr)
|
||||
{
|
||||
hyperx = hyperx_ptr;
|
||||
|
||||
@@ -124,7 +124,7 @@ RGBController_HyperX::RGBController_HyperX(HyperXController* hyperx_ptr)
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
void RGBController_HyperX::SetupZones()
|
||||
void RGBController_HyperXDRAM::SetupZones()
|
||||
{
|
||||
for(unsigned int slot = 0; slot < hyperx->GetSlotCount(); slot++)
|
||||
{
|
||||
@@ -160,14 +160,14 @@ void RGBController_HyperX::SetupZones()
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_HyperX::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
void RGBController_HyperXDRAM::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_HyperX::UpdateLEDs()
|
||||
void RGBController_HyperXDRAM::UpdateLEDs()
|
||||
{
|
||||
if(hyperx->GetMode() == HYPERX_MODE_DIRECT)
|
||||
{
|
||||
@@ -189,7 +189,7 @@ void RGBController_HyperX::UpdateLEDs()
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_HyperX::UpdateZoneLEDs(int zone)
|
||||
void RGBController_HyperXDRAM::UpdateZoneLEDs(int zone)
|
||||
{
|
||||
if(hyperx->GetMode() == HYPERX_MODE_DIRECT)
|
||||
{
|
||||
@@ -212,7 +212,7 @@ void RGBController_HyperX::UpdateZoneLEDs(int zone)
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_HyperX::UpdateSingleLED(int led)
|
||||
void RGBController_HyperXDRAM::UpdateSingleLED(int led)
|
||||
{
|
||||
RGBColor color = colors[led];
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
@@ -229,12 +229,12 @@ void RGBController_HyperX::UpdateSingleLED(int led)
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_HyperX::SetCustomMode()
|
||||
void RGBController_HyperXDRAM::SetCustomMode()
|
||||
{
|
||||
active_mode = 0;
|
||||
}
|
||||
|
||||
void RGBController_HyperX::UpdateMode()
|
||||
void RGBController_HyperXDRAM::UpdateMode()
|
||||
{
|
||||
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*-----------------------------------------*\
|
||||
| RGBController_HyperX.h |
|
||||
| RGBController_HyperXDRAM.h |
|
||||
| |
|
||||
| Generic RGB Interface for OpenAuraSDK |
|
||||
| HyperX Predator RGB interface |
|
||||
| HyperX Predator and Fury RGB interface |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 6/29/2019 |
|
||||
\*-----------------------------------------*/
|
||||
@@ -10,12 +10,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "HyperXController.h"
|
||||
#include "HyperXDRAMController.h"
|
||||
|
||||
class RGBController_HyperX : public RGBController
|
||||
class RGBController_HyperXDRAM : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_HyperX(HyperXController* hyperx_ptr);
|
||||
RGBController_HyperXDRAM(HyperXDRAMController* hyperx_ptr);
|
||||
|
||||
void SetupZones();
|
||||
|
||||
@@ -29,5 +29,5 @@ public:
|
||||
void UpdateMode();
|
||||
|
||||
private:
|
||||
HyperXController* hyperx;
|
||||
HyperXDRAMController* hyperx;
|
||||
};
|
||||
Reference in New Issue
Block a user