forked from audiohacked/OpenCorsairLink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
driver.c
87 lines (80 loc) · 2.82 KB
/
driver.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
/*
* This file is part of OpenCorsairLink.
* Copyright (C) 2017 Sean Nelson <[email protected]>
* OpenCorsairLink is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* any later version.
* OpenCorsairLink is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with OpenCorsairLink. If not, see <http://www.gnu.org/licenses/>.
*/
#include <libusb.h>
#include "device.h"
#include "driver.h"
#include "lowlevel/asetek4.h"
#include "lowlevel/hid.h"
#include "lowlevel/rmi.h"
#include "protocol/asetek4/core.h"
#include "protocol/hid/core.h"
#include "protocol/rmi/core.h"
struct corsair_device_driver corsairlink_driver_hid = {
.init = corsairlink_hid_init,
.deinit = corsairlink_hid_deinit,
.name = corsairlink_hid_name,
.vendor = corsairlink_hid_vendor,
.product = corsairlink_hid_product,
.device_id = corsairlink_hid_device_id,
.fw_version = corsairlink_hid_firmware_id,
.read = corsairlink_hid_read,
.write = corsairlink_hid_write,
.led = corsairlink_hid_change_led,
.temperature = corsairlink_hid_temperature,
};
struct corsair_device_driver corsairlink_driver_asetek = {
.init = corsairlink_asetek_init,
.deinit = corsairlink_asetek_deinit,
.name = corsairlink_asetek_name,
.vendor = corsairlink_asetek_vendor,
.product = corsairlink_asetek_product,
.device_id = corsairlink_asetek_device_id,
.fw_version = corsairlink_asetek_firmware_id,
.read = corsairlink_asetek_read,
.write = corsairlink_asetek_write,
.led = corsairlink_asetek_change_led,
.temperature = corsairlink_asetek_temperature,
.fan = {
.custom = corsairlink_asetek_fan_curve,
},
.pump = {
.profile = corsairlink_asetek_pump_mode,
}
};
struct corsair_device_driver corsairlink_driver_rmi = {
.init = corsairlink_rmi_init,
.deinit = corsairlink_rmi_deinit,
.name = corsairlink_rmi_name,
.vendor = corsairlink_rmi_vendor,
.product = corsairlink_rmi_product,
.device_id = corsairlink_rmi_device_id,
.fw_version = corsairlink_rmi_firmware_id,
.read = corsairlink_rmi_read,
.write = corsairlink_rmi_write,
.led = NULL,
.temperature = corsairlink_rmi_temperature,
.power = {
.supply_voltage = corsairlink_rmi_power_supply_voltage,
.total_wattage = corsairlink_rmi_power_total_wattage,
.select = corsairlink_rmi_output_select,
.voltage = corsairlink_rmi_output_volts,
.amperage = corsairlink_rmi_output_amps,
.wattage = corsairlink_rmi_output_watts,
},
.psu_time = {
.powered = corsairlink_rmi_time_powered,
.uptime = corsairlink_rmi_time_uptime,
}
};