Start work on Information page and add information fields to RGBController API
This commit is contained in:
parent
0d38154134
commit
7dddb9d111
25 changed files with 363 additions and 44 deletions
|
|
@ -82,11 +82,21 @@ AuraController::~AuraController()
|
|||
|
||||
}
|
||||
|
||||
char * AuraController::GetDeviceName()
|
||||
std::string AuraController::GetDeviceName()
|
||||
{
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
std::string AuraController::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 char AuraController::GetChannel(unsigned int led)
|
||||
{
|
||||
return(config_table[channel_cfg + led]);
|
||||
|
|
@ -245,4 +255,4 @@ void AuraController::AuraRegisterWriteBlock(aura_register reg, unsigned char * d
|
|||
//Write Aura block data
|
||||
bus->i2c_smbus_write_block_data(dev, 0x03, sz, data);
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
| Adam Honse (CalcProgrammer1) 8/19/2018 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
#pragma once
|
||||
|
|
@ -93,7 +94,8 @@ public:
|
|||
AuraController(i2c_smbus_interface* bus, aura_dev_id dev);
|
||||
~AuraController();
|
||||
|
||||
char* GetDeviceName();
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceLocation();
|
||||
unsigned char GetChannel(unsigned int led);
|
||||
const char* GetChannelName(unsigned int led);
|
||||
unsigned int GetLEDCount();
|
||||
|
|
@ -120,4 +122,4 @@ private:
|
|||
i2c_smbus_interface * bus;
|
||||
aura_dev_id dev;
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,11 +24,21 @@ CorsairController::~CorsairController()
|
|||
|
||||
}
|
||||
|
||||
char * CorsairController::GetDeviceName()
|
||||
std::string CorsairController::GetDeviceName()
|
||||
{
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
std::string CorsairController::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 CorsairController::GetLEDCount()
|
||||
{
|
||||
return(led_count);
|
||||
|
|
@ -55,4 +65,4 @@ void CorsairController::SetLEDColor(unsigned int led, unsigned char red, unsigne
|
|||
void CorsairController::SetMode(unsigned char mode)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_VENGEANCE_RGB_CMD_MODE, CORSAIR_VENGEANCE_RGB_MODE_SINGLE);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
| Adam Honse (CalcProgrammer1) 3/8/2019 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
#pragma once
|
||||
|
|
@ -38,7 +39,8 @@ public:
|
|||
CorsairController(i2c_smbus_interface* bus, corsair_dev_id dev);
|
||||
~CorsairController();
|
||||
|
||||
char* GetDeviceName();
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceLocation();
|
||||
unsigned int GetLEDCount();
|
||||
void SetMode(unsigned char mode);
|
||||
|
||||
|
|
@ -50,4 +52,4 @@ private:
|
|||
unsigned int led_count;
|
||||
i2c_smbus_interface * bus;
|
||||
corsair_dev_id dev;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -42,11 +42,21 @@ CorsairProController::~CorsairProController()
|
|||
|
||||
}
|
||||
|
||||
char* CorsairProController::GetDeviceName()
|
||||
std::string CorsairProController::GetDeviceName()
|
||||
{
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
std::string CorsairProController::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 CorsairProController::GetLEDCount()
|
||||
{
|
||||
return(led_count);
|
||||
|
|
@ -134,4 +144,4 @@ bool CorsairProController::WaitReady()
|
|||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
| Adam Honse (CalcProgrammer1) 6/30/2019 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
#pragma once
|
||||
|
|
@ -65,7 +66,8 @@ public:
|
|||
CorsairProController(i2c_smbus_interface* bus, corsair_dev_id dev);
|
||||
~CorsairProController();
|
||||
|
||||
char* GetDeviceName();
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceLocation();
|
||||
unsigned int GetLEDCount();
|
||||
void SetEffect(unsigned char mode);
|
||||
void SetCustom();
|
||||
|
|
@ -85,4 +87,4 @@ private:
|
|||
|
||||
i2c_smbus_interface* bus;
|
||||
corsair_dev_id dev;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -24,11 +24,21 @@ HyperXController::~HyperXController()
|
|||
|
||||
}
|
||||
|
||||
char* HyperXController::GetDeviceName()
|
||||
std::string HyperXController::GetDeviceName()
|
||||
{
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
std::string HyperXController::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 HyperXController::GetLEDCount()
|
||||
{
|
||||
return(led_count);
|
||||
|
|
@ -99,4 +109,4 @@ void HyperXController::SetMode(unsigned char mode)
|
|||
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x02);
|
||||
bus->i2c_smbus_write_byte_data(dev, HYPERX_REG_APPLY, 0x03);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
| Adam Honse (CalcProgrammer1) 6/29/2019 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
#pragma once
|
||||
|
|
@ -61,7 +62,8 @@ public:
|
|||
HyperXController(i2c_smbus_interface* bus, hyperx_dev_id dev);
|
||||
~HyperXController();
|
||||
|
||||
char* GetDeviceName();
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceLocation();
|
||||
unsigned int GetLEDCount();
|
||||
void SetMode(unsigned char mode);
|
||||
|
||||
|
|
@ -73,4 +75,4 @@ private:
|
|||
unsigned int led_count;
|
||||
i2c_smbus_interface* bus;
|
||||
hyperx_dev_id dev;
|
||||
};
|
||||
};
|
||||
|
|
|
|||
|
|
@ -29,11 +29,21 @@ RGBFusionController::~RGBFusionController()
|
|||
|
||||
}
|
||||
|
||||
char* RGBFusionController::GetDeviceName()
|
||||
std::string RGBFusionController::GetDeviceName()
|
||||
{
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
std::string RGBFusionController::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 RGBFusionController::GetLEDCount()
|
||||
{
|
||||
return(led_count);
|
||||
|
|
@ -158,4 +168,4 @@ void RGBFusionController::set_mode_ch_1(unsigned char mode)
|
|||
void RGBFusionController::switch_bank(unsigned char bank)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, RGB_FUSION_BANK_SWITCH_REG, bank);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
| Adam Honse (CalcProgrammer1) 12/10/2019 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
#pragma once
|
||||
|
|
@ -42,7 +43,8 @@ public:
|
|||
RGBFusionController(i2c_smbus_interface* bus, rgb_fusion_dev_id dev);
|
||||
~RGBFusionController();
|
||||
|
||||
char* GetDeviceName();
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceLocation();
|
||||
unsigned int GetLEDCount();
|
||||
unsigned char GetMode();
|
||||
void SetAllColors(unsigned char red, unsigned char green, unsigned char blue);
|
||||
|
|
@ -66,4 +68,4 @@ private:
|
|||
i2c_smbus_interface* bus;
|
||||
rgb_fusion_dev_id dev;
|
||||
|
||||
};
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue