Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6de8c374dc |
@@ -0,0 +1,202 @@
|
||||
/*-----------------------------------------*\
|
||||
| AuraAddressableController.cpp |
|
||||
| |
|
||||
| Driver for ASUS Aura RGB Addressable |
|
||||
| lighting controller |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 1/18/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "AuraAddressableController.h"
|
||||
#include <cstring>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <Windows.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
|
||||
static void Sleep(unsigned int milliseconds)
|
||||
{
|
||||
usleep(1000 * milliseconds);
|
||||
}
|
||||
#endif
|
||||
|
||||
AuraAddressableController::AuraAddressableController(hid_device* dev_handle)
|
||||
{
|
||||
dev = dev_handle;
|
||||
|
||||
channel_leds[0] = 40;
|
||||
}
|
||||
|
||||
AuraAddressableController::~AuraAddressableController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void AuraAddressableController::SetLEDsDirect(std::vector<RGBColor> colors)
|
||||
{
|
||||
unsigned char led_data[60];
|
||||
unsigned int leds_sent = 0;
|
||||
|
||||
SendDirectBegin();
|
||||
|
||||
while(leds_sent < colors.size())
|
||||
{
|
||||
unsigned int leds_to_send = 20;
|
||||
|
||||
if((colors.size() - leds_sent) < leds_to_send)
|
||||
{
|
||||
leds_to_send = colors.size() - leds_sent;
|
||||
}
|
||||
|
||||
for(int led_idx = 0; leds_to_send < 20; led_idx++)
|
||||
{
|
||||
led_data[(led_idx * 3) + 0] = RGBGetRValue(colors[led_idx]);
|
||||
led_data[(led_idx * 3) + 1] = RGBGetGValue(colors[led_idx]);
|
||||
led_data[(led_idx * 3) + 2] = RGBGetBValue(colors[led_idx]);
|
||||
}
|
||||
|
||||
SendDirect
|
||||
(
|
||||
0,
|
||||
leds_sent,
|
||||
leds_to_send,
|
||||
led_data
|
||||
);
|
||||
}
|
||||
|
||||
SendDirectApply();
|
||||
}
|
||||
|
||||
void AuraAddressableController::SetMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned char red,
|
||||
unsigned char grn,
|
||||
unsigned char blu
|
||||
)
|
||||
{
|
||||
SendEffect
|
||||
(
|
||||
mode,
|
||||
red,
|
||||
grn,
|
||||
blu
|
||||
);
|
||||
}
|
||||
|
||||
void AuraAddressableController::SendEffect
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned char red,
|
||||
unsigned char grn,
|
||||
unsigned char blu
|
||||
)
|
||||
{
|
||||
unsigned char usb_buf[65];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up message packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0xEC;
|
||||
usb_buf[0x01] = AURA_CONTROL_MODE_EFFECT;
|
||||
usb_buf[0x02] = 0x00;
|
||||
usb_buf[0x03] = 0x00;
|
||||
usb_buf[0x04] = mode;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Copy in color data bytes |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x05] = red;
|
||||
usb_buf[0x06] = grn;
|
||||
usb_buf[0x07] = blu;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, usb_buf, 64);
|
||||
}
|
||||
|
||||
void AuraAddressableController::SendDirect
|
||||
(
|
||||
unsigned char device,
|
||||
unsigned char start_led,
|
||||
unsigned char led_count,
|
||||
unsigned char* led_data
|
||||
)
|
||||
{
|
||||
unsigned char usb_buf[65];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up message packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0xEC;
|
||||
usb_buf[0x01] = AURA_CONTROL_MODE_DIRECT;
|
||||
usb_buf[0x02] = device;
|
||||
usb_buf[0x03] = start_led;
|
||||
usb_buf[0x04] = led_count;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Copy in color data bytes |
|
||||
\*-----------------------------------------------------*/
|
||||
memcpy(&usb_buf[0x05], led_data, led_count * 3);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, usb_buf, 64);
|
||||
}
|
||||
|
||||
void AuraAddressableController::SendDirectBegin()
|
||||
{
|
||||
unsigned char usb_buf[65];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up message packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0xEC;
|
||||
usb_buf[0x01] = AURA_CONTROL_MODE_EFFECT;
|
||||
usb_buf[0x04] = 0xFF;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, usb_buf, 64);
|
||||
}
|
||||
|
||||
void AuraAddressableController::SendDirectApply()
|
||||
{
|
||||
unsigned char usb_buf[65];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up message packet |
|
||||
\*-----------------------------------------------------*/
|
||||
usb_buf[0x00] = 0xEC;
|
||||
usb_buf[0x01] = AURA_CONTROL_MODE_DIRECT;
|
||||
usb_buf[0x02] = 0x80;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
hid_send_feature_report(dev, usb_buf, 64);
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
/*-----------------------------------------*\
|
||||
| AuraAddressableController.h |
|
||||
| |
|
||||
| Definitions and types for ASUS Aura |
|
||||
| Addressable RGB lighting controller |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 1/18/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController.h"
|
||||
|
||||
#include <string>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
AURA_MODE_OFF = 0, /* OFF mode */
|
||||
AURA_MODE_STATIC = 1, /* Static color mode */
|
||||
AURA_MODE_BREATHING = 2, /* Breathing effect mode */
|
||||
AURA_MODE_FLASHING = 3, /* Flashing effect mode */
|
||||
AURA_MODE_SPECTRUM_CYCLE = 4, /* Spectrum Cycle mode */
|
||||
AURA_MODE_RAINBOW = 5, /* Rainbow effect mode */
|
||||
AURA_MODE_SPECTRUM_CYCLE_BREATHING = 6, /* Rainbow Breathing effect mode */
|
||||
AURA_MODE_CHASE_FADE = 7, /* Chase with Fade effect mode */
|
||||
AURA_MODE_SPECTRUM_CYCLE_CHASE_FADE = 8, /* Chase with Fade, Rainbow effect mode */
|
||||
AURA_MODE_CHASE = 9, /* Chase effect mode */
|
||||
AURA_MODE_SPECTRUM_CYCLE_CHASE = 10, /* Chase with Rainbow effect mode */
|
||||
AURA_MODE_SPECTRUM_CYCLE_WAVE = 11, /* Wave effect mode */
|
||||
AURA_MODE_CHASE_RAINBOW_PULSE = 12, /* Chase with Rainbow Pulse effect mode*/
|
||||
AURA_MODE_RANDOM_FLICKER = 13, /* Random flicker effect mode */
|
||||
AURA_MODE_MUSIC = 14, /* Music effect mode */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
AURA_CONTROL_MODE_EFFECT = 0x3B, /* Effect control mode */
|
||||
AURA_CONTROL_MODE_DIRECT = 0x40, /* Direct control mode */
|
||||
};
|
||||
|
||||
class AuraAddressableController
|
||||
{
|
||||
public:
|
||||
AuraAddressableController(hid_device* dev_handle);
|
||||
~AuraAddressableController();
|
||||
|
||||
void SetLEDsDirect(std::vector<RGBColor> colors);
|
||||
|
||||
void SetMode
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned char red,
|
||||
unsigned char grn,
|
||||
unsigned char blu
|
||||
);
|
||||
|
||||
unsigned int channel_leds[1];
|
||||
|
||||
private:
|
||||
char device_name[32];
|
||||
hid_device* dev;
|
||||
unsigned int led_count;
|
||||
|
||||
void SendEffect
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned char red,
|
||||
unsigned char grn,
|
||||
unsigned char blu
|
||||
);
|
||||
|
||||
void SendDirect
|
||||
(
|
||||
unsigned char device,
|
||||
unsigned char start_led,
|
||||
unsigned char led_count,
|
||||
unsigned char* led_data
|
||||
);
|
||||
|
||||
void SendDirectBegin();
|
||||
|
||||
void SendDirectApply();
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
#include "AuraAddressableController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_AuraAddressable.h"
|
||||
#include <vector>
|
||||
#include <hidapi/hidapi.h>
|
||||
|
||||
#define AURA_ADDRESSABLE_VID 0x0B05
|
||||
#define AURA_ADDRESSABLE_PID 0x1872
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectAuraAddressableControllers *
|
||||
* *
|
||||
* Tests the USB address to see if an Asus Aura addressable RGB header controller *
|
||||
* exists there. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectAuraAddressableControllers(std::vector<RGBController*>& rgb_controllers)
|
||||
{
|
||||
hid_device* dev;
|
||||
|
||||
//Look for Asus Aura addressable RGB header controller
|
||||
hid_init();
|
||||
|
||||
dev = hid_open(AURA_ADDRESSABLE_VID, AURA_ADDRESSABLE_PID, 0);
|
||||
|
||||
if( dev )
|
||||
{
|
||||
AuraAddressableController* controller = new AuraAddressableController(dev);
|
||||
|
||||
RGBController_AuraAddressable* rgb_controller = new RGBController_AuraAddressable(controller);
|
||||
|
||||
rgb_controllers.push_back(rgb_controller);
|
||||
}
|
||||
}
|
||||
@@ -260,6 +260,7 @@ void DetectHyperXControllers(std::vector<i2c_smbus_interface*> &busses, std::vec
|
||||
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 DetectAuraAddressableControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectLEDStripControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectHue2Controllers(std::vector<RGBController*> &rgb_controllers);
|
||||
void DetectHuePlusControllers(std::vector<RGBController*> &rgb_controllers);
|
||||
@@ -297,6 +298,7 @@ void DetectRGBControllers(void)
|
||||
DetectPolychromeControllers(busses, rgb_controllers);
|
||||
DetectRGBFusionControllers(busses, rgb_controllers);
|
||||
|
||||
DetectAuraAddressableControllers(rgb_controllers);
|
||||
DetectLEDStripControllers(rgb_controllers);
|
||||
DetectHue2Controllers(rgb_controllers);
|
||||
DetectHuePlusControllers(rgb_controllers);
|
||||
|
||||
@@ -13,6 +13,7 @@ INCLUDEPATH += \
|
||||
serial_port/ \
|
||||
super_io/ \
|
||||
Controllers/AMDWraithPrismController/ \
|
||||
Controllers/AuraAddressableController/ \
|
||||
Controllers/AuraController/ \
|
||||
Controllers/CorsairController/ \
|
||||
Controllers/CorsairCmdrProController/ \
|
||||
@@ -52,6 +53,8 @@ SOURCES += \
|
||||
super_io/super_io.cpp \
|
||||
Controllers/AMDWraithPrismController/AMDWraithPrismController.cpp \
|
||||
Controllers/AMDWraithPrismController/AMDWraithPrismControllerDetect.cpp \
|
||||
Controllers/AuraAddressableController/AuraAddressableController.cpp \
|
||||
Controllers/AuraAddressableController/AuraAddressableControllerDetect.cpp \
|
||||
Controllers/AuraController/AuraController.cpp \
|
||||
Controllers/AuraController/AuraControllerDetect.cpp \
|
||||
Controllers/CorsairController/CorsairController.cpp \
|
||||
@@ -94,6 +97,7 @@ SOURCES += \
|
||||
RGBController/E131ControllerDetect.cpp \
|
||||
RGBController/RGBController_AMDWraithPrism.cpp \
|
||||
RGBController/RGBController_Aura.cpp \
|
||||
RGBController/RGBController_AuraAddressable.cpp \
|
||||
RGBController/RGBController_Corsair.cpp \
|
||||
RGBController/RGBController_CorsairCmdrPro.cpp \
|
||||
RGBController/RGBController_CorsairKeyboard.cpp \
|
||||
@@ -128,6 +132,7 @@ HEADERS += \
|
||||
super_io/super_io.h \
|
||||
Controllers/AMDWraithPrismController/AMDWraithPrismController.h \
|
||||
Controllers/AuraController/AuraController.h \
|
||||
Controllers/AuraAddressableController/AuraAddressableController.h \
|
||||
Controllers/CorsairController/CorsairController.h \
|
||||
Controllers/CorsairCmdrProController/CorsairCmdrProController.h \
|
||||
Controllers/CorsairKeyboardController/CorsairKeyboardController.h \
|
||||
@@ -149,6 +154,7 @@ HEADERS += \
|
||||
RGBController/RGBController.h \
|
||||
RGBController/RGBController_AMDWraithPrism.h \
|
||||
RGBController/RGBController_Aura.h \
|
||||
RGBController/RGBController_AuraAddressable.h \
|
||||
RGBController/RGBController_Corsair.h \
|
||||
RGBController/RGBController_CorsairCmdrPro.h \
|
||||
RGBController/RGBController_CorsairNodePro.h \
|
||||
|
||||
@@ -0,0 +1,196 @@
|
||||
/*-----------------------------------------*\
|
||||
| RGBController_AuraAddressable.cpp |
|
||||
| |
|
||||
| Generic RGB Interface for Asus Aura |
|
||||
| addressable controller driver |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 1/18/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "RGBController_AuraAddressable.h"
|
||||
|
||||
RGBController_AuraAddressable::RGBController_AuraAddressable(AuraAddressableController* aura_ptr)
|
||||
{
|
||||
aura = aura_ptr;
|
||||
|
||||
name = "Asus Aura Addressable";
|
||||
type = DEVICE_TYPE_MOTHERBOARD;
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0xFFFF;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Off;
|
||||
Off.name = "Off";
|
||||
Off.value = AURA_MODE_OFF;
|
||||
Off.flags = 0;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Off);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = AURA_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.colors.resize(1);
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = AURA_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.colors.resize(1);
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Flashing;
|
||||
Flashing.name = "Flashing";
|
||||
Flashing.value = AURA_MODE_FLASHING;
|
||||
Flashing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Flashing.colors_min = 1;
|
||||
Flashing.colors_max = 1;
|
||||
Flashing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Flashing.colors.resize(1);
|
||||
modes.push_back(Flashing);
|
||||
|
||||
mode SpectrumCycle;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = AURA_MODE_SPECTRUM_CYCLE;
|
||||
SpectrumCycle.flags = 0;
|
||||
SpectrumCycle.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(SpectrumCycle);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = AURA_MODE_RAINBOW;
|
||||
Rainbow.flags = 0;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
mode ChaseFade;
|
||||
ChaseFade.name = "Chase Fade";
|
||||
ChaseFade.value = AURA_MODE_CHASE_FADE;
|
||||
ChaseFade.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
ChaseFade.colors_min = 1;
|
||||
ChaseFade.colors_max = 1;
|
||||
ChaseFade.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ChaseFade.colors.resize(1);
|
||||
modes.push_back(ChaseFade);
|
||||
|
||||
mode Chase;
|
||||
Chase.name = "Chase";
|
||||
Chase.value = AURA_MODE_CHASE;
|
||||
Chase.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Chase.colors_min = 1;
|
||||
Chase.colors_max = 1;
|
||||
Chase.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Chase.colors.resize(1);
|
||||
modes.push_back(Chase);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Set size of colors array |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned int led_count = 0;
|
||||
for (unsigned int channel_idx = 0; channel_idx < 1; channel_idx++)
|
||||
{
|
||||
led_count += aura->channel_leds[channel_idx];
|
||||
}
|
||||
colors.resize(led_count);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Set zones and leds |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned int led_idx = 0;
|
||||
for (unsigned int channel_idx = 0; channel_idx < 1; channel_idx++)
|
||||
{
|
||||
if(aura->channel_leds[channel_idx] > 0)
|
||||
{
|
||||
zone* new_zone = new zone;
|
||||
|
||||
char ch_idx_string[2];
|
||||
sprintf(ch_idx_string, "%d", channel_idx + 1);
|
||||
|
||||
new_zone->name = "Channel ";
|
||||
new_zone->name.append(ch_idx_string);
|
||||
new_zone->type = ZONE_TYPE_LINEAR;
|
||||
|
||||
std::vector<int> *new_zone_map = new std::vector<int>();
|
||||
|
||||
for (unsigned int led_ch_idx = 0; led_ch_idx < aura->channel_leds[channel_idx]; led_ch_idx++)
|
||||
{
|
||||
char led_idx_string[3];
|
||||
sprintf(led_idx_string, "%d", led_ch_idx + 1);
|
||||
|
||||
led new_led;
|
||||
new_led.name = "Channel ";
|
||||
new_led.name.append(ch_idx_string);
|
||||
new_led.name.append(", LED ");
|
||||
new_led.name.append(led_idx_string);
|
||||
|
||||
leds.push_back(new_led);
|
||||
leds_channel.push_back(channel_idx + 1);
|
||||
|
||||
new_zone_map->push_back(led_idx);
|
||||
led_idx++;
|
||||
}
|
||||
|
||||
new_zone->map.push_back(*new_zone_map);
|
||||
zones.push_back(*new_zone);
|
||||
zones_channel.push_back(channel_idx + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RGBController_AuraAddressable::~RGBController_AuraAddressable()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RGBController_AuraAddressable::UpdateLEDs()
|
||||
{
|
||||
if(modes[active_mode].value == 0xFFFF)
|
||||
{
|
||||
aura->SetLEDsDirect(colors);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_AuraAddressable::UpdateZoneLEDs(int zone)
|
||||
{
|
||||
UpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_AuraAddressable::UpdateSingleLED(int led)
|
||||
{
|
||||
UpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_AuraAddressable::SetCustomMode()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void RGBController_AuraAddressable::UpdateMode()
|
||||
{
|
||||
unsigned char red = 0;
|
||||
unsigned char grn = 0;
|
||||
unsigned char blu = 0;
|
||||
|
||||
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
||||
{
|
||||
red = RGBGetRValue(modes[active_mode].colors[0]);
|
||||
grn = RGBGetGValue(modes[active_mode].colors[0]);
|
||||
blu = RGBGetBValue(modes[active_mode].colors[0]);
|
||||
}
|
||||
|
||||
if(modes[active_mode].value != 0xFFFF)
|
||||
{
|
||||
aura->SetMode(modes[active_mode].value, red, grn, blu);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
/*-----------------------------------------*\
|
||||
| RGBController_AuraAddressable.h |
|
||||
| |
|
||||
| Generic RGB Interface for Asus Aura |
|
||||
| addressable controller driver |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 1/18/2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
#include "RGBController.h"
|
||||
#include "AuraAddressableController.h"
|
||||
|
||||
class RGBController_AuraAddressable : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_AuraAddressable(AuraAddressableController* aura_ptr);
|
||||
~RGBController_AuraAddressable();
|
||||
void UpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
|
||||
void SetCustomMode();
|
||||
void UpdateMode();
|
||||
|
||||
private:
|
||||
AuraAddressableController* aura;
|
||||
std::vector<unsigned int> leds_channel;
|
||||
std::vector<unsigned int> zones_channel;
|
||||
};
|
||||
Reference in New Issue
Block a user