Compare commits
606
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81bbe18a84 | ||
|
|
8eb30ba840 | ||
|
|
f01ab516df | ||
|
|
0440478acb | ||
|
|
6bb57b8822 | ||
|
|
954027f087 | ||
|
|
243889d818 | ||
|
|
f69213db02 | ||
|
|
f4173ed72f | ||
|
|
69226884cb | ||
|
|
728846f668 | ||
|
|
f6cfac8eef | ||
|
|
9a4857ac33 | ||
|
|
45a6c93bb3 | ||
|
|
77285e308a | ||
|
|
84fb7d18d0 | ||
|
|
e161314090 | ||
|
|
0ff7f0fcd6 | ||
|
|
e6ea038ac8 | ||
|
|
6be0193788 | ||
|
|
8963586ead | ||
|
|
9ac50bd646 | ||
|
|
fde019d920 | ||
|
|
2b24d0a2e9 | ||
|
|
afb654aa55 | ||
|
|
82ae818712 | ||
|
|
6ac47cc4f3 | ||
|
|
1e1b26e062 | ||
|
|
aaa7cb0886 | ||
|
|
a42352c867 | ||
|
|
1da6a652fd | ||
|
|
4f63756e15 | ||
|
|
f72e99225d | ||
|
|
93b374ad9f | ||
|
|
2319f5c20d | ||
|
|
7523e11eb5 | ||
|
|
523bdb96f8 | ||
|
|
75302d7219 | ||
|
|
56256a8054 | ||
|
|
ed3d7894c8 | ||
|
|
dc14dff646 | ||
|
|
706e2ab30f | ||
|
|
3e494c884a | ||
|
|
31a09bc728 | ||
|
|
87b0b904c5 | ||
|
|
07e1f2bb2a | ||
|
|
fd1bc449ae | ||
|
|
1103a567da | ||
|
|
b420af5c42 | ||
|
|
d092f3b159 | ||
|
|
87af7c8dc2 | ||
|
|
1335a9b06c | ||
|
|
bf2a0fb8f1 | ||
|
|
657cc0d05d | ||
|
|
47eba889c2 | ||
|
|
7fed68ccf1 | ||
|
|
3e290907d5 | ||
|
|
999cbd2578 | ||
|
|
cf048edb6c | ||
|
|
a44f525078 | ||
|
|
88af06182a | ||
|
|
dd35cb8cbf | ||
|
|
cfc6081f9d | ||
|
|
8f701ee147 | ||
|
|
eb535f43c8 | ||
|
|
864ea220da | ||
|
|
a152927ec6 | ||
|
|
bc9c04c00b | ||
|
|
648f190e22 | ||
|
|
47044213fd | ||
|
|
da3f396a25 | ||
|
|
0dff37baa9 | ||
|
|
44c7b9fc07 | ||
|
|
bfba7e99d0 | ||
|
|
cd02ba5d39 | ||
|
|
bf03f70950 | ||
|
|
c789351977 | ||
|
|
bac9cffb27 | ||
|
|
544fd47756 | ||
|
|
206f211ccc | ||
|
|
de7a8df31d | ||
|
|
054e979fcf | ||
|
|
d3e06b9124 | ||
|
|
b0c517ab9f | ||
|
|
7325e83e8c | ||
|
|
c40967989a | ||
|
|
382b3e4d72 | ||
|
|
a8d46b32c2 | ||
|
|
72b7e5cf5b | ||
|
|
5903e7e7c5 | ||
|
|
1198d3ed3c | ||
|
|
d623e76d25 | ||
|
|
a1ff9c8e35 | ||
|
|
c3102bc724 | ||
|
|
a9dea96147 | ||
|
|
e5823a0e10 | ||
|
|
e5d3b76263 | ||
|
|
a757c04cf9 | ||
|
|
01c65c1d17 | ||
|
|
cfdd06e1f4 | ||
|
|
e2d0bee51a | ||
|
|
280df42267 | ||
|
|
1538936758 | ||
|
|
255cfcf422 | ||
|
|
c029bb2b1d | ||
|
|
e958e0132e | ||
|
|
51daeed585 | ||
|
|
60e4309eec | ||
|
|
31247bacd4 | ||
|
|
2c23fd6ace | ||
|
|
61fcdd1a1c | ||
|
|
dc0e9b2fd3 | ||
|
|
c90eafbe72 | ||
|
|
b087a65f3c | ||
|
|
c31c6088ac | ||
|
|
b14342d9ee | ||
|
|
849e725b11 | ||
|
|
b23da372ad | ||
|
|
a96b5e0f1a | ||
|
|
6315c79afa | ||
|
|
ee8d24bac6 | ||
|
|
d9a726d97f | ||
|
|
1a55da8ac4 | ||
|
|
5c8baf47f8 | ||
|
|
249c22082d | ||
|
|
02237aeb4d | ||
|
|
5d7090b5fd | ||
|
|
f70c3bf8d4 | ||
|
|
dc0d2e2d2f | ||
|
|
fa91a11964 | ||
|
|
ecf0bfc847 | ||
|
|
41b7087e20 | ||
|
|
046a1bae65 | ||
|
|
a9a1856b9c | ||
|
|
d7f452e542 | ||
|
|
799113942c | ||
|
|
206ef9aca5 | ||
|
|
603714f749 | ||
|
|
49e1687141 | ||
|
|
6d07573fff | ||
|
|
2a0222bde1 | ||
|
|
725d0ec1f5 | ||
|
|
f14b6cb49d | ||
|
|
2b60e9ac37 | ||
|
|
693332ff50 | ||
|
|
a678f3bb25 | ||
|
|
b80ac45d99 | ||
|
|
20a8bc611b | ||
|
|
77a474b993 | ||
|
|
853074d80c | ||
|
|
5df989c7a0 | ||
|
|
f3b9f1c3fd | ||
|
|
061bae9546 | ||
|
|
679635afd9 | ||
|
|
7854c491f7 | ||
|
|
9695f9d00b | ||
|
|
b26df0f67e | ||
|
|
88fa92fd8d | ||
|
|
430501408b | ||
|
|
19d3f8884e | ||
|
|
3b4a66096a | ||
|
|
b93fe2a058 | ||
|
|
7332c6a7ea | ||
|
|
d91dae8f15 | ||
|
|
02979dc209 | ||
|
|
c1cbbfc207 | ||
|
|
2631b5c0b2 | ||
|
|
5795280b49 | ||
|
|
2b834c9ee4 | ||
|
|
444a748411 | ||
|
|
58238c048b | ||
|
|
c5befc354b | ||
|
|
33854f8886 | ||
|
|
8121ee29f4 | ||
|
|
15b784f6c6 | ||
|
|
2df162408e | ||
|
|
10d06298ce | ||
|
|
eebe4dd0dd | ||
|
|
0459df64c1 | ||
|
|
b635f0c2fd | ||
|
|
770e40596e | ||
|
|
2e990ba3ce | ||
|
|
ea5d7c6c4c | ||
|
|
779514a6fc | ||
|
|
f027b7a312 | ||
|
|
da31501087 | ||
|
|
140aa96aff | ||
|
|
671f0a66f5 | ||
|
|
5b1e782b9b | ||
|
|
b222dfeceb | ||
|
|
5db5678c1d | ||
|
|
433cbc1837 | ||
|
|
bf99c32e72 | ||
|
|
c2ec44c0b7 | ||
|
|
550fa1046e | ||
|
|
cf910d2616 | ||
|
|
2d32510008 | ||
|
|
4d8fd55206 | ||
|
|
c852af2a2c | ||
|
|
ae22e1e8ea | ||
|
|
02620313f6 | ||
|
|
bbccdc2de0 | ||
|
|
bc54e18e48 | ||
|
|
8e4859688d | ||
|
|
967bb51313 | ||
|
|
51d46849fb | ||
|
|
74bb119a05 | ||
|
|
ae038bc8e9 | ||
|
|
433788cc49 | ||
|
|
5e6d627f51 | ||
|
|
f9897ef99a | ||
|
|
5c1a2c4d13 | ||
|
|
f987bc3199 | ||
|
|
0c1a73accc | ||
|
|
1fb75b66dd | ||
|
|
790e1485f6 | ||
|
|
400faabb21 | ||
|
|
684b74ca9e | ||
|
|
6069a3c0cb | ||
|
|
606f5f6c86 | ||
|
|
bfccc1a95d | ||
|
|
e33a56001a | ||
|
|
0afc4c752f | ||
|
|
834fc6a8f7 | ||
|
|
da824ccfa8 | ||
|
|
2c397c5110 | ||
|
|
4a4f04825c | ||
|
|
2ac41813fa | ||
|
|
422414737b | ||
|
|
d45d9a31be | ||
|
|
5f297a62ba | ||
|
|
7605c14d89 | ||
|
|
bad23f7574 | ||
|
|
ee4886512b | ||
|
|
8a87befeda | ||
|
|
44b37c57c1 | ||
|
|
0b59ccfb42 | ||
|
|
3c8f05982e | ||
|
|
a7a6b241e0 | ||
|
|
d6de563178 | ||
|
|
ee62b14384 | ||
|
|
712df22b95 | ||
|
|
a0d063e78f | ||
|
|
5a2712750b | ||
|
|
320f755e5e | ||
|
|
f1d4a7c045 | ||
|
|
710f97bb62 | ||
|
|
454344185c | ||
|
|
b25250db7b | ||
|
|
009156994e | ||
|
|
6f21dd884c | ||
|
|
5dfa33320e | ||
|
|
2147291c52 | ||
|
|
e971c619b1 | ||
|
|
6e832b337f | ||
|
|
6ec5a955df | ||
|
|
71cd411ffc | ||
|
|
1be9097852 | ||
|
|
a8a848a259 | ||
|
|
15d008a169 | ||
|
|
2e09228568 | ||
|
|
bfaef77719 | ||
|
|
02d0e16a72 | ||
|
|
6ebf3573af | ||
|
|
5aef451e81 | ||
|
|
1880961afa | ||
|
|
fb5a723193 | ||
|
|
88002a4abf | ||
|
|
289dbc675a | ||
|
|
bcfaa7e8a7 | ||
|
|
bf62ead713 | ||
|
|
8a7cda7495 | ||
|
|
84cf974d70 | ||
|
|
afc54314b5 | ||
|
|
bd8db75106 | ||
|
|
9da692b12f | ||
|
|
4ee39b0dc8 | ||
|
|
286514b509 | ||
|
|
c7140baa33 | ||
|
|
2a9889b194 | ||
|
|
2afbd64c8e | ||
|
|
8be6aba43a | ||
|
|
565f1dad74 | ||
|
|
67a81f219d | ||
|
|
ccd103a29f | ||
|
|
c5d088b69d | ||
|
|
6362054368 | ||
|
|
2dab17f5dc | ||
|
|
c545305825 | ||
|
|
578c81784b | ||
|
|
1cd9b63c3e | ||
|
|
7b1817a0b8 | ||
|
|
fb0e4f3ad9 | ||
|
|
09a5b414b6 | ||
|
|
e5dc869c9b | ||
|
|
2687ff57aa | ||
|
|
52138b4cbd | ||
|
|
b3a2cccfed | ||
|
|
15a8abf2c9 | ||
|
|
d16b474aa8 | ||
|
|
760758230a | ||
|
|
358fc7b007 | ||
|
|
069eeccb60 | ||
|
|
da77b63bea | ||
|
|
791d8820d6 | ||
|
|
05fbe381dd | ||
|
|
3b2466ba10 | ||
|
|
acc7fa6754 | ||
|
|
394a5c8eb0 | ||
|
|
ac6d89b611 | ||
|
|
46cdd6fbe1 | ||
|
|
14d543b9e4 | ||
|
|
8a831cef04 | ||
|
|
9fd79b1ad2 | ||
|
|
c9c37a4576 | ||
|
|
fe53d90664 | ||
|
|
8e8a9c8e05 | ||
|
|
dafc6e9cbc | ||
|
|
68b113bf86 | ||
|
|
eb5d8b579c | ||
|
|
56df76dbfc | ||
|
|
878f32fccf | ||
|
|
63828313bd | ||
|
|
31992acad1 | ||
|
|
bd41ba3b5c | ||
|
|
b9309c61e1 | ||
|
|
7fc8aea930 | ||
|
|
b35e119325 | ||
|
|
8fb790358f | ||
|
|
39c6dbf361 | ||
|
|
9d189d5b9b | ||
|
|
9e5c63cc64 | ||
|
|
b664f35e17 | ||
|
|
381e3ac70c | ||
|
|
e3225d93c4 | ||
|
|
1b3480bf8a | ||
|
|
a6bea17df2 | ||
|
|
28d73d74bc | ||
|
|
cf383cacdd | ||
|
|
d9b0995b44 | ||
|
|
79eb758a52 | ||
|
|
75463b8772 | ||
|
|
5da92fca4e | ||
|
|
d11be2aa0b | ||
|
|
285a7bce4e | ||
|
|
21009cdc45 | ||
|
|
a0cee2ce2b | ||
|
|
ba33ff0c35 | ||
|
|
795616e62d | ||
|
|
baa033ff7f | ||
|
|
33ec03d129 | ||
|
|
a0d5a985f0 | ||
|
|
1275fe816b | ||
|
|
d4e1ed5245 | ||
|
|
b833a43490 | ||
|
|
94295c52ba | ||
|
|
f32aa29ecd | ||
|
|
623fdfe522 | ||
|
|
a122ccdc37 | ||
|
|
74219e502a | ||
|
|
73cd84f43c | ||
|
|
f5a8ecc3f4 | ||
|
|
86a6a130e7 | ||
|
|
703afac049 | ||
|
|
2d0ebb7279 | ||
|
|
d9b51e4a02 | ||
|
|
387fed4f79 | ||
|
|
df0137c2b0 | ||
|
|
7c059fa3e3 | ||
|
|
1a62db7246 | ||
|
|
3a0b93c774 | ||
|
|
1afe65d206 | ||
|
|
962754f379 | ||
|
|
e69c9eedae | ||
|
|
9182d1e566 | ||
|
|
893de3f076 | ||
|
|
4f1c623093 | ||
|
|
7846d22bd8 | ||
|
|
68ae9ef9d5 | ||
|
|
44641ca8a6 | ||
|
|
152f16b31c | ||
|
|
b87f7150fc | ||
|
|
831a7cf5eb | ||
|
|
f99843a550 | ||
|
|
35217bce51 | ||
|
|
00077347b4 | ||
|
|
b2c9ace9c8 | ||
|
|
fd7dbd618d | ||
|
|
103b5f27bb | ||
|
|
71c1ffe91c | ||
|
|
0154f3c5dc | ||
|
|
60bc375345 | ||
|
|
5a2dca1ced | ||
|
|
c80f3be283 | ||
|
|
52f757ced2 | ||
|
|
156b7d0f89 | ||
|
|
69a8c84b4d | ||
|
|
d30f3a5f03 | ||
|
|
2868f61766 | ||
|
|
5d1c990b18 | ||
|
|
e6eeb906b8 | ||
|
|
ea00807a06 | ||
|
|
95b1133395 | ||
|
|
d56a9133ab | ||
|
|
8c96bf03f5 | ||
|
|
79e546fa43 | ||
|
|
baed37ecc7 | ||
|
|
c0be211236 | ||
|
|
55506f984e | ||
|
|
d03ca67ae5 | ||
|
|
b7f8eeb034 | ||
|
|
e8e0362d85 | ||
|
|
e9f430d8ed | ||
|
|
a306cf815b | ||
|
|
7c0eba1dc3 | ||
|
|
5d20744653 | ||
|
|
7e74c295a3 | ||
|
|
d145ee38e7 | ||
|
|
0a39673b9d | ||
|
|
6e93443034 | ||
|
|
cb71627d29 | ||
|
|
35f10dfb48 | ||
|
|
04ef7a2c28 | ||
|
|
a58e79ba71 | ||
|
|
3a74c85be8 | ||
|
|
6e71cd39b9 | ||
|
|
248668ea7d | ||
|
|
496a7a3609 | ||
|
|
112b6a2b9b | ||
|
|
7c38dad1ab | ||
|
|
cd1c9c705b | ||
|
|
b7f68379c2 | ||
|
|
43c0fea3be | ||
|
|
39f112bb98 | ||
|
|
3d113dab3c | ||
|
|
92f397544b | ||
|
|
fe4ca34528 | ||
|
|
464ef419e7 | ||
|
|
30e35eb44c | ||
|
|
b92a8996e9 | ||
|
|
c887ea94ff | ||
|
|
25a753b97a | ||
|
|
a86ab2955a | ||
|
|
259e05360e | ||
|
|
36b4f52cbc | ||
|
|
ee6343900b | ||
|
|
3818398d86 | ||
|
|
0973f6149b | ||
|
|
1e1fb09821 | ||
|
|
dfe099fe9b | ||
|
|
3b6450f188 | ||
|
|
971a2cc300 | ||
|
|
6b8db478fb | ||
|
|
3932a9614c | ||
|
|
4dde4fffe3 | ||
|
|
57d38be688 | ||
|
|
b79522a955 | ||
|
|
94333ff2f1 | ||
|
|
d3f4bfe192 | ||
|
|
d130e64f69 | ||
|
|
f7e9cddae9 | ||
|
|
6fbcf62d76 | ||
|
|
1a6943fe17 | ||
|
|
cde2343d09 | ||
|
|
c746b30287 | ||
|
|
3582b96dd9 | ||
|
|
d258065e36 | ||
|
|
7627466891 | ||
|
|
c476ee46f8 | ||
|
|
6fc68f4e62 | ||
|
|
75bac1fd4e | ||
|
|
94042375a7 | ||
|
|
103306c6c8 | ||
|
|
6d37d262ea | ||
|
|
473331dd3a | ||
|
|
bc9d03ef48 | ||
|
|
740c88fe0c | ||
|
|
684ef09168 | ||
|
|
e3b08fc15d | ||
|
|
5c931a61b4 | ||
|
|
ad7534d00d | ||
|
|
c81f8699f1 | ||
|
|
2af03eb0dc | ||
|
|
5064ba3f1d | ||
|
|
c5abe47859 | ||
|
|
8fdd0e40f8 | ||
|
|
a6a07ba0d7 | ||
|
|
614fef4189 | ||
|
|
d3e7dba2b7 | ||
|
|
39343c3e9e | ||
|
|
73865fec59 | ||
|
|
b508818f23 | ||
|
|
bef8ae0a2f | ||
|
|
cce2d41500 | ||
|
|
175f3ed338 | ||
|
|
c2cc7c6163 | ||
|
|
8fee041fad | ||
|
|
dfc1f8524a | ||
|
|
752bd2e35a | ||
|
|
01fe0b4630 | ||
|
|
e7f8bc0136 | ||
|
|
370918e07f | ||
|
|
133966677b | ||
|
|
44f84e4781 | ||
|
|
a8354ee046 | ||
|
|
4550e3073a | ||
|
|
abe7a49092 | ||
|
|
82a486bfb6 | ||
|
|
ad06e733f8 | ||
|
|
4306603a28 | ||
|
|
554f834a90 | ||
|
|
7236bec61f | ||
|
|
c799f1bfe9 | ||
|
|
f15c3c1420 | ||
|
|
aa67045330 | ||
|
|
736640f38d | ||
|
|
e9caf663bc | ||
|
|
8afbea53de | ||
|
|
c3d496ad5b | ||
|
|
06501f528d | ||
|
|
f6a678c1a4 | ||
|
|
30690d0ebd | ||
|
|
7a830cddf9 | ||
|
|
3dc1365d39 | ||
|
|
b03cd94ae8 | ||
|
|
bbf348d273 | ||
|
|
dce48eb415 | ||
|
|
decf14635d | ||
|
|
db4f49bbba | ||
|
|
26824fcb6e | ||
|
|
8afad91b33 | ||
|
|
69de0b13c4 | ||
|
|
967153bc10 | ||
|
|
971d9be1bd | ||
|
|
7a3faef886 | ||
|
|
f67030fcc7 | ||
|
|
7353e99449 | ||
|
|
91d9597c89 | ||
|
|
2eb569912b | ||
|
|
9410d9c066 | ||
|
|
29d8788e25 | ||
|
|
0304c50bc6 | ||
|
|
dd22150cfe | ||
|
|
07e7feca56 | ||
|
|
a93eec8f50 | ||
|
|
88bad762e5 | ||
|
|
18dfe6ca8b | ||
|
|
96dfa7009f | ||
|
|
92a9d8ad11 | ||
|
|
2ab9094b41 | ||
|
|
f6154ccbc4 | ||
|
|
0be01dde19 | ||
|
|
e113e91423 | ||
|
|
28c63b8b9d | ||
|
|
c5aac4c44f | ||
|
|
42e7f2a5c3 | ||
|
|
ae9ae18d31 | ||
|
|
f89cdac198 | ||
|
|
e8f345ff77 | ||
|
|
aff0610df9 | ||
|
|
9199d062d1 | ||
|
|
0ec4aaa629 | ||
|
|
9fca99b4ef | ||
|
|
14853895f3 | ||
|
|
d79a400c8c | ||
|
|
f741385e43 | ||
|
|
840bd92afb | ||
|
|
96e1fb0b10 | ||
|
|
388557e5f9 | ||
|
|
3f32817272 | ||
|
|
056b383536 | ||
|
|
0691f40588 | ||
|
|
800ca0aa7c | ||
|
|
a91679609b | ||
|
|
19f9408990 | ||
|
|
0eea0c9aca | ||
|
|
9f95aa8271 | ||
|
|
0ee04c497b | ||
|
|
2847270c97 | ||
|
|
b98174afba | ||
|
|
3416980849 | ||
|
|
c171bfbf3b | ||
|
|
583a737cb5 | ||
|
|
d2af6289dd | ||
|
|
44e6f455e9 | ||
|
|
b3a50d669e | ||
|
|
0092ea22e2 | ||
|
|
58fb35a9bb | ||
|
|
9a6ff77545 | ||
|
|
c4e0164479 | ||
|
|
f872f1c591 | ||
|
|
03e64da845 | ||
|
|
3150f64895 | ||
|
|
8b36e9c317 | ||
|
|
c5c5fc6c02 | ||
|
|
c7d9992a3d | ||
|
|
0d8f2c6b14 | ||
|
|
c1800f2a6f | ||
|
|
d41a115a07 | ||
|
|
2640a3b93f | ||
|
|
984c18cb11 | ||
|
|
23db15dfb9 | ||
|
|
9426f954b0 | ||
|
|
133b64778b | ||
|
|
a8a97fa38d | ||
|
|
da6061bbde |
+59
-35
@@ -14,9 +14,9 @@
|
||||
# run only if manually started to save CI minutes if #
|
||||
# GitLab hosted runners #
|
||||
# * For commits to the CalcProgrammer1/OpenRGB repository, #
|
||||
# automatically run all jobs on the default branch, #
|
||||
# otherwise run them if the source is part of a merge #
|
||||
# request #
|
||||
# automatically run all jobs on the default branch or #
|
||||
# tag builds, otherwise run them if the source is part #
|
||||
# of a merge request #
|
||||
#-----------------------------------------------------------#
|
||||
.downstream_rules:
|
||||
rules:
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
.upstream_rules:
|
||||
rules:
|
||||
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_PIPELINE_SOURCE == "merge_request_event")'
|
||||
- if: '$CI_PROJECT_PATH == "CalcProgrammer1/OpenRGB" && ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH || $CI_COMMIT_TAG || $CI_PIPELINE_SOURCE == "merge_request_event")'
|
||||
when: on_success
|
||||
- !reference [.downstream_rules, rules]
|
||||
|
||||
@@ -51,7 +51,7 @@ before_script:
|
||||
# Supported Devices Build Target #
|
||||
#-----------------------------------------------------------#
|
||||
"Supported Devices":
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-amd64
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:trixie-amd64
|
||||
tags:
|
||||
- linux
|
||||
- amd64
|
||||
@@ -71,10 +71,10 @@ before_script:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# OpenRGB Common Appimage Build Steps #
|
||||
# OpenRGB Common AppImage Build Steps #
|
||||
#-----------------------------------------------------------#
|
||||
.hidden_appimage_script: &appimage_script_steps
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:bookworm-${TGT_ARCH}
|
||||
image: registry.gitlab.com/openrgbdevelopers/openrgb-linux-ci-deb-builder:trixie-${TGT_ARCH}
|
||||
tags:
|
||||
- linux
|
||||
- ${TGT_ARCH}
|
||||
@@ -87,8 +87,6 @@ before_script:
|
||||
name: "${CI_PROJECT_NAME}_Linux_${TGT_NAME}_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- OpenRGB-${TGT_PATH}.AppImage
|
||||
- 60-openrgb.rules
|
||||
- README.md
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
@@ -290,13 +288,13 @@ before_script:
|
||||
<<: *debian_script_steps
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Linux (.rpm, F43) 64-bit Build Target #
|
||||
# Linux (.rpm) Fedora 44 amd64 Build Target #
|
||||
#-----------------------------------------------------------#
|
||||
"Linux 64 F43 rpm":
|
||||
image: fedora:43
|
||||
"Linux amd64 .rpm (Fedora 44)":
|
||||
image: fedora:44
|
||||
stage: build
|
||||
script:
|
||||
- dnf install rpmdevtools dnf-plugins-core libcurl-devel qt5-qtbase-devel git wget -y
|
||||
- dnf install rpmdevtools dnf-plugins-core libcurl-devel qt6-qtbase-devel git wget -y
|
||||
- 'wget -O hidapi-hotplug.zip https://gitlab.com/OpenRGBDevelopers/hidapi-hotplug/-/jobs/artifacts/master/download?job=Linux+64+F43+rpm'
|
||||
- unzip hidapi-hotplug.zip
|
||||
- dnf install ./*.rpm -y
|
||||
@@ -312,7 +310,7 @@ before_script:
|
||||
- cd ${CI_PROJECT_DIR}
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_64_rpm_${CI_COMMIT_SHORT_SHA}"
|
||||
name: "${CI_PROJECT_NAME}_Linux_amd64_rpm_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- openrgb*.rpm
|
||||
expire_in: 30 days
|
||||
@@ -320,6 +318,44 @@ before_script:
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# OpenRGB Common Flatpak Build Steps #
|
||||
#-----------------------------------------------------------#
|
||||
.hidden_flatpak_script: &flatpak_script_steps
|
||||
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.10
|
||||
stage: build
|
||||
tags:
|
||||
- linux
|
||||
- ${TGT_ARCH}
|
||||
script:
|
||||
- flatpak-builder --user --disable-rofiles-fuse --repo=build/repo build/flatpak-build flatpak/org.openrgb.OpenRGB.yaml
|
||||
- flatpak build-bundle build/repo org.openrgb.OpenRGB.flatpak org.openrgb.OpenRGB
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_Linux_${TGT_ARCH}_Flatpak_${CI_COMMIT_SHORT_SHA}"
|
||||
paths:
|
||||
- org.openrgb.OpenRGB.flatpak
|
||||
expire_in: 30 days
|
||||
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Linux Flatpak amd64 Build Target #
|
||||
#-----------------------------------------------------------#
|
||||
"Linux amd64 Flatpak":
|
||||
variables:
|
||||
TGT_ARCH: "amd64"
|
||||
<<: *flatpak_script_steps
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Linux Flatpak arm64 Build Target #
|
||||
#-----------------------------------------------------------#
|
||||
"Linux arm64 Flatpak":
|
||||
variables:
|
||||
TGT_ARCH: "arm64"
|
||||
<<: *flatpak_script_steps
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Debian i386 Bookworm test #
|
||||
#-----------------------------------------------------------#
|
||||
@@ -387,10 +423,10 @@ before_script:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
#-----------------------------------------------------------#
|
||||
# Fedora 64 v43 test #
|
||||
# Fedora amd64 44 test #
|
||||
#-----------------------------------------------------------#
|
||||
"Fedora 64 v43":
|
||||
image: fedora:43
|
||||
"Fedora 64 44":
|
||||
image: fedora:44
|
||||
stage: test
|
||||
script:
|
||||
- dnf install unzip wget -y
|
||||
@@ -401,9 +437,9 @@ before_script:
|
||||
- openrgb --version
|
||||
- dnf5 -y remove openrgb
|
||||
dependencies:
|
||||
- "Linux 64 F43 rpm"
|
||||
- "Linux amd64 .rpm (Fedora 44)"
|
||||
needs:
|
||||
- "Linux 64 F43 rpm"
|
||||
- "Linux amd64 .rpm (Fedora 44)"
|
||||
rules:
|
||||
- !reference [.upstream_rules, rules]
|
||||
|
||||
@@ -536,10 +572,7 @@ before_script:
|
||||
- macos
|
||||
stage: build
|
||||
script:
|
||||
- eval $(/opt/homebrew/bin/brew shellenv)
|
||||
- qmake OpenRGB.pro
|
||||
- make -j16
|
||||
- macdeployqt OpenRGB.app -codesign=OpenRGB
|
||||
- ./scripts/build-macos.sh qt6 arm
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_MacOS_ARM64_${CI_COMMIT_SHORT_SHA}"
|
||||
@@ -555,10 +588,7 @@ before_script:
|
||||
- macos
|
||||
stage: build
|
||||
script:
|
||||
- eval $(/opt/homebrew/bin/brew shellenv)
|
||||
- /opt/homebrew/opt/qt@5/bin/qmake OpenRGB.pro
|
||||
- make -j16
|
||||
- /opt/homebrew/opt/qt@5/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
|
||||
- ./scripts/build-macos.sh qt5 arm
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_MacOS_Qt5_ARM64_${CI_COMMIT_SHORT_SHA}"
|
||||
@@ -574,10 +604,7 @@ before_script:
|
||||
- macos
|
||||
stage: build
|
||||
script:
|
||||
- eval $(/usr/local/bin/brew shellenv)
|
||||
- arch -x86_64 /usr/local/bin/qmake OpenRGB.pro
|
||||
- arch -x86_64 make -j16
|
||||
- arch -x86_64 /usr/local/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
|
||||
- ./scripts/build-macos.sh qt6 intel
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_MacOS_Intel_${CI_COMMIT_SHORT_SHA}"
|
||||
@@ -593,10 +620,7 @@ before_script:
|
||||
- macos
|
||||
stage: build
|
||||
script:
|
||||
- eval $(/usr/local/bin/brew shellenv)
|
||||
- arch -x86_64 /usr/local/opt/qt@5/bin/qmake OpenRGB.pro
|
||||
- arch -x86_64 make -j16
|
||||
- arch -x86_64 /usr/local/opt/qt@5/bin/macdeployqt OpenRGB.app -codesign=OpenRGB
|
||||
- ./scripts/build-macos.sh qt5 intel
|
||||
|
||||
artifacts:
|
||||
name: "${CI_PROJECT_NAME}_MacOS_Intel_Qt5_${CI_COMMIT_SHORT_SHA}"
|
||||
|
||||
+1
-2
@@ -22,13 +22,12 @@ CODEOWNERS @Calcprogrammer1
|
||||
/Controllers/BlinkyTapeController/
|
||||
/Controllers/CoolerMasterController/ @Dr_No
|
||||
/Controllers/CorsairCommanderCoreController/
|
||||
/Controllers/CorsairDominatorPlatinumController/
|
||||
/Controllers/CorsairDRAMController/
|
||||
/Controllers/CorsairHydroController/
|
||||
/Controllers/CorsairHydroPlatinumController/
|
||||
/Controllers/CorsairLightingNodeController/
|
||||
/Controllers/CorsairPeripheralController/
|
||||
/Controllers/CorsairVengeanceController/
|
||||
/Controllers/CorsairVengeanceProController/
|
||||
/Controllers/CorsairWirelessController/
|
||||
/Controllers/CreativeController/
|
||||
/Controllers/CrucialController/
|
||||
|
||||
@@ -0,0 +1,158 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| AutoStart-Flatpak.cpp |
|
||||
| |
|
||||
| Autostart implementation for Linux via Flatpak Portal |
|
||||
| |
|
||||
| Adam Honse <[email protected]> 04 Sep 2026 |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "AutoStart-Flatpak.h"
|
||||
#include <gio/gio.h>
|
||||
|
||||
AutoStart::AutoStart(std::string name)
|
||||
{
|
||||
InitAutoStart(name);
|
||||
}
|
||||
|
||||
void AutoStart::InitAutoStart(std::string name)
|
||||
{
|
||||
app_name = name;
|
||||
}
|
||||
|
||||
bool AutoStart::CallBackgroundPortal(bool enable, const AutoStartInfo& autostart_info)
|
||||
{
|
||||
GError* error = nullptr;
|
||||
GDBusConnection* connection = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, &error);
|
||||
|
||||
if(!connection)
|
||||
{
|
||||
if(error)
|
||||
{
|
||||
g_error_free(error);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| FreeDesktop Background Portal parameters |
|
||||
\*-----------------------------------------------------*/
|
||||
const char* bus_name = "org.freedesktop.portal.Desktop";
|
||||
const char* object_path = "/org/freedesktop/portal/desktop";
|
||||
const char* interface_name = "org.freedesktop.portal.Background";
|
||||
const char* method_name = "RequestBackground";
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Build the options dictionary (vardict) required by |
|
||||
| the Portal |
|
||||
\*-----------------------------------------------------*/
|
||||
GVariantBuilder options_builder;
|
||||
g_variant_builder_init(&options_builder, G_VARIANT_TYPE_VARDICT);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Reason shown to the user in the system settings / |
|
||||
| permission prompt |
|
||||
\*-----------------------------------------------------*/
|
||||
std::string reason_str = "Allow " + app_name + " to launch automatically at startup.";
|
||||
g_variant_builder_add(&options_builder, "{sv}", "reason", g_variant_new_string(reason_str.c_str()));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Toggle the autostart feature state |
|
||||
\*-----------------------------------------------------*/
|
||||
g_variant_builder_add(&options_builder, "{sv}", "autostart", g_variant_new_boolean(enable));
|
||||
|
||||
if(enable)
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Pass command-line arguments to the background |
|
||||
| request |
|
||||
\*-------------------------------------------------*/
|
||||
GVariantBuilder arg_builder;
|
||||
g_variant_builder_init(&arg_builder, G_VARIANT_TYPE("as"));
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Add the primary executable path inside the |
|
||||
| Flatpak sandbox |
|
||||
\*-------------------------------------------------*/
|
||||
g_variant_builder_add(&arg_builder, "s", GetExePath().c_str());
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Append any additional arguments provided by |
|
||||
| OpenRGB's autostart config |
|
||||
\*-------------------------------------------------*/
|
||||
if(!autostart_info.args.empty())
|
||||
{
|
||||
g_variant_builder_add(&arg_builder, "s", autostart_info.args.c_str());
|
||||
}
|
||||
|
||||
GVariant* commandline_args = g_variant_builder_end(&arg_builder);
|
||||
g_variant_builder_add(&options_builder, "{sv}", "commandline", commandline_args);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| An empty string window handle is used since this is a |
|
||||
| background configuration request |
|
||||
\*-----------------------------------------------------*/
|
||||
const char* parent_window = "";
|
||||
GVariant* options = g_variant_builder_end(&options_builder);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Bundle parameters: (s a{sv}) -> Parent window handle, |
|
||||
| Options dictionary |
|
||||
\*-----------------------------------------------------*/
|
||||
GVariant* parameters = g_variant_new("(s@a{sv})", parent_window, options);
|
||||
GVariant* reply;
|
||||
|
||||
reply = g_dbus_connection_call_sync(connection, bus_name, object_path, interface_name, method_name, parameters, G_VARIANT_TYPE("(o)"), G_DBUS_CALL_FLAGS_NONE, -1, nullptr, &error);
|
||||
|
||||
g_object_unref(connection);
|
||||
|
||||
if(error)
|
||||
{
|
||||
g_error_free(error);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(reply)
|
||||
{
|
||||
g_variant_unref(reply);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
{
|
||||
return CallBackgroundPortal(true, autostart_info);
|
||||
}
|
||||
|
||||
bool AutoStart::DisableAutoStart()
|
||||
{
|
||||
return CallBackgroundPortal(false);
|
||||
}
|
||||
|
||||
bool AutoStart::IsAutoStartEnabled()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| The FreeDesktop Background Portal does not provide a |
|
||||
| stateless status getter. Sandbox permissions are |
|
||||
| securely managed and persisted internally by the |
|
||||
| host's portal service. To implement a true state |
|
||||
| track here, OpenRGB will need to manage a local |
|
||||
| boolean flag inside its own configuration files (e.g. |
|
||||
| OpenRGB.json). |
|
||||
\*-----------------------------------------------------*/
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string AutoStart::GetExePath()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Flatpak applications always run from this specific |
|
||||
| exported path hierarchy |
|
||||
\*-----------------------------------------------------*/
|
||||
return "/app/bin/openrgb";
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| AutoStart-Flatpak.h |
|
||||
| |
|
||||
| Autostart implementation for Linux via Flatpak Portal |
|
||||
| |
|
||||
| Adam Honse <[email protected]> 04 Sep 2026 |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "AutoStart.h"
|
||||
|
||||
class AutoStart : public AutoStartInterface
|
||||
{
|
||||
public:
|
||||
AutoStart(std::string name);
|
||||
|
||||
bool DisableAutoStart();
|
||||
bool EnableAutoStart(AutoStartInfo autostart_info);
|
||||
bool IsAutoStartEnabled();
|
||||
std::string GetExePath();
|
||||
|
||||
private:
|
||||
void InitAutoStart(std::string name);
|
||||
bool CallBackgroundPortal(bool enable, const AutoStartInfo& autostart_info = {});
|
||||
|
||||
std::string app_name;
|
||||
};
|
||||
@@ -119,6 +119,21 @@ bool AutoStart::IsAutoStartEnabled()
|
||||
|
||||
std::string AutoStart::GetExePath()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| When running from an AppImage, the AppImage runtime |
|
||||
| sets the APPIMAGE environment variable to the path of |
|
||||
| the AppImage file itself. /proc/self/exe would |
|
||||
| instead point at the extracted binary inside the |
|
||||
| temporary squashfs mount, which disappears once the |
|
||||
| AppImage is closed, so prefer APPIMAGE when it is set |
|
||||
\*-----------------------------------------------------*/
|
||||
const char* appimage_path = getenv("APPIMAGE");
|
||||
|
||||
if(appimage_path != NULL)
|
||||
{
|
||||
return(std::string(appimage_path));
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the OpenRGB executable path |
|
||||
\*-----------------------------------------------------*/
|
||||
@@ -134,6 +149,64 @@ std::string AutoStart::GetExePath()
|
||||
| Private Methods |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Escape a single argument for use in a .desktop Exec= |
|
||||
| field, per the Desktop Entry Specification. |
|
||||
| |
|
||||
| Reserved characters must be escaped by wrapping the whole |
|
||||
| argument in double quotes and backslash-escaping the |
|
||||
| quote/backquote/backslash/dollar characters, and any |
|
||||
| literal '%' must be doubled to '%%'. |
|
||||
\*---------------------------------------------------------*/
|
||||
static std::string DesktopExecEscape(const std::string& arg)
|
||||
{
|
||||
static const std::string reserved = " \t\n\"'`\\><~|&;$*?#()%";
|
||||
|
||||
bool needs_quotes = false;
|
||||
for(char c : arg)
|
||||
{
|
||||
if(reserved.find(c) != std::string::npos)
|
||||
{
|
||||
needs_quotes = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::string escaped;
|
||||
|
||||
if(needs_quotes)
|
||||
{
|
||||
escaped += '"';
|
||||
}
|
||||
|
||||
for(char c : arg)
|
||||
{
|
||||
switch(c)
|
||||
{
|
||||
case '"':
|
||||
case '`':
|
||||
case '\\':
|
||||
case '$':
|
||||
escaped += '\\';
|
||||
escaped += c;
|
||||
break;
|
||||
case '%':
|
||||
escaped += "%%";
|
||||
break;
|
||||
default:
|
||||
escaped += c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(needs_quotes)
|
||||
{
|
||||
escaped += '"';
|
||||
}
|
||||
|
||||
return(escaped);
|
||||
}
|
||||
|
||||
std::string AutoStart::GenerateDesktopFile(AutoStartInfo autostart_info)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -154,11 +227,17 @@ std::string AutoStart::GenerateDesktopFile(AutoStartInfo autostart_info)
|
||||
/*-----------------------------------------------------*\
|
||||
| Add the executable path and arguments |
|
||||
\*-----------------------------------------------------*/
|
||||
fileContents << "Exec=" << autostart_info.path;
|
||||
fileContents << "Exec=" << DesktopExecEscape(autostart_info.path);
|
||||
|
||||
if (autostart_info.args != "")
|
||||
{
|
||||
fileContents << " " << autostart_info.args;
|
||||
std::istringstream arg_parser(autostart_info.args);
|
||||
std::string arg;
|
||||
|
||||
while(arg_parser >> arg)
|
||||
{
|
||||
fileContents << " " << DesktopExecEscape(arg);
|
||||
}
|
||||
}
|
||||
|
||||
fileContents << std::endl;
|
||||
|
||||
@@ -137,6 +137,43 @@ std::string AutoStart::GetExePath()
|
||||
| Private Methods |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Escape a string for embedding inside an XML element |
|
||||
| (used by the .plist generator) to avoid producing |
|
||||
| malformed property list files. |
|
||||
\*---------------------------------------------------------*/
|
||||
static std::string XmlEscape(const std::string& input)
|
||||
{
|
||||
std::string escaped;
|
||||
|
||||
for(char c : input)
|
||||
{
|
||||
switch(c)
|
||||
{
|
||||
case '&':
|
||||
escaped += "&";
|
||||
break;
|
||||
case '<':
|
||||
escaped += "<";
|
||||
break;
|
||||
case '>':
|
||||
escaped += ">";
|
||||
break;
|
||||
case '"':
|
||||
escaped += """;
|
||||
break;
|
||||
case '\'':
|
||||
escaped += "'";
|
||||
break;
|
||||
default:
|
||||
escaped += c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return(escaped);
|
||||
}
|
||||
|
||||
std::string AutoStart::GenerateLaunchAgentFile(AutoStartInfo autostart_info)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -153,7 +190,8 @@ std::string AutoStart::GenerateLaunchAgentFile(AutoStartInfo autostart_info)
|
||||
fileContents << " <string>org.openrgb</string>" << std::endl;
|
||||
fileContents << " <key>ProgramArguments</key>" << std::endl;
|
||||
fileContents << " <array>" << std::endl;
|
||||
fileContents << " <string>" << autostart_info.path << "</string>" << std::endl;
|
||||
fileContents << " <string>" << XmlEscape(autostart_info.path) << "</string>"
|
||||
<< std::endl;
|
||||
|
||||
if(autostart_info.args != "")
|
||||
{
|
||||
@@ -162,7 +200,8 @@ std::string AutoStart::GenerateLaunchAgentFile(AutoStartInfo autostart_info)
|
||||
|
||||
while(arg_parser >> arg)
|
||||
{
|
||||
fileContents << " <string>" << arg << "</string>" << std::endl;
|
||||
fileContents << " <string>" << XmlEscape(arg) << "</string>"
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <shlobj.h>
|
||||
#include "AutoStart-Windows.h"
|
||||
#include "LogManager.h"
|
||||
#include "StringUtils.h"
|
||||
#include "filesystem.h"
|
||||
#include "windows.h"
|
||||
|
||||
@@ -71,11 +72,11 @@ bool AutoStart::EnableAutoStart(AutoStartInfo autostart_info)
|
||||
HRESULT result;
|
||||
IShellLinkW* shellLink = NULL;
|
||||
|
||||
std::wstring exepathw = utf8_decode(autostart_info.path);
|
||||
std::wstring argumentsw = utf8_decode(autostart_info.args);
|
||||
std::wstring startupfilepathw = utf8_decode(autostart_file);
|
||||
std::wstring descriptionw = utf8_decode(autostart_info.desc);
|
||||
std::wstring iconw = utf8_decode(autostart_info.path);
|
||||
std::wstring exepathw = StringUtils::string_to_wstring(autostart_info.path);
|
||||
std::wstring argumentsw = StringUtils::string_to_wstring(autostart_info.args);
|
||||
std::wstring startupfilepathw = StringUtils::string_to_wstring(autostart_file);
|
||||
std::wstring descriptionw = StringUtils::string_to_wstring(autostart_info.desc);
|
||||
std::wstring iconw = StringUtils::string_to_wstring(autostart_info.path);
|
||||
|
||||
result = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_ALL, IID_IShellLinkW, (void**)&shellLink);
|
||||
|
||||
@@ -150,11 +151,16 @@ std::string AutoStart::GetExePath()
|
||||
/*-----------------------------------------------------*\
|
||||
| Create the OpenRGB executable path |
|
||||
\*-----------------------------------------------------*/
|
||||
char exepath[MAX_PATH] = "";
|
||||
wchar_t exepath[MAX_PATH] = L"";
|
||||
|
||||
DWORD count = GetModuleFileNameA(NULL, exepath, MAX_PATH);
|
||||
DWORD count = GetModuleFileNameW(NULL, exepath, MAX_PATH);
|
||||
|
||||
return(std::string(exepath, (count > 0) ? count : 0));
|
||||
if(count == 0)
|
||||
{
|
||||
return(std::string());
|
||||
}
|
||||
|
||||
return(StringUtils::wstring_to_string(std::wstring(exepath, count)));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
@@ -164,43 +170,39 @@ std::string AutoStart::GetExePath()
|
||||
|
||||
void AutoStart::InitAutoStart(std::string name)
|
||||
{
|
||||
char startMenuPath[MAX_PATH];
|
||||
wchar_t startMenuPath[MAX_PATH];
|
||||
|
||||
autostart_name = name;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Get startup applications path |
|
||||
\*-----------------------------------------------------*/
|
||||
HRESULT result = SHGetFolderPathA(NULL, CSIDL_PROGRAMS, NULL, 0, startMenuPath);
|
||||
HRESULT result = SHGetFolderPathW(NULL, CSIDL_PROGRAMS, NULL, 0, startMenuPath);
|
||||
|
||||
if(SUCCEEDED(result))
|
||||
{
|
||||
autostart_file = std::string(startMenuPath);
|
||||
std::string autostart_dir = StringUtils::wstring_to_string(startMenuPath);
|
||||
autostart_dir += "\\Startup\\";
|
||||
|
||||
autostart_file += "\\Startup\\" + autostart_name + ".lnk";
|
||||
/*-------------------------------------------------*\
|
||||
| Create the directory if it doesn't exist |
|
||||
\*-------------------------------------------------*/
|
||||
std::error_code ec;
|
||||
|
||||
bool success = true;
|
||||
|
||||
if(!filesystem::exists(autostart_dir))
|
||||
{
|
||||
success = filesystem::create_directories(autostart_dir, ec);
|
||||
}
|
||||
|
||||
if(success)
|
||||
{
|
||||
autostart_file = autostart_dir + autostart_name + ".lnk";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
autostart_file.clear();
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Convert an UTF8 string to a wide Unicode String |
|
||||
| (from wmi.cpp) |
|
||||
\*---------------------------------------------------------*/
|
||||
std::wstring AutoStart::utf8_decode(const std::string& str)
|
||||
{
|
||||
if(str.empty())
|
||||
{
|
||||
return std::wstring();
|
||||
}
|
||||
|
||||
int size_needed = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int) str.size(), nullptr, 0);
|
||||
|
||||
std::wstring wstrTo(size_needed, 0);
|
||||
|
||||
MultiByteToWideChar(CP_UTF8, 0, &str[0], (int) str.size(), &wstrTo[0], size_needed);
|
||||
|
||||
return(wstrTo);
|
||||
}
|
||||
|
||||
@@ -24,5 +24,4 @@ public:
|
||||
|
||||
private:
|
||||
void InitAutoStart(std::string name);
|
||||
std::wstring utf8_decode(const std::string& str);
|
||||
};
|
||||
|
||||
@@ -40,9 +40,15 @@ protected:
|
||||
#include "AutoStart-Windows.h"
|
||||
#endif
|
||||
|
||||
#ifdef FLATPAK_BUILD
|
||||
#include "AutoStart-Flatpak.h"
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
#ifndef FLATPAK_BUILD
|
||||
#include "AutoStart-Linux.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include "AutoStart-MacOS.h"
|
||||
|
||||
@@ -69,3 +69,7 @@ OpenRGB is written in C++, uses the Qt framework for UI, and uses the QMake buil
|
||||
|
||||
Translation files are located in [`OpenRGB/qt/i18n/`](https://gitlab.com/CalcProgrammer1/OpenRGB/-/tree/master/qt/i18n), where languages are formatted using ISO 639-1 format: `OpenRGB_xx_XX.ts` — `xx_XX` representing the language code.
|
||||
In order to translate a file, you need to [fork](https://gitlab.com/CalcProgrammer1/OpenRGB/-/forks/new) the project, create a new file for your language with `lupdate` (or edit an exisiting one), edit the file with `qtlinguist`, commit, push, and create a merge request.
|
||||
|
||||
## AI Guidelines
|
||||
|
||||
OpenRGB is an open source project developed by humans for humans. As a general rule, AI generated submissions are not permitted. The licensing behind AI generated code is problematic. If you choose to use AI for assistance in your development process, we can't stop you, but do not credit the AI in commits (no AI authorship/co-authorship). Ultimately, you as a human developer are responsible for the code you submit and it is expected that any code you submit you fully understand and have manually vetted before submission. Merge requests that appear to be straight from an AI output, commits with AI tool authorship or co-authorship tags, or otherwise AI generated submissions are subject to closure.
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| A4TechDetector.cpp |
|
||||
| |
|
||||
| Detector for A4Tech Devices |
|
||||
| |
|
||||
| Chris M (Dr_No) 30 Jun 2022 |
|
||||
| Mohammed Julfikar Ali Mahbub (o-julfikar) 01 Apr 2024 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "BloodyB820RController.h"
|
||||
#include "BloodyMouseController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_BloodyB820R.h"
|
||||
#include "RGBController_BloodyMouse.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| A4 Tech USB vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define A4_TECH_VID 0x09DA
|
||||
|
||||
DetectedControllers DetectA4TechMouseControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
BloodyMouseController* controller = new BloodyMouseController(dev, info->path, info->product_id, name);
|
||||
RGBController_BloodyMouse* rgb_controller = new RGBController_BloodyMouse(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectBloodyB820R(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
BloodyB820RController* controller = new BloodyB820RController(dev, info->path, name);
|
||||
RGBController_BloodyB820R* rgb_controller = new RGBController_BloodyB820R(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W60 Pro", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W60_PRO_PID, 2, 0xFF33, 0x0529);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W70 Max", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W70_MAX_PID, 2, 0xFF33, 0x0518);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W90 Max", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W90_MAX_PID, 2, 0xFF33, 0x053D);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W90 Pro", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_W90_PRO_PID, 2, 0xFF33, 0x054D);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody MP 50RS", DetectA4TechMouseControllers, A4_TECH_VID, BLOODY_MP_50RS_PID, 2, 0xFFF2, 0x6009);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody B820R", DetectBloodyB820R, A4_TECH_VID, BLOODY_B820R_PID, 2, 0xFF52, 0x0210);
|
||||
@@ -0,0 +1,40 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| BloodyB820RControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Bloody B820R Devices |
|
||||
| |
|
||||
| Mohammed Julfikar Ali Mahbub (o-julfikar) 01 Apr 2024 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "BloodyB820RController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_BloodyB820R.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| A4 Tech USB vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define A4_TECH_VID 0x09DA
|
||||
|
||||
DetectedControllers DetectBloodyB820R(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
BloodyB820RController* controller = new BloodyB820RController(dev, info->path, name);
|
||||
RGBController_BloodyB820R* rgb_controller = new RGBController_BloodyB820R(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody B820R", DetectBloodyB820R, A4_TECH_VID, BLOODY_B820R_PID, 2, 0xFF52, 0x0210);
|
||||
@@ -0,0 +1,44 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| BloodyMouseControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Bloody Mouse Devices |
|
||||
| |
|
||||
| Chris M (Dr_No) 30 Jun 2022 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "BloodyMouseController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_BloodyMouse.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| A4 Tech USB vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define A4_TECH_VID 0x09DA
|
||||
|
||||
DetectedControllers DetectBloodyMouseControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
BloodyMouseController* controller = new BloodyMouseController(dev, info->path, info->product_id, name);
|
||||
RGBController_BloodyMouse* rgb_controller = new RGBController_BloodyMouse(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W60 Pro", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W60_PRO_PID, 2, 0xFF33, 0x0529);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W70 Max", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W70_MAX_PID, 2, 0xFF33, 0x0518);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W90 Max", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W90_MAX_PID, 2, 0xFF33, 0x053D);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody W90 Pro", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_W90_PRO_PID, 2, 0xFF33, 0x054D);
|
||||
REGISTER_HID_DETECTOR_IPU("Bloody MP 50RS", DetectBloodyMouseControllers, A4_TECH_VID, BLOODY_MP_50RS_PID, 2, 0xFFF2, 0x6009);
|
||||
@@ -31,7 +31,7 @@ AOCKeyboardController::~AOCKeyboardController()
|
||||
|
||||
std::string AOCKeyboardController::GetDeviceLocation()
|
||||
{
|
||||
return("HID " + location);
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AOCKeyboardController::GetDeviceName()
|
||||
|
||||
@@ -27,7 +27,7 @@ AOCMouseController::~AOCMouseController()
|
||||
|
||||
std::string AOCMouseController::GetDeviceLocation()
|
||||
{
|
||||
return("HID " + location);
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AOCMouseController::GetDeviceName()
|
||||
|
||||
@@ -27,7 +27,7 @@ AOCMousematController::~AOCMousematController()
|
||||
|
||||
std::string AOCMousematController::GetDeviceLocation()
|
||||
{
|
||||
return("HID " + location);
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AOCMousematController::GetDeviceName()
|
||||
|
||||
@@ -228,7 +228,8 @@ void RGBController_PolychromeUSB::SetupZones()
|
||||
zones[channel_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
}
|
||||
|
||||
if(!(zones[channel_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
@@ -268,7 +269,7 @@ void RGBController_PolychromeUSB::SetupZones()
|
||||
new_led.name = zones[channel_idx].name;
|
||||
new_led.name.append(", LED ");
|
||||
new_led.name.append(std::to_string(led_ch_idx + 1));
|
||||
new_led.value = channel_idx;
|
||||
new_led.value = (unsigned int)channel_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
@@ -333,9 +334,14 @@ void RGBController_PolychromeUSB::DeviceUpdateLEDs()
|
||||
}
|
||||
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||
{
|
||||
if(zones[zone_idx].leds_count == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
unsigned char set_mode = zones_info[zone_idx].mode;
|
||||
|
||||
if (set_mode>modes.size())
|
||||
if(set_mode>modes.size())
|
||||
{
|
||||
set_mode = active_mode;
|
||||
}
|
||||
@@ -346,6 +352,11 @@ void RGBController_PolychromeUSB::DeviceUpdateLEDs()
|
||||
|
||||
void RGBController_PolychromeUSB::DeviceUpdateZoneLEDs(int zone)
|
||||
{
|
||||
if(zones[zone].leds_count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned char set_mode=zones_info[zone].mode;
|
||||
|
||||
if(set_mode > modes.size())
|
||||
@@ -353,7 +364,7 @@ void RGBController_PolychromeUSB::DeviceUpdateZoneLEDs(int zone)
|
||||
set_mode = active_mode;
|
||||
}
|
||||
|
||||
controller->WriteZone(zone, set_mode, zones_info[zone].speed, zones[zone].colors[0], false);
|
||||
controller->WriteZone((unsigned char)zone, set_mode, zones_info[zone].speed, zones[zone].colors[0], false);
|
||||
}
|
||||
|
||||
void RGBController_PolychromeUSB::DeviceUpdateSingleLED(int led)
|
||||
@@ -361,12 +372,17 @@ void RGBController_PolychromeUSB::DeviceUpdateSingleLED(int led)
|
||||
unsigned int channel = leds[led].value;
|
||||
unsigned char set_mode = zones_info[channel].mode;
|
||||
|
||||
if(zones[channel].leds_count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(set_mode > modes.size())
|
||||
{
|
||||
set_mode = active_mode;
|
||||
}
|
||||
|
||||
controller->WriteZone(channel, set_mode, zones_info[channel].speed, zones[channel].colors[0], false);
|
||||
controller->WriteZone((unsigned char)channel, set_mode, zones_info[channel].speed, zones[channel].colors[0], false);
|
||||
}
|
||||
|
||||
unsigned char RGBController_PolychromeUSB::GetDeviceMode(unsigned char zone)
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ ASRockASRRGBSMBusController::~ASRockASRRGBSMBusController()
|
||||
|
||||
std::string ASRockASRRGBSMBusController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->device_name);
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ASRockGPUSMBusController.cpp |
|
||||
| |
|
||||
| Driver for ASRock GPU RGB controllers |
|
||||
| |
|
||||
| Based on SignalRGB ASRock GPU.js plugin |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "ASRockGPUSMBusController.h"
|
||||
#include "LogManager.h"
|
||||
#include <chrono>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include <thread>
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
ASRockGPUSMBusController::ASRockGPUSMBusController(i2c_smbus_interface* bus, asrock_gpu_dev_id dev, std::string name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->device_name = name;
|
||||
this->num_channels = 0;
|
||||
|
||||
memset(enabled_channels, 0, sizeof(enabled_channels));
|
||||
memset(led_counts, 0, sizeof(led_counts));
|
||||
}
|
||||
|
||||
ASRockGPUSMBusController::~ASRockGPUSMBusController()
|
||||
{
|
||||
}
|
||||
|
||||
std::string ASRockGPUSMBusController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
return_string.append(addr);
|
||||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string ASRockGPUSMBusController::GetDeviceName()
|
||||
{
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
bool ASRockGPUSMBusController::WriteBlock(uint8_t command, uint8_t subcommand, const uint8_t* data, uint8_t len)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| SignalRGB packet format |
|
||||
| [command, 0, subcommand, data...] |
|
||||
| Uses pure I2C rather than SMBus |
|
||||
\*-----------------------------------------------------*/
|
||||
uint8_t packet[12];
|
||||
memset(packet, 0, sizeof(packet));
|
||||
|
||||
packet[0] = command;
|
||||
packet[1] = 0x00;
|
||||
packet[2] = subcommand;
|
||||
|
||||
if(data != nullptr && len > 0)
|
||||
{
|
||||
uint8_t copy_len = (len > 9) ? 9 : len;
|
||||
memcpy(&packet[3], data, copy_len);
|
||||
}
|
||||
|
||||
int size = 12;
|
||||
int result = bus->i2c_write_block(dev, size, packet);
|
||||
|
||||
if(result < 0)
|
||||
{
|
||||
LOG_DEBUG("[ASRock GPU] Write block failed: %d", result);
|
||||
return(false);
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool ASRockGPUSMBusController::ReadBlock(uint8_t* response, uint8_t len)
|
||||
{
|
||||
memset(response, 0, len);
|
||||
int size = len;
|
||||
int result = bus->i2c_read_block(dev, &size, response);
|
||||
|
||||
if(result < 0)
|
||||
{
|
||||
LOG_DEBUG("[ASRock GPU] Read block failed: %d", result);
|
||||
return(false);
|
||||
}
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool ASRockGPUSMBusController::DetectChannels()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Get enabled channels |
|
||||
| Command 0x14, subcommand 0x01 |
|
||||
\*-----------------------------------------------------*/
|
||||
if(!WriteBlock(0x14, 0x01, nullptr, 0))
|
||||
{
|
||||
LOG_WARNING("[ASRock GPU] Failed to request enabled channels");
|
||||
return(false);
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(20ms);
|
||||
|
||||
uint8_t response[I2C_SMBUS_BLOCK_MAX];
|
||||
if(!ReadBlock(response, sizeof(response)))
|
||||
{
|
||||
LOG_WARNING("[ASRock GPU] Failed to read enabled channels");
|
||||
return(false);
|
||||
}
|
||||
|
||||
LOG_TRACE("[ASRock GPU] Enabled channels response: %02X %02X %02X %02X %02X %02X", response[0], response[1], response[2], response[3], response[4], response[5]);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Response format |
|
||||
| Bytes 4-5 contain the channel bitmap |
|
||||
\*-----------------------------------------------------*/
|
||||
uint16_t channel_bits = response[4] | (response[5] << 8);
|
||||
LOG_TRACE("[ASRock GPU] Channel bits: 0x%04X", channel_bits);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Get LED counts |
|
||||
| Command 0x14, subcommand 0x02 |
|
||||
\*-----------------------------------------------------*/
|
||||
if(!WriteBlock(0x14, 0x02, nullptr, 0))
|
||||
{
|
||||
LOG_WARNING("[ASRock GPU] Failed to request LED counts");
|
||||
return(false);
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(20ms);
|
||||
|
||||
if(!ReadBlock(response, sizeof(response)))
|
||||
{
|
||||
LOG_WARNING("[ASRock GPU] Failed to read LED counts");
|
||||
return(false);
|
||||
}
|
||||
|
||||
num_channels = 0;
|
||||
for(int i = 0; i < 16; i++)
|
||||
{
|
||||
if(channel_bits & (1 << i))
|
||||
{
|
||||
enabled_channels[num_channels] = i;
|
||||
led_counts[num_channels] = response[4 + i];
|
||||
|
||||
const char* name = "Unknown";
|
||||
if(i == ASROCK_GPU_CHANNEL_ARGB_HEADER)
|
||||
{
|
||||
name = "ARGB Header";
|
||||
}
|
||||
else if(i == ASROCK_GPU_CHANNEL_TOP_SIDE)
|
||||
{
|
||||
name = "Top Side";
|
||||
}
|
||||
else if(i == ASROCK_GPU_CHANNEL_FAN)
|
||||
{
|
||||
name = "Fan";
|
||||
}
|
||||
|
||||
LOG_DEBUG("[ASRock GPU] Channel %d (%s) active with %d LEDs", i, name, response[4 + i]);
|
||||
num_channels++;
|
||||
}
|
||||
}
|
||||
|
||||
LOG_DEBUG("[ASRock GPU] Found %d active channels", num_channels);
|
||||
return(num_channels > 0);
|
||||
}
|
||||
|
||||
void ASRockGPUSMBusController::SetChannelColor(uint8_t channel_idx, uint8_t red, uint8_t green, uint8_t blue)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| SignalRGB color packet |
|
||||
| Command 0x10, subcommand is the channel index |
|
||||
\*-----------------------------------------------------*/
|
||||
uint8_t data[8] =
|
||||
{
|
||||
0x01, // Mode: direct/static
|
||||
red,
|
||||
green,
|
||||
blue,
|
||||
0x80, // Brightness
|
||||
0xFF, // Effect speed
|
||||
0x00, // Effect direction
|
||||
0x1A // Unknown constant
|
||||
};
|
||||
|
||||
if(!WriteBlock(0x10, channel_idx, data, sizeof(data)))
|
||||
{
|
||||
LOG_WARNING("[ASRock GPU] Failed to set color for channel %d", channel_idx);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ASRockGPUSMBusController.h |
|
||||
| |
|
||||
| Driver for ASRock GPU RGB controllers |
|
||||
| |
|
||||
| Based on SignalRGB ASRock GPU.js plugin |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
typedef uint8_t asrock_gpu_dev_id;
|
||||
|
||||
#define ASROCK_GPU_CONTROLLER_NAME "ASRock GPU SMBus Controller"
|
||||
#define ASROCK_GPU_SMBUS_ADDRESS 0x36
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| ASRock GPU Channel Names (from SignalRGB) |
|
||||
\*-----------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
ASROCK_GPU_CHANNEL_ARGB_HEADER = 3,
|
||||
ASROCK_GPU_CHANNEL_TOP_SIDE = 6,
|
||||
ASROCK_GPU_CHANNEL_FAN = 7,
|
||||
};
|
||||
|
||||
class ASRockGPUSMBusController
|
||||
{
|
||||
public:
|
||||
ASRockGPUSMBusController(i2c_smbus_interface* bus, asrock_gpu_dev_id dev, std::string name);
|
||||
~ASRockGPUSMBusController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
|
||||
void SetChannelColor(uint8_t channel_idx, uint8_t red, uint8_t green, uint8_t blue);
|
||||
bool DetectChannels();
|
||||
|
||||
uint8_t enabled_channels[16];
|
||||
uint8_t led_counts[16];
|
||||
uint8_t num_channels;
|
||||
|
||||
private:
|
||||
i2c_smbus_interface* bus;
|
||||
asrock_gpu_dev_id dev;
|
||||
std::string device_name;
|
||||
|
||||
bool WriteBlock(uint8_t command, uint8_t subcommand, const uint8_t* data, uint8_t len);
|
||||
bool ReadBlock(uint8_t* response, uint8_t len);
|
||||
};
|
||||
+46
@@ -0,0 +1,46 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ASRockGPUSMBusControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for ASRock GPU RGB controllers |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "DetectionManager.h"
|
||||
#include "ASRockGPUSMBusController.h"
|
||||
#include "LogManager.h"
|
||||
#include "RGBController_ASRockGPUSMBus.h"
|
||||
#include "i2c_amd_gpu.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "pci_ids.h"
|
||||
|
||||
DetectedControllers DetectASRockGPUSMBusControllers(i2c_smbus_interface* bus, uint8_t address, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
if(bus->info.pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
|
||||
{
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
LOG_DEBUG("[ASRock GPU] Checking GPU I2C bus for RGB controller at 0x%02X", address);
|
||||
|
||||
ASRockGPUSMBusController* controller = new ASRockGPUSMBusController(bus, address, name);
|
||||
|
||||
if(controller->DetectChannels())
|
||||
{
|
||||
detected_controllers.push_back(new RGBController_ASRockGPUSMBus(controller));
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_WARNING("[ASRock GPU] No active channels found, device not registered");
|
||||
delete controller;
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_PCI_DETECTOR("ASRock Radeon RX 9070 XT Steel Legend", DetectASRockGPUSMBusControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, ASROCK_SUB_VEN, 0x5403, ASROCK_GPU_SMBUS_ADDRESS);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASRock Radeon RX 9070 XT Taichi 16GB OC", DetectASRockGPUSMBusControllers, AMD_GPU_VEN, AMD_NAVI48_DEV, ASROCK_SUB_VEN, 0x5401, ASROCK_GPU_SMBUS_ADDRESS);
|
||||
REGISTER_I2C_PCI_DETECTOR("ASRock Radeon RX 9060 XT Steel Legend", DetectASRockGPUSMBusControllers, AMD_GPU_VEN, AMD_NAVI44_DEV, ASROCK_SUB_VEN, 0x5407, ASROCK_GPU_SMBUS_ADDRESS);
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_ASRockGPUSMBus.cpp |
|
||||
| |
|
||||
| RGBController for ASRock GPU RGB controllers |
|
||||
| |
|
||||
| Based on SignalRGB ASRock GPU.js plugin |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_ASRockGPUSMBus.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name ASRock GPU SMBus
|
||||
@category GPU
|
||||
@type I2C
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :x:
|
||||
@detectors DetectASRockGPUSMBusControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_ASRockGPUSMBus::RGBController_ASRockGPUSMBus(ASRockGPUSMBusController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "ASRock";
|
||||
type = DEVICE_TYPE_GPU;
|
||||
description = "ASRock GPU RGB Controller";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_ASRockGPUSMBus::~RGBController_ASRockGPUSMBus()
|
||||
{
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_ASRockGPUSMBus::SetupZones()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up zones - one zone per channel |
|
||||
\*-----------------------------------------------------*/
|
||||
for(unsigned int i = 0; i < controller->num_channels; i++)
|
||||
{
|
||||
uint8_t channel_idx = controller->enabled_channels[i];
|
||||
|
||||
zone new_zone;
|
||||
new_zone.type = ZONE_TYPE_SINGLE;
|
||||
new_zone.leds_min = 1;
|
||||
new_zone.leds_max = 1;
|
||||
new_zone.leds_count = 1;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Channel names from SignalRGB |
|
||||
\*-----------------------------------------------------*/
|
||||
if(channel_idx == ASROCK_GPU_CHANNEL_ARGB_HEADER)
|
||||
{
|
||||
new_zone.name = "ARGB Header";
|
||||
}
|
||||
else if(channel_idx == ASROCK_GPU_CHANNEL_TOP_SIDE)
|
||||
{
|
||||
new_zone.name = "Top Side";
|
||||
}
|
||||
else if(channel_idx == ASROCK_GPU_CHANNEL_FAN)
|
||||
{
|
||||
new_zone.name = "Fan";
|
||||
}
|
||||
else
|
||||
{
|
||||
new_zone.name = "Channel " + std::to_string(channel_idx);
|
||||
}
|
||||
|
||||
zones.push_back(new_zone);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up LED for this zone |
|
||||
\*-----------------------------------------------------*/
|
||||
led new_led;
|
||||
new_led.name = new_zone.name;
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_ASRockGPUSMBus::ResizeZone(int /*zone*/, int /*new_size*/)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| This device does not support resizing zones |
|
||||
\*-----------------------------------------------------*/
|
||||
}
|
||||
|
||||
void RGBController_ASRockGPUSMBus::DeviceUpdateLEDs()
|
||||
{
|
||||
for(unsigned int i = 0; i < controller->num_channels; i++)
|
||||
{
|
||||
uint8_t channel_idx = controller->enabled_channels[i];
|
||||
RGBColor color = colors[i];
|
||||
|
||||
controller->SetChannelColor(channel_idx,
|
||||
RGBGetRValue(color),
|
||||
RGBGetGValue(color),
|
||||
RGBGetBValue(color));
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_ASRockGPUSMBus::UpdateZoneLEDs(int zone)
|
||||
{
|
||||
uint8_t channel_idx = controller->enabled_channels[zone];
|
||||
RGBColor color = colors[zone];
|
||||
|
||||
controller->SetChannelColor(channel_idx,
|
||||
RGBGetRValue(color),
|
||||
RGBGetGValue(color),
|
||||
RGBGetBValue(color));
|
||||
}
|
||||
|
||||
void RGBController_ASRockGPUSMBus::UpdateSingleLED(int led)
|
||||
{
|
||||
UpdateZoneLEDs(led);
|
||||
}
|
||||
|
||||
void RGBController_ASRockGPUSMBus::DeviceUpdateMode()
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_ASRockGPUSMBus.h |
|
||||
| |
|
||||
| RGBController for ASRock GPU RGB controllers |
|
||||
| |
|
||||
| Based on SignalRGB ASRock GPU.js plugin |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "ASRockGPUSMBusController.h"
|
||||
|
||||
class RGBController_ASRockGPUSMBus : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_ASRockGPUSMBus(ASRockGPUSMBusController* controller_ptr);
|
||||
~RGBController_ASRockGPUSMBus();
|
||||
|
||||
void SetupZones();
|
||||
void ResizeZone(int zone, int new_size);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void UpdateZoneLEDs(int zone);
|
||||
void UpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
ASRockGPUSMBusController* controller;
|
||||
};
|
||||
+1
-1
@@ -36,7 +36,7 @@ ASRockPolychromeV1SMBusController::~ASRockPolychromeV1SMBusController()
|
||||
|
||||
std::string ASRockPolychromeV1SMBusController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->device_name);
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ ASRockPolychromeV2SMBusController::~ASRockPolychromeV2SMBusController()
|
||||
|
||||
std::string ASRockPolychromeV2SMBusController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->device_name);
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
|
||||
-3
@@ -238,7 +238,6 @@ void RGBController_ASRockPolychromeV2SMBus::SetupZones()
|
||||
}
|
||||
}
|
||||
|
||||
unsigned int led_count = 0;
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up LEDs |
|
||||
\*---------------------------------------------------------*/
|
||||
@@ -268,8 +267,6 @@ void RGBController_ASRockPolychromeV2SMBus::SetupZones()
|
||||
\*---------------------------------------------------------*/
|
||||
leds.push_back(*new_led);
|
||||
|
||||
led_count++;
|
||||
|
||||
if(zone_idx == POLYCHROME_V2_ZONE_ADDRESSABLE)
|
||||
{
|
||||
break;
|
||||
|
||||
@@ -85,31 +85,31 @@ uint16_t GetFirmwareVersion(i2c_smbus_interface* bus, uint8_t address)
|
||||
}
|
||||
}
|
||||
|
||||
DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface*>& busses)
|
||||
DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface*>& buses)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
for(unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
for(unsigned int bus = 0; bus < buses.size(); bus++)
|
||||
{
|
||||
IF_MOBO_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
|
||||
IF_MOBO_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
|
||||
{
|
||||
if(busses[bus]->pci_subsystem_vendor == ASROCK_SUB_VEN)
|
||||
if(buses[bus]->info.pci_subsystem_vendor == ASROCK_SUB_VEN)
|
||||
{
|
||||
LOG_DEBUG(SMBUS_CHECK_DEVICE_MESSAGE_EN, ASROCK_DETECTOR_NAME, bus, VENDOR_NAME, SMBUS_ADDRESS);
|
||||
// Check for Polychrome controller at 0x6A
|
||||
if(TestForPolychromeSMBusController(busses[bus], SMBUS_ADDRESS))
|
||||
if(TestForPolychromeSMBusController(buses[bus], SMBUS_ADDRESS))
|
||||
{
|
||||
LOG_DEBUG("[%s] Detected a device at address 0x%02X, testing for a known controller", ASROCK_DETECTOR_NAME, SMBUS_ADDRESS);
|
||||
|
||||
u16_to_u8 version;
|
||||
version.u16 = GetFirmwareVersion(busses[bus], SMBUS_ADDRESS);
|
||||
version.u16 = GetFirmwareVersion(buses[bus], SMBUS_ADDRESS);
|
||||
|
||||
switch(version.msb)
|
||||
{
|
||||
case ASROCK_TYPE_ASRLED:
|
||||
{
|
||||
LOG_DEBUG("[%s] Found a ASR RGB LED Controller", ASROCK_DETECTOR_NAME);
|
||||
ASRockASRRGBSMBusController* controller = new ASRockASRRGBSMBusController(busses[bus], SMBUS_ADDRESS);
|
||||
ASRockASRRGBSMBusController* controller = new ASRockASRRGBSMBusController(buses[bus], SMBUS_ADDRESS);
|
||||
controller-> fw_version = version.u16;
|
||||
RGBController_ASRockASRRGBSMBus* rgb_controller = new RGBController_ASRockASRRGBSMBus(controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
@@ -119,7 +119,7 @@ DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface
|
||||
case ASROCK_TYPE_POLYCHROME_V1:
|
||||
{
|
||||
LOG_DEBUG("[%s] Found a Polychrome v1 Controller", ASROCK_DETECTOR_NAME);
|
||||
ASRockPolychromeV1SMBusController* controller = new ASRockPolychromeV1SMBusController(busses[bus], SMBUS_ADDRESS);
|
||||
ASRockPolychromeV1SMBusController* controller = new ASRockPolychromeV1SMBusController(buses[bus], SMBUS_ADDRESS);
|
||||
controller-> fw_version = version.u16;
|
||||
RGBController_ASRockPolychromeV1SMBus* rgb_controller = new RGBController_ASRockPolychromeV1SMBus(controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
@@ -129,7 +129,7 @@ DetectedControllers DetectASRockSMBusControllers(std::vector<i2c_smbus_interface
|
||||
case ASROCK_TYPE_POLYCHROME_V2:
|
||||
{
|
||||
LOG_DEBUG("[%s] Found a Polychrome v2 Controller", ASROCK_DETECTOR_NAME);
|
||||
ASRockPolychromeV2SMBusController* controller = new ASRockPolychromeV2SMBusController(busses[bus], SMBUS_ADDRESS);
|
||||
ASRockPolychromeV2SMBusController* controller = new ASRockPolychromeV2SMBusController(buses[bus], SMBUS_ADDRESS);
|
||||
controller-> fw_version = version.u16;
|
||||
RGBController_ASRockPolychromeV2SMBus* rgb_controller = new RGBController_ASRockPolychromeV2SMBus(controller);
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_AcerNitroHidKeyboard.cpp |
|
||||
| |
|
||||
| Detector for Acer Nitro HID Keyboard |
|
||||
| |
|
||||
| Marek Pokropiński Jul 27 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <vector>
|
||||
#include "DetectionManager.h"
|
||||
#include "AcerNitroHidKeyboardController.h"
|
||||
#include "RGBController_AcerNitroHidKeyboard.h"
|
||||
#include "RGBController_AcerNitroHidLed.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| HID vendor and product IDs for ENEK EC in Acer Nitro |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#define ACER_ENEC_VID 0x0CF2
|
||||
#define ACER_ENEC_PID 0x5130
|
||||
#define ACER_ENEC_USAGE_PAGE 0xFF5A
|
||||
#define ACER_ENEC_USAGE 0x01
|
||||
|
||||
DetectedControllers DetectAcerHIDControllers(hid_device_info* info, const std::string&)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
if(dev)
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Controller is shared between keyboard and onboard |
|
||||
| led |
|
||||
\*-------------------------------------------------*/
|
||||
std::shared_ptr<AcerNitroHidKeyboardController> controller = std::make_shared<AcerNitroHidKeyboardController>(dev, info->path);
|
||||
RGBController_AcerNitroHidKeyboard* rgb_kb_controller = new RGBController_AcerNitroHidKeyboard(controller);
|
||||
RGBController_AcerNitroHidLed* rgb_led_controller = new RGBController_AcerNitroHidLed(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_kb_controller);
|
||||
detected_controllers.push_back(rgb_led_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_PU("AcerNitroHidKeyboardController", DetectAcerHIDControllers, ACER_ENEC_VID, ACER_ENEC_PID, ACER_ENEC_USAGE_PAGE, ACER_ENEC_USAGE);
|
||||
@@ -0,0 +1,80 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_AcerNitroHidKeyboard.cpp |
|
||||
| |
|
||||
| Driver for Acer Nitro Keyboard |
|
||||
| |
|
||||
| Marek Pokropiński Jul 27 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "AcerNitroHidKeyboardController.h"
|
||||
|
||||
AcerNitroHidKeyboardController::AcerNitroHidKeyboardController(hid_device *dev_handle, const char *path)
|
||||
{
|
||||
this->location = path;
|
||||
this->dev = dev_handle;
|
||||
|
||||
device_name = "Acer Nitro HID Keyboard";
|
||||
}
|
||||
|
||||
AcerNitroHidKeyboardController::~AcerNitroHidKeyboardController()
|
||||
{
|
||||
if(dev)
|
||||
{
|
||||
hid_close(dev);
|
||||
}
|
||||
}
|
||||
|
||||
std::string AcerNitroHidKeyboardController::GetLocation() const
|
||||
{
|
||||
return("HID: " + location);
|
||||
}
|
||||
|
||||
std::string AcerNitroHidKeyboardController::GetDeviceName() const
|
||||
{
|
||||
return(device_name);
|
||||
}
|
||||
|
||||
void AcerNitroHidKeyboardController::SetLEDs(const std::vector<RGBColor>& colors, unsigned char brightness, unsigned char device_id)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(device_mutex);
|
||||
|
||||
for(unsigned int led_idx = 0; (led_idx < colors.size()) && (led_idx < ACER_HID_NUM_ZONES); led_idx++)
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Convert colors to RGB format |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned char r = RGBGetRValue(colors[led_idx]);
|
||||
unsigned char g = RGBGetGValue(colors[led_idx]);
|
||||
unsigned char b = RGBGetBValue(colors[led_idx]);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned char zone_select = (unsigned char)(1<<led_idx);
|
||||
unsigned char packet[ACER_HID_PACKET_SIZE] = {0xA4, device_id, ACER_HID_MODE_STATIC, brightness, 0, 1, r, g, b, zone_select, 0};
|
||||
hid_send_feature_report(dev, packet, ACER_HID_PACKET_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
void AcerNitroHidKeyboardController::SetAllLEDs(const RGBColor &color, unsigned char brightness, unsigned char speed, unsigned char direction, unsigned char mode, unsigned char device_id)
|
||||
{
|
||||
std::lock_guard<std::mutex> guard(device_mutex);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Convert color to RGB format |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned char r = RGBGetRValue(color);
|
||||
unsigned char g = RGBGetGValue(color);
|
||||
unsigned char b = RGBGetBValue(color);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
| Zone select = All zones |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned char zone_select = 0x0F;
|
||||
unsigned char packet[ACER_HID_PACKET_SIZE] = {0xA4, device_id, mode, brightness, speed, direction, r, g, b, zone_select, 0};
|
||||
hid_send_feature_report(dev, packet, ACER_HID_PACKET_SIZE);
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_AcerNitroHidKeyboard.cpp |
|
||||
| |
|
||||
| Driver for Acer Nitro Keyboard |
|
||||
| |
|
||||
| Marek Pokropiński Jul 27 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
enum
|
||||
{
|
||||
ACER_HID_MODE_DIRECT = 1,
|
||||
ACER_HID_MODE_STATIC = 2,
|
||||
ACER_HID_MODE_BREATHING = 4,
|
||||
ACER_HID_MODE_NEON = 5,
|
||||
ACER_HID_MODE_OPMODE = 6,
|
||||
ACER_HID_MODE_WAVE = 7,
|
||||
ACER_HID_MODE_SHIFTING = 8,
|
||||
ACER_HID_MODE_ZOOM = 9,
|
||||
ACER_HID_MODE_METEOR = 10,
|
||||
ACER_HID_MODE_TWINKLING = 11,
|
||||
};
|
||||
|
||||
#define ACER_HID_NAME_BUFFER_SIZE 255
|
||||
#define ACER_HID_NUM_ZONES 4
|
||||
#define ACER_HID_PACKET_SIZE 11
|
||||
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <hidapi.h>
|
||||
#include "RGBControllerInterface.h"
|
||||
|
||||
class AcerNitroHidKeyboardController
|
||||
{
|
||||
public:
|
||||
AcerNitroHidKeyboardController(hid_device *dev_handle, const char *path);
|
||||
~AcerNitroHidKeyboardController();
|
||||
|
||||
std::string GetDeviceName() const;
|
||||
std::string GetSerial() const;
|
||||
std::string GetLocation() const;
|
||||
|
||||
void SetLEDs(const std::vector<RGBColor> &colors, unsigned char brightness, unsigned char device_id);
|
||||
void SetAllLEDs(const RGBColor &color, unsigned char brightness, unsigned char speed, unsigned char direction, unsigned char mode, unsigned char device_id);
|
||||
|
||||
private:
|
||||
hid_device *dev;
|
||||
std::string device_name;
|
||||
std::string location;
|
||||
std::mutex device_mutex;
|
||||
};
|
||||
@@ -0,0 +1,231 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_AcerNitroHidKeyboard.cpp |
|
||||
| |
|
||||
| RGBController for Acer Nitro HID Keyboard |
|
||||
| |
|
||||
| Marek Pokropiński Jul 27 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_AcerNitroHidKeyboard.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Acer Nitro HID Keyboard
|
||||
@category Laptop
|
||||
@type HID
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectAcerHIDControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_AcerNitroHidKeyboard::RGBController_AcerNitroHidKeyboard(std::shared_ptr<AcerNitroHidKeyboardController> controller)
|
||||
{
|
||||
this->controller = controller;
|
||||
device_id = 0x21;
|
||||
|
||||
name = "Acer Nitro HID Keyboard";
|
||||
vendor = "Acer";
|
||||
type = DEVICE_TYPE_LAPTOP;
|
||||
description = "Acer Nitro HID Keyboard Device";
|
||||
location = controller->GetLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = ACER_HID_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS ;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.brightness_min = 0;
|
||||
Direct.brightness_max = 100;
|
||||
Direct.brightness = 100;
|
||||
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = ACER_HID_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.brightness_min = 0;
|
||||
Static.brightness_max = 100;
|
||||
Static.brightness = 100;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.colors.resize(1);
|
||||
Static.speed = 0;
|
||||
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = ACER_HID_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.brightness_min = 0;
|
||||
Breathing.brightness_max = 100;
|
||||
Breathing.brightness = 100;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.speed_min = 1;
|
||||
Breathing.speed_max = 9;
|
||||
Breathing.speed = 4;
|
||||
Breathing.colors.resize(1);
|
||||
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Neon;
|
||||
Neon.name = "Neon";
|
||||
Neon.value = ACER_HID_MODE_NEON;
|
||||
Neon.flags = MODE_FLAG_REQUIRES_ENTIRE_DEVICE | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Neon.color_mode = MODE_COLORS_NONE;
|
||||
Neon.brightness_min = 0;
|
||||
Neon.brightness_max = 100;
|
||||
Neon.brightness = 100;
|
||||
Neon.speed_min = 1;
|
||||
Neon.speed_max = 9;
|
||||
Neon.speed = 4;
|
||||
|
||||
modes.push_back(Neon);
|
||||
|
||||
mode Wave;
|
||||
Wave.name = "Wave";
|
||||
Wave.value = ACER_HID_MODE_WAVE;
|
||||
Wave.flags = MODE_FLAG_REQUIRES_ENTIRE_DEVICE | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR;
|
||||
Wave.color_mode = MODE_COLORS_NONE;
|
||||
Wave.brightness_min = 0;
|
||||
Wave.brightness_max = 100;
|
||||
Wave.brightness = 100;
|
||||
Wave.speed_min = 1;
|
||||
Wave.speed_max = 9;
|
||||
Wave.speed = 4;
|
||||
Wave.direction = 0;
|
||||
|
||||
modes.push_back(Wave);
|
||||
|
||||
mode Shifting;
|
||||
Shifting.name = "Shifting";
|
||||
Shifting.value = ACER_HID_MODE_SHIFTING;
|
||||
Shifting.flags = MODE_FLAG_REQUIRES_ENTIRE_DEVICE | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Shifting.color_mode = MODE_COLORS_NONE;
|
||||
Shifting.brightness_min = 0;
|
||||
Shifting.brightness_max = 100;
|
||||
Shifting.brightness = 100;
|
||||
Shifting.speed_min = 1;
|
||||
Shifting.speed_max = 9;
|
||||
Shifting.speed = 4;
|
||||
|
||||
modes.push_back(Shifting);
|
||||
|
||||
mode Zoom;
|
||||
Zoom.name = "Zoom";
|
||||
Zoom.value = ACER_HID_MODE_ZOOM;
|
||||
Zoom.flags = MODE_FLAG_REQUIRES_ENTIRE_DEVICE | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Zoom.color_mode = MODE_COLORS_NONE;
|
||||
Zoom.brightness_min = 0;
|
||||
Zoom.brightness_max = 100;
|
||||
Zoom.brightness = 100;
|
||||
Zoom.speed_min = 1;
|
||||
Zoom.speed_max = 9;
|
||||
Zoom.speed = 4;
|
||||
|
||||
modes.push_back(Zoom);
|
||||
|
||||
mode Meteor;
|
||||
Meteor.name = "Meteor";
|
||||
Meteor.value = ACER_HID_MODE_METEOR;
|
||||
Meteor.flags = MODE_FLAG_REQUIRES_ENTIRE_DEVICE | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Meteor.color_mode = MODE_COLORS_NONE;
|
||||
Meteor.brightness_min = 0;
|
||||
Meteor.brightness_max = 100;
|
||||
Meteor.brightness = 100;
|
||||
Meteor.speed_min = 1;
|
||||
Meteor.speed_max = 9;
|
||||
Meteor.speed = 4;
|
||||
|
||||
modes.push_back(Meteor);
|
||||
|
||||
mode Twinkling;
|
||||
Twinkling.name = "Twinkling";
|
||||
Twinkling.value = ACER_HID_MODE_TWINKLING;
|
||||
Twinkling.flags = MODE_FLAG_REQUIRES_ENTIRE_DEVICE | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Twinkling.color_mode = MODE_COLORS_NONE;
|
||||
Twinkling.brightness_min = 0;
|
||||
Twinkling.brightness_max = 100;
|
||||
Twinkling.brightness = 100;
|
||||
Twinkling.colors_min = 1;
|
||||
Twinkling.colors_max = 1;
|
||||
Twinkling.speed_min = 1;
|
||||
Twinkling.speed_max = 9;
|
||||
Twinkling.speed = 4;
|
||||
|
||||
modes.push_back(Twinkling);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_AcerNitroHidKeyboard::~RGBController_AcerNitroHidKeyboard()
|
||||
{
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
void RGBController_AcerNitroHidKeyboard::SetupZones()
|
||||
{
|
||||
zone* new_zone = new zone;
|
||||
|
||||
new_zone->name = "Keyboard Backlight Zone";
|
||||
new_zone->type = ZONE_TYPE_LINEAR;
|
||||
new_zone->leds_min = 4;
|
||||
new_zone->leds_max = 4;
|
||||
new_zone->leds_count = 4;
|
||||
|
||||
zones.push_back(*new_zone);
|
||||
|
||||
for(std::size_t zone_idx = 0; zone_idx < ACER_HID_NUM_ZONES; zone_idx++)
|
||||
{
|
||||
led* new_led = new led();
|
||||
new_led->name = "Keyboard Backlight Zone ";
|
||||
new_led->name.append(std::to_string(zone_idx + 1));
|
||||
new_led->value = (unsigned int)leds.size();
|
||||
|
||||
leds.push_back(*new_led);
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_AcerNitroHidKeyboard::DeviceUpdateLEDs()
|
||||
{
|
||||
mode& current_mode = modes[active_mode];
|
||||
if(current_mode.value == ACER_HID_MODE_DIRECT)
|
||||
{
|
||||
controller->SetLEDs(colors, current_mode.brightness, device_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
RGBColor color = current_mode.colors.size()==0? (RGBColor)0 : current_mode.colors[0];
|
||||
unsigned char direction = 1;
|
||||
if((modes[active_mode].flags & MODE_FLAG_HAS_DIRECTION_LR) && modes[active_mode].direction)
|
||||
{
|
||||
direction = 2;
|
||||
}
|
||||
controller->SetAllLEDs(color, current_mode.brightness, current_mode.speed, direction, current_mode.value, device_id);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_AcerNitroHidKeyboard::DeviceUpdateZoneLEDs(int)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_AcerNitroHidKeyboard::DeviceUpdateSingleLED(int)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_AcerNitroHidKeyboard::DeviceUpdateMode()
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_AcerNitroHidKeyboard.cpp |
|
||||
| |
|
||||
| RGBController for Acer Nitro HID Keyboard |
|
||||
| |
|
||||
| Marek Pokropiński Jul 27 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "AcerNitroHidKeyboardController.h"
|
||||
|
||||
class RGBController_AcerNitroHidKeyboard : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_AcerNitroHidKeyboard(std::shared_ptr<AcerNitroHidKeyboardController> controller);
|
||||
~RGBController_AcerNitroHidKeyboard();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
std::shared_ptr<AcerNitroHidKeyboardController> controller;
|
||||
unsigned int device_id;
|
||||
};
|
||||
@@ -0,0 +1,152 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_AcerNitroHidLed.cpp |
|
||||
| |
|
||||
| RGBController for Acer Nitro HID LED |
|
||||
| |
|
||||
| Marek Pokropiński Jul 27 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_AcerNitroHidLed.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Acer Nitro HID Led
|
||||
@category Laptop
|
||||
@type HID
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :white_check_mark:
|
||||
@detectors DetectAcerHIDControllers
|
||||
@comment
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_AcerNitroHidLed::RGBController_AcerNitroHidLed(std::shared_ptr<AcerNitroHidKeyboardController> controller)
|
||||
{
|
||||
this->controller = controller;
|
||||
device_id = 0x65;
|
||||
|
||||
name = "Acer Nitro HID LED Device";
|
||||
vendor = "Acer";
|
||||
type = DEVICE_TYPE_LIGHT;
|
||||
description = "Acer Nitro HID LED Device";
|
||||
location = controller->GetLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = ACER_HID_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS ;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
Direct.brightness_min = 0;
|
||||
Direct.brightness_max = 100;
|
||||
Direct.brightness = 100;
|
||||
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Static;
|
||||
Static.name = "Static";
|
||||
Static.value = ACER_HID_MODE_STATIC;
|
||||
Static.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Static.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Static.brightness_min = 0;
|
||||
Static.brightness_max = 100;
|
||||
Static.brightness = 100;
|
||||
Static.colors_min = 1;
|
||||
Static.colors_max = 1;
|
||||
Static.colors.resize(1);
|
||||
Static.speed = 0;
|
||||
|
||||
modes.push_back(Static);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = ACER_HID_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Breathing.brightness_min = 0;
|
||||
Breathing.brightness_max = 100;
|
||||
Breathing.brightness = 100;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.speed_min = 1;
|
||||
Breathing.speed_max = 5;
|
||||
Breathing.speed = 4;
|
||||
Breathing.colors.resize(1);
|
||||
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Neon;
|
||||
Neon.name = "Neon";
|
||||
Neon.value = ACER_HID_MODE_NEON;
|
||||
Neon.flags = MODE_FLAG_REQUIRES_ENTIRE_DEVICE | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Neon.color_mode = MODE_COLORS_NONE;
|
||||
Neon.brightness_min = 0;
|
||||
Neon.brightness_max = 100;
|
||||
Neon.brightness = 100;
|
||||
Neon.speed_min = 1;
|
||||
Neon.speed_max = 5;
|
||||
Neon.speed = 4;
|
||||
|
||||
modes.push_back(Neon);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_AcerNitroHidLed::~RGBController_AcerNitroHidLed()
|
||||
{
|
||||
Shutdown();
|
||||
}
|
||||
|
||||
void RGBController_AcerNitroHidLed::SetupZones()
|
||||
{
|
||||
zone* new_zone = new zone;
|
||||
|
||||
new_zone->name = "LED";
|
||||
new_zone->type = ZONE_TYPE_LINEAR;
|
||||
new_zone->leds_min = 1;
|
||||
new_zone->leds_max = 1;
|
||||
new_zone->leds_count = 1;
|
||||
zones.push_back(*new_zone);
|
||||
|
||||
led* new_led = new led();
|
||||
new_led->name = "LED";
|
||||
new_led->value = (unsigned int)leds.size();
|
||||
leds.push_back(*new_led);
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_AcerNitroHidLed::DeviceUpdateLEDs()
|
||||
{
|
||||
mode& current_mode = modes[active_mode];
|
||||
if(current_mode.value == ACER_HID_MODE_DIRECT)
|
||||
{
|
||||
controller->SetLEDs(colors, current_mode.brightness, device_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
RGBColor color = current_mode.colors.size()==0? (RGBColor)0 : current_mode.colors[0];
|
||||
unsigned char direction = 1;
|
||||
if((modes[active_mode].flags & MODE_FLAG_HAS_DIRECTION_LR) && modes[active_mode].direction)
|
||||
{
|
||||
direction = 2;
|
||||
}
|
||||
controller->SetAllLEDs(color, current_mode.brightness, current_mode.speed, direction, current_mode.value, device_id);
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_AcerNitroHidLed::DeviceUpdateZoneLEDs(int)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_AcerNitroHidLed::DeviceUpdateSingleLED(int)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_AcerNitroHidLed::DeviceUpdateMode()
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_AcerNitroHidLed.cpp |
|
||||
| |
|
||||
| RGBController for Acer Nitro HID LED |
|
||||
| |
|
||||
| Marek Pokropiński Jul 27 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "AcerNitroHidKeyboardController.h"
|
||||
#include "RGBController_AcerNitroHidKeyboard.h"
|
||||
|
||||
class RGBController_AcerNitroHidLed : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_AcerNitroHidLed(std::shared_ptr<AcerNitroHidKeyboardController> controller);
|
||||
~RGBController_AcerNitroHidLed();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
void DeviceUpdateZoneLEDs(int zone);
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
std::shared_ptr<AcerNitroHidKeyboardController> controller;
|
||||
unsigned int device_id;
|
||||
};
|
||||
@@ -32,6 +32,7 @@ static const std::map<alienware_platform_id, uint8_t> zone_quirks_table =
|
||||
{ 0x0C01, 4 }, // Dell G5 SE 5505
|
||||
{ 0x0A01, 16 }, // Dell G7 15 7500
|
||||
{ 0x0E03, 4 }, // Dell G15 5511
|
||||
{ 0x0E07, 4 }, // Dell G15 5520
|
||||
{ 0x0E0A, 4 } // Dell G15 5530
|
||||
|
||||
};
|
||||
@@ -49,9 +50,21 @@ static const std::map<alienware_platform_id, std::vector<const char*>> zone_name
|
||||
"Light Bar 7", "Light Bar 8", "Light Bar 9",
|
||||
"Light Bar 10", "Light Bar 11", "Light Bar 12" } },
|
||||
{ 0x0E03, { "Left", "Middle", "Right", "Numpad" } },
|
||||
{ 0x0E07, { "Left", "Middle", "Right", "Numpad" } },
|
||||
{ 0x0E0A, { "Left", "Middle", "Right", "Numpad" } }
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Mapping the platform ID to the actual hardware zone IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
static const std::map<alienware_platform_id, std::vector<uint8_t>> zone_ids_table =
|
||||
{
|
||||
{ 0x0C01, { 0x00, 0x01, 0x02, 0x03 } }, // Dell G5 SE 5505
|
||||
{ 0x0E03, { 0x00, 0x01, 0x02, 0x03 } }, // Dell G15 5511
|
||||
{ 0x0E07, { 0x10, 0x11, 0x12, 0x13 } }, // Dell G15 5520
|
||||
{ 0x0E0A, { 0x10, 0x11, 0x12, 0x13 } } // Dell G15 5530
|
||||
};
|
||||
|
||||
static void SendHIDReport(hid_device *dev, const unsigned char* usb_buf, size_t usb_buf_size)
|
||||
{
|
||||
using namespace std::chrono_literals;
|
||||
@@ -138,6 +151,21 @@ AlienwareController::AlienwareController(hid_device* dev_handle, const hid_devic
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Initialize hardware zone IDs |
|
||||
\*-----------------------------------------------------*/
|
||||
if(zone_ids_table.count(platform_id))
|
||||
{
|
||||
zone_ids = zone_ids_table.at(platform_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
for(size_t i = 0; i < number_of_zones; i++)
|
||||
{
|
||||
zone_ids.push_back(static_cast<uint8_t>(i));
|
||||
}
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set defaults for all zones |
|
||||
| It doesn't seem possible to read the controller's |
|
||||
@@ -155,6 +183,7 @@ AlienwareController::AlienwareController(hid_device* dev_handle, const hid_devic
|
||||
zones[zone_idx].period = 2000;
|
||||
zones[zone_idx].tempo = ALIENWARE_TEMPO_MAX;
|
||||
zones[zone_idx].dim = 0;
|
||||
zones[zone_idx].direction = 0;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
@@ -266,42 +295,53 @@ bool AlienwareController::Dim(std::vector<uint8_t> zones, double percent)
|
||||
return(true);
|
||||
}
|
||||
|
||||
unsigned char usb_buf[HIDAPI_ALIENWARE_REPORT_SIZE];
|
||||
bool result = true;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
| Split the zone list into packet-sized chunks so it |
|
||||
| never overflows usb_buf |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up message packet with leading 00, per hidapi |
|
||||
\*-----------------------------------------------------*/
|
||||
uint16_t num_zones = (uint16_t)zones.size();
|
||||
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0x03;
|
||||
usb_buf[0x02] = ALIENWARE_COMMAND_DIM;
|
||||
usb_buf[0x03] = static_cast<uint8_t>(percent);
|
||||
usb_buf[0x04] = num_zones >> 8;
|
||||
usb_buf[0x05] = num_zones & 0xFF;
|
||||
|
||||
for(size_t i = 0; i < num_zones; i++)
|
||||
for(size_t offset = 0; offset < zones.size(); offset += ALIENWARE_MAX_ZONES_PER_PACKET)
|
||||
{
|
||||
usb_buf[0x06+i] = zones[i];
|
||||
unsigned char usb_buf[HIDAPI_ALIENWARE_REPORT_SIZE];
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Set up message packet with leading 00, per hidapi |
|
||||
\*-------------------------------------------------*/
|
||||
uint16_t num_zones = (uint16_t)std::min<size_t>(ALIENWARE_MAX_ZONES_PER_PACKET, zones.size() - offset);
|
||||
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0x03;
|
||||
usb_buf[0x02] = ALIENWARE_COMMAND_DIM;
|
||||
usb_buf[0x03] = static_cast<uint8_t>(percent);
|
||||
usb_buf[0x04] = num_zones >> 8;
|
||||
usb_buf[0x05] = num_zones & 0xFF;
|
||||
|
||||
for(size_t i = 0; i < num_zones; i++)
|
||||
{
|
||||
usb_buf[0x06+i] = zones[offset + i];
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-------------------------------------------------*/
|
||||
SendHIDReport(dev, usb_buf, sizeof(usb_buf));
|
||||
|
||||
HidapiAlienwareReport response = GetResponse();
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| For this command, error is if the output equals |
|
||||
| the input |
|
||||
\*-------------------------------------------------*/
|
||||
result &= (response.data[1] == 0x03) && memcmp(usb_buf, response.data, HIDAPI_ALIENWARE_REPORT_SIZE);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
SendHIDReport(dev, usb_buf, sizeof(usb_buf));
|
||||
|
||||
HidapiAlienwareReport response = GetResponse();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| For this command, error is if the output equals the |
|
||||
| input |
|
||||
\*-----------------------------------------------------*/
|
||||
return((response.data[1] == 0x03) && memcmp(usb_buf, response.data, HIDAPI_ALIENWARE_REPORT_SIZE));
|
||||
return(result);
|
||||
}
|
||||
|
||||
bool AlienwareController::UserAnimation(uint16_t subcommand, uint16_t animation, uint16_t duration)
|
||||
@@ -370,42 +410,53 @@ bool AlienwareController::SelectZones(const std::vector<uint8_t>& zones)
|
||||
return(false);
|
||||
}
|
||||
|
||||
unsigned char usb_buf[HIDAPI_ALIENWARE_REPORT_SIZE];
|
||||
bool result = true;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
| Split the zone list into packet-sized chunks so it |
|
||||
| never overflows usb_buf |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up message packet with leading 00, per hidapi |
|
||||
\*-----------------------------------------------------*/
|
||||
uint16_t num_zones = (uint16_t)zones.size();
|
||||
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0x03;
|
||||
usb_buf[0x02] = ALIENWARE_COMMAND_SELECT_ZONES;
|
||||
usb_buf[0x03] = 1; // loop?
|
||||
usb_buf[0x04] = num_zones >> 8;
|
||||
usb_buf[0x05] = num_zones & 0xFF;
|
||||
|
||||
for(size_t i = 0; i < num_zones; i++)
|
||||
for(size_t offset = 0; offset < zones.size(); offset += ALIENWARE_MAX_ZONES_PER_PACKET)
|
||||
{
|
||||
usb_buf[0x06+i] = zones[i];
|
||||
unsigned char usb_buf[HIDAPI_ALIENWARE_REPORT_SIZE];
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Set up message packet with leading 00, per hidapi |
|
||||
\*-------------------------------------------------*/
|
||||
uint16_t num_zones = (uint16_t)std::min<size_t>(ALIENWARE_MAX_ZONES_PER_PACKET, zones.size() - offset);
|
||||
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0x03;
|
||||
usb_buf[0x02] = ALIENWARE_COMMAND_SELECT_ZONES;
|
||||
usb_buf[0x03] = 1; // loop?
|
||||
usb_buf[0x04] = num_zones >> 8;
|
||||
usb_buf[0x05] = num_zones & 0xFF;
|
||||
|
||||
for(size_t i = 0; i < num_zones; i++)
|
||||
{
|
||||
usb_buf[0x06+i] = zones[offset + i];
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-------------------------------------------------*/
|
||||
SendHIDReport(dev, usb_buf, sizeof(usb_buf));
|
||||
|
||||
HidapiAlienwareReport response = GetResponse();
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| For this command, error is if the output equals |
|
||||
| the input |
|
||||
\*-------------------------------------------------*/
|
||||
result &= (response.data[1] == 0x03) && memcmp(usb_buf, response.data, HIDAPI_ALIENWARE_REPORT_SIZE);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
SendHIDReport(dev, usb_buf, sizeof(usb_buf));
|
||||
|
||||
HidapiAlienwareReport response = GetResponse();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| For this command, error is if the output equals the |
|
||||
| input |
|
||||
\*-----------------------------------------------------*/
|
||||
return((response.data[1] == 0x03) && memcmp(usb_buf, response.data, HIDAPI_ALIENWARE_REPORT_SIZE));
|
||||
return(result);
|
||||
}
|
||||
|
||||
bool AlienwareController::ModeAction(uint8_t mode, uint16_t duration, uint16_t tempo, RGBColor color)
|
||||
@@ -509,44 +560,55 @@ bool AlienwareController::SetColorDirect(RGBColor color, std::vector<uint8_t> zo
|
||||
return(true);
|
||||
}
|
||||
|
||||
unsigned char usb_buf[HIDAPI_ALIENWARE_REPORT_SIZE];
|
||||
bool result = true;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
| Split the zone list into packet-sized chunks so it |
|
||||
| never overflows usb_buf |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up message packet with leading 00, per hidapi |
|
||||
\*-----------------------------------------------------*/
|
||||
uint16_t num_zones = (uint16_t)zones.size();
|
||||
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0x03;
|
||||
usb_buf[0x02] = ALIENWARE_COMMAND_SET_COLOR;
|
||||
usb_buf[0x03] = RGBGetRValue(color);
|
||||
usb_buf[0x04] = RGBGetGValue(color);
|
||||
usb_buf[0x05] = RGBGetBValue(color);
|
||||
usb_buf[0x06] = num_zones >> 8;
|
||||
usb_buf[0x07] = num_zones & 0xFF;
|
||||
|
||||
for(size_t i = 0; i < num_zones; i++)
|
||||
for(size_t offset = 0; offset < zones.size(); offset += ALIENWARE_MAX_ZONES_PER_PACKET)
|
||||
{
|
||||
usb_buf[0x08 + i] = zones[i];
|
||||
unsigned char usb_buf[HIDAPI_ALIENWARE_REPORT_SIZE];
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Zero out buffer |
|
||||
\*-------------------------------------------------*/
|
||||
memset(usb_buf, 0x00, sizeof(usb_buf));
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Set up message packet with leading 00, per hidapi |
|
||||
\*-------------------------------------------------*/
|
||||
uint16_t num_zones = (uint16_t)std::min<size_t>(ALIENWARE_MAX_ZONES_PER_PACKET, zones.size() - offset);
|
||||
|
||||
usb_buf[0x00] = 0x00;
|
||||
usb_buf[0x01] = 0x03;
|
||||
usb_buf[0x02] = ALIENWARE_COMMAND_SET_COLOR;
|
||||
usb_buf[0x03] = RGBGetRValue(color);
|
||||
usb_buf[0x04] = RGBGetGValue(color);
|
||||
usb_buf[0x05] = RGBGetBValue(color);
|
||||
usb_buf[0x06] = num_zones >> 8;
|
||||
usb_buf[0x07] = num_zones & 0xFF;
|
||||
|
||||
for(size_t i = 0; i < num_zones; i++)
|
||||
{
|
||||
usb_buf[0x08 + i] = zones[offset + i];
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-------------------------------------------------*/
|
||||
SendHIDReport(dev, usb_buf, sizeof(usb_buf));
|
||||
|
||||
HidapiAlienwareReport response = GetResponse();
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| For this command, error is if the output equals |
|
||||
| the input |
|
||||
\*-------------------------------------------------*/
|
||||
result &= (response.data[1] == 0x03) && memcmp(usb_buf, response.data, HIDAPI_ALIENWARE_REPORT_SIZE);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
SendHIDReport(dev, usb_buf, sizeof(usb_buf));
|
||||
|
||||
HidapiAlienwareReport response = GetResponse();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| For this command, error is if the output equals the |
|
||||
| input |
|
||||
\*-----------------------------------------------------*/
|
||||
return((response.data[1] == 0x03) && memcmp(usb_buf, response.data, HIDAPI_ALIENWARE_REPORT_SIZE));
|
||||
return(result);
|
||||
}
|
||||
|
||||
bool AlienwareController::Reset()
|
||||
@@ -640,6 +702,15 @@ void AlienwareController::SetDim(uint8_t zone, uint8_t dim)
|
||||
}
|
||||
}
|
||||
|
||||
void AlienwareController::SetDirection(uint8_t zone, uint8_t direction)
|
||||
{
|
||||
if(zone < zones.size())
|
||||
{
|
||||
zones[zone].direction = direction;
|
||||
dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
void AlienwareController::UpdateDim()
|
||||
{
|
||||
if(!dirty_dim)
|
||||
@@ -655,7 +726,8 @@ void AlienwareController::UpdateDim()
|
||||
|
||||
for(size_t i = 0; i < zones.size(); i++)
|
||||
{
|
||||
dim_zone_map[zones[i].dim].emplace_back((uint8_t)i);
|
||||
uint8_t hw_zone = (i < zone_ids.size()) ? zone_ids[i] : static_cast<uint8_t>(i);
|
||||
dim_zone_map[zones[i].dim].emplace_back(hw_zone);
|
||||
}
|
||||
|
||||
for(std::pair<const uint8_t, std::vector<uint8_t>> &pair : dim_zone_map)
|
||||
@@ -682,7 +754,8 @@ bool AlienwareController::UpdateDirect()
|
||||
|
||||
for(size_t i = 0; i < zones.size(); i++)
|
||||
{
|
||||
color_zone_map[zones[i].color[0]].emplace_back((uint8_t)i);
|
||||
uint8_t hw_zone = (i < zone_ids.size()) ? zone_ids[i] : static_cast<uint8_t>(i);
|
||||
color_zone_map[zones[i].color[0]].emplace_back(hw_zone);
|
||||
}
|
||||
|
||||
for(std::pair<const RGBColor, std::vector<uint8_t>> &pair : color_zone_map)
|
||||
@@ -726,8 +799,9 @@ void AlienwareController::UpdateMode()
|
||||
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||
{
|
||||
alienware_zone zone = zones[zone_idx];
|
||||
uint8_t hw_zone = (zone_idx < zone_ids.size()) ? zone_ids[zone_idx] : static_cast<uint8_t>(zone_idx);
|
||||
|
||||
result = SelectZones({static_cast<uint8_t>(zone_idx)});
|
||||
result = SelectZones({hw_zone});
|
||||
|
||||
if(!result)
|
||||
{
|
||||
@@ -750,18 +824,18 @@ void AlienwareController::UpdateMode()
|
||||
|
||||
case ALIENWARE_MODE_MORPH:
|
||||
{
|
||||
uint8_t zones[2] = { zone.mode, zone.mode };
|
||||
uint8_t modes[2] = { zone.mode, zone.mode };
|
||||
uint16_t periods[2] = { zone.period, zone.period };
|
||||
uint16_t tempos[2] = { zone.tempo, zone.tempo };
|
||||
RGBColor colors[2] = { zone.color[0], zone.color[1] };
|
||||
|
||||
result = MultiModeAction(zones, periods, tempos, colors, 2);
|
||||
result = MultiModeAction(modes, periods, tempos, colors, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_SPECTRUM:
|
||||
{
|
||||
uint8_t zones[7] = { ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
uint8_t modes[7] = { ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH };
|
||||
@@ -774,13 +848,13 @@ void AlienwareController::UpdateMode()
|
||||
zone.tempo, zone.tempo,
|
||||
zone.tempo };
|
||||
|
||||
result = MultiModeAction(zones, periods, tempos, rainbow_colors[0], 7);
|
||||
result = MultiModeAction(modes, periods, tempos, rainbow_colors[0], 7);
|
||||
}
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_RAINBOW:
|
||||
{
|
||||
uint8_t zones[7] = { ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
uint8_t modes[7] = { ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH };
|
||||
@@ -793,18 +867,19 @@ void AlienwareController::UpdateMode()
|
||||
zone.tempo, zone.tempo,
|
||||
zone.tempo };
|
||||
|
||||
result = MultiModeAction(zones, periods, tempos, rainbow_colors[zone_idx], 7);
|
||||
unsigned int color_idx = (zone.direction == MODE_DIRECTION_LEFT) ? (4 - 1 - (zone_idx % 4)) : (zone_idx % 4);
|
||||
result = MultiModeAction(modes, periods, tempos, rainbow_colors[color_idx], 7);
|
||||
}
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_BREATHING:
|
||||
{
|
||||
uint8_t zones[2] = { ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH };
|
||||
uint8_t modes[2] = { ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH };
|
||||
uint16_t periods[2] = { zone.period, zone.period };
|
||||
uint16_t tempos[2] = { zone.tempo, zone.tempo };
|
||||
RGBColor colors[2] = { zone.color[0], 0x0 };
|
||||
|
||||
result = MultiModeAction(zones, periods, tempos, colors, 2);
|
||||
result = MultiModeAction(modes, periods, tempos, colors, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -831,6 +906,117 @@ void AlienwareController::UpdateMode()
|
||||
dirty = false;
|
||||
}
|
||||
|
||||
void AlienwareController::SaveController()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Save current mode configuration to EEPROM slot 0x0061 |
|
||||
\*-----------------------------------------------------*/
|
||||
UserAnimation(ALIENWARE_COMMAND_USER_ANIM_REMOVE, ALIENWARE_ANIM_DEFAULT, 0);
|
||||
bool result = UserAnimation(ALIENWARE_COMMAND_USER_ANIM_NEW, ALIENWARE_ANIM_DEFAULT, 0);
|
||||
|
||||
if(!result)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for(std::size_t zone_idx = 0; zone_idx < zones.size(); zone_idx++)
|
||||
{
|
||||
alienware_zone zone = zones[zone_idx];
|
||||
uint8_t hw_zone = (zone_idx < zone_ids.size()) ? zone_ids[zone_idx] : static_cast<uint8_t>(zone_idx);
|
||||
|
||||
result = SelectZones({hw_zone});
|
||||
|
||||
if(!result)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (zone.mode)
|
||||
{
|
||||
case ALIENWARE_MODE_COLOR:
|
||||
result = ModeAction(zone.mode, 2000, ALIENWARE_TEMPO_MAX, zone.color[0]);
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_PULSE:
|
||||
result = ModeAction(zone.mode, zone.period, zone.tempo, zone.color[0]);
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_MORPH:
|
||||
{
|
||||
uint8_t modes[2] = { zone.mode, zone.mode };
|
||||
uint16_t periods[2] = { zone.period, zone.period };
|
||||
uint16_t tempos[2] = { zone.tempo, zone.tempo };
|
||||
RGBColor colors[2] = { zone.color[0], zone.color[1] };
|
||||
|
||||
result = MultiModeAction(modes, periods, tempos, colors, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_SPECTRUM:
|
||||
{
|
||||
uint8_t modes[7] = { ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH };
|
||||
uint16_t periods[7] = { zone.period, zone.period,
|
||||
zone.period, zone.period,
|
||||
zone.period, zone.period,
|
||||
zone.period };
|
||||
uint16_t tempos[7] = { zone.tempo, zone.tempo,
|
||||
zone.tempo, zone.tempo,
|
||||
zone.tempo, zone.tempo,
|
||||
zone.tempo };
|
||||
|
||||
result = MultiModeAction(modes, periods, tempos, rainbow_colors[0], 7);
|
||||
}
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_RAINBOW:
|
||||
{
|
||||
uint8_t modes[7] = { ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH,
|
||||
ALIENWARE_MODE_MORPH };
|
||||
uint16_t periods[7] = { zone.period, zone.period,
|
||||
zone.period, zone.period,
|
||||
zone.period, zone.period,
|
||||
zone.period };
|
||||
uint16_t tempos[7] = { zone.tempo, zone.tempo,
|
||||
zone.tempo, zone.tempo,
|
||||
zone.tempo, zone.tempo,
|
||||
zone.tempo };
|
||||
|
||||
unsigned int color_idx = (zone.direction == MODE_DIRECTION_LEFT) ? (4 - 1 - (zone_idx % 4)) : (zone_idx % 4);
|
||||
result = MultiModeAction(modes, periods, tempos, rainbow_colors[color_idx], 7);
|
||||
}
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_BREATHING:
|
||||
{
|
||||
uint8_t modes[2] = { ALIENWARE_MODE_MORPH, ALIENWARE_MODE_MORPH };
|
||||
uint16_t periods[2] = { zone.period, zone.period };
|
||||
uint16_t tempos[2] = { zone.tempo, zone.tempo };
|
||||
RGBColor colors[2] = { zone.color[0], 0x0 };
|
||||
|
||||
result = MultiModeAction(modes, periods, tempos, colors, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
result = false;
|
||||
}
|
||||
|
||||
if(!result)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
UserAnimation(ALIENWARE_COMMAND_USER_ANIM_FINISH_SAVE, ALIENWARE_ANIM_DEFAULT, 0);
|
||||
UserAnimation(ALIENWARE_COMMAND_USER_ANIM_DEFAULT, ALIENWARE_ANIM_DEFAULT, 0);
|
||||
UserAnimation(ALIENWARE_COMMAND_USER_ANIM_STARTUP, ALIENWARE_ANIM_DEFAULT, 0);
|
||||
}
|
||||
|
||||
void AlienwareController::UpdateController()
|
||||
{
|
||||
UpdateMode();
|
||||
|
||||
@@ -22,6 +22,14 @@
|
||||
#define ALIENWARE_REPORT_SIZE 33
|
||||
#define HIDAPI_ALIENWARE_REPORT_SIZE (ALIENWARE_REPORT_SIZE + 1)
|
||||
#define ALIENWARE_CONTROLLER_NAME "AlienWare Controller"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Max zone IDs that fit in one report after the command |
|
||||
| header. Selections larger than this must be split across |
|
||||
| multiple packets; writing them into a single report |
|
||||
| overflows usb_buf (e.g. desktops with ~100 zones). |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_MAX_ZONES_PER_PACKET 25
|
||||
enum
|
||||
{
|
||||
ALIENWARE_COMMAND_REPORT = 0x20, /* Set report type to get */
|
||||
@@ -115,11 +123,13 @@ public:
|
||||
void SetPeriod(uint8_t zone, uint16_t period);
|
||||
void SetTempo(uint8_t zone, uint16_t tempo);
|
||||
void SetDim(uint8_t zone, uint8_t dim);
|
||||
void SetDirection(uint8_t zone, uint8_t direction);
|
||||
AlienwareReport GetStatus(uint8_t subcommand);
|
||||
|
||||
void UpdateDim();
|
||||
void UpdateMode();
|
||||
void UpdateController();
|
||||
void SaveController();
|
||||
|
||||
protected:
|
||||
hid_device* dev;
|
||||
@@ -132,6 +142,7 @@ private:
|
||||
uint16_t period;
|
||||
uint16_t tempo;
|
||||
uint8_t dim;
|
||||
uint8_t direction;
|
||||
} alienware_zone;
|
||||
|
||||
typedef struct
|
||||
@@ -145,6 +156,7 @@ private:
|
||||
std::string serial_number;
|
||||
std::string version;
|
||||
std::vector<const char*> zone_names;
|
||||
std::vector<uint8_t> zone_ids;
|
||||
bool dirty;
|
||||
bool dirty_dim;
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ RGBController_Alienware::RGBController_Alienware(AlienwareController* controller
|
||||
mode Color;
|
||||
Color.name = "Static";
|
||||
Color.value = ALIENWARE_MODE_COLOR;
|
||||
Color.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Color.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_MANUAL_SAVE;
|
||||
Color.color_mode = MODE_COLORS_PER_LED;
|
||||
Color.colors_min = 1;
|
||||
Color.colors_max = 1;
|
||||
@@ -51,13 +51,13 @@ RGBController_Alienware::RGBController_Alienware(AlienwareController* controller
|
||||
mode Pulse;
|
||||
Pulse.name = "Flashing";
|
||||
Pulse.value = ALIENWARE_MODE_PULSE;
|
||||
Pulse.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Pulse.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE;
|
||||
Pulse.color_mode = MODE_COLORS_PER_LED;
|
||||
Pulse.colors_min = 1;
|
||||
Pulse.colors_max = 1;
|
||||
Pulse.speed_min = ALIENWARE_TEMPO_MIN;
|
||||
Pulse.speed_max = ALIENWARE_TEMPO_MAX;
|
||||
Pulse.speed = ALIENWARE_TEMPO_MIN;
|
||||
Pulse.speed_min = ALIENWARE_TEMPO_MAX;
|
||||
Pulse.speed_max = 50;
|
||||
Pulse.speed = 150;
|
||||
Pulse.brightness_min = 100;
|
||||
Pulse.brightness_max = 0;
|
||||
Pulse.brightness = 0;
|
||||
@@ -66,14 +66,16 @@ RGBController_Alienware::RGBController_Alienware(AlienwareController* controller
|
||||
mode Morph;
|
||||
Morph.name = "Morph";
|
||||
Morph.value = ALIENWARE_MODE_MORPH;
|
||||
Morph.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Morph.flags = MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE;
|
||||
Morph.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Morph.colors_min = 2 * controller->GetZoneCount();
|
||||
Morph.colors_max = Morph.colors_min;
|
||||
Morph.colors.resize(Morph.colors_max);
|
||||
Morph.speed_min = ALIENWARE_TEMPO_MIN;
|
||||
Morph.speed_max = ALIENWARE_TEMPO_MAX;
|
||||
Morph.speed = ALIENWARE_TEMPO_MIN;
|
||||
Morph.colors_min = 2;
|
||||
Morph.colors_max = 2 * controller->GetZoneCount();
|
||||
Morph.colors.resize(2);
|
||||
Morph.colors[0] = 0x0000FF;
|
||||
Morph.colors[1] = 0xFF0000;
|
||||
Morph.speed_min = ALIENWARE_TEMPO_MAX;
|
||||
Morph.speed_max = 20;
|
||||
Morph.speed = 100;
|
||||
Morph.brightness_min = 100;
|
||||
Morph.brightness_max = 0;
|
||||
Morph.brightness = 0;
|
||||
@@ -82,11 +84,11 @@ RGBController_Alienware::RGBController_Alienware(AlienwareController* controller
|
||||
mode Spectrum;
|
||||
Spectrum.name = "Spectrum Cycle";
|
||||
Spectrum.value = ALIENWARE_MODE_SPECTRUM;
|
||||
Spectrum.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Spectrum.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE;
|
||||
Spectrum.color_mode = MODE_COLORS_NONE;
|
||||
Spectrum.speed_min = ALIENWARE_TEMPO_SPECTRUM;
|
||||
Spectrum.speed_max = ALIENWARE_TEMPO_MAX;
|
||||
Spectrum.speed = ALIENWARE_TEMPO_SPECTRUM;
|
||||
Spectrum.speed_min = ALIENWARE_TEMPO_MAX;
|
||||
Spectrum.speed_max = ALIENWARE_TEMPO_SPECTRUM;
|
||||
Spectrum.speed = 40;
|
||||
Spectrum.brightness_min = 100;
|
||||
Spectrum.brightness_max = 0;
|
||||
Spectrum.brightness = 0;
|
||||
@@ -95,11 +97,12 @@ RGBController_Alienware::RGBController_Alienware(AlienwareController* controller
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow Wave";
|
||||
Rainbow.value = ALIENWARE_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Rainbow.flags = MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_MANUAL_SAVE;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
Rainbow.speed_min = ALIENWARE_TEMPO_SPECTRUM;
|
||||
Rainbow.speed_max = ALIENWARE_TEMPO_MAX;
|
||||
Rainbow.speed = ALIENWARE_TEMPO_SPECTRUM;
|
||||
Rainbow.speed_min = ALIENWARE_TEMPO_MAX;
|
||||
Rainbow.speed_max = ALIENWARE_TEMPO_SPECTRUM;
|
||||
Rainbow.speed = 40;
|
||||
Rainbow.direction = MODE_DIRECTION_RIGHT;
|
||||
Rainbow.brightness_min = 100;
|
||||
Rainbow.brightness_max = 0;
|
||||
Rainbow.brightness = 0;
|
||||
@@ -108,13 +111,13 @@ RGBController_Alienware::RGBController_Alienware(AlienwareController* controller
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = ALIENWARE_MODE_BREATHING;
|
||||
Breathing.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED;
|
||||
Breathing.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_SPEED | MODE_FLAG_MANUAL_SAVE;
|
||||
Breathing.color_mode = MODE_COLORS_PER_LED;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.speed_min = ALIENWARE_TEMPO_MIN;
|
||||
Breathing.speed_max = ALIENWARE_TEMPO_MAX;
|
||||
Breathing.speed = ALIENWARE_TEMPO_MIN;
|
||||
Breathing.speed_min = ALIENWARE_TEMPO_MAX;
|
||||
Breathing.speed_max = 50;
|
||||
Breathing.speed = 150;
|
||||
Breathing.brightness_min = 100;
|
||||
Breathing.brightness_max = 0;
|
||||
Breathing.brightness = 0;
|
||||
@@ -224,6 +227,7 @@ void RGBController_Alienware::DeviceUpdateMode()
|
||||
uint16_t period = 0x07d0;
|
||||
|
||||
controller->SetMode(zone_idx, current_mode.value);
|
||||
controller->SetDirection(zone_idx, current_mode.direction);
|
||||
|
||||
switch(current_mode_idx)
|
||||
{
|
||||
@@ -235,6 +239,7 @@ void RGBController_Alienware::DeviceUpdateMode()
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_PULSE:
|
||||
period = std::max<uint16_t>(500, (uint16_t)(current_mode.speed * 10));
|
||||
controller->SetPeriod(zone_idx, period);
|
||||
controller->SetColor( zone_idx, colors[current_zone.start_idx]);
|
||||
controller->SetTempo( zone_idx, current_mode.speed);
|
||||
@@ -242,10 +247,22 @@ void RGBController_Alienware::DeviceUpdateMode()
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_MORPH:
|
||||
controller->SetPeriod(zone_idx, period);
|
||||
controller->SetColor( zone_idx, current_mode.colors[zone_idx * 2], current_mode.colors[(zone_idx * 2) + 1]);
|
||||
controller->SetTempo( zone_idx, current_mode.speed);
|
||||
controller->SetDim( zone_idx, modes[current_mode_idx].brightness);
|
||||
{
|
||||
RGBColor c1 = (current_mode.colors.size() >= 1) ? current_mode.colors[0] : 0x0000FF;
|
||||
RGBColor c2 = (current_mode.colors.size() >= 2) ? current_mode.colors[1] : 0xFF0000;
|
||||
|
||||
if(current_mode.colors.size() >= (std::size_t)((zone_idx + 1) * 2))
|
||||
{
|
||||
c1 = current_mode.colors[zone_idx * 2];
|
||||
c2 = current_mode.colors[(zone_idx * 2) + 1];
|
||||
}
|
||||
|
||||
period = std::max<uint16_t>(400, (uint16_t)(current_mode.speed * 10));
|
||||
controller->SetPeriod(zone_idx, period);
|
||||
controller->SetColor( zone_idx, c1, c2);
|
||||
controller->SetTempo( zone_idx, current_mode.speed);
|
||||
controller->SetDim( zone_idx, modes[current_mode_idx].brightness);
|
||||
}
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_SPECTRUM:
|
||||
@@ -256,6 +273,7 @@ void RGBController_Alienware::DeviceUpdateMode()
|
||||
break;
|
||||
|
||||
case ALIENWARE_MODE_BREATHING:
|
||||
period = std::max<uint16_t>(500, (uint16_t)(current_mode.speed * 10));
|
||||
controller->SetPeriod(zone_idx, period);
|
||||
controller->SetColor( zone_idx, colors[current_zone.start_idx], 0x0);
|
||||
controller->SetTempo( zone_idx, current_mode.speed);
|
||||
@@ -282,3 +300,9 @@ void RGBController_Alienware::DeviceUpdateMode()
|
||||
current_mode = new_current_mode;
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_Alienware::DeviceSaveMode()
|
||||
{
|
||||
controller->SaveController();
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,7 @@ public:
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
void DeviceSaveMode();
|
||||
|
||||
private:
|
||||
AlienwareController* controller;
|
||||
|
||||
+4
-26
@@ -1,7 +1,7 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| AlienwareKeyboardControllerDetect.cpp |
|
||||
| AlienwareAW410KControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Alienware Keyboard |
|
||||
| Detector for Alienware AW410K Keyboard |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
@@ -10,38 +10,17 @@
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "AlienwareAW410KController.h"
|
||||
#include "AlienwareAW510KController.h"
|
||||
#include "RGBController_AlienwareAW410K.h"
|
||||
#include "RGBController_AlienwareAW510K.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Alienware vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_VID 0x04F2
|
||||
#define ALIENWARE_VID 0x04F2
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_AW510K_PID 0x1830
|
||||
#define ALIENWARE_AW410K_PID 0x1968
|
||||
|
||||
DetectedControllers DetectAlienwareAW510KControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AlienwareAW510KController* controller = new AlienwareAW510KController(dev, info->path, name);
|
||||
RGBController_AlienwareAW510K* rgb_controller = new RGBController_AlienwareAW510K(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
#define ALIENWARE_AW410K_PID 0x1968
|
||||
|
||||
DetectedControllers DetectAlienwareAW410KControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
@@ -61,5 +40,4 @@ DetectedControllers DetectAlienwareAW410KControllers(hid_device_info* info, cons
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Alienware AW510K", DetectAlienwareAW510KControllers, ALIENWARE_VID, ALIENWARE_AW510K_PID, 0x02, 0xFF00, 0x01);
|
||||
REGISTER_HID_DETECTOR_IPU("Alienware AW410K", DetectAlienwareAW410KControllers, ALIENWARE_VID, ALIENWARE_AW410K_PID, 0x02, 0xFF00, 0x01);
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| AlienwareAW510KControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Alienware AW510K Keyboard |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "DetectionManager.h"
|
||||
#include "AlienwareAW510KController.h"
|
||||
#include "RGBController_AlienwareAW510K.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Alienware vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_VID 0x04F2
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Keyboard product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_AW510K_PID 0x1830
|
||||
|
||||
DetectedControllers DetectAlienwareAW510KControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AlienwareAW510KController* controller = new AlienwareAW510KController(dev, info->path, name);
|
||||
RGBController_AlienwareAW510K* rgb_controller = new RGBController_AlienwareAW510K(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Alienware AW510K", DetectAlienwareAW510KControllers, ALIENWARE_VID, ALIENWARE_AW510K_PID, 0x02, 0xFF00, 0x01);
|
||||
+5
-5
@@ -40,11 +40,11 @@ std::vector<unsigned char> AlienwareAW3423DWFController::GetReportResponse()
|
||||
|
||||
void AlienwareAW3423DWFController::PerformLogin()
|
||||
{
|
||||
unsigned char init_packet[64] =
|
||||
{
|
||||
0x40, 0xE1, 0x01
|
||||
};
|
||||
SendControlPacket(init_packet, 4);
|
||||
unsigned char init_packet[192] = {0x00};
|
||||
init_packet[0] = 0x40;
|
||||
init_packet[1] = 0xE1;
|
||||
init_packet[2] = 0x01;
|
||||
SendControlPacket(init_packet, 192);
|
||||
|
||||
std::vector<unsigned char> response = GetReportResponse();
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| AlienwareAW3423DWFControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Alienware AW3423DWF monitor |
|
||||
| |
|
||||
| Ferréol DUBOIS COLI (Fefe_du_973) 23 Jan 2025 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "AlienwareAW3423DWFController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_AlienwareAW3423DWF.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Alienware Vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_VID 0x187C
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Alienware Vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_AW3423DWF_PID 0x100E
|
||||
#define ALIENWARE_USAGE_PAGE 0xFFDA
|
||||
#define ALIENWARE_USAGE 0x00DA
|
||||
|
||||
DetectedControllers DetectAlienwareAW3423DWFControllers(hid_device_info* info, const std::string&)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AlienwareAW3423DWFController* controller = new AlienwareAW3423DWFController(dev, info->path);
|
||||
RGBController_AlienwareAW3423DWF* rgb_controller = new RGBController_AlienwareAW3423DWF(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR("Alienware AW3423DWF", DetectAlienwareAW3423DWFControllers, ALIENWARE_VID, ALIENWARE_AW3423DWF_PID);
|
||||
-22
@@ -10,10 +10,8 @@
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "AlienwareAW3423DWFController.h"
|
||||
#include "AlienwareMonitorController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_AlienwareAW3423DWF.h"
|
||||
#include "RGBController_AlienwareMonitor.h"
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
@@ -24,29 +22,10 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| Alienware Vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ALIENWARE_AW3423DWF_PID 0x100E
|
||||
#define ALIENWARE_AW3225QF_PID 0x1013
|
||||
#define ALIENWARE_USAGE_PAGE 0xFFDA
|
||||
#define ALIENWARE_USAGE 0x00DA
|
||||
|
||||
DetectedControllers DetectAlienwareAW3423DWFControllers(hid_device_info* info, const std::string&)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AlienwareAW3423DWFController* controller = new AlienwareAW3423DWFController(dev, info->path);
|
||||
RGBController_AlienwareAW3423DWF* rgb_controller = new RGBController_AlienwareAW3423DWF(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectAlienwareMonitorControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
@@ -65,5 +44,4 @@ DetectedControllers DetectAlienwareMonitorControllers(hid_device_info* info, con
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR("Alienware AW3423DWF", DetectAlienwareAW3423DWFControllers, ALIENWARE_VID, ALIENWARE_AW3423DWF_PID);
|
||||
REGISTER_HID_DETECTOR("Alienware AW3225QF", DetectAlienwareMonitorControllers, ALIENWARE_VID, ALIENWARE_AW3225QF_PID);
|
||||
@@ -21,13 +21,13 @@
|
||||
DetectedControllers DetectArcticControllers()
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
std::vector<std::string *> ports;
|
||||
std::vector<std::string> ports;
|
||||
|
||||
ports = find_usb_serial_port(CH341_VID, CH341_PID);
|
||||
|
||||
for(unsigned int device = 0; device < ports.size(); device++)
|
||||
{
|
||||
ArcticController *controller = new ArcticController(*ports[device]);
|
||||
ArcticController *controller = new ArcticController(ports[device]);
|
||||
|
||||
if(controller->IsPresent())
|
||||
{
|
||||
@@ -38,16 +38,10 @@ DetectedControllers DetectArcticControllers()
|
||||
{
|
||||
delete controller;
|
||||
}
|
||||
|
||||
delete ports[device];
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("Arctic RGB controller", DetectArcticControllers);
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Entries for dynamic UDEV rules |
|
||||
| |
|
||||
| DUMMY_DEVICE_DETECTOR("Arctic RGB controller", DetectArcticControllers, 0x1A86, 0x7523 ) |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
REGISTER_CUSTOM_UDEV_RULE(arctic, "Arctic RGB controller", "SUBSYSTEMS==\"serial|hidraw\", ATTRS{idVendor}==\"1a86\", ATTRS{idProduct}==\"7523\", TAG+=\"uaccess\", TAG+=\"Arctic_RGB_controller\"");
|
||||
|
||||
+3
-27
@@ -4,18 +4,15 @@
|
||||
| Detector for ASUS ROG Aura Core |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 13 Apr 2020 |
|
||||
| Chris M (Dr_No) 28 Jul 2022 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "DetectionManager.h"
|
||||
#include "AsusAuraCoreController.h"
|
||||
#include "RGBController.h"
|
||||
#include "RGBController_AsusAuraCore.h"
|
||||
#include "RGBController_AsusAuraCoreLaptop.h"
|
||||
#include <hidapi.h>
|
||||
#include "AsusAuraCoreController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_AsusAuraCore.h"
|
||||
|
||||
#define AURA_CORE_VID 0x0B05
|
||||
|
||||
@@ -44,27 +41,6 @@ DetectedControllers DetectAsusAuraCoreControllers(hid_device_info* info, const s
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
DetectedControllers DetectAsusAuraCoreLaptopControllers(hid_device_info* info, const std::string& /*name*/)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AsusAuraCoreLaptopController* controller = new AsusAuraCoreLaptopController(dev, info->path);
|
||||
RGBController_AsusAuraCoreLaptop* rgb_controller = new RGBController_AsusAuraCoreLaptop(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
|
||||
REGISTER_HID_DETECTOR ("ASUS Aura Core", DetectAsusAuraCoreControllers, AURA_CORE_VID, 0x1854);
|
||||
REGISTER_HID_DETECTOR ("ASUS Aura Core", DetectAsusAuraCoreControllers, AURA_CORE_VID, 0x1866);
|
||||
REGISTER_HID_DETECTOR ("ASUS Aura Core", DetectAsusAuraCoreControllers, AURA_CORE_VID, 0x1869);
|
||||
REGISTER_HID_DETECTOR_PU("ASUS ROG Strix SCAR 15", DetectAsusAuraCoreLaptopControllers, AURA_CORE_VID, AURA_STRIX_SCAR_15_PID, 0xFF31, 0x79);
|
||||
REGISTER_HID_DETECTOR_PU("ASUS ROG Strix SCAR 17", DetectAsusAuraCoreLaptopControllers, AURA_CORE_VID, 0x1866, 0xFF31, 0x79);
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| AsusAuraCoreLaptopControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for ASUS ROG Aura Core Laptop |
|
||||
| |
|
||||
| Chris M (Dr_No) 28 Jul 2022 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <hidapi.h>
|
||||
#include "AsusAuraCoreLaptopController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "RGBController_AsusAuraCoreLaptop.h"
|
||||
|
||||
#define AURA_CORE_VID 0x0B05
|
||||
|
||||
DetectedControllers DetectAsusAuraCoreLaptopControllers(hid_device_info* info, const std::string& /*name*/)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
|
||||
dev = hid_open_path(info->path);
|
||||
|
||||
if(dev)
|
||||
{
|
||||
AsusAuraCoreLaptopController* controller = new AsusAuraCoreLaptopController(dev, info->path);
|
||||
RGBController_AsusAuraCoreLaptop* rgb_controller = new RGBController_AsusAuraCoreLaptop(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_PU("ASUS ROG Strix SCAR 15", DetectAsusAuraCoreLaptopControllers, AURA_CORE_VID, AURA_STRIX_SCAR_15_PID, 0xFF31, 0x79);
|
||||
REGISTER_HID_DETECTOR_PU("ASUS ROG Strix SCAR 17", DetectAsusAuraCoreLaptopControllers, AURA_CORE_VID, 0x1866, 0xFF31, 0x79);
|
||||
+20
@@ -940,6 +940,25 @@ static const aura_core_laptop_device g814jv_device =
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------*\
|
||||
| ASUS ROG Strix G18 (G814JIR) |
|
||||
| |
|
||||
| G814JIR uses the same Aura Core keyboard and lightbar |
|
||||
| layout as the G814JV G18 profile. |
|
||||
\*-------------------------------------------------------------*/
|
||||
static const aura_core_laptop_device g814jir_device =
|
||||
{
|
||||
"G814JIR",
|
||||
{
|
||||
&g814rw_keyboard_zone,
|
||||
&g814jv_lightbar_zone,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr,
|
||||
nullptr
|
||||
}
|
||||
};
|
||||
|
||||
/*-------------------------------------------------------------------------*\
|
||||
| DEVICE MASTER LIST |
|
||||
\*-------------------------------------------------------------------------*/
|
||||
@@ -954,6 +973,7 @@ const aura_core_laptop_device* aura_core_laptop_device_list_data[] =
|
||||
&g713rw_device,
|
||||
&g733qr_device,
|
||||
&g814jv_device,
|
||||
&g814jir_device,
|
||||
};
|
||||
|
||||
const unsigned int AURA_CORE_LAPTOP_DEVICE_COUNT = (sizeof(aura_core_laptop_device_list_data) / sizeof(aura_core_laptop_device_list_data[ 0 ]));
|
||||
|
||||
@@ -32,7 +32,7 @@ std::string AuraGPUController::GetDeviceName()
|
||||
|
||||
std::string AuraGPUController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->device_name);
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
@@ -79,7 +79,7 @@ void AuraGPUController::AuraGPURegisterWrite(unsigned char reg, unsigned char va
|
||||
|
||||
bool AuraGPUController::SaveOnlyApplies()
|
||||
{
|
||||
switch (bus->pci_subsystem_device)
|
||||
switch (bus->info.pci_subsystem_device)
|
||||
{
|
||||
case ASUS_VEGA64_STRIX:
|
||||
return false;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
bool TestForAsusAuraGPUController(i2c_smbus_interface* bus, unsigned char address)
|
||||
{
|
||||
if(bus->pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
|
||||
if(bus->info.pci_vendor == AMD_GPU_VEN && !is_amd_gpu_i2c_bus(bus))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#define AURA_ROG_GLADIUS_II_WIRELESS_1_PID 0x189E
|
||||
#define AURA_ROG_GLADIUS_II_WIRELESS_2_PID 0x18A0
|
||||
#define AURA_ROG_GLADIUS_III_PID 0x197B
|
||||
#define AURA_ROG_GLADIUS_III_CORE_PID 0x1C8D
|
||||
#define AURA_ROG_GLADIUS_III_WIRELESS_USB_PID 0x197D
|
||||
#define AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID 0x197F
|
||||
#define AURA_ROG_GLADIUS_III_WIRELESS_BT_PID 0x1981
|
||||
@@ -217,6 +218,20 @@ static std::map<int,mouse_type> aura_mouse_devices =
|
||||
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_WAVE, AURA_MOUSE_MODE_REACTIVE, AURA_MOUSE_MODE_COMET, AURA_MOUSE_MODE_BATTERY }
|
||||
}
|
||||
},
|
||||
{
|
||||
AURA_ROG_GLADIUS_III_CORE_PID, // ROG Gladius III Core
|
||||
{
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
100,
|
||||
false,
|
||||
1,
|
||||
false,
|
||||
{ AURA_MOUSE_ZONE_LOGO, AURA_MOUSE_ZONE_SCROLL },
|
||||
{ AURA_MOUSE_MODE_STATIC, AURA_MOUSE_MODE_BREATHING, AURA_MOUSE_MODE_SPECTRUM, AURA_MOUSE_MODE_NONE, AURA_MOUSE_MODE_REACTIVE }
|
||||
}
|
||||
},
|
||||
{
|
||||
AURA_ROG_GLADIUS_III_WIRELESS_USB_PID, // ROG Gladius III Wireless USB
|
||||
{
|
||||
|
||||
+4
-1
@@ -19,7 +19,10 @@ AsusAuraRyuoAIOController::AsusAuraRyuoAIOController(hid_device* dev_handle, con
|
||||
| Manually adding device info for now |
|
||||
| TODO: Implement config table accurately |
|
||||
\*-----------------------------------------------------*/
|
||||
device_info.push_back({0x00, 0x00, 12, 0, AuraDeviceType::FIXED});
|
||||
uint8_t leds = (dev_name.find("Ryujin") != std::string::npos) ? 5 : 12;
|
||||
|
||||
device_info.push_back({0x00, 0x00, leds, 0, AuraDeviceType::FIXED});
|
||||
|
||||
}
|
||||
|
||||
AsusAuraRyuoAIOController::~AsusAuraRyuoAIOController()
|
||||
|
||||
+1
-1
@@ -428,7 +428,6 @@ void RGBController_AuraTUFKeyboard::SetupZones()
|
||||
break;
|
||||
case AURA_TUF_K3_GAMING_PID:
|
||||
case AURA_TUF_K7_GAMING_PID:
|
||||
case AURA_TUF_K3_GENII_MIKU_EDITION_PID:
|
||||
keyboard_ptr = &AsusTUFK7Layouts;
|
||||
break;
|
||||
case AURA_ROG_STRIX_SCOPE_PID:
|
||||
@@ -485,6 +484,7 @@ void RGBController_AuraTUFKeyboard::SetupZones()
|
||||
keyboard_ptr = &AsusTufK1Layouts;
|
||||
break;
|
||||
case AURA_TUF_K3_GAMING_GEN_II_PID:
|
||||
case AURA_TUF_K3_GENII_MIKU_EDITION_PID:
|
||||
keyboard_ptr = &AsusTUFK3GamingGen2Layouts;
|
||||
break;
|
||||
default:
|
||||
|
||||
+3
-2
@@ -170,7 +170,8 @@ void RGBController_AuraUSB::SetupZones()
|
||||
zones[channel_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
}
|
||||
|
||||
if(!(zones[channel_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
@@ -220,7 +221,7 @@ void RGBController_AuraUSB::SetupZones()
|
||||
|
||||
new_led.name.append(std::to_string(led_idx));
|
||||
|
||||
new_led.value = channel_idx;
|
||||
new_led.value = (unsigned int)channel_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
#define AURA_TERMINAL_PID 0x1889
|
||||
#define ROG_STRIX_LC120_PID 0x879E
|
||||
#define AURA_RYUO_AIO_PID 0x1887
|
||||
#define AURA_RYUJIN_AIO_PID 0x18AE
|
||||
#define ASUS_ROG_ALLY_PID 0x1ABE
|
||||
#define ASUS_ROG_ALLY_X_PID 0x1B4C
|
||||
|
||||
@@ -416,7 +417,7 @@ REGISTER_HID_DETECTOR ("ASUS Aura Addressable", DetectAs
|
||||
REGISTER_HID_DETECTOR ("ASUS Aura Addressable", DetectAsusAuraUSBAddressable, AURA_USB_VID, AURA_ADDRESSABLE_4_PID);
|
||||
REGISTER_HID_DETECTOR ("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_1_PID);
|
||||
REGISTER_HID_DETECTOR ("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_2_PID);
|
||||
REGISTER_HID_DETECTOR ("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_3_PID);
|
||||
REGISTER_HID_DETECTOR_PU("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_3_PID, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR ("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_4_PID);
|
||||
REGISTER_HID_DETECTOR ("ASUS Aura Motherboard", DetectAsusAuraUSBMotherboards, AURA_USB_VID, AURA_MOTHERBOARD_5_PID);
|
||||
|
||||
@@ -463,6 +464,7 @@ REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Origin COD",
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_1_PID, 1, 0xFF13);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius II Wireless", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_II_WIRELESS_2_PID, 2, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Core", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_CORE_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless USB", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_USB_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless 2.4Ghz", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_2_4_PID, 0, 0xFF01);
|
||||
REGISTER_HID_DETECTOR_IP("ASUS ROG Gladius III Wireless Bluetooth", DetectAsusAuraUSBMice, AURA_USB_VID, AURA_ROG_GLADIUS_III_WIRELESS_BT_PID, 0, 0xFF01);
|
||||
@@ -523,6 +525,7 @@ REGISTER_HID_DETECTOR_PU("ASUS ROG PG32UQ", DetectAs
|
||||
REGISTER_HID_DETECTOR ("ASUS ROG AURA Terminal", DetectAsusAuraUSBTerminal, AURA_USB_VID, AURA_TERMINAL_PID);
|
||||
REGISTER_HID_DETECTOR_PU ("ASUS ROG Strix LC", DetectAsusAuraUSBROGStrixLC, AURA_USB_VID, ROG_STRIX_LC120_PID, 0x00FF, 1);
|
||||
REGISTER_HID_DETECTOR_PU ("ASUS ROG Ryuo AIO", DetectAsusAuraUSBRyuoAIO, AURA_USB_VID, AURA_RYUO_AIO_PID, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR_PU ("ASUS ROG Ryujin AIO", DetectAsusAuraUSBRyuoAIO, AURA_USB_VID, AURA_RYUJIN_AIO_PID, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne QI", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_QI_PID, 0);
|
||||
REGISTER_HID_DETECTOR_I ("ASUS ROG Throne QI GUNDAM", DetectAsusAuraUSBHeadsetStand, AURA_USB_VID, AURA_ROG_THRONE_QI_GUNDAM_PID, 0);
|
||||
|
||||
@@ -22,8 +22,12 @@
|
||||
| Product ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define ASUS_ROG_STRIX_XG27AQDMG_PID 0x1BA3
|
||||
#define ASUS_ROG_SWIFT_XG27UCG_PID 0x1BB4
|
||||
#define ASUS_ROG_STRIX_XG27ACDNG_PID 0x1BC9
|
||||
#define ASUS_ROG_STRIX_XG27UCG_PID 0x1BB4
|
||||
#define ASUS_ROG_SWIFT_PG32UCDM_PID 0x1B2B
|
||||
#define ASUS_ROG_SWIFT_PG32UCDMR_PID 0x1C9B
|
||||
#define ASUS_ROG_SWIFT_PG32UCDP_PID 0x1BCA
|
||||
#define ASUS_ROG_AURA_MONITOR_LIGHT_BAR_PID 0x1AC8
|
||||
|
||||
DetectedControllers DetectAsusMonitorControllers(hid_device_info* info, const std::string& name)
|
||||
{
|
||||
@@ -44,5 +48,13 @@ DetectedControllers DetectAsusMonitorControllers(hid_device_info* info, const st
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_IPU("Asus ROG STRIX XG27AQDMG", DetectAsusMonitorControllers, ASUS_VID, ASUS_ROG_STRIX_XG27AQDMG_PID, 1, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR_IPU("Asus ROG STRIX XG27UCG", DetectAsusMonitorControllers, ASUS_VID, ASUS_ROG_SWIFT_XG27UCG_PID, 1, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR_IPU("Asus ROG STRIX PG32UCDM", DetectAsusMonitorControllers, ASUS_VID, ASUS_ROG_SWIFT_PG32UCDM_PID, 1, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR_IPU("Asus ROG STRIX XG27ACDNG", DetectAsusMonitorControllers, ASUS_VID, ASUS_ROG_STRIX_XG27ACDNG_PID, 1, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR_IPU("Asus ROG STRIX XG27UCG", DetectAsusMonitorControllers, ASUS_VID, ASUS_ROG_STRIX_XG27UCG_PID, 1, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR_IPU("Asus ROG SWIFT PG32UCDM", DetectAsusMonitorControllers, ASUS_VID, ASUS_ROG_SWIFT_PG32UCDM_PID, 1, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR_IPU("Asus ROG SWIFT PG32UCDMR", DetectAsusMonitorControllers, ASUS_VID, ASUS_ROG_SWIFT_PG32UCDMR_PID, 1, 0xFF72, 0x00A1);
|
||||
REGISTER_HID_DETECTOR_IPU("Asus ROG SWIFT PG32UCDP", DetectAsusMonitorControllers, ASUS_VID, ASUS_ROG_SWIFT_PG32UCDP_PID, 1, 0xFF72, 0x00A1);
|
||||
/*---------------------------------------------------------*\
|
||||
| ALB01 exposes the Aura HID collection on interface 2. |
|
||||
\*---------------------------------------------------------*/
|
||||
REGISTER_HID_DETECTOR_IPU("Asus ROG Aura Monitor Light Bar", DetectAsusMonitorControllers, ASUS_VID, ASUS_ROG_AURA_MONITOR_LIGHT_BAR_PID, 2, 0xFF72, 0x00A1);
|
||||
|
||||
|
||||
@@ -36,3 +36,5 @@ DetectedControllers DetectAsusTUFLaptopLinuxControllers()
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("ASUS TUF Laptop", DetectAsusTUFLaptopLinuxControllers);
|
||||
|
||||
REGISTER_CUSTOM_UDEV_RULE(asus_wmi, "ASUS TUF Laptops (asus-wmi)", "ACTION==\"add\", SUBSYSTEM==\"leds\", KERNEL==\"asus::kbd_backlight\", RUN+=\"/usr/bin/env chmod a+w /sys%p/kbd_rgb_mode\"\nACTION==\"add\", SUBSYSTEM==\"leds\", KERNEL==\"asus::kbd_backlight\", RUN+=\"/usr/bin/env chmod a+w /sys%p/brightness\"");
|
||||
|
||||
@@ -24,12 +24,12 @@
|
||||
DetectedControllers DetectBlinkyTapeControllers()
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
std::vector<std::string *> device_locations = find_usb_serial_port(BLINKINLABS_VID, BLINKYTAPE_PID);
|
||||
std::vector<std::string> device_locations = find_usb_serial_port(BLINKINLABS_VID, BLINKYTAPE_PID);
|
||||
|
||||
for(unsigned int device_idx = 0; device_idx < device_locations.size(); device_idx++)
|
||||
{
|
||||
BlinkyTapeController* controller = new BlinkyTapeController();
|
||||
controller->Initialize(*device_locations[device_idx]);
|
||||
controller->Initialize(device_locations[device_idx]);
|
||||
|
||||
RGBController_BlinkyTape* rgb_controller = new RGBController_BlinkyTape(controller);
|
||||
|
||||
@@ -40,8 +40,4 @@ DetectedControllers DetectBlinkyTapeControllers()
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("BlinkyTape", DetectBlinkyTapeControllers);
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Entries for dynamic UDEV rules |
|
||||
| |
|
||||
| DUMMY_DEVICE_DETECTOR("BlinkyTape", DetectBlinkyTapeControllers, 0x1D50, 0x605E ) |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
REGISTER_CUSTOM_UDEV_RULE(blinky_tape, "BlinkyTape", "SUBSYSTEMS==\"serial|hidraw\", ATTRS{idVendor}==\"1d50\", ATTRS{idProduct}==\"605e\", TAG+=\"uaccess\", TAG+=\"BlinkyTape\"");
|
||||
|
||||
@@ -79,7 +79,8 @@ void RGBController_BlinkyTape::SetupZones()
|
||||
zones[0].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
}
|
||||
|
||||
if(!(zones[0].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
@@ -1,22 +1,25 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ClevoKeyboardController.cpp |
|
||||
| |
|
||||
| Driver for Clevo laptop per-key RGB keyboard (ITE 8291) |
|
||||
| Protocol based on tuxedo-drivers ite_8291 module |
|
||||
| Driver for Clevo per-key RGB keyboard |
|
||||
| Supports ITE 8291 (PID 0x600B) and ITE 829x (0x8910) |
|
||||
| |
|
||||
| Kyle Cascade ([email protected]) 16 Jan 2026 |
|
||||
| Valentin Lobstein ([email protected]) 27 Mar 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include "ClevoKeyboardController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
ClevoKeyboardController::ClevoKeyboardController(hid_device* dev_handle, const hid_device_info& info)
|
||||
ClevoKeyboardController::ClevoKeyboardController(hid_device* dev_handle, const hid_device_info& info, clevo_keyboard_type kb_type)
|
||||
{
|
||||
dev = dev_handle;
|
||||
type = kb_type;
|
||||
location = info.path;
|
||||
version = info.release_number;
|
||||
}
|
||||
@@ -26,6 +29,31 @@ ClevoKeyboardController::~ClevoKeyboardController()
|
||||
hid_close(dev);
|
||||
}
|
||||
|
||||
clevo_keyboard_type ClevoKeyboardController::GetType()
|
||||
{
|
||||
return type;
|
||||
}
|
||||
|
||||
int ClevoKeyboardController::GetNumRows()
|
||||
{
|
||||
return(type == CLEVO_KB_ITE829X) ? CLEVO_829X_NUM_ROWS : CLEVO_8291_NUM_ROWS;
|
||||
}
|
||||
|
||||
int ClevoKeyboardController::GetNumCols()
|
||||
{
|
||||
return(type == CLEVO_KB_ITE829X) ? CLEVO_829X_NUM_COLS : CLEVO_8291_NUM_COLS;
|
||||
}
|
||||
|
||||
int ClevoKeyboardController::GetNumLEDs()
|
||||
{
|
||||
return GetNumRows() * GetNumCols();
|
||||
}
|
||||
|
||||
unsigned char ClevoKeyboardController::GetBrightnessMax()
|
||||
{
|
||||
return(type == CLEVO_KB_ITE829X) ? CLEVO_829X_BRIGHTNESS_MAX : CLEVO_8291_BRIGHTNESS_MAX;
|
||||
}
|
||||
|
||||
std::string ClevoKeyboardController::GetDeviceLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
@@ -51,147 +79,355 @@ std::string ClevoKeyboardController::GetFirmwareVersion()
|
||||
return(version_string);
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::WriteControl(unsigned char* data)
|
||||
/*---------------------------------------------------------*\
|
||||
| ITE 8291: 8-byte feature report, no report ID |
|
||||
\*---------------------------------------------------------*/
|
||||
void ClevoKeyboardController::WriteControl8291(unsigned char* data)
|
||||
{
|
||||
hid_send_feature_report(dev, data, CLEVO_KEYBOARD_REPORT_SIZE);
|
||||
hid_send_feature_report(dev, data, CLEVO_8291_REPORT_SIZE);
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::WriteRowData(unsigned char* data)
|
||||
{
|
||||
hid_write(dev, data, CLEVO_KEYBOARD_ROW_DATA_SIZE);
|
||||
hid_write(dev, data, CLEVO_8291_ROW_DATA_SIZE);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| ITE 829x: 6-byte feature report with report ID 0xCC |
|
||||
\*---------------------------------------------------------*/
|
||||
void ClevoKeyboardController::SendCommand829x(unsigned char cmd, unsigned char d0, unsigned char d1, unsigned char d2, unsigned char d3)
|
||||
{
|
||||
unsigned char buf[CLEVO_829X_REPORT_SIZE];
|
||||
|
||||
buf[0] = CLEVO_829X_REPORT_ID;
|
||||
buf[1] = cmd;
|
||||
buf[2] = d0;
|
||||
buf[3] = d1;
|
||||
buf[4] = d2;
|
||||
buf[5] = d3;
|
||||
|
||||
hid_send_feature_report(dev, buf, CLEVO_829X_REPORT_SIZE);
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::TurnOff()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Turn off: 08 01 00 00 00 00 00 00 |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char buf[CLEVO_KEYBOARD_REPORT_SIZE];
|
||||
if(type == CLEVO_KB_ITE829X)
|
||||
{
|
||||
SendCommand829x(CLEVO_829X_CMD_BRIGHTNESS);
|
||||
return;
|
||||
}
|
||||
|
||||
memset(buf, 0x00, CLEVO_KEYBOARD_REPORT_SIZE);
|
||||
buf[0] = 0x08;
|
||||
buf[1] = 0x01;
|
||||
|
||||
WriteControl(buf);
|
||||
unsigned char buf[CLEVO_8291_REPORT_SIZE];
|
||||
memset(buf, 0x00, CLEVO_8291_REPORT_SIZE);
|
||||
buf[0] = CLEVO_8291_CMD_MODE;
|
||||
buf[1] = CLEVO_8291_POWER_OFF;
|
||||
WriteControl8291(buf);
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::SetMode(unsigned char mode, unsigned char brightness, unsigned char speed, unsigned char behaviour)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Set params: 08 [power] [mode] [speed] [brightness] 08 |
|
||||
| [behaviour] 00 |
|
||||
| power: 01=off, 02=on |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char buf[CLEVO_KEYBOARD_REPORT_SIZE];
|
||||
if(type == CLEVO_KB_ITE829X)
|
||||
{
|
||||
SendCommand829x(CLEVO_829X_CMD_BRIGHTNESS, brightness, speed);
|
||||
return;
|
||||
}
|
||||
|
||||
memset(buf, 0x00, CLEVO_KEYBOARD_REPORT_SIZE);
|
||||
buf[0] = 0x08;
|
||||
buf[1] = 0x02; // Power on
|
||||
unsigned char buf[CLEVO_8291_REPORT_SIZE];
|
||||
memset(buf, 0x00, CLEVO_8291_REPORT_SIZE);
|
||||
buf[0] = CLEVO_8291_CMD_MODE;
|
||||
buf[1] = CLEVO_8291_POWER_ON;
|
||||
buf[2] = mode;
|
||||
buf[3] = speed;
|
||||
buf[4] = brightness;
|
||||
buf[5] = 0x08;
|
||||
buf[5] = CLEVO_8291_MODE_FLAG;
|
||||
buf[6] = behaviour;
|
||||
|
||||
WriteControl(buf);
|
||||
WriteControl8291(buf);
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::SetModeColor(unsigned char color_idx, unsigned char red, unsigned char green, unsigned char blue)
|
||||
void ClevoKeyboardController::SetModeColor(unsigned char color_idx, RGBColor color)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Set color define: 14 00 [index] R G B 00 00 |
|
||||
| index: 1-7 for built-in effects |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char buf[CLEVO_KEYBOARD_REPORT_SIZE];
|
||||
|
||||
memset(buf, 0x00, CLEVO_KEYBOARD_REPORT_SIZE);
|
||||
buf[0] = 0x14;
|
||||
buf[1] = 0x00;
|
||||
buf[2] = color_idx;
|
||||
buf[3] = red;
|
||||
buf[4] = green;
|
||||
buf[5] = blue;
|
||||
|
||||
WriteControl(buf);
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::SendColors(unsigned char* color_data, unsigned char brightness)
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Per-key RGB mode (mode 0x33) |
|
||||
| 1. Set params with mode 0x33 and brightness |
|
||||
| 2. For each row 0-5: |
|
||||
| - Announce row: 16 00 [row] 00 00 00 00 00 |
|
||||
| - Send 65 bytes row data via output report |
|
||||
| |
|
||||
| Row data format (65 bytes): |
|
||||
| [0x00 padding][0x00 padding] |
|
||||
| [B0..B20][G0..G20][R0..R20] |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char ctrl_buf[CLEVO_KEYBOARD_REPORT_SIZE];
|
||||
unsigned char row_buf[CLEVO_KEYBOARD_ROW_DATA_SIZE];
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Clamp brightness |
|
||||
\*---------------------------------------------------------*/
|
||||
if(brightness > CLEVO_KEYBOARD_BRIGHTNESS_MAX)
|
||||
if(type == CLEVO_KB_ITE829X)
|
||||
{
|
||||
brightness = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned char buf[CLEVO_8291_REPORT_SIZE];
|
||||
memset(buf, 0x00, CLEVO_8291_REPORT_SIZE);
|
||||
buf[0] = CLEVO_8291_CMD_COLOR;
|
||||
buf[2] = color_idx;
|
||||
buf[3] = RGBGetRValue(color);
|
||||
buf[4] = RGBGetGValue(color);
|
||||
buf[5] = RGBGetBValue(color);
|
||||
WriteControl8291(buf);
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::SetBrightnessSpeed829x(unsigned char brightness, unsigned char speed)
|
||||
{
|
||||
if(brightness > CLEVO_829X_BRIGHTNESS_MAX)
|
||||
{
|
||||
brightness = CLEVO_829X_BRIGHTNESS_MAX;
|
||||
}
|
||||
|
||||
if(brightness != current_brightness_829x || speed != current_speed_829x)
|
||||
{
|
||||
current_brightness_829x = brightness;
|
||||
current_speed_829x = speed;
|
||||
SendCommand829x(CLEVO_829X_CMD_BRIGHTNESS, brightness, speed);
|
||||
}
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::SendColorSlot829x(unsigned char cmd, unsigned char slot, RGBColor color)
|
||||
{
|
||||
SendCommand829x(cmd, slot, RGBGetRValue(color), RGBGetGValue(color), RGBGetBValue(color));
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| ITE 829x: Save/Clear BIOS keyboard state |
|
||||
\*---------------------------------------------------------*/
|
||||
void ClevoKeyboardController::SaveToBios829x()
|
||||
{
|
||||
SendCommand829x(CLEVO_829X_CMD_SAVE_BIOS, 0x01);
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::ClearBiosSave829x()
|
||||
{
|
||||
SendCommand829x(CLEVO_829X_CMD_SAVE_BIOS, 0x00);
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::StopAnimation829x()
|
||||
{
|
||||
SendCommand829x(CLEVO_829X_CMD_ANIM, CLEVO_829X_CMD_STOP_ANIM);
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::SetEffect829x(unsigned char mode_value, const std::vector<RGBColor>& colors, unsigned int direction, unsigned int color_mode)
|
||||
{
|
||||
bool mode_changed = (mode_value != current_mode_829x);
|
||||
current_mode_829x = mode_value;
|
||||
bool use_custom_color = (color_mode != MODE_COLORS_RANDOM) && !colors.empty();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Animation modes: send [CC, 00, mode_id] on mode change |
|
||||
\*---------------------------------------------------------*/
|
||||
struct anim_entry { unsigned char mode; unsigned char anim_id; };
|
||||
static const anim_entry anim_modes[] =
|
||||
{
|
||||
{ CLEVO_829X_MODE_WAVE, 0x04 },
|
||||
{ CLEVO_829X_MODE_RANDOM, 0x09 },
|
||||
{ CLEVO_829X_MODE_SCAN, 0x0A },
|
||||
{ CLEVO_829X_MODE_SNAKE, 0x0B },
|
||||
{ CLEVO_829X_MODE_RAINBOW_CYCLE, 0x02 },
|
||||
{ CLEVO_829X_MODE_RAINBOW_GRAD, 0x04 },
|
||||
};
|
||||
|
||||
const anim_entry* anim_it = std::find_if(std::begin(anim_modes), std::end(anim_modes),
|
||||
[mode_value](const anim_entry& e) { return e.mode == mode_value; });
|
||||
|
||||
if(anim_it != std::end(anim_modes) && mode_changed)
|
||||
{
|
||||
SendCommand829x(CLEVO_829X_CMD_ANIM, anim_it->anim_id);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set params for per-key mode |
|
||||
| Direction-based effects (Wave/Snake) |
|
||||
| Slot = base + direction_index |
|
||||
| Custom color: base = 0xA1, Preset: base = 0x71 |
|
||||
\*---------------------------------------------------------*/
|
||||
memset(ctrl_buf, 0x00, CLEVO_KEYBOARD_REPORT_SIZE);
|
||||
ctrl_buf[0] = 0x08;
|
||||
ctrl_buf[1] = 0x02; // Power on
|
||||
ctrl_buf[2] = CLEVO_KEYBOARD_MODE_DIRECT; // Per-key mode
|
||||
ctrl_buf[3] = 0x00; // Speed (unused)
|
||||
ctrl_buf[4] = brightness;
|
||||
ctrl_buf[5] = 0x00;
|
||||
ctrl_buf[6] = 0x00;
|
||||
/*---------------------------------------------------------*\
|
||||
| Map OpenRGB direction enum to firmware slot index |
|
||||
\*---------------------------------------------------------*/
|
||||
static const unsigned char dir_to_wave_idx[] =
|
||||
{
|
||||
6, /* MODE_DIRECTION_LEFT */
|
||||
7, /* MODE_DIRECTION_RIGHT */
|
||||
4, /* MODE_DIRECTION_UP */
|
||||
5, /* MODE_DIRECTION_DOWN */
|
||||
6, /* MODE_DIRECTION_HORIZONTAL */
|
||||
4, /* MODE_DIRECTION_VERTICAL */
|
||||
0, /* MODE_DIRECTION_UP_LEFT */
|
||||
1, /* MODE_DIRECTION_UP_RIGHT */
|
||||
2, /* MODE_DIRECTION_DOWN_LEFT */
|
||||
3, /* MODE_DIRECTION_DOWN_RIGHT */
|
||||
};
|
||||
|
||||
WriteControl(ctrl_buf);
|
||||
static const unsigned char dir_to_snake_idx[] =
|
||||
{
|
||||
0, /* MODE_DIRECTION_LEFT */
|
||||
0, /* MODE_DIRECTION_RIGHT */
|
||||
0, /* MODE_DIRECTION_UP */
|
||||
0, /* MODE_DIRECTION_DOWN */
|
||||
0, /* MODE_DIRECTION_HORIZONTAL */
|
||||
0, /* MODE_DIRECTION_VERTICAL */
|
||||
0, /* MODE_DIRECTION_UP_LEFT */
|
||||
1, /* MODE_DIRECTION_UP_RIGHT */
|
||||
2, /* MODE_DIRECTION_DOWN_LEFT */
|
||||
3, /* MODE_DIRECTION_DOWN_RIGHT */
|
||||
};
|
||||
|
||||
if((mode_value == CLEVO_829X_MODE_WAVE || mode_value == CLEVO_829X_MODE_RAINBOW_GRAD) && direction < sizeof(dir_to_wave_idx))
|
||||
{
|
||||
unsigned char base = use_custom_color ? CLEVO_829X_COLOR_SLOT_BASE : CLEVO_829X_PRESET_SLOT_BASE;
|
||||
unsigned char idx = dir_to_wave_idx[direction];
|
||||
unsigned char slot = base + idx;
|
||||
|
||||
if(use_custom_color)
|
||||
{
|
||||
SendColorSlot829x(CLEVO_829X_CMD_WAVE_COLOR, slot, colors[0]);
|
||||
}
|
||||
|
||||
if(!use_custom_color)
|
||||
{
|
||||
SendCommand829x(CLEVO_829X_CMD_WAVE_COLOR, slot);
|
||||
}
|
||||
}
|
||||
|
||||
if(mode_value == CLEVO_829X_MODE_SNAKE && direction < sizeof(dir_to_snake_idx))
|
||||
{
|
||||
unsigned char base = use_custom_color ? CLEVO_829X_COLOR_SLOT_BASE : CLEVO_829X_PRESET_SLOT_BASE;
|
||||
unsigned char idx = dir_to_snake_idx[direction];
|
||||
unsigned char slot = base + idx;
|
||||
|
||||
if(use_custom_color)
|
||||
{
|
||||
SendColorSlot829x(CLEVO_829X_CMD_SNAKE_COLOR, slot, colors[0]);
|
||||
}
|
||||
|
||||
if(!use_custom_color)
|
||||
{
|
||||
SendCommand829x(CLEVO_829X_CMD_SNAKE_COLOR, slot);
|
||||
}
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Send each row |
|
||||
| Breathing/Flashing: random or custom color |
|
||||
\*---------------------------------------------------------*/
|
||||
for(int row = 0; row < CLEVO_KEYBOARD_NUM_ROWS; row++)
|
||||
if(mode_value == CLEVO_829X_MODE_BREATH && use_custom_color)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Announce row data |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(ctrl_buf, 0x00, CLEVO_KEYBOARD_REPORT_SIZE);
|
||||
ctrl_buf[0] = 0x16;
|
||||
ctrl_buf[1] = 0x00;
|
||||
ctrl_buf[2] = row;
|
||||
SendColorSlot829x(0x0A, CLEVO_829X_COLOR_CUSTOM, colors[0]);
|
||||
}
|
||||
|
||||
WriteControl(ctrl_buf);
|
||||
if(mode_value == CLEVO_829X_MODE_BREATH && !use_custom_color)
|
||||
{
|
||||
SendCommand829x(0x0A);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Build row data buffer |
|
||||
| Format: [pad][pad][B0..B20][G0..G20][R0..R20] |
|
||||
\*-----------------------------------------------------*/
|
||||
memset(row_buf, 0x00, CLEVO_KEYBOARD_ROW_DATA_SIZE);
|
||||
if(mode_value == CLEVO_829X_MODE_BLINK && use_custom_color)
|
||||
{
|
||||
SendColorSlot829x(0x0B, CLEVO_829X_COLOR_CUSTOM, colors[0]);
|
||||
}
|
||||
|
||||
for(int col = 0; col < CLEVO_KEYBOARD_NUM_COLS; col++)
|
||||
if(mode_value == CLEVO_829X_MODE_BLINK && !use_custom_color)
|
||||
{
|
||||
SendCommand829x(0x0B);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Random: custom color only (multicolor is the default) |
|
||||
\*---------------------------------------------------------*/
|
||||
if(mode_value == CLEVO_829X_MODE_RANDOM && use_custom_color)
|
||||
{
|
||||
SendColorSlot829x(CLEVO_829X_CMD_RANDOM_COLOR, CLEVO_829X_COLOR_SLOT_BASE, colors[0]);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Scan: 2 custom color bands |
|
||||
\*---------------------------------------------------------*/
|
||||
if(mode_value == CLEVO_829X_MODE_SCAN)
|
||||
{
|
||||
for(size_t i = 0; i < colors.size() && i < 2; i++)
|
||||
{
|
||||
int led_idx = (row * CLEVO_KEYBOARD_NUM_COLS) + col;
|
||||
int color_offset = led_idx * 3;
|
||||
SendColorSlot829x(CLEVO_829X_CMD_SCAN_COLOR, CLEVO_829X_COLOR_SLOT_BASE + (unsigned char)i, colors[i]);
|
||||
}
|
||||
}
|
||||
|
||||
unsigned char red = color_data[color_offset + 0];
|
||||
unsigned char green = color_data[color_offset + 1];
|
||||
unsigned char blue = color_data[color_offset + 2];
|
||||
/*---------------------------------------------------------*\
|
||||
| Fn Highlight: per-key color on function keys |
|
||||
\*---------------------------------------------------------*/
|
||||
if(mode_value == CLEVO_829X_MODE_FN_COLOR && !colors.empty())
|
||||
{
|
||||
static const unsigned char fn_keys[] =
|
||||
{
|
||||
0x01, 0x02, 0x03, 0x05, 0x06, 0x07, 0x08, 0x09,
|
||||
0x0A, 0x0B, 0x0C, 0x21, 0x23, 0x31, 0x32, 0x33,
|
||||
0x53, 0x73, 0xA2
|
||||
};
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Row data layout (after 2-byte padding): |
|
||||
| Bytes 2-22: Blue values for columns 0-20 |
|
||||
| Bytes 23-43: Green values for columns 0-20 |
|
||||
| Bytes 44-64: Red values for columns 0-20 |
|
||||
\*-------------------------------------------------*/
|
||||
row_buf[2 + col] = blue;
|
||||
row_buf[2 + CLEVO_KEYBOARD_NUM_COLS + col] = green;
|
||||
row_buf[2 + CLEVO_KEYBOARD_NUM_COLS*2 + col] = red;
|
||||
SendCommand829x(CLEVO_829X_CMD_ANIM, CLEVO_829X_CMD_CLEAR);
|
||||
|
||||
for(unsigned char key : fn_keys)
|
||||
{
|
||||
SendCommand829x(CLEVO_829X_CMD_SET_LED, key,
|
||||
RGBGetRValue(colors[0]),
|
||||
RGBGetGValue(colors[0]),
|
||||
RGBGetBValue(colors[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ClevoKeyboardController::SendColors(const unsigned char* color_data, unsigned char brightness, unsigned char speed)
|
||||
{
|
||||
int num_rows = GetNumRows();
|
||||
int num_cols = GetNumCols();
|
||||
|
||||
if(type == CLEVO_KB_ITE829X)
|
||||
{
|
||||
if(brightness > CLEVO_829X_BRIGHTNESS_MAX)
|
||||
{
|
||||
brightness = CLEVO_829X_BRIGHTNESS_MAX;
|
||||
}
|
||||
|
||||
SendCommand829x(CLEVO_829X_CMD_BRIGHTNESS, brightness, speed);
|
||||
|
||||
for(int row = 0; row < num_rows; row++)
|
||||
{
|
||||
for(int col = 0; col < num_cols; col++)
|
||||
{
|
||||
int idx = (row * num_cols + col) * 3;
|
||||
|
||||
SendCommand829x(CLEVO_829X_CMD_SET_LED,
|
||||
CLEVO_829X_LED_ID(row, col),
|
||||
color_data[idx + 0],
|
||||
color_data[idx + 1],
|
||||
color_data[idx + 2]);
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| ITE 8291: row-based color transfer |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char ctrl_buf[CLEVO_8291_REPORT_SIZE];
|
||||
unsigned char row_buf[CLEVO_8291_ROW_DATA_SIZE];
|
||||
|
||||
if(brightness > CLEVO_8291_BRIGHTNESS_MAX)
|
||||
{
|
||||
brightness = CLEVO_8291_BRIGHTNESS_MAX;
|
||||
}
|
||||
|
||||
memset(ctrl_buf, 0x00, CLEVO_8291_REPORT_SIZE);
|
||||
ctrl_buf[0] = CLEVO_8291_CMD_MODE;
|
||||
ctrl_buf[1] = CLEVO_8291_POWER_ON;
|
||||
ctrl_buf[2] = CLEVO_KEYBOARD_MODE_DIRECT;
|
||||
ctrl_buf[4] = brightness;
|
||||
WriteControl8291(ctrl_buf);
|
||||
|
||||
for(int row = 0; row < num_rows; row++)
|
||||
{
|
||||
memset(ctrl_buf, 0x00, CLEVO_8291_REPORT_SIZE);
|
||||
ctrl_buf[0] = CLEVO_8291_CMD_ROW;
|
||||
ctrl_buf[2] = row;
|
||||
WriteControl8291(ctrl_buf);
|
||||
|
||||
memset(row_buf, 0x00, CLEVO_8291_ROW_DATA_SIZE);
|
||||
|
||||
for(int col = 0; col < num_cols; col++)
|
||||
{
|
||||
int idx = (row * num_cols + col) * 3;
|
||||
|
||||
row_buf[2 + col] = color_data[idx + 2];
|
||||
row_buf[2 + num_cols + col] = color_data[idx + 1];
|
||||
row_buf[2 + num_cols * 2 + col] = color_data[idx + 0];
|
||||
}
|
||||
|
||||
WriteRowData(row_buf);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ClevoKeyboardController.h |
|
||||
| |
|
||||
| Driver for Clevo laptop per-key RGB keyboard (ITE 8291) |
|
||||
| Driver for Clevo per-key RGB keyboard |
|
||||
| Supports ITE 8291 (PID 0x600B) and ITE 829x (0x8910) |
|
||||
| |
|
||||
| Kyle Cascade ([email protected]) 16 Jan 2026 |
|
||||
| Valentin Lobstein ([email protected]) 27 Mar 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
@@ -12,27 +14,75 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <hidapi.h>
|
||||
#include "RGBController.h"
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| ITE 8291 keyboard defines |
|
||||
\*-----------------------------------------------------*/
|
||||
#define CLEVO_KEYBOARD_REPORT_SIZE 8
|
||||
#define CLEVO_KEYBOARD_ROW_DATA_SIZE 65
|
||||
/*---------------------------------------------------------*\
|
||||
| Device type enumeration |
|
||||
\*---------------------------------------------------------*/
|
||||
enum clevo_keyboard_type
|
||||
{
|
||||
CLEVO_KB_ITE8291,
|
||||
CLEVO_KB_ITE829X,
|
||||
};
|
||||
|
||||
#define CLEVO_KEYBOARD_NUM_ROWS 6
|
||||
#define CLEVO_KEYBOARD_NUM_COLS 21
|
||||
#define CLEVO_KEYBOARD_NUM_LEDS (CLEVO_KEYBOARD_NUM_ROWS * CLEVO_KEYBOARD_NUM_COLS)
|
||||
/*---------------------------------------------------------*\
|
||||
| ITE 8291 keyboard defines (PID 0x600B) |
|
||||
| 8 bytes, no report ID, row-based color data |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CLEVO_8291_REPORT_SIZE 8
|
||||
#define CLEVO_8291_ROW_DATA_SIZE 65
|
||||
#define CLEVO_8291_NUM_ROWS 6
|
||||
#define CLEVO_8291_NUM_COLS 21
|
||||
#define CLEVO_8291_NUM_LEDS (CLEVO_8291_NUM_ROWS * CLEVO_8291_NUM_COLS)
|
||||
#define CLEVO_8291_BRIGHTNESS_MAX 0x32
|
||||
#define CLEVO_8291_CMD_MODE 0x08
|
||||
#define CLEVO_8291_CMD_COLOR 0x14
|
||||
#define CLEVO_8291_CMD_ROW 0x16
|
||||
#define CLEVO_8291_POWER_OFF 0x01
|
||||
#define CLEVO_8291_POWER_ON 0x02
|
||||
#define CLEVO_8291_MODE_FLAG 0x08
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| ITE 829x keyboard defines (PID 0x8910) |
|
||||
| 6 bytes with report ID 0xCC, per-key color commands |
|
||||
| Protocol: [0xCC, cmd, d0, d1, d2, d3] |
|
||||
| LED ID: ((row & 0x07) << 5) | (col & 0x1F) |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CLEVO_829X_REPORT_ID 0xCC
|
||||
#define CLEVO_829X_REPORT_SIZE 6
|
||||
#define CLEVO_829X_NUM_ROWS 6
|
||||
#define CLEVO_829X_NUM_COLS 20
|
||||
#define CLEVO_829X_NUM_LEDS (CLEVO_829X_NUM_ROWS * CLEVO_829X_NUM_COLS)
|
||||
#define CLEVO_829X_BRIGHTNESS_MAX 0x0A
|
||||
#define CLEVO_829X_LED_ID(row, col) (unsigned char)((((row) & 0x07) << 5) | ((col) & 0x1F))
|
||||
|
||||
#define CLEVO_829X_CMD_SET_LED 0x01
|
||||
#define CLEVO_829X_CMD_BRIGHTNESS 0x09
|
||||
#define CLEVO_829X_CMD_ANIM 0x00
|
||||
#define CLEVO_829X_CMD_CLEAR 0x0C
|
||||
#define CLEVO_829X_CMD_WAVE_COLOR 0x15
|
||||
#define CLEVO_829X_CMD_SNAKE_COLOR 0x16
|
||||
#define CLEVO_829X_CMD_SCAN_COLOR 0x17
|
||||
#define CLEVO_829X_CMD_RANDOM_COLOR 0x18
|
||||
#define CLEVO_829X_COLOR_CUSTOM 0xAA
|
||||
#define CLEVO_829X_COLOR_SLOT_BASE 0xA1
|
||||
#define CLEVO_829X_PRESET_SLOT_BASE 0x71
|
||||
#define CLEVO_829X_CMD_SAVE_BIOS 0x20
|
||||
#define CLEVO_829X_CMD_STOP_ANIM 0x03
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Shared defines |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CLEVO_KEYBOARD_BRIGHTNESS_MIN 0x00
|
||||
#define CLEVO_KEYBOARD_BRIGHTNESS_MAX 0x32
|
||||
|
||||
#define CLEVO_KEYBOARD_SPEED_MIN 0x01
|
||||
#define CLEVO_KEYBOARD_SPEED_MIN 0x00
|
||||
#define CLEVO_KEYBOARD_SPEED_MAX 0x0A
|
||||
#define CLEVO_KEYBOARD_SPEED_DEFAULT 0x00
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| ITE 8291 modes |
|
||||
\*-----------------------------------------------------*/
|
||||
/*---------------------------------------------------------*\
|
||||
| ITE 8291 modes |
|
||||
\*---------------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
CLEVO_KEYBOARD_MODE_DIRECT = 0x33,
|
||||
@@ -47,9 +97,36 @@ enum
|
||||
CLEVO_KEYBOARD_MODE_SPARK = 0x11,
|
||||
};
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Wave/reactive behaviour |
|
||||
\*-----------------------------------------------------*/
|
||||
/*---------------------------------------------------------*\
|
||||
| ITE 829x firmware modes |
|
||||
| Two command styles: |
|
||||
| cmd=0x00, d0=mode_id (animation select) |
|
||||
| cmd=mode_id, d0=0x00 (standalone effects) |
|
||||
\*---------------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
CLEVO_829X_MODE_DIRECT = 0xFD,
|
||||
CLEVO_829X_MODE_WAVE = 0xA0,
|
||||
CLEVO_829X_MODE_WAVE_COLOR = 0xB0,
|
||||
CLEVO_829X_MODE_BREATH = 0xA1,
|
||||
CLEVO_829X_MODE_BREATH_COLOR = 0xB1,
|
||||
CLEVO_829X_MODE_BLINK = 0xA2,
|
||||
CLEVO_829X_MODE_BLINK_COLOR = 0xB2,
|
||||
CLEVO_829X_MODE_RANDOM = 0xA3,
|
||||
CLEVO_829X_MODE_RANDOM_COLOR = 0xA9,
|
||||
CLEVO_829X_MODE_SCAN = 0xA4,
|
||||
/* Ripple (0x07) requires Insyde BIOS EC config, not supported */
|
||||
CLEVO_829X_MODE_SNAKE = 0xA6,
|
||||
CLEVO_829X_MODE_SNAKE_COLOR = 0xB6,
|
||||
CLEVO_829X_MODE_RAINBOW_CYCLE = 0xA7,
|
||||
CLEVO_829X_MODE_RAINBOW_GRAD = 0xA8,
|
||||
CLEVO_829X_MODE_FN_COLOR = 0xAF,
|
||||
CLEVO_829X_MODE_OFF = 0xFF,
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Wave/reactive behaviour |
|
||||
\*---------------------------------------------------------*/
|
||||
enum
|
||||
{
|
||||
CLEVO_KEYBOARD_DIRECTION_LEFT = 0x01,
|
||||
@@ -67,23 +144,40 @@ enum
|
||||
class ClevoKeyboardController
|
||||
{
|
||||
public:
|
||||
ClevoKeyboardController(hid_device* dev_handle, const hid_device_info& info);
|
||||
ClevoKeyboardController(hid_device* dev_handle, const hid_device_info& info, clevo_keyboard_type kb_type);
|
||||
~ClevoKeyboardController();
|
||||
|
||||
clevo_keyboard_type GetType();
|
||||
int GetNumRows();
|
||||
int GetNumCols();
|
||||
int GetNumLEDs();
|
||||
unsigned char GetBrightnessMax();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetSerialString();
|
||||
std::string GetFirmwareVersion();
|
||||
|
||||
void TurnOff();
|
||||
void SetMode(unsigned char mode, unsigned char brightness, unsigned char speed, unsigned char behaviour);
|
||||
void SetModeColor(unsigned char color_idx, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SendColors(unsigned char* color_data, unsigned char brightness);
|
||||
void SetModeColor(unsigned char color_idx, RGBColor color);
|
||||
void SendColors(const unsigned char* color_data, unsigned char brightness, unsigned char speed);
|
||||
void SetEffect829x(unsigned char mode_value, const std::vector<RGBColor>& colors, unsigned int direction = 0, unsigned int color_mode = 0);
|
||||
void SetBrightnessSpeed829x(unsigned char brightness, unsigned char speed);
|
||||
void SaveToBios829x();
|
||||
void ClearBiosSave829x();
|
||||
void StopAnimation829x();
|
||||
|
||||
private:
|
||||
hid_device* dev;
|
||||
std::string location;
|
||||
unsigned short version;
|
||||
hid_device* dev;
|
||||
clevo_keyboard_type type;
|
||||
std::string location;
|
||||
unsigned short version;
|
||||
unsigned char current_mode_829x = 0xFF;
|
||||
unsigned char current_brightness_829x = 0xFF;
|
||||
unsigned char current_speed_829x = 0xFF;
|
||||
|
||||
void WriteControl(unsigned char* data);
|
||||
void WriteControl8291(unsigned char* data);
|
||||
void WriteRowData(unsigned char* data);
|
||||
void SendCommand829x(unsigned char cmd, unsigned char d0 = 0, unsigned char d1 = 0, unsigned char d2 = 0, unsigned char d3 = 0);
|
||||
void SendColorSlot829x(unsigned char cmd, unsigned char slot, RGBColor color);
|
||||
};
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ClevoKeyboardControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Clevo per-key RGB keyboard (ITE 8291) |
|
||||
| Detector for Clevo per-key RGB keyboard |
|
||||
| Supports ITE 8291 (PID 0x600B) and ITE 829x (0x8910) |
|
||||
| |
|
||||
| Kyle Cascade ([email protected]) 16 Jan 2026 |
|
||||
| Valentin Lobstein ([email protected]) 27 Mar 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
@@ -22,11 +24,12 @@
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Clevo Keyboard product IDs |
|
||||
| These are ITE 8291 per-key RGB keyboard controllers |
|
||||
| ITE 8291 and ITE 829x per-key RGB keyboard controllers |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CLEVO_KEYBOARD_PID_600B 0x600B
|
||||
#define CLEVO_KEYBOARD_PID_8291 0x600B
|
||||
#define CLEVO_KEYBOARD_PID_829X 0x8910
|
||||
|
||||
DetectedControllers DetectClevoKeyboardControllers(hid_device_info* info, const std::string& /*name*/)
|
||||
static DetectedControllers DetectClevoKeyboard(hid_device_info* info, clevo_keyboard_type kb_type)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
hid_device* dev;
|
||||
@@ -35,7 +38,7 @@ DetectedControllers DetectClevoKeyboardControllers(hid_device_info* info, const
|
||||
|
||||
if(dev)
|
||||
{
|
||||
ClevoKeyboardController* controller = new ClevoKeyboardController(dev, *info);
|
||||
ClevoKeyboardController* controller = new ClevoKeyboardController(dev, *info, kb_type);
|
||||
RGBController_ClevoKeyboard* rgb_controller = new RGBController_ClevoKeyboard(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
@@ -44,4 +47,15 @@ DetectedControllers DetectClevoKeyboardControllers(hid_device_info* info, const
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_PU("CLEVO Keyboard", DetectClevoKeyboardControllers, 0x048D, 0x600B, 0xFF03, 0x01);
|
||||
DetectedControllers DetectClevoKeyboard8291(hid_device_info* info, const std::string& /*name*/)
|
||||
{
|
||||
return(DetectClevoKeyboard(info, CLEVO_KB_ITE8291));
|
||||
}
|
||||
|
||||
DetectedControllers DetectClevoKeyboard829x(hid_device_info* info, const std::string& /*name*/)
|
||||
{
|
||||
return(DetectClevoKeyboard(info, CLEVO_KB_ITE829X));
|
||||
}
|
||||
|
||||
REGISTER_HID_DETECTOR_PU("Clevo Keyboard (ITE 8291)", DetectClevoKeyboard8291, ITE_VID, CLEVO_KEYBOARD_PID_8291, 0xFF03, 0x01);
|
||||
REGISTER_HID_DETECTOR_PU("Clevo Keyboard (ITE 829x)", DetectClevoKeyboard829x, ITE_VID, CLEVO_KEYBOARD_PID_829X, 0xFF89, 0xCC);
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ClevoKeyboardDevices.cpp |
|
||||
| |
|
||||
| Device list for Clevo per-key RGB keyboards (ITE 8291) |
|
||||
| Device list for Clevo per-key RGB keyboards |
|
||||
| Supports ITE 8291 (PID 0x600B) and ITE 829x (0x8910) |
|
||||
| |
|
||||
| Kyle Cascade ([email protected]) 21 Jan 2026 |
|
||||
| Valentin Lobstein ([email protected]) 27 Mar 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
@@ -16,71 +18,79 @@
|
||||
| |
|
||||
| Based on KEYBOARD_SIZE_TKL with numpad added and |
|
||||
| navigation cluster adjusted to match Clevo's layout. |
|
||||
| |
|
||||
| Hardware LED indices (value field): |
|
||||
| - Row 5 (F-keys): 105-124 |
|
||||
| - Row 4 (numbers): 84-102 |
|
||||
| - Row 3 (QWERTY): 63-81 |
|
||||
| - Row 2 (home): 42-59 |
|
||||
| - Row 1 (Z row): 22-39 |
|
||||
| - Row 0 (modifiers): 0-18 |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| LED values in TKL order (fn_row + main + extras) |
|
||||
| LED values, in physical (row, then column) order. |
|
||||
| |
|
||||
| This must match the order KeyboardLayoutManager assigns |
|
||||
| default_values against: the structural keymap sorted by |
|
||||
| (row, col) across main+fn_row+extras combined, NOT the |
|
||||
| fn_row-then-main-then-extras order the zone tables below |
|
||||
| are declared in. Getting this wrong silently misassigns |
|
||||
| almost every key from Print Screen onward, not just a few.|
|
||||
| |
|
||||
| Values follow the key order in KeyboardLayoutManager.cpp. |
|
||||
| For ANSI-only keys (not present on this ISO keyboard), |
|
||||
| use 0 as a placeholder - they won't be displayed. |
|
||||
| Numpad values are added via edit_keys. |
|
||||
\*---------------------------------------------------------*/
|
||||
static const std::vector<unsigned int> clevo_tkl_values =
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Function row (keyboard_zone_fn_row) |
|
||||
\*---------------------------------------------------------*/
|
||||
/*-----------------------------------------------------*\
|
||||
| Row 0: fn_row + Print Screen/Scroll Lock/Pause |
|
||||
\*-----------------------------------------------------*/
|
||||
105, // Escape
|
||||
106, 107, 108, 109, // F1-F4
|
||||
110, 111, 112, 113, // F5-F8
|
||||
114, 115, 116, 117, // F9-F12
|
||||
118, // Print Screen
|
||||
0, // Scroll Lock (removed via edit_keys)
|
||||
0, // Pause (removed via edit_keys)
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Main block - Row 1 (keyboard_zone_main) |
|
||||
\*---------------------------------------------------------*/
|
||||
/*-----------------------------------------------------*\
|
||||
| Row 1: numbers row + Insert/Home/Page Up |
|
||||
\*-----------------------------------------------------*/
|
||||
84, // Back tick
|
||||
85, 86, 87, 88, 89, 90, 91, 92, 93, 94, // 1-0
|
||||
95, 96, // Minus, Equals
|
||||
98, // Backspace
|
||||
119, // Insert
|
||||
121, // Home
|
||||
122, // Page Up
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Main block - Row 2 |
|
||||
\*---------------------------------------------------------*/
|
||||
/*-----------------------------------------------------*\
|
||||
| Row 2: Tab/QWERTY row + Delete/End/PageDown |
|
||||
\*-----------------------------------------------------*/
|
||||
63, // Tab
|
||||
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, // Q-P
|
||||
75, 76, // [ ]
|
||||
0, // ANSI backslash (not on ISO)
|
||||
120, // Delete
|
||||
124, // End
|
||||
123, // Page Down
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Main block - Row 3 |
|
||||
\*---------------------------------------------------------*/
|
||||
/*-----------------------------------------------------*\
|
||||
| Row 3: Caps Lock/home row/Enter |
|
||||
\*-----------------------------------------------------*/
|
||||
42, // Caps Lock
|
||||
44, 45, 46, 47, 48, 49, 50, 51, 52, // A-L
|
||||
53, 54, // ; '
|
||||
55, // ISO # (POUND)
|
||||
77, // Enter (ANSI/ISO share same LED)
|
||||
56, // Enter
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Main block - Row 4 |
|
||||
\*---------------------------------------------------------*/
|
||||
22, // Left Shift
|
||||
23, // ISO backslash
|
||||
/*-----------------------------------------------------*\
|
||||
| Row 4: Left Shift/ISO backslash/Z row + Up |
|
||||
\*-----------------------------------------------------*/
|
||||
21, // Left Shift
|
||||
77, // ISO backslash
|
||||
24, 25, 26, 27, 28, 29, 30, 31, 32, // Z-. (9 keys)
|
||||
33, // /
|
||||
35, // Right Shift
|
||||
14, // Up
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Main block - Row 5 |
|
||||
\*---------------------------------------------------------*/
|
||||
/*-----------------------------------------------------*\
|
||||
| Row 5: bottom modifier row + Left/Down/Right |
|
||||
\*-----------------------------------------------------*/
|
||||
0, // Left Ctrl
|
||||
3, // Left Win
|
||||
4, // Left Alt
|
||||
@@ -89,29 +99,53 @@ static const std::vector<unsigned int> clevo_tkl_values =
|
||||
0, // Right Fn (removed via edit_keys)
|
||||
0, // Menu (removed via edit_keys)
|
||||
12, // Right Ctrl
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Extras - Navigation cluster (keyboard_zone_extras) |
|
||||
\*---------------------------------------------------------*/
|
||||
118, // Print Screen
|
||||
0, // Scroll Lock (removed via edit_keys)
|
||||
0, // Pause (removed via edit_keys)
|
||||
119, // Insert
|
||||
121, // Home
|
||||
123, // Page Up
|
||||
120, // Delete
|
||||
122, // End
|
||||
124, // Page Down
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Extras - Arrow keys |
|
||||
\*---------------------------------------------------------*/
|
||||
14, // Up
|
||||
13, // Left
|
||||
18, // Down
|
||||
15, // Right
|
||||
};
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| ITE 829x LED value mapping |
|
||||
| LED ID = ((row & 7) << 5) | col |
|
||||
| Row 5 (F-keys) = 0xA0+, Row 4 (numbers) = 0x80+ |
|
||||
| Row 3 (QWERTY) = 0x60+, Row 2 (home) = 0x40+ |
|
||||
| Row 1 (Z row) = 0x20+, Row 0 (mods) = 0x00+ |
|
||||
\*---------------------------------------------------------*/
|
||||
static const std::vector<unsigned int> clevo_829x_full_values =
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Values in FULL layout visual order (same as CM keyboard) |
|
||||
| LED ID = ((row & 7) << 5) | col |
|
||||
| Row counts: 16, 21, 21, 17, 18, 13 |
|
||||
\*---------------------------------------------------------*/
|
||||
/* ESC F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 PRSC SCLK PSBK */
|
||||
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0, 0,
|
||||
/* BKTK 1 2 3 4 5 6 7 8 9 0 - = BSPC INS HOME PGUP NMLK NMDV NMTM NMMI */
|
||||
0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2A, 0x2B, 0x2D, 0x2E, 0x0E, 0x10, 0x12, 0x30, 0x31, 0x32, 0x33,
|
||||
/* TAB Q W E R T Y U I O P [ ] ANSI\ DEL END PGDN NM7 NM8 NM9 NMPL */
|
||||
0x40, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x0F, 0x11, 0x13, 0x50, 0x51, 0x52, 0x53,
|
||||
/* CPLK A S D F G H J K L ; ' # ENTR NM4 NM5 NM6 */
|
||||
0x60, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6A, 0x6B, 0x6C, 0, 0x6E, 0x70, 0x71, 0x72,
|
||||
/* LSFT ISO\ Z X C V B N M , . / RSFT ARWU NM1 NM2 NM3 NMER */
|
||||
0x80, 0, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8F, 0x90, 0x91, 0x92, 0x93,
|
||||
/* LCTL LFNC LWIN LALT SPACE RALT RMNU RCTL ARWL ARDN ARWR NM0 NMPD */
|
||||
0xA0, 0xA2, 0xA3, 0xA4, 0xA5, 0xAA, 0xAB, 0xAC, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2,
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values clevo_829x_keyboard_layout
|
||||
{
|
||||
KEYBOARD_SIZE_FULL,
|
||||
{
|
||||
clevo_829x_full_values,
|
||||
{
|
||||
/* No regional overlays needed */
|
||||
}
|
||||
},
|
||||
{
|
||||
/* No edit keys needed - all keys defined in full layout */
|
||||
}
|
||||
};
|
||||
|
||||
keyboard_keymap_overlay_values clevo_keyboard_layout
|
||||
{
|
||||
KEYBOARD_SIZE_TKL,
|
||||
@@ -122,10 +156,9 @@ keyboard_keymap_overlay_values clevo_keyboard_layout
|
||||
}
|
||||
},
|
||||
{
|
||||
/*-------------------------------------------------------------------------------------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
| Zone, Row, Column, Value, Key, Alternate Name, OpCode, |
|
||||
\*-------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*---------------------------------------------------------*\
|
||||
| Edit Keys |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Remove keys not present on Clevo keyboard |
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| ClevoKeyboardDevices.h |
|
||||
| |
|
||||
| Device list for Clevo per-key RGB keyboards (ITE 8291) |
|
||||
| Device list for Clevo per-key RGB keyboards |
|
||||
| Supports ITE 8291 (PID 0x600B) and ITE 829x (0x8910) |
|
||||
| |
|
||||
| Kyle Cascade ([email protected]) 21 Jan 2026 |
|
||||
| Valentin Lobstein ([email protected]) 27 Mar 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
@@ -14,7 +16,8 @@
|
||||
#include <string>
|
||||
#include "KeyboardLayoutManager.h"
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Clevo keyboard layout definitions |
|
||||
\*-----------------------------------------------------*/
|
||||
/*---------------------------------------------------------*\
|
||||
| Clevo keyboard layout definitions |
|
||||
\*---------------------------------------------------------*/
|
||||
extern keyboard_keymap_overlay_values clevo_keyboard_layout;
|
||||
extern keyboard_keymap_overlay_values clevo_829x_keyboard_layout;
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_ClevoKeyboard.cpp |
|
||||
| |
|
||||
| RGBController for Clevo per-key RGB keyboard (ITE 8291) |
|
||||
| RGBController for Clevo per-key RGB keyboard |
|
||||
| Supports ITE 8291 (PID 0x600B) and ITE 829x (0x8910) |
|
||||
| |
|
||||
| Kyle Cascade ([email protected]) 16 Jan 2026 |
|
||||
| Valentin Lobstein ([email protected]) 27 Mar 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <vector>
|
||||
#include "RGBController_ClevoKeyboard.h"
|
||||
#include "KeyboardLayoutManager.h"
|
||||
|
||||
@@ -40,152 +43,306 @@ RGBController_ClevoKeyboard::RGBController_ClevoKeyboard(ClevoKeyboardController
|
||||
Direct.value = CLEVO_KEYBOARD_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Direct.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Direct.brightness_max = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Direct.brightness = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Direct.brightness_max = controller->GetBrightnessMax();
|
||||
Direct.brightness = controller->GetBrightnessMax();
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = CLEVO_KEYBOARD_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Rainbow.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Rainbow.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Rainbow.speed = 0x05;
|
||||
Rainbow.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Rainbow.brightness_max = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Rainbow.brightness = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Rainbow);
|
||||
/*---------------------------------------------------------*\
|
||||
| ITE 8291 built-in effects (not available on ITE 829x) |
|
||||
\*---------------------------------------------------------*/
|
||||
if(controller->GetType() == CLEVO_KB_ITE8291)
|
||||
{
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = CLEVO_KEYBOARD_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Rainbow.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Rainbow.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Rainbow.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Rainbow.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Rainbow.brightness_max = controller->GetBrightnessMax();
|
||||
Rainbow.brightness = controller->GetBrightnessMax();
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
mode Wave;
|
||||
Wave.name = "Wave";
|
||||
Wave.value = CLEVO_KEYBOARD_MODE_WAVE;
|
||||
Wave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Wave.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Wave.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Wave.speed = 0x05;
|
||||
Wave.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Wave.brightness_max = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Wave.brightness = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Wave.direction = MODE_DIRECTION_LEFT;
|
||||
Wave.colors_min = 1;
|
||||
Wave.colors_max = 1;
|
||||
Wave.colors.resize(1);
|
||||
Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Wave);
|
||||
mode Wave;
|
||||
Wave.name = "Wave";
|
||||
Wave.value = CLEVO_KEYBOARD_MODE_WAVE;
|
||||
Wave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Wave.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Wave.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Wave.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Wave.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Wave.brightness_max = controller->GetBrightnessMax();
|
||||
Wave.brightness = controller->GetBrightnessMax();
|
||||
Wave.direction = MODE_DIRECTION_LEFT;
|
||||
Wave.colors_min = 1;
|
||||
Wave.colors_max = 1;
|
||||
Wave.colors.resize(1);
|
||||
Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Wave);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = CLEVO_KEYBOARD_MODE_BREATH;
|
||||
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Breathing.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Breathing.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Breathing.speed = 0x05;
|
||||
Breathing.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Breathing.brightness_max = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Breathing.brightness = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.colors.resize(1);
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Breathing);
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = CLEVO_KEYBOARD_MODE_BREATH;
|
||||
Breathing.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Breathing.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Breathing.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Breathing.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Breathing.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Breathing.brightness_max = controller->GetBrightnessMax();
|
||||
Breathing.brightness = controller->GetBrightnessMax();
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.colors.resize(1);
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Reactive;
|
||||
Reactive.name = "Reactive";
|
||||
Reactive.value = CLEVO_KEYBOARD_MODE_REACTIVE;
|
||||
Reactive.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Reactive.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Reactive.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Reactive.speed = 0x05;
|
||||
Reactive.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Reactive.brightness_max = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Reactive.brightness = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Reactive.colors_min = 1;
|
||||
Reactive.colors_max = 1;
|
||||
Reactive.colors.resize(1);
|
||||
Reactive.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Reactive);
|
||||
mode Reactive;
|
||||
Reactive.name = "Reactive";
|
||||
Reactive.value = CLEVO_KEYBOARD_MODE_REACTIVE;
|
||||
Reactive.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Reactive.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Reactive.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Reactive.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Reactive.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Reactive.brightness_max = controller->GetBrightnessMax();
|
||||
Reactive.brightness = controller->GetBrightnessMax();
|
||||
Reactive.colors_min = 1;
|
||||
Reactive.colors_max = 1;
|
||||
Reactive.colors.resize(1);
|
||||
Reactive.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Reactive);
|
||||
|
||||
mode Ripple;
|
||||
Ripple.name = "Ripple";
|
||||
Ripple.value = CLEVO_KEYBOARD_MODE_RIPPLE;
|
||||
Ripple.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Ripple.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Ripple.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Ripple.speed = 0x05;
|
||||
Ripple.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Ripple.brightness_max = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Ripple.brightness = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Ripple.colors_min = 1;
|
||||
Ripple.colors_max = 1;
|
||||
Ripple.colors.resize(1);
|
||||
Ripple.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Ripple);
|
||||
mode Ripple;
|
||||
Ripple.name = "Ripple";
|
||||
Ripple.value = CLEVO_KEYBOARD_MODE_RIPPLE;
|
||||
Ripple.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Ripple.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Ripple.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Ripple.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Ripple.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Ripple.brightness_max = controller->GetBrightnessMax();
|
||||
Ripple.brightness = controller->GetBrightnessMax();
|
||||
Ripple.colors_min = 1;
|
||||
Ripple.colors_max = 1;
|
||||
Ripple.colors.resize(1);
|
||||
Ripple.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Ripple);
|
||||
|
||||
mode Marquee;
|
||||
Marquee.name = "Marquee";
|
||||
Marquee.value = CLEVO_KEYBOARD_MODE_MARQUEE;
|
||||
Marquee.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Marquee.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Marquee.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Marquee.speed = 0x05;
|
||||
Marquee.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Marquee.brightness_max = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Marquee.brightness = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Marquee.colors_min = 1;
|
||||
Marquee.colors_max = 1;
|
||||
Marquee.colors.resize(1);
|
||||
Marquee.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Marquee);
|
||||
mode Marquee;
|
||||
Marquee.name = "Marquee";
|
||||
Marquee.value = CLEVO_KEYBOARD_MODE_MARQUEE;
|
||||
Marquee.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Marquee.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Marquee.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Marquee.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Marquee.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Marquee.brightness_max = controller->GetBrightnessMax();
|
||||
Marquee.brightness = controller->GetBrightnessMax();
|
||||
Marquee.colors_min = 1;
|
||||
Marquee.colors_max = 1;
|
||||
Marquee.colors.resize(1);
|
||||
Marquee.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Marquee);
|
||||
|
||||
mode Raindrop;
|
||||
Raindrop.name = "Raindrop";
|
||||
Raindrop.value = CLEVO_KEYBOARD_MODE_RAINDROP;
|
||||
Raindrop.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Raindrop.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Raindrop.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Raindrop.speed = 0x05;
|
||||
Raindrop.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Raindrop.brightness_max = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Raindrop.brightness = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Raindrop.colors_min = 1;
|
||||
Raindrop.colors_max = 1;
|
||||
Raindrop.colors.resize(1);
|
||||
Raindrop.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Raindrop);
|
||||
mode Raindrop;
|
||||
Raindrop.name = "Raindrop";
|
||||
Raindrop.value = CLEVO_KEYBOARD_MODE_RAINDROP;
|
||||
Raindrop.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Raindrop.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Raindrop.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Raindrop.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Raindrop.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Raindrop.brightness_max = controller->GetBrightnessMax();
|
||||
Raindrop.brightness = controller->GetBrightnessMax();
|
||||
Raindrop.colors_min = 1;
|
||||
Raindrop.colors_max = 1;
|
||||
Raindrop.colors.resize(1);
|
||||
Raindrop.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Raindrop);
|
||||
|
||||
mode Aurora;
|
||||
Aurora.name = "Aurora";
|
||||
Aurora.value = CLEVO_KEYBOARD_MODE_AURORA;
|
||||
Aurora.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Aurora.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Aurora.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Aurora.speed = 0x05;
|
||||
Aurora.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Aurora.brightness_max = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Aurora.brightness = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Aurora.colors_min = 1;
|
||||
Aurora.colors_max = 1;
|
||||
Aurora.colors.resize(1);
|
||||
Aurora.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Aurora);
|
||||
mode Aurora;
|
||||
Aurora.name = "Aurora";
|
||||
Aurora.value = CLEVO_KEYBOARD_MODE_AURORA;
|
||||
Aurora.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Aurora.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Aurora.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Aurora.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Aurora.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Aurora.brightness_max = controller->GetBrightnessMax();
|
||||
Aurora.brightness = controller->GetBrightnessMax();
|
||||
Aurora.colors_min = 1;
|
||||
Aurora.colors_max = 1;
|
||||
Aurora.colors.resize(1);
|
||||
Aurora.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Aurora);
|
||||
|
||||
mode Spark;
|
||||
Spark.name = "Spark";
|
||||
Spark.value = CLEVO_KEYBOARD_MODE_SPARK;
|
||||
Spark.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Spark.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Spark.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Spark.speed = 0x05;
|
||||
Spark.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Spark.brightness_max = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Spark.brightness = CLEVO_KEYBOARD_BRIGHTNESS_MAX;
|
||||
Spark.colors_min = 1;
|
||||
Spark.colors_max = 1;
|
||||
Spark.colors.resize(1);
|
||||
Spark.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Spark);
|
||||
mode Spark;
|
||||
Spark.name = "Spark";
|
||||
Spark.value = CLEVO_KEYBOARD_MODE_SPARK;
|
||||
Spark.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Spark.speed_min = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Spark.speed_max = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Spark.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Spark.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Spark.brightness_max = controller->GetBrightnessMax();
|
||||
Spark.brightness = controller->GetBrightnessMax();
|
||||
Spark.colors_min = 1;
|
||||
Spark.colors_max = 1;
|
||||
Spark.colors.resize(1);
|
||||
Spark.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Spark);
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| ITE 829x firmware effects |
|
||||
\*---------------------------------------------------------*/
|
||||
if(controller->GetType() == CLEVO_KB_ITE829X)
|
||||
{
|
||||
unsigned char bmax = controller->GetBrightnessMax();
|
||||
|
||||
mode Wave;
|
||||
Wave.name = "Wave";
|
||||
Wave.value = CLEVO_829X_MODE_WAVE;
|
||||
Wave.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_DIRECTION_DIAG;
|
||||
Wave.speed_min = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Wave.speed_max = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Wave.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Wave.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Wave.brightness_max = bmax;
|
||||
Wave.brightness = bmax;
|
||||
Wave.direction = MODE_DIRECTION_LEFT;
|
||||
Wave.colors_min = 1;
|
||||
Wave.colors_max = 1;
|
||||
Wave.colors.resize(1, ToRGBColor(255, 0, 0));
|
||||
Wave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Wave);
|
||||
|
||||
mode Breathing;
|
||||
Breathing.name = "Breathing";
|
||||
Breathing.value = CLEVO_829X_MODE_BREATH;
|
||||
Breathing.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
|
||||
Breathing.speed_min = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Breathing.speed_max = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Breathing.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Breathing.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Breathing.brightness_max = bmax;
|
||||
Breathing.brightness = bmax;
|
||||
Breathing.colors_min = 1;
|
||||
Breathing.colors_max = 1;
|
||||
Breathing.colors.resize(1, ToRGBColor(255, 0, 0));
|
||||
Breathing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Flashing;
|
||||
Flashing.name = "Flashing";
|
||||
Flashing.value = CLEVO_829X_MODE_BLINK;
|
||||
Flashing.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
|
||||
Flashing.speed_min = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Flashing.speed_max = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Flashing.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Flashing.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Flashing.brightness_max = bmax;
|
||||
Flashing.brightness = bmax;
|
||||
Flashing.colors_min = 1;
|
||||
Flashing.colors_max = 1;
|
||||
Flashing.colors.resize(1, ToRGBColor(255, 0, 0));
|
||||
Flashing.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Flashing);
|
||||
|
||||
mode Random;
|
||||
Random.name = "Random";
|
||||
Random.value = CLEVO_829X_MODE_RANDOM;
|
||||
Random.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR;
|
||||
Random.speed_min = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Random.speed_max = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Random.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Random.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Random.brightness_max = bmax;
|
||||
Random.brightness = bmax;
|
||||
Random.colors_min = 1;
|
||||
Random.colors_max = 1;
|
||||
Random.colors.resize(1, ToRGBColor(255, 0, 0));
|
||||
Random.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Random);
|
||||
|
||||
mode Scan;
|
||||
Scan.name = "Scan";
|
||||
Scan.value = CLEVO_829X_MODE_SCAN;
|
||||
Scan.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
Scan.speed_min = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Scan.speed_max = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Scan.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Scan.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Scan.brightness_max = bmax;
|
||||
Scan.brightness = bmax;
|
||||
Scan.colors_min = 2;
|
||||
Scan.colors_max = 2;
|
||||
Scan.colors.resize(2);
|
||||
Scan.colors[0] = ToRGBColor(255, 0, 0);
|
||||
Scan.colors[1] = ToRGBColor(0, 0, 255);
|
||||
Scan.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Scan);
|
||||
|
||||
mode Snake;
|
||||
Snake.name = "Snake";
|
||||
Snake.value = CLEVO_829X_MODE_SNAKE;
|
||||
Snake.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_DIRECTION_DIAG;
|
||||
Snake.speed_min = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
Snake.speed_max = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
Snake.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
Snake.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
Snake.brightness_max = bmax;
|
||||
Snake.brightness = bmax;
|
||||
Snake.direction = MODE_DIRECTION_UP_LEFT;
|
||||
Snake.colors_min = 1;
|
||||
Snake.colors_max = 1;
|
||||
Snake.colors.resize(1, ToRGBColor(255, 0, 0));
|
||||
Snake.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(Snake);
|
||||
|
||||
mode RainbowCycle;
|
||||
RainbowCycle.name = "Spectrum Cycle";
|
||||
RainbowCycle.value = CLEVO_829X_MODE_RAINBOW_CYCLE;
|
||||
RainbowCycle.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
RainbowCycle.speed_min = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
RainbowCycle.speed_max = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
RainbowCycle.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
RainbowCycle.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
RainbowCycle.brightness_max = bmax;
|
||||
RainbowCycle.brightness = bmax;
|
||||
RainbowCycle.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(RainbowCycle);
|
||||
|
||||
mode RainbowGrad;
|
||||
RainbowGrad.name = "Rainbow Wave";
|
||||
RainbowGrad.value = CLEVO_829X_MODE_RAINBOW_GRAD;
|
||||
RainbowGrad.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_DIRECTION_DIAG;
|
||||
RainbowGrad.speed_min = CLEVO_KEYBOARD_SPEED_MIN;
|
||||
RainbowGrad.speed_max = CLEVO_KEYBOARD_SPEED_MAX;
|
||||
RainbowGrad.speed = CLEVO_KEYBOARD_SPEED_DEFAULT;
|
||||
RainbowGrad.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
RainbowGrad.brightness_max = bmax;
|
||||
RainbowGrad.brightness = bmax;
|
||||
RainbowGrad.direction = MODE_DIRECTION_LEFT;
|
||||
RainbowGrad.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(RainbowGrad);
|
||||
|
||||
mode FnColor;
|
||||
FnColor.name = "Fn Highlight";
|
||||
FnColor.value = CLEVO_829X_MODE_FN_COLOR;
|
||||
FnColor.flags = MODE_FLAG_MANUAL_SAVE | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR;
|
||||
FnColor.brightness_min = CLEVO_KEYBOARD_BRIGHTNESS_MIN;
|
||||
FnColor.brightness_max = bmax;
|
||||
FnColor.brightness = bmax;
|
||||
FnColor.colors_min = 1;
|
||||
FnColor.colors_max = 1;
|
||||
FnColor.colors.resize(1, ToRGBColor(255, 0, 0));
|
||||
FnColor.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
modes.push_back(FnColor);
|
||||
}
|
||||
|
||||
mode Off;
|
||||
Off.name = "Off";
|
||||
@@ -207,16 +364,22 @@ RGBController_ClevoKeyboard::~RGBController_ClevoKeyboard()
|
||||
void RGBController_ClevoKeyboard::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Create keyboard layout using KeyboardLayoutManager |
|
||||
| Select layout based on device type |
|
||||
\*---------------------------------------------------------*/
|
||||
KeyboardLayoutManager new_kb(KEYBOARD_LAYOUT_ISO_QWERTY,
|
||||
clevo_keyboard_layout.base_size,
|
||||
clevo_keyboard_layout.key_values);
|
||||
bool is_829x = (controller->GetType() == CLEVO_KB_ITE829X);
|
||||
|
||||
new_kb.ChangeKeys(clevo_keyboard_layout);
|
||||
keyboard_keymap_overlay_values& layout = is_829x
|
||||
? clevo_829x_keyboard_layout
|
||||
: clevo_keyboard_layout;
|
||||
|
||||
KeyboardLayoutManager new_kb(KEYBOARD_LAYOUT_ISO_QWERTY,
|
||||
layout.base_size,
|
||||
layout.key_values);
|
||||
|
||||
new_kb.ChangeKeys(layout);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Create a matrix zone for the keyboard |
|
||||
| Create keyboard zone from KLM |
|
||||
\*---------------------------------------------------------*/
|
||||
zone keyboard_zone;
|
||||
|
||||
@@ -233,9 +396,6 @@ void RGBController_ClevoKeyboard::SetupZones()
|
||||
|
||||
zones.push_back(keyboard_zone);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Create LEDs from the KeyboardLayoutManager data |
|
||||
\*---------------------------------------------------------*/
|
||||
for(unsigned int led_idx = 0; led_idx < keyboard_zone.leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
@@ -249,36 +409,48 @@ void RGBController_ClevoKeyboard::SetupZones()
|
||||
SetupColors();
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Create buffer map to translate OpenRGB LED order to |
|
||||
| hardware LED order. The hardware expects 126 color values |
|
||||
| indexed by LED position (0-125). |
|
||||
| Build buffer map from LED values to color pointers |
|
||||
| 829x LED IDs have gaps (stride 32), need larger map |
|
||||
\*---------------------------------------------------------*/
|
||||
null_color = 0x00000000;
|
||||
buffer_map.resize(CLEVO_KEYBOARD_NUM_LEDS, &null_color);
|
||||
|
||||
size_t map_size = is_829x
|
||||
? CLEVO_829X_LED_ID(CLEVO_829X_NUM_ROWS - 1, CLEVO_829X_NUM_COLS - 1) + 1
|
||||
: (size_t)controller->GetNumLEDs();
|
||||
|
||||
buffer_map.resize(map_size, &null_color);
|
||||
|
||||
for(size_t led_idx = 0; led_idx < leds.size(); led_idx++)
|
||||
{
|
||||
buffer_map[leds[led_idx].value] = &colors[led_idx];
|
||||
if(leds[led_idx].value < buffer_map.size())
|
||||
{
|
||||
buffer_map[leds[led_idx].value] = &colors[led_idx];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_ClevoKeyboard::DeviceUpdateLEDs()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Build color data array using buffer map and send to device|
|
||||
| The buffer_map translates from hardware LED index to the |
|
||||
| corresponding color pointer for that LED. |
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char color_data[CLEVO_KEYBOARD_NUM_LEDS * 3];
|
||||
int num_rows = controller->GetNumRows();
|
||||
int num_cols = controller->GetNumCols();
|
||||
bool is_829x = (controller->GetType() == CLEVO_KB_ITE829X);
|
||||
|
||||
for(int i = 0; i < CLEVO_KEYBOARD_NUM_LEDS; i++)
|
||||
std::vector<unsigned char> color_data(num_rows * num_cols * 3);
|
||||
|
||||
for(int row = 0; row < num_rows; row++)
|
||||
{
|
||||
color_data[i * 3 + 0] = RGBGetRValue(*buffer_map[i]);
|
||||
color_data[i * 3 + 1] = RGBGetGValue(*buffer_map[i]);
|
||||
color_data[i * 3 + 2] = RGBGetBValue(*buffer_map[i]);
|
||||
for(int col = 0; col < num_cols; col++)
|
||||
{
|
||||
int seq = row * num_cols + col;
|
||||
int led_id = is_829x ? CLEVO_829X_LED_ID(row, col) : seq;
|
||||
|
||||
color_data[seq * 3 + 0] = RGBGetRValue(*buffer_map[led_id]);
|
||||
color_data[seq * 3 + 1] = RGBGetGValue(*buffer_map[led_id]);
|
||||
color_data[seq * 3 + 2] = RGBGetBValue(*buffer_map[led_id]);
|
||||
}
|
||||
}
|
||||
|
||||
controller->SendColors(color_data, modes[active_mode].brightness);
|
||||
controller->SendColors(color_data.data(), modes[active_mode].brightness, modes[active_mode].speed);
|
||||
}
|
||||
|
||||
void RGBController_ClevoKeyboard::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
@@ -304,6 +476,16 @@ void RGBController_ClevoKeyboard::DeviceUpdateMode()
|
||||
return;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Handle ITE 829x firmware effects |
|
||||
\*---------------------------------------------------------*/
|
||||
if(controller->GetType() == CLEVO_KB_ITE829X && mode_value != CLEVO_KEYBOARD_MODE_DIRECT)
|
||||
{
|
||||
controller->SetEffect829x(mode_value, modes[active_mode].colors, modes[active_mode].direction, modes[active_mode].color_mode);
|
||||
controller->SetBrightnessSpeed829x(modes[active_mode].brightness, modes[active_mode].speed);
|
||||
return;
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Handle Direct (per-key) mode |
|
||||
\*---------------------------------------------------------*/
|
||||
@@ -318,41 +500,26 @@ void RGBController_ClevoKeyboard::DeviceUpdateMode()
|
||||
\*---------------------------------------------------------*/
|
||||
unsigned char brightness = modes[active_mode].brightness;
|
||||
unsigned char speed = modes[active_mode].speed;
|
||||
unsigned char behaviour = 0x00;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set direction for wave mode |
|
||||
\*---------------------------------------------------------*/
|
||||
if(mode_value == CLEVO_KEYBOARD_MODE_WAVE)
|
||||
{
|
||||
switch(modes[active_mode].direction)
|
||||
{
|
||||
case MODE_DIRECTION_LEFT:
|
||||
behaviour = CLEVO_KEYBOARD_DIRECTION_LEFT;
|
||||
break;
|
||||
case MODE_DIRECTION_RIGHT:
|
||||
behaviour = CLEVO_KEYBOARD_DIRECTION_RIGHT;
|
||||
break;
|
||||
case MODE_DIRECTION_UP:
|
||||
behaviour = CLEVO_KEYBOARD_DIRECTION_UP;
|
||||
break;
|
||||
case MODE_DIRECTION_DOWN:
|
||||
behaviour = CLEVO_KEYBOARD_DIRECTION_DOWN;
|
||||
break;
|
||||
}
|
||||
}
|
||||
unsigned char behaviour = (mode_value == CLEVO_KEYBOARD_MODE_WAVE)
|
||||
? modes[active_mode].direction + 1
|
||||
: 0x00;
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set mode color if applicable |
|
||||
\*---------------------------------------------------------*/
|
||||
if(modes[active_mode].colors.size() > 0)
|
||||
{
|
||||
unsigned char red = RGBGetRValue(modes[active_mode].colors[0]);
|
||||
unsigned char green = RGBGetGValue(modes[active_mode].colors[0]);
|
||||
unsigned char blue = RGBGetBValue(modes[active_mode].colors[0]);
|
||||
|
||||
controller->SetModeColor(1, red, green, blue);
|
||||
controller->SetModeColor(1, modes[active_mode].colors[0]);
|
||||
}
|
||||
|
||||
controller->SetMode(mode_value, brightness, speed, behaviour);
|
||||
}
|
||||
|
||||
void RGBController_ClevoKeyboard::DeviceSaveMode()
|
||||
{
|
||||
if(controller->GetType() == CLEVO_KB_ITE829X)
|
||||
{
|
||||
DeviceUpdateMode();
|
||||
controller->SaveToBios829x();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_ClevoKeyboard.h |
|
||||
| |
|
||||
| RGBController for Clevo per-key RGB keyboard (ITE 8291) |
|
||||
| RGBController for Clevo per-key RGB keyboard |
|
||||
| Supports ITE 8291 (PID 0x600B) and ITE 829x (0x8910) |
|
||||
| |
|
||||
| Kyle Cascade ([email protected]) 16 Jan 2026 |
|
||||
| Valentin Lobstein ([email protected]) 27 Mar 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
@@ -18,7 +20,7 @@
|
||||
class RGBController_ClevoKeyboard : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_ClevoKeyboard(ClevoKeyboardController* controller_ptr);
|
||||
explicit RGBController_ClevoKeyboard(ClevoKeyboardController* controller_ptr);
|
||||
~RGBController_ClevoKeyboard();
|
||||
|
||||
void SetupZones();
|
||||
@@ -28,6 +30,7 @@ public:
|
||||
void DeviceUpdateSingleLED(int led);
|
||||
|
||||
void DeviceUpdateMode();
|
||||
void DeviceSaveMode();
|
||||
|
||||
private:
|
||||
ClevoKeyboardController* controller;
|
||||
|
||||
@@ -26,7 +26,7 @@ ColorfulGPUController::~ColorfulGPUController()
|
||||
|
||||
std::string ColorfulGPUController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->device_name);
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
@@ -45,7 +45,8 @@ void ColorfulGPUController::SetDirect(RGBColor color)
|
||||
uint8_t g = RGBGetGValue(color);
|
||||
uint8_t b = RGBGetBValue(color);
|
||||
|
||||
if(this->bus->pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV)
|
||||
if(this->bus->info.pci_subsystem_device == COLORFUL_IGAME_RTX_4070_VULCAN_OCV
|
||||
|| this->bus->info.pci_subsystem_device == COLORFUL_IGAME_RTX_4090_NEPTUNE_OCV)
|
||||
{
|
||||
uint8_t data_pkt[COLORFUL_PACKET_LENGTH_V2] = { 0xAA, 0xEF, 0x01, 0x04, 0x88, 0x26 };
|
||||
for(int i=6; i < COLORFUL_PACKET_LENGTH_V2 -2; i = i + 3)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*---------------------------------------------------------*\
|
||||
/*---------------------------------------------------------*\
|
||||
| ColorfulGPUControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Colorful GPU |
|
||||
@@ -51,8 +51,9 @@ DetectedControllers DetectColorfulGPUControllers(i2c_smbus_interface* bus, uint8
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Advanced OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ADVANCED_OC_12G_LV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_GA106_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_GA106_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ultra W OC 12G L-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Ultra W OC LHR-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060_ULTRAW_OC_12G_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3070_ADVANCED_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 3060 Ti Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX3060TI_LHR_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_3060TI_ADVANCED_OC, 0x61);
|
||||
@@ -71,8 +72,17 @@ REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4070 Ti SUPER Advanced OC-V", Detec
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4070 Ti SUPER Ultra W", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070TIS_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4070TI_SUPER_ULTRA_W, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4070 SUPER Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070S_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4070_SUPER_ULTRA_W_OC, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4070 Vulcan OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4070_VULCAN_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4070_ULTRAW_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4070 SUPER Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4070S_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4070S_ULTRAW_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4080 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4080_ULTRAW_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4080 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4080_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4080_ULTRAW_OCV2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Neptune OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_NEPTUNE_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_ADVANCED_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 4090 Advanced OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX4090_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_4090_ADVANCED_OCV2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060_ULTRAW_OC, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060_ULTRAW_OC_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5060 Ti Ultra W DUO OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5060TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5060TI_ULTRAW_DUO_OC_2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070_ULTRAW_OCV, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ultra W OC-V", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070_ULTRAW_OCV2, 0x61);
|
||||
REGISTER_I2C_PCI_DETECTOR("iGame GeForce RTX 5070 Ti Ultra W OC", DetectColorfulGPUControllers, NVIDIA_VEN, NVIDIA_RTX5070TI_DEV, COLORFUL_SUB_VEN, COLORFUL_IGAME_RTX_5070TI_ULTRAW_OC, 0x61);
|
||||
@@ -24,7 +24,7 @@ ColorfulTuringGPUController::~ColorfulTuringGPUController()
|
||||
|
||||
std::string ColorfulTuringGPUController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->device_name);
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
|
||||
@@ -17,7 +17,7 @@ DetectedControllers DetectColorfulTuringGPUControllers(i2c_smbus_interface* bus,
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
if(bus->port_id == 1)
|
||||
if(bus->info.port_id == 1)
|
||||
{
|
||||
ColorfulTuringGPUController* controller = new ColorfulTuringGPUController(bus, i2c_addr, name);
|
||||
RGBController_ColorfulTuringGPU* rgb_controller = new RGBController_ColorfulTuringGPU(controller);
|
||||
|
||||
+2
-1
@@ -406,7 +406,8 @@ void RGBController_CMARGBController::SetupZones()
|
||||
zones[channel_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
}
|
||||
|
||||
if(!(zones[channel_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
@@ -13,11 +13,6 @@
|
||||
#include "CMSmallARGBController.h"
|
||||
#include "StringUtils.h"
|
||||
|
||||
cm_small_argb_headers cm_small_argb_header_data[1] =
|
||||
{
|
||||
{ "CM Small ARGB", 0x01, true, 12 }
|
||||
};
|
||||
|
||||
CMSmallARGBController::CMSmallARGBController(hid_device* dev_handle, char *_path)
|
||||
{
|
||||
dev = dev_handle;
|
||||
@@ -92,6 +87,24 @@ std::string CMSmallARGBController::GetSerial()
|
||||
return(StringUtils::wstring_to_string(serial_string));
|
||||
}
|
||||
|
||||
std::string CMSmallARGBController::GetVersion()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| This device uses the serial value to determine the |
|
||||
| version. It does not report a proper unique serial. |
|
||||
\*-----------------------------------------------------*/
|
||||
std::string serial_string = GetSerial();
|
||||
|
||||
if(serial_string == CM_SMALL_ARGB_FW0012)
|
||||
{
|
||||
return("0012");
|
||||
}
|
||||
else
|
||||
{
|
||||
return("Unsupported");
|
||||
}
|
||||
}
|
||||
|
||||
std::string CMSmallARGBController::GetLocation()
|
||||
{
|
||||
return("HID: " + location);
|
||||
@@ -122,6 +135,11 @@ unsigned char CMSmallARGBController::GetLedSpeed()
|
||||
return(current_speed);
|
||||
}
|
||||
|
||||
unsigned char CMSmallARGBController::GetBrightness()
|
||||
{
|
||||
return(current_brightness);
|
||||
}
|
||||
|
||||
bool CMSmallARGBController::GetRandomColours()
|
||||
{
|
||||
return(bool_random);
|
||||
@@ -217,9 +235,9 @@ void CMSmallARGBController::SendUpdate()
|
||||
|
||||
hid_write(dev, buffer, buffer_size);
|
||||
|
||||
buffer[CM_SMALL_ARGB_COMMAND_BYTE] = 0x0b;
|
||||
buffer[CM_SMALL_ARGB_FUNCTION_BYTE] = (false) ? 0x01 : 0x02; //This controls custom mode TODO
|
||||
buffer[CM_SMALL_ARGB_ZONE_BYTE] = cm_small_argb_header_data[0].header;
|
||||
buffer[CM_SMALL_ARGB_COMMAND_BYTE] = 0x0B;
|
||||
buffer[CM_SMALL_ARGB_FUNCTION_BYTE] = 0x02;
|
||||
buffer[CM_SMALL_ARGB_ZONE_BYTE] = 0x01;
|
||||
buffer[CM_SMALL_ARGB_MODE_BYTE] = current_mode;
|
||||
buffer[CM_SMALL_ARGB_SPEED_BYTE] = current_speed;
|
||||
buffer[CM_SMALL_ARGB_COLOUR_INDEX_BYTE] = (bool_random) ? 0x00 : 0x10; //This looks to still be the colour index and controls random colours
|
||||
|
||||
@@ -39,16 +39,6 @@ enum
|
||||
CM_SMALL_ARGB_BLUE_BYTE = 11,
|
||||
};
|
||||
|
||||
struct cm_small_argb_headers
|
||||
{
|
||||
const char* name;
|
||||
unsigned char header;
|
||||
bool digital;
|
||||
unsigned int count;
|
||||
};
|
||||
|
||||
extern cm_small_argb_headers cm_small_argb_header_data[1];
|
||||
|
||||
enum
|
||||
{
|
||||
CM_SMALL_ARGB_MODE_SPECTRUM = 0x01, //Spectrum Mode
|
||||
@@ -71,6 +61,8 @@ enum
|
||||
CM_SMALL_ARGB_SPEED_FASTEST = 0x04, // Fastest speed
|
||||
};
|
||||
|
||||
#define CM_SMALL_ARGB_FW0012 std::string("A202104052336")
|
||||
|
||||
class CMSmallARGBController
|
||||
{
|
||||
public:
|
||||
@@ -80,12 +72,14 @@ public:
|
||||
std::string GetDeviceName();
|
||||
std::string GetSerial();
|
||||
std::string GetLocation();
|
||||
std::string GetVersion();
|
||||
|
||||
unsigned char GetMode();
|
||||
unsigned char GetLedRed();
|
||||
unsigned char GetLedGreen();
|
||||
unsigned char GetLedBlue();
|
||||
unsigned char GetLedSpeed();
|
||||
unsigned char GetBrightness();
|
||||
bool GetRandomColours();
|
||||
|
||||
void SetLedCount(int zone, int led_count);
|
||||
|
||||
+123
-52
@@ -27,22 +27,68 @@
|
||||
RGBController_CMSmallARGBController::RGBController_CMSmallARGBController(CMSmallARGBController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
unsigned char speed = controller->GetLedSpeed();
|
||||
|
||||
name = cm_small_argb_header_data[0].name;
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Cooler Master";
|
||||
type = DEVICE_TYPE_LEDSTRIP;
|
||||
description = controller->GetDeviceName();
|
||||
version = "2.0 for FW0012";
|
||||
description = "Cooler Master Small ARGB Controller Device";
|
||||
version = controller->GetVersion();
|
||||
serial = controller->GetSerial();
|
||||
location = controller->GetLocation();
|
||||
|
||||
if(serial >= CM_SMALL_ARGB_FW0012)
|
||||
SetupModes();
|
||||
SetupZones();
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Initialize the active mode to the device's current |
|
||||
| mode |
|
||||
\*-----------------------------------------------------*/
|
||||
int device_mode = controller->GetMode();
|
||||
|
||||
for(std::size_t mode_idx = 0; mode_idx < modes.size(); mode_idx++)
|
||||
{
|
||||
if(modes[mode_idx].value == device_mode)
|
||||
{
|
||||
active_mode = (int)mode_idx;
|
||||
|
||||
if((modes[mode_idx].flags & MODE_FLAG_HAS_MODE_SPECIFIC_COLOR) && (modes[mode_idx].colors.size() > 0))
|
||||
{
|
||||
modes[mode_idx].colors[0] = ToRGBColor(controller->GetLedRed(), controller->GetLedGreen(), controller->GetLedBlue());
|
||||
}
|
||||
|
||||
if(modes[mode_idx].flags & MODE_FLAG_HAS_SPEED)
|
||||
{
|
||||
modes[mode_idx].speed = controller->GetLedSpeed();
|
||||
}
|
||||
|
||||
if(modes[mode_idx].flags & MODE_FLAG_HAS_BRIGHTNESS)
|
||||
{
|
||||
modes[mode_idx].brightness = controller->GetBrightness();
|
||||
}
|
||||
|
||||
if(modes[mode_idx].flags & MODE_FLAG_HAS_RANDOM_COLOR)
|
||||
{
|
||||
modes[mode_idx].color_mode = controller->GetRandomColours() ? MODE_COLORS_RANDOM : MODE_COLORS_MODE_SPECIFIC;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_CMSmallARGBController::SetupModes()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| The Small ARGB only supports Direct mode from FW0012 |
|
||||
| onwards, older firmware does not accept direct mode |
|
||||
| packets |
|
||||
\*-----------------------------------------------------*/
|
||||
//if(serial >= CM_SMALL_ARGB_FW0012)
|
||||
{
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = CM_SMALL_ARGB_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_REQUIRES_ENTIRE_DEVICE;
|
||||
Direct.brightness_min = 0;
|
||||
Direct.brightness_max = CM_SMALL_ARGB_BRIGHTNESS_MAX;
|
||||
Direct.brightness = CM_SMALL_ARGB_BRIGHTNESS_MAX;
|
||||
@@ -69,7 +115,7 @@ RGBController_CMSmallARGBController::RGBController_CMSmallARGBController(CMSmall
|
||||
Reload.speed_min = CM_SMALL_ARGB_SPEED_SLOWEST;
|
||||
Reload.speed_max = CM_SMALL_ARGB_SPEED_FASTEST;
|
||||
Reload.color_mode = MODE_COLORS_RANDOM;
|
||||
Reload.speed = speed;
|
||||
Reload.speed = CM_SMALL_ARGB_SPEED_NORMAL;
|
||||
modes.push_back(Reload);
|
||||
|
||||
mode Recoil;
|
||||
@@ -85,7 +131,7 @@ RGBController_CMSmallARGBController::RGBController_CMSmallARGBController(CMSmall
|
||||
Recoil.speed_min = CM_SMALL_ARGB_SPEED_SLOWEST;
|
||||
Recoil.speed_max = CM_SMALL_ARGB_SPEED_FASTEST;
|
||||
Recoil.color_mode = MODE_COLORS_RANDOM;
|
||||
Recoil.speed = speed;
|
||||
Recoil.speed = CM_SMALL_ARGB_SPEED_NORMAL;
|
||||
modes.push_back(Recoil);
|
||||
|
||||
mode Breathing;
|
||||
@@ -101,7 +147,7 @@ RGBController_CMSmallARGBController::RGBController_CMSmallARGBController(CMSmall
|
||||
Breathing.speed_min = CM_SMALL_ARGB_SPEED_SLOWEST;
|
||||
Breathing.speed_max = CM_SMALL_ARGB_SPEED_FASTEST;
|
||||
Breathing.color_mode = MODE_COLORS_RANDOM;
|
||||
Breathing.speed = speed;
|
||||
Breathing.speed = CM_SMALL_ARGB_SPEED_NORMAL;
|
||||
modes.push_back(Breathing);
|
||||
|
||||
mode Refill;
|
||||
@@ -117,7 +163,7 @@ RGBController_CMSmallARGBController::RGBController_CMSmallARGBController(CMSmall
|
||||
Refill.speed_min = CM_SMALL_ARGB_SPEED_SLOWEST;
|
||||
Refill.speed_max = CM_SMALL_ARGB_SPEED_FASTEST;
|
||||
Refill.color_mode = MODE_COLORS_RANDOM;
|
||||
Refill.speed = speed;
|
||||
Refill.speed = CM_SMALL_ARGB_SPEED_NORMAL;
|
||||
modes.push_back(Refill);
|
||||
|
||||
mode Demo;
|
||||
@@ -130,7 +176,7 @@ RGBController_CMSmallARGBController::RGBController_CMSmallARGBController(CMSmall
|
||||
Demo.speed_min = CM_SMALL_ARGB_SPEED_SLOWEST;
|
||||
Demo.speed_max = CM_SMALL_ARGB_SPEED_FASTEST;
|
||||
Demo.color_mode = MODE_COLORS_NONE;
|
||||
Demo.speed = speed;
|
||||
Demo.speed = CM_SMALL_ARGB_SPEED_NORMAL;
|
||||
modes.push_back(Demo);
|
||||
|
||||
mode Spectrum;
|
||||
@@ -143,39 +189,19 @@ RGBController_CMSmallARGBController::RGBController_CMSmallARGBController(CMSmall
|
||||
Spectrum.speed_min = CM_SMALL_ARGB_SPEED_SLOWEST;
|
||||
Spectrum.speed_max = CM_SMALL_ARGB_SPEED_FASTEST;
|
||||
Spectrum.color_mode = MODE_COLORS_NONE;
|
||||
Spectrum.speed = speed;
|
||||
Spectrum.speed = CM_SMALL_ARGB_SPEED_NORMAL;
|
||||
modes.push_back(Spectrum);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Define Passthrough mode as requiring the entire |
|
||||
| device, it hands control over to the motherboard |
|
||||
\*-----------------------------------------------------*/
|
||||
mode PassThru;
|
||||
PassThru.name = "Pass Thru";
|
||||
PassThru.value = CM_SMALL_ARGB_MODE_PASSTHRU;
|
||||
PassThru.flags = MODE_FLAG_REQUIRES_ENTIRE_DEVICE;
|
||||
PassThru.color_mode = MODE_COLORS_NONE;
|
||||
modes.push_back(PassThru);
|
||||
|
||||
SetupZones();
|
||||
|
||||
int temp_mode = controller->GetMode();
|
||||
|
||||
for(int mode_idx = 0; mode_idx < (int)modes.size() ; mode_idx++)
|
||||
{
|
||||
if(temp_mode == modes[mode_idx].value)
|
||||
{
|
||||
active_mode = mode_idx;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (modes[active_mode].flags & MODE_FLAG_HAS_MODE_SPECIFIC_COLOR)
|
||||
{
|
||||
modes[active_mode].colors[0] = ToRGBColor(controller->GetLedRed(), controller->GetLedGreen(), controller->GetLedBlue());
|
||||
}
|
||||
|
||||
modes[active_mode].color_mode = (controller->GetRandomColours()) ? MODE_COLORS_RANDOM : MODE_COLORS_MODE_SPECIFIC;
|
||||
|
||||
if (modes[active_mode].flags & MODE_FLAG_HAS_SPEED)
|
||||
{
|
||||
modes[active_mode].speed = controller->GetLedSpeed();
|
||||
}
|
||||
}
|
||||
|
||||
RGBController_CMSmallARGBController::~RGBController_CMSmallARGBController()
|
||||
@@ -217,7 +243,8 @@ void RGBController_CMSmallARGBController::SetupZones()
|
||||
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
}
|
||||
|
||||
if(!(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
@@ -247,7 +274,9 @@ void RGBController_CMSmallARGBController::SetupZones()
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = zones[zone_idx].name;
|
||||
new_led.name.append(", LED " + std::to_string(lp_idx));
|
||||
new_led.name.append(", LED ");
|
||||
new_led.name.append(std::to_string(lp_idx + 1));
|
||||
new_led.value = (unsigned int)zone_idx;
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
@@ -260,7 +289,7 @@ void RGBController_CMSmallARGBController::DeviceConfigureZone(int zone_idx)
|
||||
{
|
||||
if((size_t)zone_idx < zones.size())
|
||||
{
|
||||
controller->SetLedCount(cm_small_argb_header_data[zone_idx].header, zones[zone_idx].leds_count);
|
||||
controller->SetLedCount(1, zones[zone_idx].leds_count);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
@@ -276,37 +305,79 @@ void RGBController_CMSmallARGBController::DeviceUpdateLEDs()
|
||||
|
||||
void RGBController_CMSmallARGBController::DeviceUpdateZoneLEDs(int zone)
|
||||
{
|
||||
if(serial >= CM_SMALL_ARGB_FW0012)
|
||||
/*-----------------------------------------------------*\
|
||||
| Only send direct packets while Direct mode is active. |
|
||||
| Direct mode is only offered on FW0012 and newer, so |
|
||||
| older firmware will never send direct packets here |
|
||||
\*-----------------------------------------------------*/
|
||||
if(modes[active_mode].value != CM_SMALL_ARGB_MODE_DIRECT)
|
||||
{
|
||||
controller->SetLedsDirect( zones[zone].colors, zones[zone].leds_count );
|
||||
return;
|
||||
}
|
||||
|
||||
controller->SetLedsDirect(zones[zone].colors, zones[zone].leds_count);
|
||||
}
|
||||
|
||||
void RGBController_CMSmallARGBController::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
DeviceUpdateZoneLEDs(led);
|
||||
/*-----------------------------------------------------*\
|
||||
| Map the LED back to its zone and update that zone |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned int zone_idx = leds[led].value;
|
||||
|
||||
UpdateZoneLEDs(zone_idx);
|
||||
}
|
||||
|
||||
void RGBController_CMSmallARGBController::SetCustomMode()
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| The small ARGB may not support "Direct" mode |
|
||||
| in which case this will select "Pass Thru" |
|
||||
\*-------------------------------------------------*/
|
||||
/*-----------------------------------------------------*\
|
||||
| Direct mode is only supported on FW0012 and newer |
|
||||
\*-----------------------------------------------------*/
|
||||
if(serial >= CM_SMALL_ARGB_FW0012)
|
||||
{
|
||||
active_mode = 0;
|
||||
/*-------------------------------------------------*\
|
||||
| Search the mode list for Direct mode |
|
||||
\*-------------------------------------------------*/
|
||||
for(std::size_t mode_idx = 0; mode_idx < modes.size(); mode_idx++)
|
||||
{
|
||||
if(modes[mode_idx].name == "Direct")
|
||||
{
|
||||
SetActiveMode((int)mode_idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
active_mode = 7;
|
||||
/*-------------------------------------------------*\
|
||||
| Direct mode is unsupported by the firmware, |
|
||||
| fall back to Pass Thru |
|
||||
\*-------------------------------------------------*/
|
||||
for(std::size_t mode_idx = 0; mode_idx < modes.size(); mode_idx++)
|
||||
{
|
||||
if(modes[mode_idx].value == CM_SMALL_ARGB_MODE_PASSTHRU)
|
||||
{
|
||||
SetActiveMode((int)mode_idx);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void RGBController_CMSmallARGBController::DeviceUpdateMode()
|
||||
{
|
||||
bool random_colours = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
|
||||
RGBColor colour = (modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC) ? modes[active_mode].colors[0] : 0;
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up mode parameters |
|
||||
\*-----------------------------------------------------*/
|
||||
bool random_colours = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
|
||||
RGBColor colour = 0;
|
||||
unsigned int speed = modes[active_mode].speed;
|
||||
unsigned int brightness = modes[active_mode].brightness;
|
||||
|
||||
controller->SetMode( modes[active_mode].value, modes[active_mode].speed, modes[active_mode].brightness, colour, random_colours);
|
||||
if(modes[active_mode].colors.size() > 0)
|
||||
{
|
||||
colour = modes[active_mode].colors[0];
|
||||
}
|
||||
|
||||
controller->SetMode(modes[active_mode].value, speed, brightness, colour, random_colours);
|
||||
}
|
||||
|
||||
+3
-4
@@ -18,7 +18,6 @@
|
||||
#define CM_SMALL_ARGB_MIN_LEDS 4
|
||||
#define CM_SMALL_ARGB_MAX_LEDS 48
|
||||
#define CM_SMALL_ARGB_BRIGHTNESS_MAX 0xFF
|
||||
#define CM_SMALL_ARGB_FW0012 "A202104052336"
|
||||
|
||||
class RGBController_CMSmallARGBController : public RGBController
|
||||
{
|
||||
@@ -26,7 +25,9 @@ public:
|
||||
RGBController_CMSmallARGBController(CMSmallARGBController* controller_ptr);
|
||||
~RGBController_CMSmallARGBController();
|
||||
|
||||
void SetupModes();
|
||||
void SetupZones();
|
||||
|
||||
void DeviceConfigureZone(int zone_idx);
|
||||
|
||||
void DeviceUpdateLEDs();
|
||||
@@ -35,9 +36,7 @@ public:
|
||||
|
||||
void SetCustomMode();
|
||||
void DeviceUpdateMode();
|
||||
private:
|
||||
void Init_Controller();
|
||||
int GetDeviceMode();
|
||||
|
||||
private:
|
||||
CMSmallARGBController* controller;
|
||||
};
|
||||
|
||||
@@ -327,9 +327,18 @@ DetectedControllers DetectCoolerMasterSmallARGB(hid_device_info* info, const std
|
||||
if(dev)
|
||||
{
|
||||
CMSmallARGBController* controller = new CMSmallARGBController(dev, info->path);
|
||||
RGBController_CMSmallARGBController* rgb_controller = new RGBController_CMSmallARGBController(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
if(controller->GetVersion() != "Unsupported")
|
||||
{
|
||||
RGBController_CMSmallARGBController* rgb_controller = new RGBController_CMSmallARGBController(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_ERROR("[CMSmallARGBController] Unsupported firmware version");
|
||||
delete controller;
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
|
||||
@@ -340,7 +340,6 @@ void CorsairCommanderCoreController::SetDirectColor
|
||||
lastzones = zones;
|
||||
int packet_offset = 0;
|
||||
int led_idx = 0;
|
||||
int channel_idx = 0;
|
||||
int packet_len = CORSAIR_COMMANDER_CORE_RGB_DATA_LENGTH;
|
||||
|
||||
if(pid == CORSAIR_COMMANDER_CORE_XT_PID)
|
||||
@@ -369,8 +368,6 @@ void CorsairCommanderCoreController::SetDirectColor
|
||||
{
|
||||
packet_offset += 3 * (34 - zones[zone_idx].leds_count);
|
||||
}
|
||||
|
||||
channel_idx++;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
|
||||
@@ -111,7 +111,8 @@ void RGBController_CorsairCommanderCore::SetupZones()
|
||||
zones[0].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
}
|
||||
|
||||
if(!(zones[0].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
@@ -164,7 +165,8 @@ void RGBController_CorsairCommanderCore::SetupZones()
|
||||
zones[zone_idx].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
}
|
||||
|
||||
if(!(zones[zone_idx].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
@@ -0,0 +1,487 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDRAMController.cpp |
|
||||
| |
|
||||
| Driver for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "CRC.h"
|
||||
#include "CorsairDRAMController.h"
|
||||
#include "LogManager.h"
|
||||
|
||||
#define CORSAIR_DRAM_NAME "Corsair DRAM"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
CorsairDRAMController::CorsairDRAMController(i2c_smbus_interface *bus, corsair_dev_id dev)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Initialize class variables |
|
||||
\*-----------------------------------------------------*/
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
device_index = 0;
|
||||
direct_mode = true;
|
||||
pid = 0;
|
||||
vid = 0;
|
||||
protocol_version = 0;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Read device information |
|
||||
\*-----------------------------------------------------*/
|
||||
ReadDeviceInfo();
|
||||
}
|
||||
|
||||
CorsairDRAMController::~CorsairDRAMController()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int CorsairDRAMController::GetLEDCount()
|
||||
{
|
||||
return(corsair_dram_device_list[device_index]->led_count);
|
||||
}
|
||||
|
||||
unsigned char CorsairDRAMController::GetProtocolVersion()
|
||||
{
|
||||
return(protocol_version);
|
||||
}
|
||||
|
||||
std::string CorsairDRAMController::GetDeviceLocation()
|
||||
{
|
||||
std::string return_string(bus->info.device_name);
|
||||
char addr[5];
|
||||
snprintf(addr, 5, "0x%02X", dev);
|
||||
return_string.append(", address ");
|
||||
return_string.append(addr);
|
||||
return("I2C: " + return_string);
|
||||
}
|
||||
|
||||
std::string CorsairDRAMController::GetDeviceName()
|
||||
{
|
||||
return(corsair_dram_device_list[device_index]->name);
|
||||
}
|
||||
|
||||
std::string CorsairDRAMController::GetDeviceVersion()
|
||||
{
|
||||
return(firmware_version);
|
||||
}
|
||||
|
||||
void CorsairDRAMController::SetColorsPerLED(RGBColor* colors)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Get LED count from device list |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned int led_count = corsair_dram_device_list[device_index]->led_count;
|
||||
|
||||
if(direct_mode)
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Sanity check - Direct mode can only be used on |
|
||||
| protocol 4+ |
|
||||
\*-------------------------------------------------*/
|
||||
if(protocol_version < 4)
|
||||
{
|
||||
LOG_ERROR("[%s] Protocol version %d tried to use direct mode, ignoring", CORSAIR_DRAM_NAME, protocol_version);
|
||||
return;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Packet format: |
|
||||
| Size n is (LED count * 3) + 2 |
|
||||
| 0: Command byte (0x0A or 0x0C) |
|
||||
| 1 to (n-2): LED color data in R/G/B order |
|
||||
| (n-1): CRC8 of bytes 0 to (n-2) |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned int direct_packet_size = (led_count * 3) + 2;
|
||||
unsigned char* direct_packet = new unsigned char[direct_packet_size];
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| First byte in packet is LED count |
|
||||
\*-------------------------------------------------*/
|
||||
direct_packet[0] = led_count;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Fill in LED data |
|
||||
\*-------------------------------------------------*/
|
||||
for(unsigned int led_idx = 0; led_idx < led_count; led_idx++)
|
||||
{
|
||||
unsigned int color_index = led_idx;
|
||||
unsigned int offset = (led_idx * 3) + 1;
|
||||
|
||||
if(corsair_dram_device_list[device_index]->reverse)
|
||||
{
|
||||
color_index = (led_count -1) - led_idx;
|
||||
}
|
||||
|
||||
direct_packet[offset + 0] = RGBGetRValue(colors[color_index]);
|
||||
direct_packet[offset + 1] = RGBGetGValue(colors[color_index]);
|
||||
direct_packet[offset + 2] = RGBGetBValue(colors[color_index]);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Last byte in packet is CRC of all data up to it |
|
||||
\*-------------------------------------------------*/
|
||||
direct_packet[direct_packet_size - 1] = CRCPP::CRC::Calculate(direct_packet, (direct_packet_size - 1), CRCPP::CRC::CRC_8());
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Write using block writes, if packet exceeds 32 |
|
||||
| bytes, use a second block write to the second |
|
||||
| block write address for the remaining data |
|
||||
\*-------------------------------------------------*/
|
||||
s32 ret = bus->i2c_smbus_write_block_data(dev, CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_1, 32, direct_packet);
|
||||
|
||||
if((ret >= 0) && (direct_packet_size > 32))
|
||||
{
|
||||
bus->i2c_smbus_write_block_data(dev, CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_2, direct_packet_size - 32, direct_packet + 32);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Corsair DRAM supports an alternate means of |
|
||||
| writing block data without using SMBus block |
|
||||
| operations. If block operations are not |
|
||||
| available, fall back to this scheme. |
|
||||
| |
|
||||
| Blocks are split up into word data writes. |
|
||||
| Some data bytes are packed into the lower nibble |
|
||||
| of the register address byte. |
|
||||
\*-------------------------------------------------*/
|
||||
if(ret < 0)
|
||||
{
|
||||
unsigned int block_index = 0;
|
||||
|
||||
while(block_index < direct_packet_size)
|
||||
{
|
||||
unsigned char reg_value_0 = 0xA0;
|
||||
unsigned char reg_value_1 = 0x00;
|
||||
unsigned short word_value_0 = 0;
|
||||
unsigned short word_value_1 = 0;
|
||||
|
||||
if(block_index == 0)
|
||||
{
|
||||
reg_value_0 = 0x90;
|
||||
}
|
||||
|
||||
word_value_0 = (direct_packet[block_index]);
|
||||
block_index++;
|
||||
|
||||
if(block_index < direct_packet_size)
|
||||
{
|
||||
word_value_0 |= (direct_packet[block_index] << 8);
|
||||
block_index++;
|
||||
}
|
||||
|
||||
if(block_index < direct_packet_size)
|
||||
{
|
||||
reg_value_1 = 0xA0;
|
||||
reg_value_0 |= (direct_packet[block_index] & 0x0F);
|
||||
reg_value_1 |= (direct_packet[block_index] & 0xF0) >> 4;
|
||||
block_index++;
|
||||
}
|
||||
|
||||
if(block_index < direct_packet_size)
|
||||
{
|
||||
word_value_1 = (direct_packet[block_index]);
|
||||
block_index++;
|
||||
}
|
||||
|
||||
if(block_index < direct_packet_size)
|
||||
{
|
||||
word_value_1 |= (direct_packet[block_index] << 8);
|
||||
block_index++;
|
||||
}
|
||||
|
||||
bus->i2c_smbus_write_word_data(dev, reg_value_0, word_value_0);
|
||||
|
||||
if(reg_value_1 > 0)
|
||||
{
|
||||
bus->i2c_smbus_write_word_data(dev, reg_value_1, word_value_1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Remember to delete the data buffer |
|
||||
\*-------------------------------------------------*/
|
||||
delete[] direct_packet;
|
||||
}
|
||||
else
|
||||
{
|
||||
/*-------------------------------------------------*\
|
||||
| Local variables |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned char device_crc;
|
||||
unsigned char calc_crc;
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Packet format: |
|
||||
| Size n is (LED count * 4) |
|
||||
| Format is 0xRR, 0xGG, 0xBB, 0xFF for each LED |
|
||||
\*-------------------------------------------------*/
|
||||
unsigned int color_data_size = (led_count * 4);
|
||||
unsigned char* color_data_packet = new unsigned char[color_data_size];
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < led_count; led_idx++)
|
||||
{
|
||||
unsigned int color_index = led_idx;
|
||||
|
||||
if(corsair_dram_device_list[device_index]->reverse)
|
||||
{
|
||||
color_index = (led_count -1) - led_idx;
|
||||
}
|
||||
|
||||
color_data_packet[(led_idx * 4) + 0] = RGBGetRValue(colors[color_index]);
|
||||
color_data_packet[(led_idx * 4) + 1] = RGBGetGValue(colors[color_index]);
|
||||
color_data_packet[(led_idx * 4) + 2] = RGBGetBValue(colors[color_index]);
|
||||
color_data_packet[(led_idx * 4) + 3] = 0xFF;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Write LED color data packet |
|
||||
\*-------------------------------------------------*/
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_RESET_BUFFER, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_BINARY_START, 0x00);
|
||||
|
||||
for(unsigned int i = 0; i < color_data_size; i++)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_SET_BINARY_DATA, color_data_packet[i]);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Calculate CRC and read CRC reported by device |
|
||||
\*-------------------------------------------------*/
|
||||
calc_crc = CRCPP::CRC::Calculate(color_data_packet, color_data_size, CRCPP::CRC::CRC_8());
|
||||
device_crc = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_CHECKSUM);
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Write effect configuration only if CRCs match |
|
||||
\*-------------------------------------------------*/
|
||||
if(calc_crc == device_crc)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_WRITE_CONFIGURATION, CORSAIR_DRAM_ID_COLOR_DATA);
|
||||
WaitReady();
|
||||
}
|
||||
|
||||
/*-------------------------------------------------*\
|
||||
| Remember to delete the data buffer |
|
||||
\*-------------------------------------------------*/
|
||||
delete[] color_data_packet;
|
||||
}
|
||||
}
|
||||
|
||||
void CorsairDRAMController::SetDirect(bool direct)
|
||||
{
|
||||
direct_mode = direct;
|
||||
}
|
||||
|
||||
void CorsairDRAMController::SetEffect
|
||||
(
|
||||
unsigned char mode,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
bool random,
|
||||
unsigned char brightness,
|
||||
unsigned char red1,
|
||||
unsigned char grn1,
|
||||
unsigned char blu1,
|
||||
unsigned char red2,
|
||||
unsigned char grn2,
|
||||
unsigned char blu2
|
||||
)
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Local variables |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned char effect_data[20];
|
||||
unsigned char device_crc;
|
||||
unsigned char calc_crc;
|
||||
unsigned char random_byte;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| If mode is direct (which is a dummy value not |
|
||||
| understood by the hardware), return. Direct mode is |
|
||||
| not set in the effect configuration. |
|
||||
\*-----------------------------------------------------*/
|
||||
direct_mode = (mode == CORSAIR_DRAM_MODE_DIRECT);
|
||||
|
||||
if(direct_mode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Determine random byte |
|
||||
\*-----------------------------------------------------*/
|
||||
if(random)
|
||||
{
|
||||
random_byte = CORSAIR_DRAM_EFFECT_RANDOM_COLORS;
|
||||
}
|
||||
else
|
||||
{
|
||||
random_byte = CORSAIR_DRAM_EFFECT_CUSTOM_COLORS;
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Fill in effect packet |
|
||||
\*-----------------------------------------------------*/
|
||||
effect_data[0] = mode; // Mode
|
||||
effect_data[1] = speed; // Speed
|
||||
effect_data[2] = random_byte; // Custom color
|
||||
effect_data[3] = direction; // Direction
|
||||
effect_data[4] = red1; // Custom color 1 red
|
||||
effect_data[5] = grn1; // Custom color 1 green
|
||||
effect_data[6] = blu1; // Custom color 1 blue
|
||||
effect_data[7] = brightness;
|
||||
effect_data[8] = red2; // Custom color 2 red
|
||||
effect_data[9] = grn2; // Custom color 2 green
|
||||
effect_data[10] = blu2; // Custom color 2 blue
|
||||
effect_data[11] = brightness;
|
||||
effect_data[12] = 0x00;
|
||||
effect_data[13] = 0x00;
|
||||
effect_data[14] = 0x00;
|
||||
effect_data[15] = 0x00;
|
||||
effect_data[16] = 0x00;
|
||||
effect_data[17] = 0x00;
|
||||
effect_data[18] = 0x00;
|
||||
effect_data[19] = 0x00;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Write effect packet |
|
||||
\*-----------------------------------------------------*/
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_RESET_BUFFER, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_BINARY_START, 0x00);
|
||||
|
||||
for(unsigned int i = 0; i < 20; i++)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_SET_BINARY_DATA, effect_data[i]);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Calculate CRC and read CRC reported by device |
|
||||
\*-----------------------------------------------------*/
|
||||
calc_crc = CRCPP::CRC::Calculate(effect_data, sizeof(effect_data), CRCPP::CRC::CRC_8());
|
||||
device_crc = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_CHECKSUM);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Write effect configuration only if CRCs match |
|
||||
\*-----------------------------------------------------*/
|
||||
if(calc_crc == device_crc)
|
||||
{
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_WRITE_CONFIGURATION, CORSAIR_DRAM_ID_EFFECT_CONFIGURATION);
|
||||
WaitReady();
|
||||
}
|
||||
}
|
||||
|
||||
bool CorsairDRAMController::WaitReady()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Poll status register 0x30; bit 3 (0x08) = busy. |
|
||||
| Device is ready when bit 3 is clear. |
|
||||
\*-----------------------------------------------------*/
|
||||
for(int retry = 0; retry < 5; retry++)
|
||||
{
|
||||
int status = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_STATUS);
|
||||
|
||||
if(status >= 0 && (status & 0x08) == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(10ms);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CorsairDRAMController::ReadDeviceInfo()
|
||||
{
|
||||
unsigned char device_information_data[32];
|
||||
unsigned char device_crc;
|
||||
unsigned char calc_crc;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Request Device Information Data |
|
||||
\*-----------------------------------------------------*/
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_GET_DEVICE_INFO, 0x00);
|
||||
bus->i2c_smbus_write_byte_data(dev, CORSAIR_DRAM_REG_BINARY_START, 0x00);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Read Device Information Data |
|
||||
\*-----------------------------------------------------*/
|
||||
for(unsigned int i = 0; i < 32; i++)
|
||||
{
|
||||
device_information_data[i] = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_BINARY_DATA);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Compare CRC |
|
||||
\*-----------------------------------------------------*/
|
||||
calc_crc = CRCPP::CRC::Calculate(device_information_data, sizeof(device_information_data), CRCPP::CRC::CRC_8());
|
||||
device_crc = bus->i2c_smbus_read_byte_data(dev, CORSAIR_DRAM_REG_GET_CHECKSUM);
|
||||
|
||||
if(calc_crc != device_crc)
|
||||
{
|
||||
LOG_ERROR("[%s] ReadDeviceInfo CRC Mismatch", CORSAIR_DRAM_NAME);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Log Device Information Data |
|
||||
\*-----------------------------------------------------*/
|
||||
if(LogManager::get()->GetLogLevel() >= LL_TRACE)
|
||||
{
|
||||
char device_info_buf[256];
|
||||
unsigned int pos;
|
||||
|
||||
pos = snprintf(device_info_buf, sizeof(device_info_buf), "%02X: ", dev);
|
||||
|
||||
for(unsigned int i = 0; i < 32; i++)
|
||||
{
|
||||
pos += snprintf(&device_info_buf[pos], sizeof(device_info_buf) - pos, "%02X ", device_information_data[i]);
|
||||
}
|
||||
|
||||
LOG_TRACE("[%s] Device Info: %s", CORSAIR_DRAM_NAME, device_info_buf);
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Read VID |
|
||||
\*-----------------------------------------------------*/
|
||||
vid = (device_information_data[1] << 8) | device_information_data[0];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Read PID |
|
||||
\*-----------------------------------------------------*/
|
||||
pid = (device_information_data[3] << 8) | device_information_data[2];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Format Firwmare Version |
|
||||
\*-----------------------------------------------------*/
|
||||
firmware_version = std::to_string(device_information_data[9]) + "." + std::to_string(device_information_data[8]) + "." + std::to_string((device_information_data[11] << 8) | device_information_data[10]);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Read Protocol Version |
|
||||
\*-----------------------------------------------------*/
|
||||
protocol_version = device_information_data[28];
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Loop through all known devices to look for a PID |
|
||||
| match |
|
||||
\*-----------------------------------------------------*/
|
||||
for(unsigned int i = 0; i < CORSAIR_DRAM_NUM_DEVICES; i++)
|
||||
{
|
||||
for(unsigned int j = 0; j < CORSAIR_DRAM_MAX_PIDS; j++)
|
||||
{
|
||||
if(corsair_dram_device_list[i]->pids[j] == pid)
|
||||
{
|
||||
/*-----------------------------------------*\
|
||||
| Set device ID |
|
||||
\*-----------------------------------------*/
|
||||
device_index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,149 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDRAMController.h |
|
||||
| |
|
||||
| Driver for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
#include "CorsairDRAMDevices.h"
|
||||
#include "RGBController.h"
|
||||
|
||||
typedef unsigned char corsair_dev_id;
|
||||
|
||||
enum
|
||||
{ /* (*) indicates deprecated registers no longer used by iCue */
|
||||
CORSAIR_DRAM_REG_RESET_BUFFER = 0x0B, /* Reset buffer by writing 0x00 */
|
||||
CORSAIR_DRAM_REG_SET_BINARY_DATA = 0x20, /* Write byte to active binary data buffer */
|
||||
CORSAIR_DRAM_REG_BINARY_START = 0x21, /* Start binary data transfer by writing 0x00 */
|
||||
CORSAIR_DRAM_REG_SWITCH_MODE = 0x23, /* Switch between Bootloader(0x00) and Normal(0x01) */
|
||||
CORSAIR_DRAM_REG_SET_BUFFER = 0x26, /* Select configuration buffer to write by ID (*) */
|
||||
CORSAIR_DRAM_REG_STATUS = 0x30, /* Status register */
|
||||
CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_1 = 0x31, /* Direct color buffer block register 1 */
|
||||
CORSAIR_DRAM_REG_COLOR_BUFFER_BLOCK_2 = 0x32, /* Direct color buffer block register 2 */
|
||||
CORSAIR_DRAM_REG_GET_BINARY_DATA = 0x40, /* Read byte from active binary data buffer */
|
||||
CORSAIR_DRAM_REG_BUSY_STATUS = 0x41, /* Reads nonzero while busy, zero when ready(*) */
|
||||
CORSAIR_DRAM_REG_GET_CHECKSUM = 0x42, /* Get checksum (CRC8) of active binary data buffer */
|
||||
CORSAIR_DRAM_REG_GET_DEVICE_INFO = 0x61, /* Select device info buffer */
|
||||
CORSAIR_DRAM_REG_GET_CONFIGURATION = 0x63, /* Select configuration buffer to read by ID */
|
||||
CORSAIR_DRAM_REG_WRITE_CONFIGURATION = 0x82, /* Write/Apply configuration by writing buffer ID */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_ID_COMMAND_LIST = 0, /* Command list */
|
||||
CORSAIR_DRAM_ID_EFFECT_CONFIGURATION = 1, /* Effect configuration */
|
||||
CORSAIR_DRAM_ID_COLOR_DATA = 2, /* Color data */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_MODE_DIRECT = 0xDD, /* Arbitrary value to compare against later. Not the actual packet */
|
||||
CORSAIR_DRAM_MODE_COLOR_SHIFT = 0x00, /* Color Shift mode */
|
||||
CORSAIR_DRAM_MODE_COLOR_PULSE = 0x01, /* Color Pulse mode */
|
||||
CORSAIR_DRAM_MODE_RAINBOW_WAVE = 0x03, /* Rainbow Wave mode */
|
||||
CORSAIR_DRAM_MODE_COLOR_WAVE = 0x04, /* Color Wave mode */
|
||||
CORSAIR_DRAM_MODE_VISOR = 0x05, /* Visor mode */
|
||||
CORSAIR_DRAM_MODE_RAIN = 0x06, /* Rain mode */
|
||||
CORSAIR_DRAM_MODE_MARQUEE = 0x07, /* Marquee mode */
|
||||
CORSAIR_DRAM_MODE_RAINBOW = 0x08, /* Rainbow mode */
|
||||
CORSAIR_DRAM_MODE_SEQUENTIAL = 0x09, /* Sequential mode */
|
||||
CORSAIR_DRAM_MODE_STATIC = 0x10, /* Static mode */
|
||||
|
||||
CORSAIR_DRAM_NUMBER_MODES = 10, /* Number of Corsair Pro modes */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_SPEED_SLOW = 0x00, /* Slow speed */
|
||||
CORSAIR_DRAM_SPEED_MEDIUM = 0x01, /* Medium speed */
|
||||
CORSAIR_DRAM_SPEED_FAST = 0x02, /* Fast speed */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_EFFECT_RANDOM_COLORS = 0x00, /* Random colors */
|
||||
CORSAIR_DRAM_EFFECT_CUSTOM_COLORS = 0x01, /* Custom colors */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_DIRECTION_UP = 0x00, /* Up direction */
|
||||
CORSAIR_DRAM_DIRECTION_DOWN = 0x01, /* Down direction */
|
||||
CORSAIR_DRAM_DIRECTION_LEFT = 0x02, /* Left direction */
|
||||
CORSAIR_DRAM_DIRECTION_RIGHT = 0x03, /* Right direction */
|
||||
CORSAIR_DRAM_DIRECTION_VERTICAL = 0x01, /* Vertical direction */
|
||||
CORSAIR_DRAM_DIRECTION_HORIZONTAL = 0x03, /* Horizontal direction */
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
CORSAIR_DRAM_BRIGHTNESS_MIN = 0, /* Minimum brightness */
|
||||
CORSAIR_DRAM_BRIGHTNESS_MAX = 255, /* Maximum brightness */
|
||||
CORSAIR_DRAM_BRIGHTNESS_DEFAULT = 255, /* Default brightness */
|
||||
};
|
||||
|
||||
class CorsairDRAMController
|
||||
{
|
||||
public:
|
||||
CorsairDRAMController(i2c_smbus_interface *bus, corsair_dev_id dev);
|
||||
~CorsairDRAMController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
std::string GetDeviceVersion();
|
||||
|
||||
unsigned int GetLEDCount();
|
||||
unsigned char GetProtocolVersion();
|
||||
|
||||
void SetColorsPerLED(RGBColor* colors);
|
||||
void SetDirect(bool direct);
|
||||
void SetEffect(unsigned char mode,
|
||||
unsigned char speed,
|
||||
unsigned char direction,
|
||||
bool random,
|
||||
unsigned char brightness,
|
||||
unsigned char red1,
|
||||
unsigned char grn1,
|
||||
unsigned char blu1,
|
||||
unsigned char red2,
|
||||
unsigned char grn2,
|
||||
unsigned char blu2);
|
||||
|
||||
bool WaitReady();
|
||||
|
||||
private:
|
||||
/*-----------------------------------------------------*\
|
||||
| I2C |
|
||||
\*-----------------------------------------------------*/
|
||||
i2c_smbus_interface* bus;
|
||||
corsair_dev_id dev;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| State tracking |
|
||||
\*-----------------------------------------------------*/
|
||||
bool direct_mode;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Corsair DRAM information |
|
||||
\*-----------------------------------------------------*/
|
||||
unsigned short vid;
|
||||
unsigned short pid;
|
||||
std::string firmware_version;
|
||||
unsigned char protocol_version;
|
||||
|
||||
unsigned int device_index;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Private functions |
|
||||
\*-----------------------------------------------------*/
|
||||
void ReadDeviceInfo();
|
||||
};
|
||||
@@ -0,0 +1,93 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDRAMControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <vector>
|
||||
#include "CorsairDRAMController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "LogManager.h"
|
||||
#include "pci_ids.h"
|
||||
#include "RGBController_CorsairDRAM.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
#define CORSAIR_DRAM_NAME "Corsair DRAM"
|
||||
|
||||
bool TestForCorsairDRAMController(i2c_smbus_interface *bus, unsigned char address)
|
||||
{
|
||||
LOG_DEBUG("[%s] Trying address %02X", CORSAIR_DRAM_NAME, address);
|
||||
|
||||
int res = bus->i2c_smbus_read_byte_data(address, 0x43);
|
||||
|
||||
if(res < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if(!(res == 0x1A || res == 0x1B || res == 0x1C))
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: expected 0x1A, 0x1B, or 0x1C, got %04X", CORSAIR_DRAM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x44);
|
||||
|
||||
if(!(res == 0x01 || res == 0x03 || res == 0x04))
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: expected 0x01, 0x03, or 0x04, got %04X", CORSAIR_DRAM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DetectedControllers DetectCorsairDRAMControllers(std::vector<i2c_smbus_interface *> &buses)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
|
||||
for(unsigned int bus = 0; bus < buses.size(); bus++)
|
||||
{
|
||||
IF_DRAM_SMBUS(buses[bus]->info.pci_vendor, buses[bus]->info.pci_device)
|
||||
{
|
||||
LOG_DEBUG("[%s] Testing bus %d", CORSAIR_DRAM_NAME, bus);
|
||||
|
||||
std::vector<unsigned char> addresses;
|
||||
|
||||
for(unsigned char addr = 0x58; addr <= 0x5F; addr++)
|
||||
{
|
||||
addresses.push_back(addr);
|
||||
}
|
||||
|
||||
for(unsigned char addr = 0x18; addr <= 0x1F; addr++)
|
||||
{
|
||||
addresses.push_back(addr);
|
||||
}
|
||||
|
||||
for(unsigned char addr : addresses)
|
||||
{
|
||||
if(TestForCorsairDRAMController(buses[bus], addr))
|
||||
{
|
||||
CorsairDRAMController* controller = new CorsairDRAMController(buses[bus], addr);
|
||||
RGBController_CorsairDRAM* rgb_controller = new RGBController_CorsairDRAM(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(10ms);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_DETECTOR(CORSAIR_DRAM_NAME, DetectCorsairDRAMControllers);
|
||||
@@ -0,0 +1,163 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDRAMDevices.cpp |
|
||||
| |
|
||||
| Device list for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 07 Apr 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "CorsairDRAMDevices.h"
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_pro_ddr4_device =
|
||||
{
|
||||
"Corsair Vengeance RGB Pro DDR4",
|
||||
{
|
||||
CORSAIR_VENGEANCE_PRO_DDR4_PID_1,
|
||||
CORSAIR_VENGEANCE_PRO_DDR4_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
10,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_dominator_platinum_ddr4_device =
|
||||
{
|
||||
"Corsair Dominator Platinum RGB DDR4",
|
||||
{
|
||||
CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_1,
|
||||
CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
12,
|
||||
true
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_pro_sl_ddr4_device =
|
||||
{
|
||||
"Corsair Vengeance RGB Pro SL DDR4",
|
||||
{
|
||||
CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_1,
|
||||
CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
10,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_rs_ddr4_device =
|
||||
{
|
||||
"Corsair Vengeance RGB RS DDR4",
|
||||
{
|
||||
CORSAIR_VENGEANCE_RS_DDR4_PID_1,
|
||||
CORSAIR_VENGEANCE_RS_DDR4_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
6,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_dominator_platinum_ddr5_device =
|
||||
{
|
||||
"Corsair Dominator Platinum RGB DDR5",
|
||||
{
|
||||
CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_1,
|
||||
CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
12,
|
||||
true
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_dominator_titanium_ddr5_device =
|
||||
{
|
||||
"Corsair Dominator Titanium RGB DDR5",
|
||||
{
|
||||
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_1,
|
||||
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_2,
|
||||
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_3,
|
||||
CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_4,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
12,
|
||||
true
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_ddr5_device =
|
||||
{
|
||||
"Corsair Vengeance RGB DDR5",
|
||||
{
|
||||
CORSAIR_VENGEANCE_DDR5_PID_1,
|
||||
CORSAIR_VENGEANCE_DDR5_PID_2,
|
||||
CORSAIR_VENGEANCE_DDR5_PID_3,
|
||||
CORSAIR_VENGEANCE_DDR5_PID_4,
|
||||
CORSAIR_VENGEANCE_DDR5_PID_5,
|
||||
CORSAIR_VENGEANCE_DDR5_PID_6,
|
||||
},
|
||||
10,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_shugo_series_ddr5_device =
|
||||
{
|
||||
"Corsair Vengeance Shugo Series DDR5",
|
||||
{
|
||||
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_1,
|
||||
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_2,
|
||||
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_3,
|
||||
CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_4,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
10,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device corsair_vengeance_rs_ddr5_device =
|
||||
{
|
||||
"Corsair Vengeance RGB RS DDR5",
|
||||
{
|
||||
CORSAIR_VENGEANCE_RS_DDR5_PID_1,
|
||||
CORSAIR_VENGEANCE_RS_DDR5_PID_2,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
},
|
||||
6,
|
||||
false
|
||||
};
|
||||
|
||||
static const corsair_dram_device* device_list[] =
|
||||
{
|
||||
&corsair_vengeance_pro_ddr4_device,
|
||||
&corsair_dominator_platinum_ddr4_device,
|
||||
&corsair_vengeance_pro_sl_ddr4_device,
|
||||
&corsair_vengeance_rs_ddr4_device,
|
||||
&corsair_dominator_platinum_ddr5_device,
|
||||
&corsair_dominator_titanium_ddr5_device,
|
||||
&corsair_vengeance_ddr5_device,
|
||||
&corsair_vengeance_shugo_series_ddr5_device,
|
||||
&corsair_vengeance_rs_ddr5_device,
|
||||
};
|
||||
|
||||
const unsigned int CORSAIR_DRAM_NUM_DEVICES = (sizeof(device_list) / sizeof(device_list[ 0 ]));
|
||||
const corsair_dram_device** corsair_dram_device_list = device_list;
|
||||
@@ -0,0 +1,68 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDRAMDevices.h |
|
||||
| |
|
||||
| Device list for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 07 Apr 2026 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Maximum number of PIDs for a given DRAM model |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CORSAIR_DRAM_MAX_PIDS 6
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Corsair DRAM vendor ID |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CORSAIR_DRAM_VID 0x1B1C
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Corsair DRAM product IDs |
|
||||
\*---------------------------------------------------------*/
|
||||
#define CORSAIR_VENGEANCE_PRO_DDR4_PID_1 0x0100
|
||||
#define CORSAIR_VENGEANCE_PRO_DDR4_PID_2 0x0101
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_1 0x0200
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_DDR4_PID_2 0x0201
|
||||
#define CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_1 0x0300
|
||||
#define CORSAIR_VENGEANCE_PRO_SL_DDR4_PID_2 0x0301
|
||||
#define CORSAIR_VENGEANCE_RS_DDR4_PID_1 0x0400
|
||||
#define CORSAIR_VENGEANCE_RS_DDR4_PID_2 0x0401
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_1 0x0600
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_DDR5_PID_2 0x0601
|
||||
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_1 0x0800
|
||||
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_2 0x0801
|
||||
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_3 0x0810
|
||||
#define CORSAIR_DOMINATOR_TITANIUM_DDR5_PID_4 0x0811
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_1 0x0700
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_2 0x0701
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_3 0x0900
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_4 0x0901
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_5 0x0910
|
||||
#define CORSAIR_VENGEANCE_DDR5_PID_6 0x0911
|
||||
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_1 0x0A00
|
||||
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_2 0x0A01
|
||||
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_3 0x0A10
|
||||
#define CORSAIR_VENGEANCE_SHUGO_SERIES_DDR5_PID_4 0x0A11
|
||||
#define CORSAIR_VENGEANCE_RS_DDR5_PID_1 0x0B00
|
||||
#define CORSAIR_VENGEANCE_RS_DDR5_PID_2 0x0B01
|
||||
|
||||
typedef struct
|
||||
{
|
||||
std::string name;
|
||||
unsigned short pids[CORSAIR_DRAM_MAX_PIDS];
|
||||
unsigned int led_count;
|
||||
bool reverse;
|
||||
} corsair_dram_device;
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| These constant values are defined in RazerDevices.cpp |
|
||||
\*-----------------------------------------------------*/
|
||||
extern const unsigned int CORSAIR_DRAM_NUM_DEVICES;
|
||||
extern const corsair_dram_device** corsair_dram_device_list;
|
||||
@@ -0,0 +1,324 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_CorsairDRAM.cpp |
|
||||
| |
|
||||
| RGBController for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_CorsairDRAM.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Corsair DRAM
|
||||
@category RAM
|
||||
@type SMBus
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :x:
|
||||
@detectors DetectCorsairDRAMControllers
|
||||
@comment
|
||||
The Corsair DRAM RGB controller chip can be found on several
|
||||
Corsair memory sticks which have different LED counts. This can be controlled
|
||||
by editing the Part Number in OpenRGB.json with values in the below table.
|
||||
|
||||
| Part Number | LED Count |
|
||||
| :---------: | --------: |
|
||||
| CMG | 6 |
|
||||
| CMH | 10 |
|
||||
| CMN | 10 |
|
||||
| CMT | 12 |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_CorsairDRAM::RGBController_CorsairDRAM(CorsairDRAMController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Corsair";
|
||||
type = DEVICE_TYPE_DRAM;
|
||||
description = "Corsair DRAM RGB Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
version = controller->GetDeviceVersion();
|
||||
|
||||
if(controller->GetProtocolVersion() >= 4)
|
||||
{
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = CORSAIR_DRAM_MODE_DIRECT;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
}
|
||||
|
||||
mode Custom;
|
||||
Custom.name = "Custom";
|
||||
Custom.value = CORSAIR_DRAM_MODE_STATIC;
|
||||
Custom.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Custom.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Custom);
|
||||
|
||||
mode ColorShift;
|
||||
ColorShift.name = "Color Shift";
|
||||
ColorShift.value = CORSAIR_DRAM_MODE_COLOR_SHIFT;
|
||||
ColorShift.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
ColorShift.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ColorShift.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorShift.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
ColorShift.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorShift.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
ColorShift.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
ColorShift.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
ColorShift.colors_min = 2;
|
||||
ColorShift.colors_max = 2;
|
||||
ColorShift.colors.resize(2);
|
||||
modes.push_back(ColorShift);
|
||||
|
||||
mode ColorPulse;
|
||||
ColorPulse.name = "Color Pulse";
|
||||
ColorPulse.value = CORSAIR_DRAM_MODE_COLOR_PULSE;
|
||||
ColorPulse.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
ColorPulse.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ColorPulse.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorPulse.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
ColorPulse.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorPulse.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
ColorPulse.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
ColorPulse.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
ColorPulse.colors_min = 2;
|
||||
ColorPulse.colors_max = 2;
|
||||
ColorPulse.colors.resize(2);
|
||||
modes.push_back(ColorPulse);
|
||||
|
||||
mode RainbowWave;
|
||||
RainbowWave.name = "Rainbow Wave";
|
||||
RainbowWave.value = CORSAIR_DRAM_MODE_RAINBOW_WAVE;
|
||||
RainbowWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
RainbowWave.color_mode = MODE_COLORS_NONE;
|
||||
RainbowWave.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
RainbowWave.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
RainbowWave.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
RainbowWave.direction = MODE_DIRECTION_DOWN;
|
||||
modes.push_back(RainbowWave);
|
||||
|
||||
mode ColorWave;
|
||||
ColorWave.name = "Color Wave";
|
||||
ColorWave.value = CORSAIR_DRAM_MODE_COLOR_WAVE;
|
||||
ColorWave.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_LR | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
ColorWave.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
ColorWave.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorWave.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
ColorWave.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
ColorWave.direction = MODE_DIRECTION_DOWN;
|
||||
ColorWave.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
ColorWave.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
ColorWave.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
ColorWave.colors_min = 2;
|
||||
ColorWave.colors_max = 2;
|
||||
ColorWave.colors.resize(2);
|
||||
modes.push_back(ColorWave);
|
||||
|
||||
mode Visor;
|
||||
Visor.name = "Visor";
|
||||
Visor.value = CORSAIR_DRAM_MODE_VISOR;
|
||||
Visor.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_HV | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Visor.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Visor.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Visor.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
Visor.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Visor.direction = MODE_DIRECTION_VERTICAL;
|
||||
Visor.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
Visor.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
Visor.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
Visor.colors_min = 2;
|
||||
Visor.colors_max = 2;
|
||||
Visor.colors.resize(2);
|
||||
modes.push_back(Visor);
|
||||
|
||||
mode Rain;
|
||||
Rain.name = "Rain";
|
||||
Rain.value = CORSAIR_DRAM_MODE_RAIN;
|
||||
Rain.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Rain.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Rain.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Rain.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
Rain.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Rain.direction = MODE_DIRECTION_DOWN;
|
||||
Rain.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
Rain.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
Rain.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
Rain.colors_min = 2;
|
||||
Rain.colors_max = 2;
|
||||
Rain.colors.resize(2);
|
||||
modes.push_back(Rain);
|
||||
|
||||
mode Marquee;
|
||||
Marquee.name = "Marquee";
|
||||
Marquee.value = CORSAIR_DRAM_MODE_MARQUEE;
|
||||
Marquee.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Marquee.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Marquee.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Marquee.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
Marquee.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Marquee.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
Marquee.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
Marquee.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
Marquee.colors_min = 1;
|
||||
Marquee.colors_max = 1;
|
||||
Marquee.colors.resize(1);
|
||||
modes.push_back(Marquee);
|
||||
|
||||
mode Rainbow;
|
||||
Rainbow.name = "Rainbow";
|
||||
Rainbow.value = CORSAIR_DRAM_MODE_RAINBOW;
|
||||
Rainbow.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Rainbow.color_mode = MODE_COLORS_NONE;
|
||||
Rainbow.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Rainbow.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
Rainbow.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
modes.push_back(Rainbow);
|
||||
|
||||
mode Sequential;
|
||||
Sequential.name = "Sequential";
|
||||
Sequential.value = CORSAIR_DRAM_MODE_SEQUENTIAL;
|
||||
Sequential.flags = MODE_FLAG_HAS_SPEED | MODE_FLAG_HAS_DIRECTION_UD | MODE_FLAG_HAS_MODE_SPECIFIC_COLOR | MODE_FLAG_HAS_RANDOM_COLOR | MODE_FLAG_HAS_BRIGHTNESS | MODE_FLAG_AUTOMATIC_SAVE;
|
||||
Sequential.color_mode = MODE_COLORS_MODE_SPECIFIC;
|
||||
Sequential.speed_min = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Sequential.speed_max = CORSAIR_DRAM_SPEED_FAST;
|
||||
Sequential.speed = CORSAIR_DRAM_SPEED_SLOW;
|
||||
Sequential.direction = MODE_DIRECTION_DOWN;
|
||||
Sequential.brightness_min = CORSAIR_DRAM_BRIGHTNESS_MIN;
|
||||
Sequential.brightness_max = CORSAIR_DRAM_BRIGHTNESS_MAX;
|
||||
Sequential.brightness = CORSAIR_DRAM_BRIGHTNESS_DEFAULT;
|
||||
Sequential.colors_min = 1;
|
||||
Sequential.colors_max = 1;
|
||||
Sequential.colors.resize(1);
|
||||
modes.push_back(Sequential);
|
||||
|
||||
SetupZones();
|
||||
}
|
||||
|
||||
RGBController_CorsairDRAM::~RGBController_CorsairDRAM()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_CorsairDRAM::SetupZones()
|
||||
{
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up zone |
|
||||
\*-----------------------------------------------------*/
|
||||
zone new_zone;
|
||||
new_zone.name = "Corsair DRAM";
|
||||
new_zone.type = ZONE_TYPE_LINEAR;
|
||||
new_zone.leds_min = controller->GetLEDCount();
|
||||
new_zone.leds_max = controller->GetLEDCount();
|
||||
new_zone.leds_count = controller->GetLEDCount();
|
||||
zones.push_back(new_zone);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Set up LEDs |
|
||||
\*-----------------------------------------------------*/
|
||||
for(std::size_t led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = "Corsair DRAM LED ";
|
||||
new_led.name.append(std::to_string(led_idx));
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDRAM::DeviceUpdateLEDs()
|
||||
{
|
||||
controller->SetColorsPerLED(colors.data());
|
||||
}
|
||||
|
||||
void RGBController_CorsairDRAM::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDRAM::DeviceUpdateSingleLED(int /*led*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDRAM::DeviceUpdateMode()
|
||||
{
|
||||
unsigned int corsair_direction = 0;
|
||||
bool random = (modes[active_mode].color_mode == MODE_COLORS_RANDOM);
|
||||
unsigned char mode_colors[6];
|
||||
|
||||
switch(modes[active_mode].direction)
|
||||
{
|
||||
case MODE_DIRECTION_LEFT:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_LEFT;
|
||||
break;
|
||||
case MODE_DIRECTION_RIGHT:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_RIGHT;
|
||||
break;
|
||||
case MODE_DIRECTION_UP:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_UP;
|
||||
break;
|
||||
case MODE_DIRECTION_DOWN:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_DOWN;
|
||||
break;
|
||||
case MODE_DIRECTION_HORIZONTAL:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_HORIZONTAL;
|
||||
break;
|
||||
case MODE_DIRECTION_VERTICAL:
|
||||
corsair_direction = CORSAIR_DRAM_DIRECTION_VERTICAL;
|
||||
break;
|
||||
}
|
||||
|
||||
mode_colors[0] = 0;
|
||||
mode_colors[1] = 0;
|
||||
mode_colors[2] = 0;
|
||||
mode_colors[3] = 0;
|
||||
mode_colors[4] = 0;
|
||||
mode_colors[5] = 0;
|
||||
|
||||
if(modes[active_mode].color_mode == MODE_COLORS_MODE_SPECIFIC)
|
||||
{
|
||||
mode_colors[0] = RGBGetRValue(modes[active_mode].colors[0]);
|
||||
mode_colors[1] = RGBGetGValue(modes[active_mode].colors[0]);
|
||||
mode_colors[2] = RGBGetBValue(modes[active_mode].colors[0]);
|
||||
|
||||
if(modes[active_mode].colors.size() == 2)
|
||||
{
|
||||
mode_colors[3] = RGBGetRValue(modes[active_mode].colors[1]);
|
||||
mode_colors[4] = RGBGetGValue(modes[active_mode].colors[1]);
|
||||
mode_colors[5] = RGBGetBValue(modes[active_mode].colors[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if(modes[active_mode].name == "Direct")
|
||||
{
|
||||
controller->SetDirect(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
controller->SetDirect(false);
|
||||
}
|
||||
|
||||
controller->SetEffect(modes[active_mode].value,
|
||||
modes[active_mode].speed,
|
||||
corsair_direction,
|
||||
random,
|
||||
(unsigned char)modes[active_mode].brightness,
|
||||
mode_colors[0],
|
||||
mode_colors[1],
|
||||
mode_colors[2],
|
||||
mode_colors[3],
|
||||
mode_colors[4],
|
||||
mode_colors[5]);
|
||||
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(15));
|
||||
}
|
||||
+8
-7
@@ -1,8 +1,9 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_CorsairDominatorPlatinum.h |
|
||||
| RGBController_CorsairDRAM.h |
|
||||
| |
|
||||
| RGBController for Corsair Dominator Platinum RAM |
|
||||
| RGBController for Corsair DRAM RGB controllers |
|
||||
| |
|
||||
| Adam Honse (CalcProgrammer1) 30 Jun 2019 |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
@@ -12,13 +13,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "RGBController.h"
|
||||
#include "CorsairDominatorPlatinumController.h"
|
||||
#include "CorsairDRAMController.h"
|
||||
|
||||
class RGBController_CorsairDominatorPlatinum : public RGBController
|
||||
class RGBController_CorsairDRAM : public RGBController
|
||||
{
|
||||
public:
|
||||
RGBController_CorsairDominatorPlatinum(CorsairDominatorPlatinumController* controller_ptr);
|
||||
~RGBController_CorsairDominatorPlatinum();
|
||||
RGBController_CorsairDRAM(CorsairDRAMController* controller_ptr);
|
||||
~RGBController_CorsairDRAM();
|
||||
|
||||
void SetupZones();
|
||||
|
||||
@@ -29,5 +30,5 @@ public:
|
||||
void DeviceUpdateMode();
|
||||
|
||||
private:
|
||||
CorsairDominatorPlatinumController* controller;
|
||||
CorsairDRAMController* controller;
|
||||
};
|
||||
-134
@@ -1,134 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDominatorPlatinumController.cpp |
|
||||
| |
|
||||
| Driver for Corsair Dominator Platinum RAM |
|
||||
| |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <cstring>
|
||||
#include <chrono>
|
||||
#include "CorsairDominatorPlatinumController.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
CorsairDominatorPlatinumController::CorsairDominatorPlatinumController(i2c_smbus_interface *bus, corsair_dev_id dev, unsigned int leds_count, std::string dev_name)
|
||||
{
|
||||
this->bus = bus;
|
||||
this->dev = dev;
|
||||
this->leds_count = leds_count;
|
||||
this->name = dev_name;
|
||||
|
||||
led_data[0] = 0xc;
|
||||
}
|
||||
|
||||
CorsairDominatorPlatinumController::~CorsairDominatorPlatinumController()
|
||||
{
|
||||
}
|
||||
|
||||
unsigned int CorsairDominatorPlatinumController::GetLEDCount()
|
||||
{
|
||||
return leds_count;
|
||||
}
|
||||
|
||||
std::string CorsairDominatorPlatinumController::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);
|
||||
}
|
||||
|
||||
std::string CorsairDominatorPlatinumController::GetDeviceName()
|
||||
{
|
||||
return(name);
|
||||
}
|
||||
|
||||
void CorsairDominatorPlatinumController::SetAllColors
|
||||
(
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
)
|
||||
{
|
||||
for(unsigned int led = 0; led < leds_count; led++)
|
||||
{
|
||||
SetLEDColor(led, red, green, blue);
|
||||
}
|
||||
}
|
||||
|
||||
void CorsairDominatorPlatinumController::SetLEDColor
|
||||
(
|
||||
unsigned int led,
|
||||
unsigned char red,
|
||||
unsigned char green,
|
||||
unsigned char blue
|
||||
)
|
||||
{
|
||||
if(led >= leds_count)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int offset = (led * 3) + 1;
|
||||
led_data[offset] = red;
|
||||
led_data[offset + 1] = green;
|
||||
led_data[offset + 2] = blue;
|
||||
}
|
||||
|
||||
unsigned char CorsairDominatorPlatinumController::crc8
|
||||
(
|
||||
unsigned char init,
|
||||
unsigned char poly,
|
||||
unsigned char* data,
|
||||
unsigned char len
|
||||
)
|
||||
{
|
||||
unsigned char crc = init;
|
||||
|
||||
for(unsigned int i = 0; i < len; i++)
|
||||
{
|
||||
unsigned char val = data[i];
|
||||
for(unsigned char mask = 0x80; mask != 0; mask >>= 1)
|
||||
{
|
||||
unsigned char bit;
|
||||
if ((val & mask) != 0)
|
||||
{
|
||||
bit = (crc & 0x80) ^ 0x80;
|
||||
}
|
||||
else
|
||||
{
|
||||
bit = crc & 0x80;
|
||||
}
|
||||
|
||||
if (bit == 0)
|
||||
{
|
||||
crc <<= 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
crc = (crc << 1) ^ poly;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
void CorsairDominatorPlatinumController::ApplyColors()
|
||||
{
|
||||
unsigned char data[sizeof(led_data)];
|
||||
memcpy(data, led_data, sizeof(led_data));
|
||||
unsigned char crc = crc8(0x0, 0x7, data, sizeof(data) - 1);
|
||||
data[sizeof(data) - 1] = crc;
|
||||
|
||||
bus->i2c_smbus_write_block_data(dev, 0x31, 0x20, data);
|
||||
std::this_thread::sleep_for(800us);
|
||||
bus->i2c_smbus_write_block_data(dev, 0x32, sizeof(data) - 0x20, data + 0x20);
|
||||
std::this_thread::sleep_for(200us);
|
||||
}
|
||||
@@ -1,44 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDominatorPlatinumController.h |
|
||||
| |
|
||||
| Driver for Corsair Dominator Platinum RAM |
|
||||
| |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include "i2c_smbus.h"
|
||||
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_DATA_SIZE 38
|
||||
|
||||
typedef unsigned char corsair_dev_id;
|
||||
|
||||
class CorsairDominatorPlatinumController
|
||||
{
|
||||
public:
|
||||
CorsairDominatorPlatinumController(i2c_smbus_interface *bus, corsair_dev_id dev, unsigned int leds_count, std::string dev_name);
|
||||
~CorsairDominatorPlatinumController();
|
||||
|
||||
std::string GetDeviceLocation();
|
||||
std::string GetDeviceName();
|
||||
unsigned int GetLEDCount();
|
||||
|
||||
void SetAllColors(unsigned char red, unsigned char green, unsigned char blue);
|
||||
void SetLEDColor(unsigned int led, unsigned char red, unsigned char green, unsigned char blue);
|
||||
void ApplyColors();
|
||||
bool WaitReady();
|
||||
|
||||
private:
|
||||
unsigned char led_data[CORSAIR_DOMINATOR_PLATINUM_DATA_SIZE];
|
||||
i2c_smbus_interface* bus;
|
||||
corsair_dev_id dev;
|
||||
unsigned int leds_count;
|
||||
std::string name;
|
||||
|
||||
static unsigned char crc8(unsigned char init, unsigned char poly, unsigned char *data, unsigned char len);
|
||||
};
|
||||
-168
@@ -1,168 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| CorsairDominatorPlatinumControllerDetect.cpp |
|
||||
| |
|
||||
| Detector for Corsair Dominator Platinum RAM |
|
||||
| |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include <vector>
|
||||
#include "CorsairDominatorPlatinumController.h"
|
||||
#include "DetectionManager.h"
|
||||
#include "i2c_smbus.h"
|
||||
#include "LogManager.h"
|
||||
#include "pci_ids.h"
|
||||
#include "ResourceManager.h"
|
||||
#include "RGBController_CorsairDominatorPlatinum.h"
|
||||
#include "SettingsManager.h"
|
||||
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
json corsair_dominator_models =
|
||||
{
|
||||
{
|
||||
"CMT",
|
||||
{
|
||||
{"name", "Corsair Dominator Platinum"},
|
||||
{"leds", 12}
|
||||
}
|
||||
},
|
||||
{
|
||||
"CMH",
|
||||
{
|
||||
{"name", "Corsair Vengeance Pro SL"},
|
||||
{"leds", 10}
|
||||
}
|
||||
},
|
||||
{
|
||||
"CMN",
|
||||
{
|
||||
{"name", "Corsair Vengeance RGB RT"},
|
||||
{"leds", 10}
|
||||
}
|
||||
},
|
||||
{
|
||||
"CMG",
|
||||
{
|
||||
{"name", "Corsair Vengeance RGB RS"},
|
||||
{"leds", 6}
|
||||
}
|
||||
},
|
||||
{
|
||||
"CMP",
|
||||
{
|
||||
{"name", "Corsair Dominator Titanium"},
|
||||
{"leds", 11}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#define CORSAIR_DOMINATOR_PLATINUM_NAME "Corsair Dominator Platinum"
|
||||
|
||||
bool TestForCorsairDominatorPlatinumController(i2c_smbus_interface *bus, unsigned char address)
|
||||
{
|
||||
int res = bus->i2c_smbus_write_quick(address, I2C_SMBUS_WRITE);
|
||||
|
||||
LOG_DEBUG("[%s] Trying address %02X", CORSAIR_DOMINATOR_PLATINUM_NAME, address);
|
||||
|
||||
if(res < 0)
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: res was %04X", CORSAIR_DOMINATOR_PLATINUM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x43);
|
||||
|
||||
if(!(res == 0x1A || res == 0x1B))
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: expected 0x1a or 0x1b, got %04X", CORSAIR_DOMINATOR_PLATINUM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
res = bus->i2c_smbus_read_byte_data(address, 0x44);
|
||||
|
||||
if(res != 0x04)
|
||||
{
|
||||
LOG_DEBUG("[%s] Failed: expected 0x04, got %04X", CORSAIR_DOMINATOR_PLATINUM_NAME, res);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
DetectedControllers DetectCorsairDominatorPlatinumControllers(std::vector<i2c_smbus_interface *> &busses)
|
||||
{
|
||||
DetectedControllers detected_controllers;
|
||||
SettingsManager* settings_manager = ResourceManager::get()->GetSettingsManager();
|
||||
json corsair_dominator_settings = settings_manager->GetSettings("CorsairDominatorSettings");
|
||||
|
||||
if(!corsair_dominator_settings.contains("model"))
|
||||
{
|
||||
// Set default value
|
||||
corsair_dominator_settings["model"] = "CMT";
|
||||
settings_manager->SetSettings("CorsairDominatorSettings", corsair_dominator_settings);
|
||||
settings_manager->SaveSettings();
|
||||
}
|
||||
|
||||
std::string model = corsair_dominator_settings["model"];
|
||||
|
||||
for(unsigned int bus = 0; bus < busses.size(); bus++)
|
||||
{
|
||||
IF_DRAM_SMBUS(busses[bus]->pci_vendor, busses[bus]->pci_device)
|
||||
{
|
||||
LOG_DEBUG("[%s] Testing bus %d", CORSAIR_DOMINATOR_PLATINUM_NAME, bus);
|
||||
|
||||
std::vector<unsigned char> addresses;
|
||||
|
||||
for(unsigned char addr = 0x58; addr <= 0x5F; addr++)
|
||||
{
|
||||
addresses.push_back(addr);
|
||||
}
|
||||
|
||||
for(unsigned char addr = 0x18; addr <= 0x1F; addr++)
|
||||
{
|
||||
addresses.push_back(addr);
|
||||
}
|
||||
|
||||
for(unsigned char addr : addresses)
|
||||
{
|
||||
if(TestForCorsairDominatorPlatinumController(busses[bus], addr))
|
||||
{
|
||||
unsigned int leds;
|
||||
std::string name;
|
||||
|
||||
if(corsair_dominator_models.contains(model))
|
||||
{
|
||||
leds = corsair_dominator_models[model]["leds"];
|
||||
name = corsair_dominator_models[model]["name"];
|
||||
}
|
||||
else
|
||||
{
|
||||
leds = corsair_dominator_models["CMT"]["leds"];
|
||||
name = corsair_dominator_models["CMT"]["name"];
|
||||
}
|
||||
|
||||
LOG_DEBUG("[%s] Model: %s, Leds: %d", CORSAIR_DOMINATOR_PLATINUM_NAME, name.c_str(), leds);
|
||||
|
||||
CorsairDominatorPlatinumController* controller = new CorsairDominatorPlatinumController(busses[bus], addr, leds, name);
|
||||
RGBController_CorsairDominatorPlatinum* rgb_controller = new RGBController_CorsairDominatorPlatinum(controller);
|
||||
|
||||
detected_controllers.push_back(rgb_controller);
|
||||
}
|
||||
|
||||
std::this_thread::sleep_for(10ms);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_DEBUG("[%s] Bus %d is not a DRAM bus", CORSAIR_DOMINATOR_PLATINUM_NAME, bus);
|
||||
}
|
||||
}
|
||||
|
||||
return(detected_controllers);
|
||||
}
|
||||
|
||||
REGISTER_I2C_DETECTOR(CORSAIR_DOMINATOR_PLATINUM_NAME, DetectCorsairDominatorPlatinumControllers);
|
||||
-128
@@ -1,128 +0,0 @@
|
||||
/*---------------------------------------------------------*\
|
||||
| RGBController_CorsairDominatorPlatinum.cpp |
|
||||
| |
|
||||
| RGBController for Corsair Dominator Platinum RAM |
|
||||
| |
|
||||
| Erik Gilling (konkers) 25 Sep 2020 |
|
||||
| |
|
||||
| This file is part of the OpenRGB project |
|
||||
| SPDX-License-Identifier: GPL-2.0-or-later |
|
||||
\*---------------------------------------------------------*/
|
||||
|
||||
#include "RGBController_CorsairDominatorPlatinum.h"
|
||||
|
||||
/**------------------------------------------------------------------*\
|
||||
@name Corsair Dominator Platinum
|
||||
@category RAM
|
||||
@type SMBus
|
||||
@save :x:
|
||||
@direct :white_check_mark:
|
||||
@effects :x:
|
||||
@detectors DetectCorsairDominatorPlatinumControllers
|
||||
@comment
|
||||
The Corsair Dominator controller chip can be found on several
|
||||
Corsair memory sticks which have different LED counts. This can be controlled
|
||||
by editing the Part Number in OpenRGB.json with values in the below table.
|
||||
|
||||
| Part Number | LED Count |
|
||||
| :---------: | --------: |
|
||||
| CMG | 6 |
|
||||
| CMH | 10 |
|
||||
| CMN | 10 |
|
||||
| CMT | 12 |
|
||||
\*-------------------------------------------------------------------*/
|
||||
|
||||
RGBController_CorsairDominatorPlatinum::RGBController_CorsairDominatorPlatinum(CorsairDominatorPlatinumController* controller_ptr)
|
||||
{
|
||||
controller = controller_ptr;
|
||||
|
||||
name = controller->GetDeviceName();
|
||||
vendor = "Corsair";
|
||||
type = DEVICE_TYPE_DRAM;
|
||||
description = "Corsair RAM RGB Device";
|
||||
location = controller->GetDeviceLocation();
|
||||
|
||||
mode Direct;
|
||||
Direct.name = "Direct";
|
||||
Direct.value = 0;
|
||||
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR;
|
||||
Direct.speed_min = 0;
|
||||
Direct.speed_max = 0;
|
||||
Direct.speed = 0;
|
||||
Direct.color_mode = MODE_COLORS_PER_LED;
|
||||
modes.push_back(Direct);
|
||||
|
||||
SetupZones();
|
||||
|
||||
active_mode = 0;
|
||||
}
|
||||
|
||||
RGBController_CorsairDominatorPlatinum::~RGBController_CorsairDominatorPlatinum()
|
||||
{
|
||||
Shutdown();
|
||||
|
||||
delete controller;
|
||||
}
|
||||
|
||||
void RGBController_CorsairDominatorPlatinum::SetupZones()
|
||||
{
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up zone |
|
||||
\*---------------------------------------------------------*/
|
||||
zone new_zone;
|
||||
new_zone.name = "Corsair RAM Zone";
|
||||
new_zone.type = ZONE_TYPE_LINEAR;
|
||||
new_zone.leds_min = controller->GetLEDCount();
|
||||
new_zone.leds_max = controller->GetLEDCount();
|
||||
new_zone.leds_count = controller->GetLEDCount();
|
||||
zones.push_back(new_zone);
|
||||
|
||||
/*---------------------------------------------------------*\
|
||||
| Set up LEDs |
|
||||
\*---------------------------------------------------------*/
|
||||
for(std::size_t led_idx = 0; led_idx < zones[0].leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = "Corsair RAM LED ";
|
||||
new_led.name.append(std::to_string(led_idx));
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
|
||||
SetupColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDominatorPlatinum::DeviceUpdateLEDs()
|
||||
{
|
||||
for(unsigned int led = 0; led < (unsigned int)colors.size(); led++)
|
||||
{
|
||||
RGBColor color = colors[led];
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
controller->SetLEDColor(led, red, grn, blu);
|
||||
}
|
||||
|
||||
controller->ApplyColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDominatorPlatinum::DeviceUpdateZoneLEDs(int /*zone*/)
|
||||
{
|
||||
DeviceUpdateLEDs();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDominatorPlatinum::DeviceUpdateSingleLED(int led)
|
||||
{
|
||||
RGBColor color = colors[led];
|
||||
unsigned char red = RGBGetRValue(color);
|
||||
unsigned char grn = RGBGetGValue(color);
|
||||
unsigned char blu = RGBGetBValue(color);
|
||||
|
||||
controller->SetLEDColor(led, red, grn, blu);
|
||||
controller->ApplyColors();
|
||||
}
|
||||
|
||||
void RGBController_CorsairDominatorPlatinum::DeviceUpdateMode()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -44,8 +44,4 @@ DetectedControllers DetectCorsairHydro2Controllers()
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("Corsair H100i v2", DetectCorsairHydro2Controllers);
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Entries for dynamic UDEV rules |
|
||||
| |
|
||||
| DUMMY_DEVICE_DETECTOR("Corsair H100i v2", DetectCorsairHydro2Controllers, 0x1B1C, 0x0C09 ) |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
REGISTER_CUSTOM_UDEV_RULE(corsair_h100i_v2, "Corsair H100i v2", "SUBSYSTEMS==\"usb|hidraw\", ATTRS{idVendor}==\"1b1c\", ATTRS{idProduct}==\"0c09\", TAG+=\"uaccess\", TAG+=\"Corsair_H100i_v2\"");
|
||||
|
||||
@@ -77,10 +77,6 @@ DetectedControllers DetectCorsairHydroControllers()
|
||||
}
|
||||
|
||||
REGISTER_DETECTOR("Corsair Hydro Series", DetectCorsairHydroControllers);
|
||||
/*---------------------------------------------------------------------------------------------------------*\
|
||||
| Entries for dynamic UDEV rules |
|
||||
| |
|
||||
| DUMMY_DEVICE_DETECTOR("Corsair Hydro Series", DetectCorsairHydroControllers, 0x1B1C, 0x0C12 ) |
|
||||
| DUMMY_DEVICE_DETECTOR("Corsair Hydro Series", DetectCorsairHydroControllers, 0x1B1C, 0x0C13 ) |
|
||||
| DUMMY_DEVICE_DETECTOR("Corsair Hydro Series", DetectCorsairHydroControllers, 0x1B1C, 0x0C15 ) |
|
||||
\*---------------------------------------------------------------------------------------------------------*/
|
||||
REGISTER_CUSTOM_UDEV_RULE(corsair_hydro_1, "Corsair Hydro Series", "SUBSYSTEMS==\"usb|hidraw\", ATTRS{idVendor}==\"1b1c\", ATTRS{idProduct}==\"0c12\", TAG+=\"uaccess\", TAG+=\"Corsair_Hydro_Series\"");
|
||||
REGISTER_CUSTOM_UDEV_RULE(corsair_hydro_2, "Corsair Hydro Series", "SUBSYSTEMS==\"usb|hidraw\", ATTRS{idVendor}==\"1b1c\", ATTRS{idProduct}==\"0c13\", TAG+=\"uaccess\", TAG+=\"Corsair_Hydro_Series\"");
|
||||
REGISTER_CUSTOM_UDEV_RULE(corsair_hydro_3, "Corsair Hydro Series", "SUBSYSTEMS==\"usb|hidraw\", ATTRS{idVendor}==\"1b1c\", ATTRS{idProduct}==\"0c15\", TAG+=\"uaccess\", TAG+=\"Corsair_Hydro_Series\"");
|
||||
|
||||
@@ -110,7 +110,8 @@ void RGBController_CorsairHydroPlatinum::SetupZones()
|
||||
zones[1].flags = ZONE_FLAG_MANUALLY_CONFIGURABLE_SIZE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_NAME
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_TYPE
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP;
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_MATRIX_MAP
|
||||
| ZONE_FLAG_MANUALLY_CONFIGURABLE_SEGMENTS;
|
||||
}
|
||||
|
||||
if(!(zones[1].flags & ZONE_FLAG_MANUALLY_CONFIGURED_NAME))
|
||||
|
||||
@@ -98,7 +98,16 @@ void RGBController_CorsairICueLink::SetupZones()
|
||||
lcd_zone.leds_min = controller->GetEndpoints()[lcd_idx]->led_channels;
|
||||
lcd_zone.leds_max = lcd_zone.leds_min;
|
||||
lcd_zone.leds_count = lcd_zone.leds_min;
|
||||
|
||||
zones.push_back(lcd_zone);
|
||||
|
||||
for(unsigned int led_idx = 0; led_idx < lcd_zone.leds_count; led_idx++)
|
||||
{
|
||||
led new_led;
|
||||
new_led.name = "LED " + std::to_string(led_idx + 1);
|
||||
|
||||
leds.push_back(new_led);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ void CorsairLightingNodeController::SendFirmwareRequest()
|
||||
/*-----------------------------------------------------*\
|
||||
| Send packet |
|
||||
\*-----------------------------------------------------*/
|
||||
actual = WriteAndRead(usb_buf);
|
||||
actual = WriteAndRead(usb_buf, CORSAIR_LIGHTING_NODE_READ_TIMEOUT);
|
||||
|
||||
if(actual > 0)
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user