Files
linuxSmartie/include/aio.h
2026-07-21 20:38:08 +02:00

68 lines
1.1 KiB
C

#ifndef LINUXSMARTIE_AIO_H
#define LINUXSMARTIE_AIO_H
#include <libusb-1.0/libusb.h>
#define AIO_USB_VID 0x1b1cU
#define AIO_USB_PID 0x0c13U
#define AIO_COLOR_CYAN { 0, 255, 255 }
#define AIO_COLOR_WHITE { 255, 255, 255 }
#define AIO_COLOR_OFF { 0, 0, 0 }
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
struct aio_params_t {
struct {
uint8_t min_duty;
uint8_t max_duty;
bool fan_stop;
float setpoint;
struct {
float Ki;
float Kd;
} ctrl;
} fans;
};
enum aio_pump_mode_t {
QUIET,
BALANCED,
EXTREME,
UNKNOWN
};
enum aio_color_mode_t : uint8_t {
AIO_COLOR_PULSE,
AIO_COLOR_SHIFT,
AIO_COLOR_FIXED,
AIO_COLOR_BLINKING
};
struct rgb_t {
uint8_t r;
uint8_t g;
uint8_t b;
};
struct curve_point_t {
uint8_t temp;
uint8_t duty;
};
struct aio_t {
libusb_device_handle* handle;
enum aio_pump_mode_t pump_mode;
float water_temp;
uint16_t pump_counter;
uint16_t pump_speed;
uint16_t fan_speed[2];
};
void aio_detect(struct aio_t *aio);
void aio_update(struct aio_t *aio);
void aio_close(const struct aio_t *aio);
#endif