mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-05-19 03:56:26 -04:00
Add modes and additional set functions to Polychrome controller
This commit is contained in:
@@ -76,45 +76,38 @@ unsigned int PolychromeController::GetLEDCount()
|
||||
|
||||
unsigned int PolychromeController::GetMode()
|
||||
{
|
||||
return(0);
|
||||
return(active_mode);
|
||||
}
|
||||
|
||||
void PolychromeController::SetAllColors(unsigned char red, unsigned char green, unsigned char blue)
|
||||
bool PolychromeController::IsAsrLed()
|
||||
{
|
||||
return(asr_led);
|
||||
}
|
||||
|
||||
void PolychromeController::SetColor(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
unsigned char colors[3] = { red, green, blue };
|
||||
|
||||
if (asr_led)
|
||||
{
|
||||
|
||||
bus->i2c_smbus_write_block_data(dev, active_mode, 3, colors);
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char colors[3] = { red, green, blue };
|
||||
|
||||
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_COLOR, 3, colors);
|
||||
}
|
||||
}
|
||||
|
||||
void PolychromeController::SetLEDColor(unsigned int /*led*/, unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
if (asr_led)
|
||||
{
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
unsigned char colors[3] = { red, green, blue };
|
||||
|
||||
bus->i2c_smbus_write_block_data(dev, POLYCHROME_REG_COLOR, 3, colors);
|
||||
}
|
||||
}
|
||||
|
||||
void PolychromeController::SetMode(unsigned char mode)
|
||||
{
|
||||
active_mode = mode;
|
||||
|
||||
if (asr_led)
|
||||
{
|
||||
|
||||
bus->i2c_smbus_write_byte_data(dev, ASRLED_REG_MODE, active_mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, POLYCHROME_REG_MODE, mode);
|
||||
bus->i2c_smbus_write_byte_data(dev, POLYCHROME_REG_MODE, active_mode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,8 +77,8 @@ public:
|
||||
char* GetDeviceName();
|
||||
unsigned int GetLEDCount();
|
||||
unsigned int GetMode();
|
||||
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);
|
||||
bool IsAsrLed();
|
||||
void SetColor(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetMode(unsigned char mode);
|
||||
unsigned short GetFirmwareVersion();
|
||||
|
||||
@@ -86,7 +86,8 @@ private:
|
||||
bool asr_led;
|
||||
char device_name[32];
|
||||
unsigned int led_count;
|
||||
unsigned char active_mode;
|
||||
i2c_smbus_interface* bus;
|
||||
polychrome_dev_id dev;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user