Add Palit 1080 controller
This commit is contained in:
parent
d012173ebe
commit
f2132d79c5
6 changed files with 273 additions and 0 deletions
38
Controllers/PalitGPUController/PalitGPUController.cpp
Normal file
38
Controllers/PalitGPUController/PalitGPUController.cpp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/*-----------------------------------------*\
|
||||
| PalitGPUController.cpp |
|
||||
| |
|
||||
| Driver for Palit GPU RGB |
|
||||
| lighting controller |
|
||||
| |
|
||||
| Manatsawin Hanmongkolchai 04/11/2023 |
|
||||
\*-----------------------------------------*/
|
||||
|
||||
#include "PalitGPUController.h"
|
||||
|
||||
PalitGPUController::PalitGPUController(i2c_smbus_interface* bus, palit_dev_id dev)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
}
|
||||
|
||||
PalitGPUController::~PalitGPUController()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string PalitGPUController::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("I2C: " + return_string);
|
||||
}
|
||||
|
||||
void PalitGPUController::SetDirect(unsigned char red, unsigned char green, unsigned char blue)
|
||||
{
|
||||
// NvAPI_I2CWriteEx: Dev: 0x08 RegSize: 0x01 Reg: 0x03 Size: 0x04 Data: 0xFF 0x00 0x00 0xFF
|
||||
uint8_t values[] = {red, green, blue, 0xFF};
|
||||
bus->i2c_smbus_write_i2c_block_data(dev, PALIT_GPU_REG_LED, sizeof(values), values);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue