mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2025-12-24 07:47:49 -05:00
55 lines
1.5 KiB
C++
55 lines
1.5 KiB
C++
/*---------------------------------------------------------*\
|
|
| FanBusInterface.h |
|
|
| |
|
|
| Interface for FanBus devices |
|
|
| |
|
|
| Adam Honse (calcprogrammer1@gmail.com) 12 Jan 2021 |
|
|
| |
|
|
| This file is part of the OpenRGB project |
|
|
| SPDX-License-Identifier: GPL-2.0-or-later |
|
|
\*---------------------------------------------------------*/
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
#include "serial_port.h"
|
|
|
|
class FanBusInterface
|
|
{
|
|
public:
|
|
FanBusInterface(const char* portname);
|
|
~FanBusInterface();
|
|
|
|
std::vector<unsigned char> DetectControllers();
|
|
|
|
std::string GetPort();
|
|
|
|
int read
|
|
(
|
|
unsigned char dev_addr,
|
|
unsigned char int_addr
|
|
);
|
|
|
|
int write
|
|
(
|
|
unsigned char dev_addr,
|
|
unsigned char int_addr,
|
|
unsigned char val
|
|
);
|
|
|
|
void write_queue
|
|
(
|
|
unsigned char dev_addr,
|
|
unsigned char int_addr,
|
|
unsigned char val
|
|
);
|
|
|
|
int process_queue();
|
|
|
|
private:
|
|
serial_port * serialport;
|
|
std::string port_name;
|
|
bool half_duplex;
|
|
|
|
std::vector<unsigned char> fanbus_msg_queued;
|
|
};
|