WIP Galax RTX GPU support
Setting RGB values works. Modes still unknown.
This commit is contained in:
parent
5e0b1fa3cc
commit
12f5d6070f
6 changed files with 452 additions and 0 deletions
68
Controllers/GalaxGPUController/GalaxGPUControllerDetect.cpp
Normal file
68
Controllers/GalaxGPUController/GalaxGPUControllerDetect.cpp
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
/*-----------------------------------------*\
|
||||
| GalaxGPUControllerDetect.cpp |
|
||||
| |
|
||||
| Driver for Galax / KFA2 RGB on GPUs |
|
||||
| |
|
||||
| Niels Westphal (crashniels) 12.07.2020 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "GalaxGPUController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_GalaxGPU.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* TestForGalaxGPUController *
|
||||
* *
|
||||
* Tests the given address to see if a Galax GPU controller exists there. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
bool TestForGalaxGPUController(i2c_smbus_interface* bus, unsigned char address)
|
||||
{
|
||||
bool pass = false;
|
||||
|
||||
unsigned char res = bus->i2c_smbus_read_byte_data(address, 0x00);
|
||||
|
||||
if(res == 0x10 || res == 0x27) //Windows reads 0x10, Linux reads 0x27 which is correct as 0x10 is at 0x01
|
||||
{
|
||||
pass = true;
|
||||
}
|
||||
|
||||
return(pass);
|
||||
|
||||
} /* TestForGalaxGPUController() */
|
||||
|
||||
|
||||
/******************************************************************************************\
|
||||
* *
|
||||
* DetectGalaxGPUControllers *
|
||||
* *
|
||||
* Detect Galax GPU controllers on the enumerated I2C busses. *
|
||||
* *
|
||||
\******************************************************************************************/
|
||||
|
||||
void DetectGalaxGPUControllers(std::vector<i2c_smbus_interface*> &busses, std::vector<RGBController*> &rgb_controllers)
|
||||
{
|
||||
GalaxGPUController* new_GalaxGPU;
|
||||
RGBController_GalaxGPU* new_controller;
|
||||
|
||||
for (unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
{
|
||||
// Check for GALAX controller at 0x23
|
||||
if (TestForGalaxGPUController(busses[bus], 0x23))
|
||||
{
|
||||
new_GalaxGPU = new GalaxGPUController(busses[bus], 0x23);
|
||||
new_controller = new RGBController_GalaxGPU(new_GalaxGPU);
|
||||
rgb_controllers.push_back(new_controller);
|
||||
}
|
||||
}
|
||||
|
||||
} /* DetectGalaxGPUControllers() */
|
||||
Loading…
Add table
Add a link
Reference in a new issue