This repository has been archived by the owner on May 11, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Proto.h
265 lines (205 loc) · 5.19 KB
/
Proto.h
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
/*
* This file is part of OpenCorsairLink.
* Copyright (C) 2014 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/>.
*/
#ifndef _CORSAIRLINKPROTO_H
#define _CORSAIRLINKPROTO_H
/*
* http://forum.corsair.com/v3/showthread.php?t=120092&page=3
* */
enum CorsairLinkCommands {
/*
* R - 1 byte
* (H80 0x37, Cooling node 0x38, Lighting node 0x39, H100 0x3A, 80i 0x3B, 100i 0x3c --
* this field as well as the version are common on all C-Link devices; but the rest aren't
* */
DeviceID = 0x00,
/*
* R - 2 bytes
* Firmware Version in BCD (for example 1.0.5 is 0x1005, or 0x05, 0x10 in little endianess)
* */
FirmwareID = 0x01,
/*
* R - 8 bytes
* Product name, zero-terminated - only present on the H80i and H100i
* */
ProductName = 0x02,
/*
* R - 1 byte
* Status, 0 okay, 0xFF bad
* */
Status = 0x03,
/*
* RW - 1 byte
* Select current LED
* */
LED_SelectCurrent = 0x04,
/*
* R - 1 byte
* Number of LEDs
* */
LED_Count = 0x05,
/*
* RW - 1 byte
* LED mode - 0x00 for static color, 0x40 for 2-color cycle, 0x80 for 4-color, 0xC0 for temperature mode;
* low nibble defines cycle speed or the temperature channel to use (0 internal sensor, 7 manual)
* */
LED_Mode = 0x06,
/*
* R - 3 bytes
* LED current color, RGB color of the selected LED
* */
LED_CurrentColor = 0x07,
/*
* RW - 2 bytes
* In temperature controlled mode (0xC0) this defines the colour to use to with the below gradients
* */
LED_TemperatureColor = 0x08,
/*
* RW - 6 bytes
* LED temperature-mode temperatures: 3 temperatures; used when cycle mode is 0xc0
* */
LED_TemperatureMode = 0x09,
/*
* RW - 9 bytes
* LED temperature-mode colors: RGBx3 colors, corresponding to temperatures in register above
* */
LED_TemperatureModeColors = 0x0A,
/*
* RW - 12 bytes
* LED cycle colors: RGBx4 colors (only first color used if cycle mode set to 00, first two if 4b, ignored if c0)
* */
LED_CycleColors = 0x0B,
/*
* RW - 1 byte
* Select active temperature sensor
* */
TEMP_SelectActiveSensor = 0x0C,
/*
* R - 1 byte
* Number of temperature sensors
* */
TEMP_CountSensors = 0x0D,
/*
* R - 2 bytes
* Temperature as measured by selected sensor
* */
TEMP_Read = 0x0E,
/*
* RW - 2 bytes
* Temperature limit (when the temperature goes over this, status is set to 0xff)
* */
TEMP_Limit = 0x0F,
/*
* RW - 1 byte
* Select current fan; for H100i, 0-3 are the fans, 4 is pump
* */
FAN_Select = 0x10,
/*
* R - 1 byte
* Number of fans
* */
FAN_Count = 0x11,
/*
* RW - 1 byte
* Fan mode; 02=fixed PWM, 04=fixed RPM, 06=default, 08=quiet, 0a=balanced, 0c=performance, 0e=custom; high bit is one when fan is detected,
* low bit is one when the fan is 4-pin, bits 6~4 define the temperautre channel to use in "curve" modes, 0 internal and 7 manual
* */
FAN_Mode = 0x12,
/*
* RW - 1 byte
* Fan fixed PWM, 0-255, only used if fan mode is 02
* */
FAN_FixedPWM = 0x13,
/*
* RW - 2 bytes
* Fan fixed RPM; when fan mode is 04, controller will target this RPM
* */
FAN_FixedRPM = 0x14,
/*
* RW - 2 bytes
* Report external temperature to fan controller - used for controlling fans via external sensors
* */
FAN_ReportExtTemp = 0x15,
/*
* R - 2 bytes
* Current fan RPM
* */
FAN_ReadRPM = 0x16,
/*
* R - 2 bytes
* Maximum RPM recorded since power-on
* */
FAN_MaxRecordedRPM = 0x17,
/*
* RW - 2 bytes
* Fan under speed threshold
* */
FAN_UnderSpeedThreshold = 0x18,
/*
* RW - 10 bytes
* Fan RPM table, for custom (0e) mode: array of 5 RPMs
* */
FAN_RPMTable = 0x19,
/*
* RW - 10 bytes
* Fan temp table, for custom (0e) mode: array of 5 temperatures
* */
FAN_TempTable = 0x1A
};
/*
* http://forum.corsair.com/v3/showthread.php?t=120092
* */
enum _CorsairLinkOpCodes{
/*
* 06 AA BB - Write BB into one-byte register AA
* */
WriteOneByte = 0x06,
/*
* 07 AA - Read from one-byte register AA
* */
ReadOneByte = 0x07,
/*
* 08 AA BB CC - Write BB CC into two-byte register AA
* */
WriteTwoBytes = 0x08,
/*
* 09 AA - Read from two-byte register AA
* */
ReadTwoBytes = 0x09,
/*
* 0A AA 03 00 11 22 - Write 3-byte sequence (00 11 22) into 3-byte register AA
* */
WriteThreeBytes = 0x0A,
/*
* 0B AA 03 - Read from 3-byte register AA
* */
ReadThreeBytes = 0x0B,
};
enum CorsairLedModes {
StaticColor = 0x00,
TwoColorCycle = 0x40,
FourColorCycle = 0x80,
TemperatureColor = 0xC0
};
enum CorsairFanModes {
FixedPWM = 0x02,
FixedRPM = 0x04,
Default = 0x06,
Quiet = 0x08,
Balanced = 0x0A,
Performance = 0x0C,
Custom = 0x0E
};
//extern CorsairLink *cl;
#endif