Publish LumaOps source
This commit is contained in:
@@ -0,0 +1,287 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ATC800Controller.cpp |
|
||||
| |
|
||||
| Driver for Aorus ATC800 cooler |
|
||||
| |
|
||||
| Felipe Cavalcanti 13 Aug 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include "ATC800Controller.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
ATC800Controller::ATC800Controller(hid_device* dev_handle, const char* path, std::string dev_name)
|
||||
{
|
||||
dev = dev_handle;
|
||||
location = path;
|
||||
name = dev_name;
|
||||
}
|
||||
|
||||
ATC800Controller::~ATC800Controller()
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
std::string ATC800Controller::GetDeviceLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string ATC800Controller::GetNameString()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
std::string ATC800Controller::GetSerialString()
|
||||
{
|
||||
wchar_t serial_string[128];
|
||||
int ret = hid_get_serial_number_string(dev, serial_string, 128);
|
||||
|
||||
if(ret != 0)
|
||||
{
|
||||
return("");
|
||||
}
|
||||
|
||||
return(StringUtils::wstring_to_string(serial_string));
|
||||
}
|
||||
|
||||
void ATC800Controller::DisableTempRPMIndicator()
|
||||
{
|
||||
uint8_t usb_buf[9] = { 0x00, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xcc };
|
||||
hid_send_feature_report(dev, usb_buf, sizeof(usb_buf));
|
||||
}
|
||||
|
||||
void ATC800Controller::SendMode(uint8_t mode, uint8_t brightness, uint8_t speed, uint8_t mystery_flag, uint8_t zone)
|
||||
{
|
||||
uint8_t usb_buf[9] = { 0x00, 0xc9, mode, brightness, speed, mystery_flag, zone, 0x00, 0x00 };
|
||||
hid_send_feature_report(dev, usb_buf, sizeof(usb_buf));
|
||||
}
|
||||
|
||||
void ATC800Controller::SendOneColor(uint8_t color_flag, uint8_t red, uint8_t green, uint8_t blue)
|
||||
{
|
||||
uint8_t usb_buf[9] = { 0x00, color_flag, red, green, blue, 0x00, 0x00, 0x00, 0x00 };
|
||||
hid_send_feature_report(dev, usb_buf, sizeof(usb_buf));
|
||||
}
|
||||
|
||||
void ATC800Controller::SendMultiColor(uint8_t flag, uint8_t mode, uint8_t red1, uint8_t green1, uint8_t blue1, uint8_t red2, uint8_t green2, uint8_t blue2)
|
||||
{
|
||||
uint8_t usb_buf[9] = { 0x00, flag, mode, red1, green1, blue1, red2, green2, blue2 };
|
||||
hid_send_feature_report(dev, usb_buf, sizeof(usb_buf));
|
||||
}
|
||||
|
||||
void ATC800Controller::SendOk()
|
||||
{
|
||||
uint8_t usb_buf[9] = { 0x00, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
||||
hid_send_feature_report(dev, usb_buf, sizeof(usb_buf));
|
||||
}
|
||||
|
||||
void ATC800Controller::SendCoolerMode(uint8_t zone, uint8_t mode, aorus_atc800_mode_config zone_config)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
case AORUS_ATC800_MODE_OFF:
|
||||
{
|
||||
if (zone == AORUS_ATC800_TOP_ZONE)
|
||||
{
|
||||
DisableTempRPMIndicator();
|
||||
SendMode(0x01, 0x3c, 0x02, 0x02, 0x00);
|
||||
SendOneColor(0xbc, 0x00, 0x00, 0x00);
|
||||
SendOk();
|
||||
}
|
||||
else if (zone == AORUS_ATC800_FANS_ZONE)
|
||||
{
|
||||
SendMode(0x01, 0x3c, 0x02, 0x02, 0x01);
|
||||
for(int i = 0xb0; i <= 0xb3; i++)
|
||||
{
|
||||
SendMultiColor(i, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
}
|
||||
SendOk();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AORUS_ATC800_MODE_CUSTOM:
|
||||
{
|
||||
if (zone == AORUS_ATC800_TOP_ZONE)
|
||||
{
|
||||
DisableTempRPMIndicator();
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, 0x02, 0x00, 0x00);
|
||||
SendOneColor(0xbc, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]));
|
||||
SendOk();
|
||||
}
|
||||
else if (zone == AORUS_ATC800_FANS_ZONE)
|
||||
{
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, 0x02, 0x00, 0x01);
|
||||
for(int i = 0xb0; i <= 0xb3; i++)
|
||||
{
|
||||
SendMultiColor(i, mode, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]), RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]));
|
||||
}
|
||||
SendOk();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AORUS_ATC800_MODE_BREATHING:
|
||||
{
|
||||
if (zone == AORUS_ATC800_TOP_ZONE)
|
||||
{
|
||||
DisableTempRPMIndicator();
|
||||
SendMode(mode, 0x3c, zone_config.speed, 0x00, 0x00);
|
||||
SendOneColor(0xbc, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]));
|
||||
SendOk();
|
||||
}
|
||||
else if (zone == AORUS_ATC800_FANS_ZONE)
|
||||
{
|
||||
SendMode(mode, 0x3c, zone_config.speed, 0x00, 0x01);
|
||||
for(int i = 0xb0; i <= 0xb3; i++)
|
||||
{
|
||||
SendMultiColor(i, mode, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]), RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]));
|
||||
}
|
||||
SendOk();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AORUS_ATC800_MODE_SPECTRUM_CYCLE:
|
||||
{
|
||||
if (zone == AORUS_ATC800_TOP_ZONE)
|
||||
{
|
||||
DisableTempRPMIndicator();
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x00, 0x00);
|
||||
SendOk();
|
||||
}
|
||||
else if (zone == AORUS_ATC800_FANS_ZONE)
|
||||
{
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x00, 0x01);
|
||||
SendOk();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AORUS_ATC800_MODE_FLASHING:
|
||||
case AORUS_ATC800_MODE_DOUBLE_FLASHING:
|
||||
{
|
||||
if (zone == AORUS_ATC800_TOP_ZONE)
|
||||
{
|
||||
DisableTempRPMIndicator();
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x00, 0x00);
|
||||
SendOneColor(0xbc, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]));
|
||||
SendOk();
|
||||
}
|
||||
else if (zone == AORUS_ATC800_FANS_ZONE)
|
||||
{
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x00, 0x01);
|
||||
for(int i = 0xb0; i <= 0xb3; i++)
|
||||
{
|
||||
SendMultiColor(i, mode, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]), RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]));
|
||||
}
|
||||
SendOk();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AORUS_ATC800_MODE_GRADIENT:
|
||||
{
|
||||
if (zone == AORUS_ATC800_TOP_ZONE)
|
||||
{
|
||||
DisableTempRPMIndicator();
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x00, 0x00);
|
||||
SendOneColor(0xcd, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]));
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x0a, 0x00);
|
||||
SendOk();
|
||||
}
|
||||
else if (zone == AORUS_ATC800_FANS_ZONE)
|
||||
{
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x08, 0x01);
|
||||
SendOneColor(0xcd, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]));
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x0a, 0x01);
|
||||
SendOk();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AORUS_ATC800_MODE_COLOR_SHIFT:
|
||||
{
|
||||
DisableTempRPMIndicator();
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, zone_config.numberOfColors, 0x02);
|
||||
SendMultiColor(0xb0, mode, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]), RGBGetRValue(zone_config.colors[1]), RGBGetGValue(zone_config.colors[1]), RGBGetBValue(zone_config.colors[1]));
|
||||
SendMultiColor(0xb1, mode, RGBGetRValue(zone_config.colors[2]), RGBGetGValue(zone_config.colors[2]), RGBGetBValue(zone_config.colors[2]), RGBGetRValue(zone_config.colors[3]), RGBGetGValue(zone_config.colors[3]), RGBGetBValue(zone_config.colors[3]));
|
||||
SendMultiColor(0xb2, mode, RGBGetRValue(zone_config.colors[4]), RGBGetGValue(zone_config.colors[4]), RGBGetBValue(zone_config.colors[4]), RGBGetRValue(zone_config.colors[5]), RGBGetGValue(zone_config.colors[5]), RGBGetBValue(zone_config.colors[5]));
|
||||
SendMultiColor(0xb3, mode, RGBGetRValue(zone_config.colors[6]), RGBGetGValue(zone_config.colors[6]), RGBGetBValue(zone_config.colors[6]), RGBGetRValue(zone_config.colors[7]), RGBGetGValue(zone_config.colors[7]), RGBGetBValue(zone_config.colors[7]));
|
||||
SendOk();
|
||||
}
|
||||
break;
|
||||
|
||||
case AORUS_ATC800_MODE_RAINBOW_WAVE:
|
||||
{
|
||||
if (zone == AORUS_ATC800_TOP_ZONE)
|
||||
{
|
||||
DisableTempRPMIndicator();
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x02, 0x00);
|
||||
SendOk();
|
||||
}
|
||||
else if (zone == AORUS_ATC800_FANS_ZONE)
|
||||
{
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x02, 0x01);
|
||||
SendOk();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AORUS_ATC800_MODE_RADIATE:
|
||||
{
|
||||
DisableTempRPMIndicator();
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x02, 0x02);
|
||||
SendMultiColor(0xb0, mode, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]), RGBGetRValue(zone_config.colors[1]), RGBGetGValue(zone_config.colors[1]), RGBGetBValue(zone_config.colors[1]));
|
||||
SendMultiColor(0xb1, mode, RGBGetRValue(zone_config.colors[2]), RGBGetGValue(zone_config.colors[2]), RGBGetBValue(zone_config.colors[2]), RGBGetRValue(zone_config.colors[3]), RGBGetGValue(zone_config.colors[3]), RGBGetBValue(zone_config.colors[3]));
|
||||
SendMultiColor(0xb2, mode, RGBGetRValue(zone_config.colors[4]), RGBGetGValue(zone_config.colors[4]), RGBGetBValue(zone_config.colors[4]), RGBGetRValue(zone_config.colors[5]), RGBGetGValue(zone_config.colors[5]), RGBGetBValue(zone_config.colors[5]));
|
||||
SendMultiColor(0xb3, mode, RGBGetRValue(zone_config.colors[6]), RGBGetGValue(zone_config.colors[6]), RGBGetBValue(zone_config.colors[6]), RGBGetRValue(zone_config.colors[7]), RGBGetGValue(zone_config.colors[7]), RGBGetBValue(zone_config.colors[7]));
|
||||
SendOk();
|
||||
}
|
||||
break;
|
||||
|
||||
case AORUS_ATC800_MODE_RAINBOW_LOOP:
|
||||
{
|
||||
if (zone == AORUS_ATC800_TOP_ZONE)
|
||||
{
|
||||
DisableTempRPMIndicator();
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x00, zone);
|
||||
SendOk();
|
||||
}
|
||||
else if (zone == AORUS_ATC800_FANS_ZONE)
|
||||
{
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x08, zone);
|
||||
SendOk();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AORUS_ATC800_MODE_TRICOLOR:
|
||||
{
|
||||
if (zone == AORUS_ATC800_TOP_ZONE)
|
||||
{
|
||||
DisableTempRPMIndicator();
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x02, 0x00);
|
||||
SendMultiColor(0xb0, mode, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]), RGBGetRValue(zone_config.colors[1]), RGBGetGValue(zone_config.colors[1]), RGBGetBValue(zone_config.colors[1]));
|
||||
SendMultiColor(0xb1, mode, RGBGetRValue(zone_config.colors[2]), RGBGetGValue(zone_config.colors[2]), RGBGetBValue(zone_config.colors[2]), 0x00, 0x00, 0x00);
|
||||
SendMultiColor(0xb2, mode, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
SendMultiColor(0xb3, mode, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
SendOk();
|
||||
}
|
||||
else if (zone == AORUS_ATC800_FANS_ZONE)
|
||||
{
|
||||
SendMode(mode, (zone_config.brightness + 1) * 0x0a, zone_config.speed, 0x02, 0x01);
|
||||
SendMultiColor(0xb0, mode, RGBGetRValue(zone_config.colors[0]), RGBGetGValue(zone_config.colors[0]), RGBGetBValue(zone_config.colors[0]), RGBGetRValue(zone_config.colors[1]), RGBGetGValue(zone_config.colors[1]), RGBGetBValue(zone_config.colors[1]));
|
||||
SendMultiColor(0xb1, mode, RGBGetRValue(zone_config.colors[2]), RGBGetGValue(zone_config.colors[2]), RGBGetBValue(zone_config.colors[2]), 0x00, 0x00, 0x00);
|
||||
SendMultiColor(0xb2, mode, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
SendMultiColor(0xb3, mode, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
|
||||
SendOk();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ATC800Controller.h |
|
||||
| |
|
||||
| Driver for Aorus ATC800 cooler |
|
||||
| |
|
||||
| Felipe Cavalcanti 13 Aug 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <hidapi.h>
|
||||
#include "RGBController.h"
|
||||
|
||||
struct aorus_atc800_mode_config
|
||||
{
|
||||
RGBColor colors[8];
|
||||
uint8_t numberOfColors;
|
||||
uint8_t speed;
|
||||
uint8_t brightness;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
AORUS_ATC800_MODE_OFF = 0x00,
|
||||
AORUS_ATC800_MODE_CUSTOM = 0x01,
|
||||
AORUS_ATC800_MODE_BREATHING = 0x02,
|
||||
AORUS_ATC800_MODE_SPECTRUM_CYCLE = 0x03,
|
||||
AORUS_ATC800_MODE_FLASHING = 0x04,
|
||||
AORUS_ATC800_MODE_DOUBLE_FLASHING = 0x05,
|
||||
AORUS_ATC800_MODE_GRADIENT = 0x06,
|
||||
AORUS_ATC800_MODE_COLOR_SHIFT = 0x07,
|
||||
AORUS_ATC800_MODE_RAINBOW_WAVE = 0x08,
|
||||
AORUS_ATC800_MODE_RADIATE = 0x09,
|
||||
AORUS_ATC800_MODE_RAINBOW_LOOP = 0x0A,
|
||||
AORUS_ATC800_MODE_TRICOLOR = 0x0B,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
AORUS_ATC800_SPEED_SLOWEST = 0x00, /* Slowest speed */
|
||||
AORUS_ATC800_SPEED_NORMAL = 0x02, /* Normal speed */
|
||||
AORUS_ATC800_SPEED_FASTEST = 0x05, /* Fastest speed */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
AORUS_ATC800_BRIGHTNESS_MIN = 0x00,
|
||||
AORUS_ATC800_BRIGHTNESS_MAX = 0x05
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
AORUS_ATC800_FANS_ZONE = 0,
|
||||
AORUS_ATC800_TOP_ZONE = 1
|
||||
};
|
||||
|
||||
class ATC800Controller
|
||||
{
|
||||
public:
|
||||
ATC800Controller(hid_device* dev_handle, const char* path, std::string name);
|
||||
~ATC800Controller();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetNameString();
|
||||
std::string GetSerialString();
|
||||
|
||||
void DisableTempRPMIndicator();
|
||||
void SendMode(uint8_t mode, uint8_t brightness, uint8_t speed, uint8_t mystery_flag, uint8_t zone);
|
||||
void SendOneColor(uint8_t color_flag, uint8_t red, uint8_t green, uint8_t blue);
|
||||
void SendMultiColor(uint8_t flag, uint8_t mode, uint8_t red1, uint8_t green1, uint8_t blue1, uint8_t red2, uint8_t green2, uint8_t blue2);
|
||||
void SendOk();
|
||||
void SendCoolerMode(uint8_t zone, uint8_t mode, aorus_atc800_mode_config zone_config);
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
std::string name;
|
||||
};
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| GigabyteAorusCPUCoolerControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Gigabyte Aorus CPU coolers |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "Detector.h"
|
||||
#include "ATC800Controller.h"
|
||||
#include "RGBController_AorusATC800.h"
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Vendor ID |
|
||||
\*-----------------------------------------------------*/
|
||||
#define HOLTEK_VID 0x1044
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Controller product ids |
|
||||
\*-----------------------------------------------------*/
|
||||
#define ATC_800_CONTROLLER_PID 0x7A42
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectAorusCPUCoolerControllers *
|
||||
* *
|
||||
* Tests the USB address to see if a Aorus RGB CPU Cooler exists there. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectGigabyteAorusCPUCoolerControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
hid_device* dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
ATC800Controller* controller = new ATC800Controller(dev, info->path, name);
|
||||
RGBController_AorusATC800* rgb_controller = new RGBController_AorusATC800(controller);
|
||||
|
||||
ResourceManager::get()->RegisterRGBController(rgb_controller);
|
||||
}
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Gigabyte AORUS ATC800", DetectGigabyteAorusCPUCoolerControllers, HOLTEK_VID, ATC_800_CONTROLLER_PID, 0, 0xFF01, 1);
|
||||
@@ -0,0 +1,272 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_AorusATC800.cpp |
|
||||
| |
|
||||
| RGBController for Aorus ATC800 cooler |
|
||||
| |
|
||||
| Felipe Cavalcanti 13 Aug 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_AorusATC800.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Aorus ATC800
|
||||
@category Cooler
|
||||
@type USB
|
||||
@save :x:
|
||||
@direct :x:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectGigabyteAorusCPUCoolerControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_AorusATC800::RGBController_AorusATC800(ATC800Controller* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetNameString();
|
||||
vendor = "Gigabyte";
|
||||
type = DEVICE_TYPE_COOLER;
|
||||
description = "Aorus ATC800 CPU Cooler Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
serial = controller->GetSerialString();
|
||||
|
||||
mode Custom;
|
||||
Custom.name = "Custom";
|
||||
Custom.value = AORUS_ATC800_MODE_CUSTOM;
|
||||
Custom.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Custom.color_mode = MODE_COLORS_PER_LED;
|
||||
Custom.brightness_min = AORUS_ATC800_BRIGHTNESS_MIN;
|
||||
Custom.brightness_max = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
Custom.brightness = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
modes.push_back(Custom);
|
||||
|
||||
mode Off;
|
||||
Off.name = "Off";
|
||||
Off.value = AORUS_ATC800_MODE_OFF;
|
||||
Off.flags = MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Off.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Off);
|
||||
|
||||
mode Flashing;
|
||||
Flashing.name = "Flashing";
|
||||
Flashing.value = AORUS_ATC800_MODE_FLASHING;
|
||||
Flashing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Flashing.color_mode = MODE_COLORS_PER_LED;
|
||||
Flashing.speed_min = AORUS_ATC800_SPEED_SLOWEST;
|
||||
Flashing.speed_max = AORUS_ATC800_SPEED_FASTEST;
|
||||
Flashing.speed = AORUS_ATC800_SPEED_NORMAL;
|
||||
Flashing.brightness_min = AORUS_ATC800_BRIGHTNESS_MIN;
|
||||
Flashing.brightness_max = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
Flashing.brightness = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
modes.push_back(Flashing);
|
||||
|
||||
mode DoubleFlashing;
|
||||
DoubleFlashing.name = "Double Flashing";
|
||||
DoubleFlashing.value = AORUS_ATC800_MODE_DOUBLE_FLASHING;
|
||||
DoubleFlashing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
DoubleFlashing.color_mode = MODE_COLORS_PER_LED;
|
||||
DoubleFlashing.speed_min = AORUS_ATC800_SPEED_SLOWEST;
|
||||
DoubleFlashing.speed_max = AORUS_ATC800_SPEED_FASTEST;
|
||||
DoubleFlashing.speed = AORUS_ATC800_SPEED_NORMAL;
|
||||
DoubleFlashing.brightness_min = AORUS_ATC800_BRIGHTNESS_MIN;
|
||||
DoubleFlashing.brightness_max = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
DoubleFlashing.brightness = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
modes.push_back(DoubleFlashing);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = AORUS_ATC800_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Breathing.color_mode = MODE_COLORS_PER_LED;
|
||||
Breathing.speed_min = AORUS_ATC800_SPEED_SLOWEST;
|
||||
Breathing.speed_max = AORUS_ATC800_SPEED_FASTEST;
|
||||
Breathing.speed = AORUS_ATC800_SPEED_NORMAL;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Gradient;
|
||||
Gradient.name = "Gradient";
|
||||
Gradient.value = AORUS_ATC800_MODE_GRADIENT;
|
||||
Gradient.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Gradient.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Gradient.colors_min = 1;
|
||||
Gradient.colors_max = 1;
|
||||
Gradient.colors = { 0x0000FF };
|
||||
Gradient.speed_min = AORUS_ATC800_SPEED_SLOWEST;
|
||||
Gradient.speed_max = AORUS_ATC800_SPEED_FASTEST;
|
||||
Gradient.speed = AORUS_ATC800_SPEED_NORMAL;
|
||||
Gradient.brightness_min = AORUS_ATC800_BRIGHTNESS_MIN;
|
||||
Gradient.brightness_max = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
Gradient.brightness = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
modes.push_back(Gradient);
|
||||
|
||||
mode ColorShift;
|
||||
ColorShift.name = "Color Shift";
|
||||
ColorShift.value = AORUS_ATC800_MODE_COLOR_SHIFT;
|
||||
ColorShift.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
ColorShift.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ColorShift.colors_min = 2;
|
||||
ColorShift.colors_max = 8;
|
||||
ColorShift.colors = { 0x0000FF, 0x0072FF, 0x00FFFF, 0x00FF00, 0xFFFF00, 0xFF0000, 0xFF00FF, 0x8080FF };
|
||||
ColorShift.speed_min = AORUS_ATC800_SPEED_SLOWEST;
|
||||
ColorShift.speed_max = AORUS_ATC800_SPEED_FASTEST;
|
||||
ColorShift.speed = AORUS_ATC800_SPEED_NORMAL;
|
||||
ColorShift.brightness_min = AORUS_ATC800_BRIGHTNESS_MIN;
|
||||
ColorShift.brightness_max = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
ColorShift.brightness = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
modes.push_back(ColorShift);
|
||||
|
||||
mode RainbowWave;
|
||||
RainbowWave.name = "Rainbow Wave";
|
||||
RainbowWave.value = AORUS_ATC800_MODE_RAINBOW_WAVE;
|
||||
RainbowWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
RainbowWave.color_mode = MODE_COLORS_NONE;
|
||||
RainbowWave.speed_min = AORUS_ATC800_SPEED_SLOWEST;
|
||||
RainbowWave.speed_max = AORUS_ATC800_SPEED_FASTEST;
|
||||
RainbowWave.speed = AORUS_ATC800_SPEED_NORMAL;
|
||||
RainbowWave.brightness_min = AORUS_ATC800_BRIGHTNESS_MIN;
|
||||
RainbowWave.brightness_max = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
RainbowWave.brightness = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
modes.push_back(RainbowWave);
|
||||
|
||||
mode Radiate;
|
||||
Radiate.name = "Radiate";
|
||||
Radiate.value = AORUS_ATC800_MODE_RADIATE;
|
||||
Radiate.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Radiate.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Radiate.colors_min = 8;
|
||||
Radiate.colors_max = 8;
|
||||
Radiate.colors = { 0x0000FF, 0x0072FF, 0x00FFFF, 0x00FF00, 0xFFFF00, 0xFFFF00, 0xFF00FF, 0x8080FF };
|
||||
Radiate.speed_min = AORUS_ATC800_SPEED_SLOWEST;
|
||||
Radiate.speed_max = AORUS_ATC800_SPEED_FASTEST;
|
||||
Radiate.speed = AORUS_ATC800_SPEED_NORMAL;
|
||||
Radiate.brightness_min = AORUS_ATC800_BRIGHTNESS_MIN;
|
||||
Radiate.brightness_max = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
Radiate.brightness = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
modes.push_back(Radiate);
|
||||
|
||||
mode RainbowLoop;
|
||||
RainbowLoop.name = "Rainbow Loop";
|
||||
RainbowLoop.value = AORUS_ATC800_MODE_RAINBOW_LOOP;
|
||||
RainbowLoop.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
RainbowLoop.color_mode = MODE_COLORS_NONE;
|
||||
RainbowLoop.speed_min = AORUS_ATC800_SPEED_SLOWEST;
|
||||
RainbowLoop.speed_max = AORUS_ATC800_SPEED_FASTEST;
|
||||
RainbowLoop.speed = AORUS_ATC800_SPEED_NORMAL;
|
||||
RainbowLoop.brightness_min = AORUS_ATC800_BRIGHTNESS_MIN;
|
||||
RainbowLoop.brightness_max = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
RainbowLoop.brightness = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
modes.push_back(RainbowLoop);
|
||||
|
||||
mode Tricolor;
|
||||
Tricolor.name = "Tricolor";
|
||||
Tricolor.value = AORUS_ATC800_MODE_TRICOLOR;
|
||||
Tricolor.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Tricolor.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Tricolor.colors_min = 3;
|
||||
Tricolor.colors_max = 3;
|
||||
Tricolor.colors = { 0xFF0000, 0xFF00FF, 0xFFFF00 };
|
||||
Tricolor.speed_min = AORUS_ATC800_SPEED_SLOWEST;
|
||||
Tricolor.speed_max = AORUS_ATC800_SPEED_FASTEST;
|
||||
Tricolor.speed = AORUS_ATC800_SPEED_NORMAL;
|
||||
Tricolor.brightness_min = AORUS_ATC800_BRIGHTNESS_MIN;
|
||||
Tricolor.brightness_max = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
Tricolor.brightness = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
modes.push_back(Tricolor);
|
||||
|
||||
mode SpectrumCycle;
|
||||
SpectrumCycle.name = "Spectrum Cycle";
|
||||
SpectrumCycle.value = AORUS_ATC800_MODE_SPECTRUM_CYCLE;
|
||||
SpectrumCycle.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
SpectrumCycle.color_mode = MODE_COLORS_NONE;
|
||||
SpectrumCycle.speed_min = AORUS_ATC800_SPEED_SLOWEST;
|
||||
SpectrumCycle.speed_max = AORUS_ATC800_SPEED_FASTEST;
|
||||
SpectrumCycle.speed = AORUS_ATC800_SPEED_NORMAL;
|
||||
SpectrumCycle.brightness_min = AORUS_ATC800_BRIGHTNESS_MIN;
|
||||
SpectrumCycle.brightness_max = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
SpectrumCycle.brightness = AORUS_ATC800_BRIGHTNESS_MAX;
|
||||
modes.push_back(SpectrumCycle);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_AorusATC800::~RGBController_AorusATC800()
|
||||
{
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_AorusATC800::SetupZones()
|
||||
{
|
||||
zone atc800_cpu_fans_zone;
|
||||
atc800_cpu_fans_zone.name = "Fan";
|
||||
atc800_cpu_fans_zone.type = ZONE_TYPE_SINGLE;
|
||||
atc800_cpu_fans_zone.leds_min = 1;
|
||||
atc800_cpu_fans_zone.leds_max = 1;
|
||||
atc800_cpu_fans_zone.leds_count = 1;
|
||||
atc800_cpu_fans_zone.matrix_map = NULL;
|
||||
zones.push_back(atc800_cpu_fans_zone);
|
||||
|
||||
led atc800_fan_led;
|
||||
atc800_fan_led.name = "Fan";
|
||||
leds.push_back(atc800_fan_led);
|
||||
|
||||
zone atc800_top_zone;
|
||||
atc800_top_zone.name = "Top";
|
||||
atc800_top_zone.type = ZONE_TYPE_SINGLE;
|
||||
atc800_top_zone.leds_min = 1;
|
||||
atc800_top_zone.leds_max = 1;
|
||||
atc800_top_zone.leds_count = 1;
|
||||
atc800_top_zone.matrix_map = NULL;
|
||||
zones.push_back(atc800_top_zone);
|
||||
|
||||
led atc800_top_led;
|
||||
atc800_top_led.name = "Top";
|
||||
leds.push_back(atc800_top_led);
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_AorusATC800::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*---------------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_AorusATC800::DeviceUpdateLEDs()
|
||||
{
|
||||
UpdateZoneLEDs(0);
|
||||
UpdateZoneLEDs(1);
|
||||
}
|
||||
|
||||
void RGBController_AorusATC800::UpdateZoneLEDs(int zone)
|
||||
{
|
||||
aorus_atc800_mode_config zone_config;
|
||||
|
||||
zone_config.colors[0] = colors[zone];
|
||||
zone_config.numberOfColors = (uint8_t)modes[active_mode].colors.size();
|
||||
zone_config.speed = modes[active_mode].speed;
|
||||
zone_config.brightness = modes[active_mode].brightness;
|
||||
|
||||
if (modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
||||
{
|
||||
for (uint8_t i = 0; i < zone_config.numberOfColors; i++)
|
||||
{
|
||||
zone_config.colors[i] = modes[active_mode].colors[i];
|
||||
}
|
||||
}
|
||||
|
||||
controller->SendCoolerMode(zone, modes[active_mode].value, zone_config);
|
||||
}
|
||||
|
||||
void RGBController_AorusATC800::UpdateSingleLED(int led)
|
||||
{
|
||||
UpdateZoneLEDs(led);
|
||||
}
|
||||
|
||||
void RGBController_AorusATC800::DeviceUpdateMode()
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_AorusATC800.h |
|
||||
| |
|
||||
| RGBController for Aorus ATC800 cooler |
|
||||
| |
|
||||
| Felipe Cavalcanti 13 Aug 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "ATC800Controller.h"
|
||||
|
||||
class RGBController_AorusATC800 : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_AorusATC800(ATC800Controller* controller_ptr);
|
||||
~RGBController_AorusATC800();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
ATC800Controller* controller;
|
||||
};
|
||||
Reference in New Issue
Block a user