mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-08-09 08:53:37 +00:00
Compare commits
724 Commits
0.13.11
...
python_opt
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e293bf243d | ||
![]() |
286acfe7fd | ||
![]() |
6d20b28354 | ||
![]() |
846da06380 | ||
![]() |
243fc17e41 | ||
![]() |
f394f23ac6 | ||
![]() |
0ca53fa307 | ||
![]() |
8c361d6c41 | ||
![]() |
8d30209260 | ||
![]() |
8db1be6420 | ||
![]() |
40bf61118e | ||
![]() |
90e57b7b0a | ||
![]() |
c234341cf6 | ||
![]() |
29df3ce83b | ||
![]() |
291455098f | ||
![]() |
7ab4902543 | ||
![]() |
8f36af8409 | ||
![]() |
50a312b635 | ||
![]() |
25f1c242f8 | ||
![]() |
873658a76d | ||
![]() |
f80ee5639e | ||
![]() |
745f5f6532 | ||
![]() |
085db5ec8d | ||
![]() |
eb2886369d | ||
![]() |
8f1eccc59b | ||
![]() |
438eee96e8 | ||
![]() |
2cb4301656 | ||
![]() |
0624698d33 | ||
![]() |
f106f77692 | ||
![]() |
88e53ad9ca | ||
![]() |
e4c5b1bbbb | ||
![]() |
f6ac5abd95 | ||
![]() |
dc39d90270 | ||
![]() |
18f6ded5fa | ||
![]() |
050457818c | ||
![]() |
67af692c97 | ||
![]() |
1f4e20cfda | ||
![]() |
8d9f527081 | ||
![]() |
fc749b40e6 | ||
![]() |
c835d2e71d | ||
![]() |
76e856d052 | ||
![]() |
e3030bff5e | ||
![]() |
5b7cf9fdc8 | ||
![]() |
3c790123ce | ||
![]() |
1272ecd73c | ||
![]() |
7c5ef4060e | ||
![]() |
8dc036c2e4 | ||
![]() |
37fba09021 | ||
![]() |
0311c8036d | ||
![]() |
172e6a7030 | ||
![]() |
ef92c9ee2c | ||
![]() |
67fa2568fe | ||
![]() |
658ab47908 | ||
![]() |
d04f7bc160 | ||
![]() |
9956ff4e03 | ||
![]() |
d59f8d1c02 | ||
![]() |
f8d0ea9206 | ||
![]() |
706c8bebca | ||
![]() |
25004123ce | ||
![]() |
d150595f29 | ||
![]() |
a61c38c7ec | ||
![]() |
03f7bec6c8 | ||
![]() |
e2c5893405 | ||
![]() |
d37900b906 | ||
![]() |
06971da0be | ||
![]() |
2d6fe6eed4 | ||
![]() |
346f4548db | ||
![]() |
ff61df103e | ||
![]() |
a0959f1b33 | ||
![]() |
b151153211 | ||
![]() |
41ba616463 | ||
![]() |
d82e5055dd | ||
![]() |
3be3cdafa2 | ||
![]() |
f5c2f7153d | ||
![]() |
640f0fc7c6 | ||
![]() |
d7ecfa8382 | ||
![]() |
a2a524afbb | ||
![]() |
8d0a610f6e | ||
![]() |
6dc94019e4 | ||
![]() |
fda4149cc3 | ||
![]() |
836b8f7d64 | ||
![]() |
52028ceea1 | ||
![]() |
f8acb1ee10 | ||
![]() |
dc17180f84 | ||
![]() |
421fd75541 | ||
![]() |
0f226a30be | ||
![]() |
641141c519 | ||
![]() |
6fe3943ad3 | ||
![]() |
b2fdd48744 | ||
![]() |
cfc7ee61c5 | ||
![]() |
7a6e630ffd | ||
![]() |
32b2ac0a80 | ||
![]() |
e21a039901 | ||
![]() |
ca0070d11c | ||
![]() |
a47f482d24 | ||
![]() |
9177e22d2c | ||
![]() |
b829a1d264 | ||
![]() |
f287597c19 | ||
![]() |
cbfa2dba25 | ||
![]() |
d9add95037 | ||
![]() |
17d0fad762 | ||
![]() |
13defb0bef | ||
![]() |
84e691717c | ||
![]() |
f3fb3849a2 | ||
![]() |
c508da8a8e | ||
![]() |
9399865b0d | ||
![]() |
827e742bd4 | ||
![]() |
5e3ec2faf0 | ||
![]() |
2f910e1b2a | ||
![]() |
f922133d30 | ||
![]() |
5686a00a9c | ||
![]() |
b72f10c635 | ||
![]() |
59862d30d0 | ||
![]() |
680cc1fab4 | ||
![]() |
2e68897a62 | ||
![]() |
49fd3c0760 | ||
![]() |
415dd21206 | ||
![]() |
102442a841 | ||
![]() |
fff115c1a4 | ||
![]() |
c7277a1420 | ||
![]() |
7e4f01f454 | ||
![]() |
56ce0e4e33 | ||
![]() |
a1e575780d | ||
![]() |
3d3b9807ab | ||
![]() |
3e1e64ca19 | ||
![]() |
25fffb7da8 | ||
![]() |
c38332a5c7 | ||
![]() |
01cb2867db | ||
![]() |
17f51fa9df | ||
![]() |
a6f030fb42 | ||
![]() |
2344d06475 | ||
![]() |
eaa2e0cb24 | ||
![]() |
65fe74fde0 | ||
![]() |
b8711b9726 | ||
![]() |
9544b41640 | ||
![]() |
e5d3e5a989 | ||
![]() |
d64a853b55 | ||
![]() |
554c36a055 | ||
![]() |
5c6c37e3a9 | ||
![]() |
c22f4aeb8e | ||
![]() |
234d37ec16 | ||
![]() |
bc01ee2a6e | ||
![]() |
aa923b2034 | ||
![]() |
160f9144c2 | ||
![]() |
0d74ed3c35 | ||
![]() |
a72172a8fd | ||
![]() |
7d1194de01 | ||
![]() |
e628051505 | ||
![]() |
275996f4c1 | ||
![]() |
3ea3f32dfe | ||
![]() |
d66090af19 | ||
![]() |
b963049305 | ||
![]() |
5386c4c7b2 | ||
![]() |
c1a3060431 | ||
![]() |
b769b36202 | ||
![]() |
879185a214 | ||
![]() |
726368ce67 | ||
![]() |
995c9dff49 | ||
![]() |
69604e1750 | ||
![]() |
06aea834c4 | ||
![]() |
e128d45420 | ||
![]() |
0717890353 | ||
![]() |
cd78ab25a9 | ||
![]() |
beaebdf8eb | ||
![]() |
a5c2a74b8c | ||
![]() |
ebaba80287 | ||
![]() |
15e408a6a5 | ||
![]() |
1593e78c97 | ||
![]() |
452a5216e2 | ||
![]() |
769396839b | ||
![]() |
17991629c1 | ||
![]() |
513f5b0655 | ||
![]() |
b158afee93 | ||
![]() |
57306fb61c | ||
![]() |
d9610120de | ||
![]() |
a78964c918 | ||
![]() |
f461adbd1d | ||
![]() |
cc815c4d83 | ||
![]() |
5cecfe8c9b | ||
![]() |
57158cc3bc | ||
![]() |
8e22da67c1 | ||
![]() |
330fe1d1cc | ||
![]() |
f5820059e4 | ||
![]() |
54c368d3aa | ||
![]() |
8f4767d966 | ||
![]() |
9ce4bdfd6a | ||
![]() |
a0fed0ea17 | ||
![]() |
76c23b15ab | ||
![]() |
4c1ea0a522 | ||
![]() |
c01f873978 | ||
![]() |
924c25e702 | ||
![]() |
95d2f7c3c5 | ||
![]() |
3d49563535 | ||
![]() |
ca570947b0 | ||
![]() |
31130b9031 | ||
![]() |
8e96c5a060 | ||
![]() |
81821f0a12 | ||
![]() |
e1500ce493 | ||
![]() |
4c0d8ae8d7 | ||
![]() |
de8fada3a3 | ||
![]() |
aeaa209b9d | ||
![]() |
6955c5a002 | ||
![]() |
82aa9ad4a5 | ||
![]() |
068af97b7a | ||
![]() |
e756586f41 | ||
![]() |
58142f0726 | ||
![]() |
6cdc996e0b | ||
![]() |
7e06393407 | ||
![]() |
b098757a7e | ||
![]() |
8508fc8b98 | ||
![]() |
6c7450dad7 | ||
![]() |
c14fa1e28f | ||
![]() |
e6887f4260 | ||
![]() |
d8e38ef0b1 | ||
![]() |
39b2b2b010 | ||
![]() |
fef78c41cd | ||
![]() |
de5c30a9ba | ||
![]() |
8761e973ec | ||
![]() |
433834fb8b | ||
![]() |
86422f87c6 | ||
![]() |
388c151de7 | ||
![]() |
396abb0244 | ||
![]() |
7599cd4e50 | ||
![]() |
de2294413f | ||
![]() |
4e32465f06 | ||
![]() |
08ec7618a1 | ||
![]() |
2bc35205a7 | ||
![]() |
14c0f4e44b | ||
![]() |
d6b707403e | ||
![]() |
1dca3a8e3a | ||
![]() |
75da5e9742 | ||
![]() |
36a2297deb | ||
![]() |
16014fe31c | ||
![]() |
188bcf7636 | ||
![]() |
4a5f575ef4 | ||
![]() |
8bf7a1452d | ||
![]() |
2fcf761f33 | ||
![]() |
70bbcdf084 | ||
![]() |
178fbdac16 | ||
![]() |
5f9906eccc | ||
![]() |
16c4590396 | ||
![]() |
8d85171f16 | ||
![]() |
eeb8ba4e62 | ||
![]() |
19810f4a8b | ||
![]() |
c48ce4c259 | ||
![]() |
75ffb4b7e2 | ||
![]() |
929d06a65f | ||
![]() |
cbdc3fb81b | ||
![]() |
04ab5de73c | ||
![]() |
cae9eb4d8d | ||
![]() |
f70dc8435a | ||
![]() |
673c12fa3b | ||
![]() |
008d8a740e | ||
![]() |
b4039ec515 | ||
![]() |
f8f0ca458d | ||
![]() |
40907fa98a | ||
![]() |
89a3ef7699 | ||
![]() |
1dd6adffbe | ||
![]() |
7078d5a5bd | ||
![]() |
dbfe2d7e9e | ||
![]() |
c24d29ef54 | ||
![]() |
2d29ce5de1 | ||
![]() |
54a8b5af01 | ||
![]() |
bc9cd3e997 | ||
![]() |
da0c551692 | ||
![]() |
d200e3de8e | ||
![]() |
49bc835aa9 | ||
![]() |
536df7c240 | ||
![]() |
9c80db1fdc | ||
![]() |
53075ccc5d | ||
![]() |
92fbadeb1b | ||
![]() |
07800e82c9 | ||
![]() |
6da60d4a5d | ||
![]() |
3a1ce81d29 | ||
![]() |
4bb00c6a0a | ||
![]() |
38d8d5445e | ||
![]() |
d84cbc3cec | ||
![]() |
3edc43964d | ||
![]() |
f41fc6b70c | ||
![]() |
0432bde962 | ||
![]() |
17586ea7c4 | ||
![]() |
069cfb61b8 | ||
![]() |
6bb9113e27 | ||
![]() |
0e7c66e891 | ||
![]() |
911b45ce3b | ||
![]() |
cfc6e4bfac | ||
![]() |
ffe81cbec1 | ||
![]() |
f0b30e0027 | ||
![]() |
40d1506527 | ||
![]() |
2549b4b082 | ||
![]() |
201dc6d024 | ||
![]() |
2f367bab98 | ||
![]() |
ad1244e2cf | ||
![]() |
62c3e3d11f | ||
![]() |
12292ba264 | ||
![]() |
bfb052db1d | ||
![]() |
a0c95cb07e | ||
![]() |
7a25dcacff | ||
![]() |
d0a3bca9ec | ||
![]() |
0e6359bce9 | ||
![]() |
767089384f | ||
![]() |
3e9f809988 | ||
![]() |
a871444743 | ||
![]() |
fd5da75bdd | ||
![]() |
fca7cc1747 | ||
![]() |
992b146bc4 | ||
![]() |
5d7b026ce2 | ||
![]() |
8c2db395c4 | ||
![]() |
c820a5732c | ||
![]() |
447bd64013 | ||
![]() |
45f710f3ff | ||
![]() |
15f4ab6a3f | ||
![]() |
65ee9d1b09 | ||
![]() |
084d0ae96e | ||
![]() |
5d27c772fd | ||
![]() |
0ec438289d | ||
![]() |
79e86adfb6 | ||
![]() |
f5b6bef4b3 | ||
![]() |
3c2e69af79 | ||
![]() |
e9b0e9286e | ||
![]() |
876352a030 | ||
![]() |
109b462789 | ||
![]() |
fc29068986 | ||
![]() |
c05fef752e | ||
![]() |
9d5cd52284 | ||
![]() |
b481f554a0 | ||
![]() |
39bc8163d0 | ||
![]() |
d8167779cd | ||
![]() |
7409f03cbf | ||
![]() |
0a8e37509b | ||
![]() |
cd6168ee64 | ||
![]() |
d89d341541 | ||
![]() |
e95c76aaed | ||
![]() |
eea33df1f9 | ||
![]() |
3e43a7f044 | ||
![]() |
f30637ee11 | ||
![]() |
86ab4fcb71 | ||
![]() |
a8c0954db5 | ||
![]() |
171f3e840b | ||
![]() |
54c1548247 | ||
![]() |
9cf82fae95 | ||
![]() |
5168af9a9b | ||
![]() |
61a1915cce | ||
![]() |
03db48af75 | ||
![]() |
8c12fa2e59 | ||
![]() |
3f7350732c | ||
![]() |
5b1c3e360a | ||
![]() |
412e7a03e4 | ||
![]() |
23e70fa857 | ||
![]() |
ee26e3df60 | ||
![]() |
ab6d07b585 | ||
![]() |
891d18d356 | ||
![]() |
2a61a500de | ||
![]() |
64a9cf18e1 | ||
![]() |
19b3aa3a12 | ||
![]() |
7718b1598e | ||
![]() |
65c9752762 | ||
![]() |
f12aea5dfb | ||
![]() |
7845cf1fac | ||
![]() |
33a5468a60 | ||
![]() |
34b63cecb1 | ||
![]() |
7748a093cb | ||
![]() |
d8f113bf98 | ||
![]() |
26b9b3aa23 | ||
![]() |
8f5cc8d762 | ||
![]() |
6be87836dc | ||
![]() |
417803d7ae | ||
![]() |
15ff1927db | ||
![]() |
d6ab908272 | ||
![]() |
5d458c6c8a | ||
![]() |
fbc5a6c24b | ||
![]() |
15872bde61 | ||
![]() |
b09d068bf6 | ||
![]() |
f7f8f97e6a | ||
![]() |
2927af43e1 | ||
![]() |
7795e167ab | ||
![]() |
b68ed9ebea | ||
![]() |
ed59337239 | ||
![]() |
120b15458c | ||
![]() |
19887f2d35 | ||
![]() |
a9e6dc3629 | ||
![]() |
c922fc2cf3 | ||
![]() |
3d32cbb0dc | ||
![]() |
8da2c48650 | ||
![]() |
5aa3fd5ac7 | ||
![]() |
6620b6c515 | ||
![]() |
e31f210b59 | ||
![]() |
39e80a3f5c | ||
![]() |
bc66d71dae | ||
![]() |
427bff8504 | ||
![]() |
cb19c0906e | ||
![]() |
b1f48da5ee | ||
![]() |
c02137a0d2 | ||
![]() |
49efd6abb0 | ||
![]() |
663664e48f | ||
![]() |
c3d1456615 | ||
![]() |
dcb8407ed6 | ||
![]() |
230f09ca17 | ||
![]() |
d562b4fdc5 | ||
![]() |
46318f36ac | ||
![]() |
97e7defaae | ||
![]() |
56fff80e71 | ||
![]() |
42808238c1 | ||
![]() |
34df6743f6 | ||
![]() |
2c0b3649fb | ||
![]() |
0235fc7ab2 | ||
![]() |
180a32ec59 | ||
![]() |
f65a5d2fb5 | ||
![]() |
6e5fd1a210 | ||
![]() |
a66947b7d6 | ||
![]() |
86ece8e98e | ||
![]() |
5632c5db31 | ||
![]() |
ca9da27e16 | ||
![]() |
54521bd04b | ||
![]() |
2e7fd319a1 | ||
![]() |
21997e8894 | ||
![]() |
ea29874099 | ||
![]() |
ca11abc201 | ||
![]() |
8ecdc66700 | ||
![]() |
9484c46555 | ||
![]() |
c2d7ebc3df | ||
![]() |
7728b0f966 | ||
![]() |
0a9e18fae1 | ||
![]() |
924b9fcf05 | ||
![]() |
884f8658ef | ||
![]() |
99ce84827a | ||
![]() |
7f809c013a | ||
![]() |
40365f8297 | ||
![]() |
1ac030b119 | ||
![]() |
e2289ffac0 | ||
![]() |
1629c9b71a | ||
![]() |
42a57b37fb | ||
![]() |
be1b5c5a54 | ||
![]() |
53eb35b6cf | ||
![]() |
2c0aa27e6c | ||
![]() |
19b143688f | ||
![]() |
3c08d27abb | ||
![]() |
98dd9b6614 | ||
![]() |
4ed273699a | ||
![]() |
333cd4ec9b | ||
![]() |
30f38c4952 | ||
![]() |
a28fbcda23 | ||
![]() |
ce99f98bb5 | ||
![]() |
15f7cc3bde | ||
![]() |
a8d64c8b89 | ||
![]() |
f5aaecfdfc | ||
![]() |
ebdf750cdd | ||
![]() |
79bdfc1110 | ||
![]() |
90875997ac | ||
![]() |
f02af23973 | ||
![]() |
c9d7a4af45 | ||
![]() |
34323ecd8b | ||
![]() |
d5a8431af4 | ||
![]() |
2e2dd3113b | ||
![]() |
11e5bb2d8a | ||
![]() |
29d537ce7b | ||
![]() |
688fb1999b | ||
![]() |
bcfa3fb9f2 | ||
![]() |
58afb87288 | ||
![]() |
0a453194e8 | ||
![]() |
3190c2f98d | ||
![]() |
d4b3d00d88 | ||
![]() |
15674d0259 | ||
![]() |
52e8875eba | ||
![]() |
40c314fe5c | ||
![]() |
69bc465ace | ||
![]() |
96acb499d2 | ||
![]() |
64a0f5a659 | ||
![]() |
3ce8c9fc8f | ||
![]() |
8428cedc83 | ||
![]() |
9bedc6300d | ||
![]() |
cc4066189a | ||
![]() |
733c861052 | ||
![]() |
dd7f18f65f | ||
![]() |
e90ec6a474 | ||
![]() |
638cc50727 | ||
![]() |
1444ebb7f1 | ||
![]() |
028a0dcd3d | ||
![]() |
655927ab15 | ||
![]() |
051e23c782 | ||
![]() |
887d0fca0e | ||
![]() |
358b040157 | ||
![]() |
184c553cab | ||
![]() |
fc8495a744 | ||
![]() |
428e9e7886 | ||
![]() |
d475f04c78 | ||
![]() |
39e1b5b962 | ||
![]() |
c375ae3ec7 | ||
![]() |
f561b857f2 | ||
![]() |
8880e89bcd | ||
![]() |
4c981953ac | ||
![]() |
41723340de | ||
![]() |
56560a859b | ||
![]() |
65fab0ef5b | ||
![]() |
6e531d0ccc | ||
![]() |
c1ea97e15d | ||
![]() |
da51302345 | ||
![]() |
9d3b11d485 | ||
![]() |
a8889718aa | ||
![]() |
1704eb16cd | ||
![]() |
e95a4f4f52 | ||
![]() |
c738d60cef | ||
![]() |
2ae38e9c43 | ||
![]() |
0d1162f180 | ||
![]() |
ea472b46c9 | ||
![]() |
76f8e84edd | ||
![]() |
3d957a33fa | ||
![]() |
0eb36b5e9a | ||
![]() |
67252c246c | ||
![]() |
b05565f368 | ||
![]() |
e2b652d95f | ||
![]() |
56dee4acc6 | ||
![]() |
d0d77e8c60 | ||
![]() |
3143846ba4 | ||
![]() |
25f1a3d759 | ||
![]() |
5a0be4c6d8 | ||
![]() |
2df1b124a7 | ||
![]() |
f2729e8974 | ||
![]() |
aa85b5ee1e | ||
![]() |
fd24546787 | ||
![]() |
9294c5aa0a | ||
![]() |
712c9fc848 | ||
![]() |
96a6214316 | ||
![]() |
d2b405066d | ||
![]() |
ea1ed13bc8 | ||
![]() |
6ad0b004fa | ||
![]() |
c3483458fe | ||
![]() |
ba5aacbb95 | ||
![]() |
a2165b38a0 | ||
![]() |
e86b7d0c13 | ||
![]() |
5bc5921af4 | ||
![]() |
76db2bb39b | ||
![]() |
a3760c0891 | ||
![]() |
a747ef966b | ||
![]() |
87f6df0655 | ||
![]() |
25b7a5d531 | ||
![]() |
c7436e667d | ||
![]() |
183dde75de | ||
![]() |
8086837f69 | ||
![]() |
ff41c22fdc | ||
![]() |
2f6236d1ea | ||
![]() |
921f1ba4cf | ||
![]() |
1bb04ea598 | ||
![]() |
600fc8be2b | ||
![]() |
c823160d94 | ||
![]() |
d6b18ebfe7 | ||
![]() |
b515651feb | ||
![]() |
0dc0516f0c | ||
![]() |
743d6c430b | ||
![]() |
87aa3282f0 | ||
![]() |
bbc48b0ef5 | ||
![]() |
bd18405cf0 | ||
![]() |
dd5a732eac | ||
![]() |
862b01d4c0 | ||
![]() |
9afbbf21fd | ||
![]() |
b2cfb629e4 | ||
![]() |
34423580e0 | ||
![]() |
e6d83644e8 | ||
![]() |
fe58770df8 | ||
![]() |
00a0c81f8e | ||
![]() |
945b7a0613 | ||
![]() |
ed28795651 | ||
![]() |
9d547a8443 | ||
![]() |
c2dc3008b5 | ||
![]() |
32f0567ca5 | ||
![]() |
6f7466b6dd | ||
![]() |
f2715a0593 | ||
![]() |
90b1e271a8 | ||
![]() |
d97a9fb4ff | ||
![]() |
6d050b7282 | ||
![]() |
74c89de3e9 | ||
![]() |
af5c10ef0c | ||
![]() |
4aa57e9e46 | ||
![]() |
d0c2f3c403 | ||
![]() |
31b657e8ea | ||
![]() |
3367705ac2 | ||
![]() |
6671344602 | ||
![]() |
60837c9d0f | ||
![]() |
d4ac56226d | ||
![]() |
29589ce832 | ||
![]() |
5e7a7c7e2f | ||
![]() |
71b38e0cee | ||
![]() |
8c00003466 | ||
![]() |
33852d14af | ||
![]() |
6bc4528776 | ||
![]() |
b4b3be4f05 | ||
![]() |
6817771df7 | ||
![]() |
ed8ffa4bb4 | ||
![]() |
3c92142f12 | ||
![]() |
c680c84a31 | ||
![]() |
da752e5d7d | ||
![]() |
cefa23e4eb | ||
![]() |
07ea935533 | ||
![]() |
1d341ffbb0 | ||
![]() |
319031154d | ||
![]() |
2defbde5ab | ||
![]() |
c12eae0c5e | ||
![]() |
56d193c5c8 | ||
![]() |
c3a2a7659e | ||
![]() |
8b9419aaf7 | ||
![]() |
2f59e1c1d9 | ||
![]() |
998c58e89b | ||
![]() |
35db567c9c | ||
![]() |
93929e8d01 | ||
![]() |
75867ff164 | ||
![]() |
78be537eff | ||
![]() |
d036ebeaf6 | ||
![]() |
f236395176 | ||
![]() |
5590c40b5b | ||
![]() |
71bb07d10a | ||
![]() |
e83f4e0173 | ||
![]() |
0ee473afd1 | ||
![]() |
f279f4731b | ||
![]() |
d95df57297 | ||
![]() |
71f8f5048b | ||
![]() |
183c49f352 | ||
![]() |
97268662fe | ||
![]() |
b113772bb1 | ||
![]() |
40c7ecfdea | ||
![]() |
2e24cfadb7 | ||
![]() |
bb01ea3809 | ||
![]() |
25ec655162 | ||
![]() |
4496983233 | ||
![]() |
7b91af780a | ||
![]() |
9155b59e1a | ||
![]() |
b0069c5c05 | ||
![]() |
7d45b7f269 | ||
![]() |
43b47495e3 | ||
![]() |
b15288fb87 | ||
![]() |
e6e572bf5c | ||
![]() |
37d1fa53e0 | ||
![]() |
f48d95b415 | ||
![]() |
5fb16e3442 | ||
![]() |
d170a1c0e2 | ||
![]() |
fbd6b28633 | ||
![]() |
56d5131715 | ||
![]() |
bee226b3ee | ||
![]() |
6e19dbc923 | ||
![]() |
cde4165097 | ||
![]() |
c375a8d75b | ||
![]() |
b7f2f40ae5 | ||
![]() |
6e938f1f24 | ||
![]() |
e1ce619bf7 | ||
![]() |
3acb3a09fc | ||
![]() |
7ca9604422 | ||
![]() |
ebfd555ad1 | ||
![]() |
f8f2cf7500 | ||
![]() |
cc6cd394e5 | ||
![]() |
7e051e0619 | ||
![]() |
a71fb6057d | ||
![]() |
474cffbc0f | ||
![]() |
4fcc709f4e | ||
![]() |
01c5ee6f7d | ||
![]() |
8f54152fab | ||
![]() |
54f6ff3bd5 | ||
![]() |
d3092ced99 | ||
![]() |
6c3af2670e | ||
![]() |
6a4960889e | ||
![]() |
064265166c | ||
![]() |
9f6ce448bd | ||
![]() |
c26344fc93 | ||
![]() |
4235160dcf | ||
![]() |
73120947cf | ||
![]() |
5762bc4a5f | ||
![]() |
41933efbf0 | ||
![]() |
18a333ec6b | ||
![]() |
8f5d2e546e | ||
![]() |
4132dd87a4 | ||
![]() |
d950b97115 | ||
![]() |
cde2859a65 | ||
![]() |
967d7c47dc | ||
![]() |
4c04c848b5 | ||
![]() |
27d2fb88ca | ||
![]() |
de585e3109 | ||
![]() |
e662de94f6 | ||
![]() |
4fedf6efbd | ||
![]() |
1beb6b686a | ||
![]() |
50290c78b6 | ||
![]() |
0e984b6e7e | ||
![]() |
86f6f68274 | ||
![]() |
93a1d4f156 | ||
![]() |
80e8e20a89 | ||
![]() |
0efafdd408 | ||
![]() |
3718f5149a | ||
![]() |
3b8ca5f343 | ||
![]() |
b2f5bd7c60 | ||
![]() |
5ba4391cf2 | ||
![]() |
415a8bc249 | ||
![]() |
a3cbc8a004 | ||
![]() |
02dc3b6722 | ||
![]() |
0f084751b4 | ||
![]() |
d57b44153e | ||
![]() |
fcf1ec132f | ||
![]() |
4a31d0a9c9 | ||
![]() |
656c39909a | ||
![]() |
70bdf25284 | ||
![]() |
15af423d86 | ||
![]() |
8428dee47e | ||
![]() |
cf8097138e | ||
![]() |
c4c3e774cd | ||
![]() |
a19363ab25 | ||
![]() |
b6a39f61e5 | ||
![]() |
13d44a2281 | ||
![]() |
fad596a159 | ||
![]() |
55d85b89c0 | ||
![]() |
43bd843f37 | ||
![]() |
85dd0556d7 | ||
![]() |
e86e7c351d | ||
![]() |
c2f446f40e | ||
![]() |
d9d03d5af8 | ||
![]() |
b64fd093ad | ||
![]() |
bd4b7f8b25 | ||
![]() |
93d3cf52ab | ||
![]() |
33c7d6eb93 | ||
![]() |
9525d5b5ae | ||
![]() |
00cb9029f5 | ||
![]() |
72abf86870 | ||
![]() |
605fd0eda8 | ||
![]() |
4db695f932 | ||
![]() |
89936c66b0 | ||
![]() |
37690f2651 | ||
![]() |
6ae72f3980 | ||
![]() |
06071dc76d | ||
![]() |
c7a7982e23 |
2
Vagrantfile
vendored
2
Vagrantfile
vendored
@@ -6,7 +6,7 @@ Vagrant.configure(2) do |config|
|
||||
config.vm.define "qmk_firmware"
|
||||
|
||||
# VMware/Virtualbox ( and also Hyperv/Parallels) 64 bit
|
||||
config.vm.box = "generic/debian9"
|
||||
config.vm.box = "generic/debian10"
|
||||
|
||||
config.vm.synced_folder '.', '/vagrant'
|
||||
|
||||
|
@@ -1,22 +1,22 @@
|
||||
# Look for a json keymap file
|
||||
ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_5)/keymap.json)","")
|
||||
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
||||
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
|
||||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_5)/keymap.json
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_5)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_4)/keymap.json)","")
|
||||
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
||||
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
|
||||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_4)/keymap.json
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_4)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_3)/keymap.json)","")
|
||||
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
||||
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
|
||||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_3)/keymap.json
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_3)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_2)/keymap.json)","")
|
||||
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
||||
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
|
||||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_2)/keymap.json
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_2)
|
||||
else ifneq ("$(wildcard $(MAIN_KEYMAP_PATH_1)/keymap.json)","")
|
||||
KEYMAP_C := $(KEYBOARD_OUTPUT)/src/keymap.c
|
||||
KEYMAP_C := $(KEYMAP_OUTPUT)/keymap.c
|
||||
KEYMAP_JSON := $(MAIN_KEYMAP_PATH_1)/keymap.json
|
||||
KEYMAP_PATH := $(MAIN_KEYMAP_PATH_1)
|
||||
endif
|
||||
@@ -27,5 +27,5 @@ ifneq ("$(wildcard $(KEYMAP_PATH))", "")
|
||||
endif
|
||||
|
||||
# Generate the keymap.c
|
||||
$(KEYBOARD_OUTPUT)/src/keymap.c: $(KEYMAP_JSON)
|
||||
$(KEYMAP_C): $(KEYMAP_JSON)
|
||||
$(QMK_BIN) json2c --quiet --output $(KEYMAP_C) $(KEYMAP_JSON)
|
||||
|
@@ -103,6 +103,15 @@ MAIN_KEYMAP_PATH_5 := $(KEYBOARD_PATH_5)/keymaps/$(KEYMAP)
|
||||
INFO_RULES_MK = $(shell $(QMK_BIN) generate-rules-mk --quiet --escape --keyboard $(KEYBOARD) --output $(KEYBOARD_OUTPUT)/src/rules.mk)
|
||||
include $(INFO_RULES_MK)
|
||||
|
||||
ifneq ($(FORCE_LAYOUT),)
|
||||
TARGET := $(TARGET)_$(FORCE_LAYOUT)
|
||||
endif
|
||||
|
||||
# Object files and generated keymap directory
|
||||
# To put object files in current directory, use a dot (.), do NOT make
|
||||
# this an empty or blank macro!
|
||||
KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
|
||||
|
||||
# Check for keymap.json first, so we can regenerate keymap.c
|
||||
include build_json.mk
|
||||
|
||||
@@ -145,10 +154,6 @@ ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
|
||||
include platforms/chibios/QMK_PROTON_C/convert_to_proton_c.mk
|
||||
endif
|
||||
|
||||
ifneq ($(FORCE_LAYOUT),)
|
||||
TARGET := $(TARGET)_$(FORCE_LAYOUT)
|
||||
endif
|
||||
|
||||
include quantum/mcu_selection.mk
|
||||
|
||||
# Find all the C source files to be compiled in subfolders.
|
||||
@@ -327,11 +332,6 @@ endif
|
||||
# Disable features that a keyboard doesn't support
|
||||
-include disable_features.mk
|
||||
|
||||
# Object files directory
|
||||
# To put object files in current directory, use a dot (.), do NOT make
|
||||
# this an empty or blank macro!
|
||||
KEYMAP_OUTPUT := $(BUILD_DIR)/obj_$(TARGET)
|
||||
|
||||
ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","")
|
||||
CONFIG_H += $(KEYMAP_PATH)/config.h
|
||||
endif
|
||||
|
@@ -49,6 +49,7 @@ endif
|
||||
|
||||
include common_features.mk
|
||||
include $(TMK_PATH)/common.mk
|
||||
include $(QUANTUM_PATH)/debounce/tests/rules.mk
|
||||
include $(QUANTUM_PATH)/sequencer/tests/rules.mk
|
||||
include $(QUANTUM_PATH)/serial_link/tests/rules.mk
|
||||
ifneq ($(filter $(FULL_TESTS),$(TEST)),)
|
||||
|
@@ -244,7 +244,7 @@ endif
|
||||
endif
|
||||
|
||||
RGB_MATRIX_ENABLE ?= no
|
||||
VALID_RGB_MATRIX_TYPES := IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom
|
||||
VALID_RGB_MATRIX_TYPES := AW20216 IS31FL3731 IS31FL3733 IS31FL3737 IS31FL3741 WS2812 custom
|
||||
|
||||
ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes)
|
||||
ifeq ($(filter $(RGB_MATRIX_DRIVER),$(VALID_RGB_MATRIX_TYPES)),)
|
||||
@@ -261,6 +261,13 @@ endif
|
||||
CIE1931_CURVE := yes
|
||||
RGB_KEYCODES_ENABLE := yes
|
||||
|
||||
ifeq ($(strip $(RGB_MATRIX_DRIVER)), AW20216)
|
||||
OPT_DEFS += -DAW20216 -DSTM32_SPI -DHAL_USE_SPI=TRUE
|
||||
COMMON_VPATH += $(DRIVER_PATH)/awinic
|
||||
SRC += aw20216.c
|
||||
QUANTUM_LIB_SRC += spi_master.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(RGB_MATRIX_DRIVER)), IS31FL3731)
|
||||
OPT_DEFS += -DIS31FL3731 -DSTM32_I2C -DHAL_USE_I2C=TRUE
|
||||
COMMON_VPATH += $(DRIVER_PATH)/issi
|
||||
@@ -529,7 +536,11 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||
|
||||
# Determine which (if any) transport files are required
|
||||
ifneq ($(strip $(SPLIT_TRANSPORT)), custom)
|
||||
QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/transport.c
|
||||
QUANTUM_SRC += $(QUANTUM_DIR)/split_common/transport.c \
|
||||
$(QUANTUM_DIR)/split_common/transactions.c
|
||||
|
||||
OPT_DEFS += -DSPLIT_COMMON_TRANSACTIONS
|
||||
|
||||
# Functions added via QUANTUM_LIB_SRC are only included in the final binary if they're called.
|
||||
# Unused functions are pruned away, which is why we can add multiple drivers here without bloat.
|
||||
ifeq ($(PLATFORM),AVR)
|
||||
@@ -550,6 +561,11 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||
COMMON_VPATH += $(QUANTUM_PATH)/split_common
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(CRC_ENABLE)), yes)
|
||||
OPT_DEFS += -DCRC_ENABLE
|
||||
QUANTUM_LIB_SRC += crc.c
|
||||
endif
|
||||
|
||||
HAPTIC_ENABLE ?= no
|
||||
ifneq ($(strip $(HAPTIC_ENABLE)),no)
|
||||
COMMON_VPATH += $(DRIVER_PATH)/haptic
|
||||
@@ -580,6 +596,14 @@ ifeq ($(strip $(OLED_DRIVER_ENABLE)), yes)
|
||||
SRC += oled_driver.c
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(ST7565_ENABLE)), yes)
|
||||
OPT_DEFS += -DST7565_ENABLE
|
||||
COMMON_VPATH += $(DRIVER_PATH)/oled # For glcdfont.h
|
||||
COMMON_VPATH += $(DRIVER_PATH)/lcd
|
||||
QUANTUM_LIB_SRC += spi_master.c
|
||||
SRC += st7565.c
|
||||
endif
|
||||
|
||||
include $(DRIVER_PATH)/qwiic/qwiic.mk
|
||||
|
||||
ifeq ($(strip $(UCIS_ENABLE)), yes)
|
||||
|
@@ -59,8 +59,11 @@
|
||||
'cmm_studio/saka68': {
|
||||
target: 'cmm_studio/saka68/solder'
|
||||
},
|
||||
'crkbd/rev1': {
|
||||
target: 'crkbd/rev1/legacy'
|
||||
'crkbd/rev1/legacy': {
|
||||
target: 'crkbd/rev1'
|
||||
},
|
||||
'crkbd/rev1/common': {
|
||||
target: 'crkbd/rev1'
|
||||
},
|
||||
'doro67/multi': {
|
||||
layouts: {
|
||||
|
@@ -1,34 +1,22 @@
|
||||
{
|
||||
"$id": "qmk.api.keyboard.v1",
|
||||
"allOf": [
|
||||
{ "$ref": "qmk.keyboard.v1" },
|
||||
{"$ref": "qmk.keyboard.v1"},
|
||||
{
|
||||
"$id": "qmk.api.keyboard.v1",
|
||||
"keymaps": {
|
||||
"type": "string"
|
||||
},
|
||||
"parse_errors": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"parse_warnings": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"processor_type": {
|
||||
"type": "string"
|
||||
},
|
||||
"protocol": {
|
||||
"type": "string"
|
||||
},
|
||||
"keyboard_folder": {
|
||||
"type": "string"
|
||||
},
|
||||
"platform": {
|
||||
"type": "string"
|
||||
"properties": {
|
||||
"keymaps": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"url": {"type": "string"}
|
||||
}
|
||||
|
||||
},
|
||||
"parse_errors": {"$ref": "qmk.definitions.v1#/string_array"},
|
||||
"parse_warnings": {"$ref": "qmk.definitions.v1#/string_array"},
|
||||
"processor_type": {"type": "string"},
|
||||
"protocol": {"type": "string"},
|
||||
"keyboard_folder": {"type": "string"},
|
||||
"platform": {"type": "string"}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
107
data/schemas/definitions.jsonschema
Normal file
107
data/schemas/definitions.jsonschema
Normal file
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "qmk.definitions.v1",
|
||||
"title": "Common definitions used across QMK's jsonschemas.",
|
||||
"type": "object",
|
||||
"boolean_array": {
|
||||
"type": "object",
|
||||
"additionalProperties": {"type": "boolean"}
|
||||
},
|
||||
"filename": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"pattern": "^[0-9a-z_]*$"
|
||||
},
|
||||
"hex_number_2d": {
|
||||
"type": "string",
|
||||
"pattern": "^0x[0-9A-F]{2}$"
|
||||
},
|
||||
"hex_number_4d": {
|
||||
"type": "string",
|
||||
"pattern": "^0x[0-9A-F]{4}$"
|
||||
},
|
||||
"text_identifier": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 250
|
||||
},
|
||||
"layout_macro": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": ["LAYOUT", "LAYOUT_planck_1x2uC"]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^LAYOUT_[0-9a-z_]*$"
|
||||
}
|
||||
]
|
||||
},
|
||||
"key_unit": {
|
||||
"type": "number",
|
||||
"min": 0.25
|
||||
},
|
||||
"mcu_pin_array": {
|
||||
"type": "array",
|
||||
"items": {"$ref": "#/mcu_pin"}
|
||||
},
|
||||
"mcu_pin": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^LINE_PIN\\d{1,2}$"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"multipleOf": 1
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"signed_decimal": {
|
||||
"type": "number"
|
||||
},
|
||||
"signed_int": {
|
||||
"type": "number",
|
||||
"multipleOf": 1
|
||||
}
|
||||
"signed_int_8": {
|
||||
"type": "number",
|
||||
"min": -127,
|
||||
"max": 127,
|
||||
"multipleOf": 1
|
||||
}
|
||||
"string_array": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"string_object": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"unsigned_decimal": {
|
||||
"type": "number",
|
||||
"min": 0
|
||||
},
|
||||
"unsigned_int": {
|
||||
"type": "number",
|
||||
"min": 0,
|
||||
"multipleOf": 1
|
||||
}
|
||||
"unsigned_int_8": {
|
||||
"type": "number",
|
||||
"min": 0,
|
||||
"max": 255,
|
||||
"multipleOf": 1
|
||||
}
|
||||
}
|
@@ -1,24 +1,12 @@
|
||||
{
|
||||
"$schema": "http://json-schema.org/schema#",
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"$id": "qmk.keyboard.v1",
|
||||
"title": "Keyboard Information",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"keyboard_name": {
|
||||
"type": "string",
|
||||
"minLength": 2,
|
||||
"maxLength": 250
|
||||
},
|
||||
"maintainer": {
|
||||
"type": "string",
|
||||
"minLength": 2,
|
||||
"maxLength": 250
|
||||
},
|
||||
"manufacturer": {
|
||||
"type": "string",
|
||||
"minLength": 2,
|
||||
"maxLength": 250
|
||||
},
|
||||
"keyboard_name": {"$ref": "qmk.definitions.v1#/text_identifier"},
|
||||
"maintainer": {"$ref": "qmk.definitions.v1#/text_identifier"},
|
||||
"manufacturer": {"$ref": "qmk.definitions.v1#/text_identifier"},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
@@ -40,62 +28,25 @@
|
||||
"type": "string",
|
||||
"enum": ["COL2ROW", "ROW2COL"]
|
||||
},
|
||||
"debounce": {
|
||||
"type": "number",
|
||||
"min": 0,
|
||||
"multipleOf": 1
|
||||
},
|
||||
"height": {
|
||||
"type": "number",
|
||||
"min": 0.25
|
||||
},
|
||||
"width": {
|
||||
"type": "number",
|
||||
"min": 0.25
|
||||
},
|
||||
"debounce": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
||||
"height": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||
"width": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||
"community_layouts": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"minLength": 2,
|
||||
"pattern": "^[0-9a-z_]*$"
|
||||
}
|
||||
},
|
||||
"features": {
|
||||
"type": "object",
|
||||
"additionalProperties": {"type": "boolean"}
|
||||
"items": {"$ref": "qmk.definitions.v1#/filename"}
|
||||
},
|
||||
"features": {"$ref": "qmk.definitions.v1#/boolean_array"},
|
||||
"indicators": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"caps_lock": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
},
|
||||
"num_lock": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
},
|
||||
"scroll_lock": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
}
|
||||
"caps_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||
"num_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||
"scroll_lock": {"$ref": "qmk.definitions.v1#/mcu_pin"}
|
||||
}
|
||||
},
|
||||
"layout_aliases": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"enum": ["LAYOUT", "LAYOUT_planck_1x2uC"]
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^LAYOUT_[0-9a-z_]*$"
|
||||
}
|
||||
]
|
||||
}
|
||||
"additionalProperties": {"$ref": "qmk.definitions.v1#/layout_macro"}
|
||||
},
|
||||
"layouts": {
|
||||
"type": "object",
|
||||
@@ -109,11 +60,7 @@
|
||||
"c_macro": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"key_count": {
|
||||
"type": "number",
|
||||
"min": 0,
|
||||
"multipleOf": 1
|
||||
},
|
||||
"key_count": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||
"layout": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
@@ -131,34 +78,14 @@
|
||||
"multipleOf": 1
|
||||
}
|
||||
},
|
||||
"h": {
|
||||
"type": "number",
|
||||
"min": 0.25
|
||||
},
|
||||
"r": {
|
||||
"type": "number",
|
||||
"min": 0
|
||||
},
|
||||
"rx": {
|
||||
"type": "number",
|
||||
"min": 0
|
||||
},
|
||||
"ry": {
|
||||
"type": "number",
|
||||
"min": 0
|
||||
},
|
||||
"w": {
|
||||
"type": "number",
|
||||
"min": 0.25
|
||||
},
|
||||
"x": {
|
||||
"type": "number",
|
||||
"min": 0
|
||||
},
|
||||
"y": {
|
||||
"type": "number",
|
||||
"min": 0
|
||||
}
|
||||
"key_count": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||
"r": {"$ref": "qmk.definitions.v1#/unsigned_decimal"},
|
||||
"rx": {"$ref": "qmk.definitions.v1#/unsigned_decimal"},
|
||||
"ry": {"$ref": "qmk.definitions.v1#/unsigned_decimal"},
|
||||
"h": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||
"w": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||
"x": {"$ref": "qmk.definitions.v1#/key_unit"},
|
||||
"y": {"$ref": "qmk.definitions.v1#/key_unit"}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -171,61 +98,10 @@
|
||||
"properties": {
|
||||
"direct": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"multipleOf": 1
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
"items": {$ref": "qmk.definitions.v1#/mcu_pin_array"}
|
||||
},
|
||||
"cols": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"multipleOf": 1
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"rows": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"oneOf": [
|
||||
{
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
},
|
||||
{
|
||||
"type": "number",
|
||||
"multipleOf": 1
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
"cols": {"$ref": "qmk.definitions.v1#/mcu_pin_array"},
|
||||
"rows": {"$ref": "qmk.definitions.v1#/mcu_pin_array"}
|
||||
}
|
||||
},
|
||||
"rgblight": {
|
||||
@@ -238,47 +114,19 @@
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"brightness_steps": {
|
||||
"type": "number",
|
||||
"min": 0,
|
||||
"multipleOf": 1
|
||||
},
|
||||
"hue_steps": {
|
||||
"type": "number",
|
||||
"min": 0,
|
||||
"multipleOf": 1
|
||||
},
|
||||
"led_count": {
|
||||
"type": "number",
|
||||
"min": 0,
|
||||
"multipleOf": 1
|
||||
},
|
||||
"max_brightness": {
|
||||
"type": "number",
|
||||
"min": 0,
|
||||
"max": 255,
|
||||
"multipleOf": 1
|
||||
},
|
||||
"pin": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
},
|
||||
"saturation_steps": {
|
||||
"type": "number",
|
||||
"min": 0,
|
||||
"multipleOf": 1
|
||||
},
|
||||
"brightness_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
||||
"hue_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
||||
"led_count": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
||||
"max_brightness": {"$ref": "qmk.definitions.v1#/unsigned_int_8"},
|
||||
"pin": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||
"saturation_steps": {"$ref": "qmk.definitions.v1#/unsigned_int"},
|
||||
"sleep": {"type": "boolean"},
|
||||
"split": {"type": "boolean"},
|
||||
"split_count": {
|
||||
"type": "array",
|
||||
"minLength": 2,
|
||||
"maxLength": 2,
|
||||
"items": {
|
||||
"type": "number",
|
||||
"min": 0,
|
||||
"multipleOf": 1
|
||||
}
|
||||
"items": {"$ref": "qmk.definitions.v1#/unsigned_int"}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -286,40 +134,19 @@
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"device_ver": {
|
||||
"type": "string",
|
||||
"pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]"
|
||||
},
|
||||
"pid": {
|
||||
"type": "string",
|
||||
"pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]"
|
||||
},
|
||||
"vid": {
|
||||
"type": "string",
|
||||
"pattern": "^[0-9A-F]x[0-9A-F][0-9A-F][0-9A-F][0-9A-F]"
|
||||
}
|
||||
"device_ver": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
|
||||
"pid": {"$ref": "qmk.definitions.v1#/hex_number_4d"},
|
||||
"vid": {"$ref": "qmk.definitions.v1#/hex_number_4d"}
|
||||
}
|
||||
},
|
||||
"qmk_lufa_bootloader": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"esc_output": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
},
|
||||
"esc_input": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
},
|
||||
"led": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
},
|
||||
"speaker": {
|
||||
"type": "string",
|
||||
"pattern": "^[A-K]\\d{1,2}$"
|
||||
}
|
||||
"esc_output": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||
"esc_input": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||
"led": {"$ref": "qmk.definitions.v1#/mcu_pin"},
|
||||
"speaker": {"$ref": "qmk.definitions.v1#/mcu_pin"}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -93,6 +93,7 @@
|
||||
* Hardware Features
|
||||
* Displays
|
||||
* [HD44780 LCD Controller](feature_hd44780.md)
|
||||
* [ST7565 LCD Driver](feature_st7565.md)
|
||||
* [OLED Driver](feature_oled_driver.md)
|
||||
* Lighting
|
||||
* [Backlight](feature_backlight.md)
|
||||
|
@@ -100,3 +100,7 @@ This happens immediately after the previous `develop` branch is merged.
|
||||
* [ ] `git pull --ff-only`
|
||||
* [ ] `git merge --no-ff develop`
|
||||
* [ ] `git push upstream master`
|
||||
|
||||
## Post-merge operations
|
||||
|
||||
* (Optional) [update ChibiOS + ChibiOS-Contrib on `develop`](chibios_upgrade_instructions.md)
|
||||
|
56
docs/chibios_upgrade_instructions.md
Normal file
56
docs/chibios_upgrade_instructions.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# ChibiOS Upgrade Procedure
|
||||
|
||||
ChibiOS and ChibiOS-Contrib need to be updated in tandem -- the latter has a branch tied to the ChibiOS version in use and should not be mixed with different versions.
|
||||
|
||||
## Getting ChibiOS
|
||||
|
||||
* `svn` Initialisation:
|
||||
* Only needed to be done once
|
||||
* You might need to separately install `git-svn` package in your OS's package manager
|
||||
* `git svn init --stdlayout --prefix='svn/' http://svn.osdn.net/svnroot/chibios/`
|
||||
* `git remote add qmk git@github.com:qmk/ChibiOS.git`
|
||||
* Updating:
|
||||
* `git svn fetch`
|
||||
* First time around this will take several hours
|
||||
* Subsequent updates will be incremental only
|
||||
* Tagging example (work out which version first!):
|
||||
* `git tag -a ver20.3.3 -m ver20.3.3 svn/tags/ver20.3.3`
|
||||
* `git push qmk ver20.3.3`
|
||||
* `git tag -a breaking_YYYY_qN -m breaking_YYYY_qN svn/tags/ver20.3.3`
|
||||
* `git push qmk breaking_YYYY_qN`
|
||||
|
||||
## Getting ChibiOS-Contrib
|
||||
|
||||
* `git` Initialisation:
|
||||
* `git clone git@github.com:qmk/ChibiOS-Contrib`
|
||||
* `git remote add upstream https://github.com/ChibiOS/ChibiOS-Contrib`
|
||||
* `git checkout -b chibios-20.3.x upstream/chibios-20.3.x`
|
||||
* Updating:
|
||||
* `git fetch --all --tags --prune`
|
||||
* `git checkout chibios-20.3.x`
|
||||
* `git pull --ff-only`
|
||||
* `git push origin chibios-20.3.x`
|
||||
* `git tag -a breaking_YYYY_qN -m breaking_YYYY_qN chibios-20.3.x`
|
||||
* `git push origin breaking_YYYY_qN`
|
||||
|
||||
## Updating submodules
|
||||
|
||||
* Update the submodules
|
||||
* `cd $QMK_FIRMWARE`
|
||||
* `git checkout develop`
|
||||
* `git pull --ff-only`
|
||||
* `git checkout -b chibios-version-bump`
|
||||
* `cd lib/chibios`
|
||||
* `git fetch --all --tags --prune`
|
||||
* `git checkout breaking_YYYY_qN`
|
||||
* `cd ../chibios-contrib`
|
||||
* `git fetch --all --tags --prune`
|
||||
* `git checkout breaking_YYYY_qN`
|
||||
* Build everything
|
||||
* `cd $QMK_FIRMWARE`
|
||||
* `qmk multibuild -j4`
|
||||
* Make sure there are no errors
|
||||
* Push to the repo
|
||||
* `git commit -am 'Update ChibiOS to XXXXXXXXX'`
|
||||
* `git push --set-upstream origin chibios-version-bump`
|
||||
* Make a PR to qmk_firmware with the new branch
|
@@ -51,8 +51,10 @@ This is a C header file that is one of the first things included, and will persi
|
||||
* the number of columns in your keyboard's matrix
|
||||
* `#define MATRIX_ROW_PINS { D0, D5, B5, B6 }`
|
||||
* pins of the rows, from top to bottom
|
||||
* may be omitted by the keyboard designer if matrix reads are handled in an alternate manner. See [low-level matrix overrides](custom_quantum_functions.md?id=low-level-matrix-overrides) for more information.
|
||||
* `#define MATRIX_COL_PINS { F1, F0, B0, C7, F4, F5, F6, F7, D4, D6, B4, D7 }`
|
||||
* pins of the columns, from left to right
|
||||
* may be omitted by the keyboard designer if matrix reads are handled in an alternate manner. See [low-level matrix overrides](custom_quantum_functions.md?id=low-level-matrix-overrides) for more information.
|
||||
* `#define MATRIX_IO_DELAY 30`
|
||||
* the delay in microseconds when between changing matrix pin state and reading values
|
||||
* `#define UNUSED_PINS { D1, D2, D3, B1, B2, B3 }`
|
||||
@@ -272,7 +274,7 @@ There are a few different ways to set handedness for split keyboards (listed in
|
||||
### Other Options
|
||||
|
||||
* `#define USE_I2C`
|
||||
* For using I2C instead of Serial (defaults to serial)
|
||||
* For using I2C instead of Serial (default is serial; serial transport is supported on ARM -- I2C is AVR-only)
|
||||
|
||||
* `#define SOFT_SERIAL_PIN D0`
|
||||
* When using serial, define this. `D0` or `D1`,`D2`,`D3`,`E6`.
|
||||
@@ -280,6 +282,7 @@ There are a few different ways to set handedness for split keyboards (listed in
|
||||
* `#define MATRIX_ROW_PINS_RIGHT { <row pins> }`
|
||||
* `#define MATRIX_COL_PINS_RIGHT { <col pins> }`
|
||||
* If you want to specify a different pinout for the right half than the left half, you can define `MATRIX_ROW_PINS_RIGHT`/`MATRIX_COL_PINS_RIGHT`. Currently, the size of `MATRIX_ROW_PINS` must be the same as `MATRIX_ROW_PINS_RIGHT` and likewise for the definition of columns.
|
||||
* may be omitted by the keyboard designer if matrix reads are handled in an alternate manner. See [low-level matrix overrides](custom_quantum_functions.md?id=low-level-matrix-overrides) for more information.
|
||||
|
||||
* `#define DIRECT_PINS_RIGHT { { F1, F0, B0, C7 }, { F4, F5, F6, F7 } }`
|
||||
* If you want to specify a different direct pinout for the right half than the left half, you can define `DIRECT_PINS_RIGHT`. Currently, the size of `DIRECT_PINS` must be the same as `DIRECT_PINS_RIGHT`.
|
||||
@@ -300,7 +303,7 @@ There are a few different ways to set handedness for split keyboards (listed in
|
||||
* `#define SPLIT_USB_DETECT`
|
||||
* Detect (with timeout) USB connection when delegating master/slave
|
||||
* Default behavior for ARM
|
||||
* Required for AVR Teensy
|
||||
* Required for AVR Teensy (without hardware mods)
|
||||
|
||||
* `#define SPLIT_USB_TIMEOUT 2000`
|
||||
* Maximum timeout when detecting master/slave when using `SPLIT_USB_DETECT`
|
||||
@@ -308,6 +311,28 @@ There are a few different ways to set handedness for split keyboards (listed in
|
||||
* `#define SPLIT_USB_TIMEOUT_POLL 10`
|
||||
* Poll frequency when detecting master/slave when using `SPLIT_USB_DETECT`
|
||||
|
||||
* `#define FORCED_SYNC_THROTTLE_MS 100`
|
||||
* Deadline for synchronizing data from master to slave when using the QMK-provided split transport.
|
||||
|
||||
* `#define SPLIT_TRANSPORT_MIRROR`
|
||||
* Mirrors the master-side matrix on the slave when using the QMK-provided split transport.
|
||||
|
||||
* `#define SPLIT_LAYER_STATE_ENABLE`
|
||||
* Ensures the current layer state is available on the slave when using the QMK-provided split transport.
|
||||
|
||||
* `#define SPLIT_LED_STATE_ENABLE`
|
||||
* Ensures the current host indicator state (caps/num/scroll) is available on the slave when using the QMK-provided split transport.
|
||||
|
||||
* `#define SPLIT_MODS_ENABLE`
|
||||
* Ensures the current modifier state (normal, weak, and oneshot) is available on the slave when using the QMK-provided split transport.
|
||||
|
||||
* `#define SPLIT_WPM_ENABLE`
|
||||
* Ensures the current WPM is available on the slave when using the QMK-provided split transport.
|
||||
|
||||
* `#define SPLIT_TRANSACTION_IDS_KB .....`
|
||||
* `#define SPLIT_TRANSACTION_IDS_USER .....`
|
||||
* Allows for custom data sync with the slave when using the QMK-provided split transport. See [custom data sync between sides](feature_split_keyboard.md#custom-data-sync) for more information.
|
||||
|
||||
# The `rules.mk` File
|
||||
|
||||
This is a [make](https://www.gnu.org/software/make/manual/make.html) file that is included by the top-level `Makefile`. It is used to set some information about the MCU that we will be compiling for as well as enabling and disabling certain features.
|
||||
|
@@ -144,6 +144,14 @@ This is useful for setting up stuff that you may need elsewhere, but isn't hardw
|
||||
* Keyboard/Revision: `void matrix_init_kb(void)`
|
||||
* Keymap: `void matrix_init_user(void)`
|
||||
|
||||
### Low-level Matrix Overrides Function Documentation :id=low-level-matrix-overrides
|
||||
|
||||
* GPIO pin initialisation: `void matrix_init_pins(void)`
|
||||
* This needs to perform the low-level initialisation of all row and column pins. By default this will initialise the input/output state of each of the GPIO pins listed in `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`, based on whether or not the keyboard is set up for `ROW2COL`, `COL2ROW`, or `DIRECT_PINS`. Should the keyboard designer override this function, no initialisation of pin state will occur within QMK itself, instead deferring to the keyboard's override.
|
||||
* `COL2ROW`-based row reads: `void matrix_read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col)`
|
||||
* `ROW2COL`-based column reads: `void matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)`
|
||||
* `DIRECT_PINS`-based reads: `void matrix_read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row)`
|
||||
* These three functions need to perform the low-level retrieval of matrix state of relevant input pins, based on the matrix type. Only one of the functions should be implemented, if needed. By default this will iterate through `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`, configuring the inputs and outputs based on whether or not the keyboard is set up for `ROW2COL`, `COL2ROW`, or `DIRECT_PINS`. Should the keyboard designer override this function, no manipulation of matrix GPIO pin state will occur within QMK itself, instead deferring to the keyboard's override.
|
||||
|
||||
## Keyboard Post Initialization code
|
||||
|
||||
|
@@ -121,16 +121,16 @@ DEBOUNCE_TYPE = <name of algorithm>
|
||||
Where name of algorithm is one of:
|
||||
* ```sym_defer_g``` - debouncing per keyboard. On any state change, a global timer is set. When ```DEBOUNCE``` milliseconds of no changes has occurred, all input changes are pushed.
|
||||
* This is the current default algorithm. This is the highest performance algorithm with lowest memory usage, and it's also noise-resistant.
|
||||
* ```sym_eager_pr``` - debouncing per row. On any state change, response is immediate, followed by locking the row ```DEBOUNCE``` milliseconds of no further input for that row.
|
||||
* ```sym_eager_pr``` - debouncing per row. On any state change, response is immediate, followed by locking the row ```DEBOUNCE``` milliseconds of no further input for that row.
|
||||
For use in keyboards where refreshing ```NUM_KEYS``` 8-bit counters is computationally expensive / low scan rate, and fingers usually only hit one row at a time. This could be
|
||||
appropriate for the ErgoDox models; the matrix is rotated 90°, and hence its "rows" are really columns, and each finger only hits a single "row" at a time in normal use.
|
||||
* ```sym_eager_pk``` - debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that key
|
||||
* ```sym_defer_pk``` - debouncing per key. On any state change, a per-key timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that key, the key status change is pushed.
|
||||
* ```asym_eager_defer_pk``` - debouncing per key. On a key-down state change, response is immediate, followed by ```DEBOUNCE``` milliseconds of no further input for that key. On a key-up state change, a per-key timer is set. When ```DEBOUNCE``` milliseconds of no changes have occurred on that key, the key-up status change is pushed.
|
||||
|
||||
### A couple algorithms that could be implemented in the future:
|
||||
* ```sym_defer_pr```
|
||||
* ```sym_eager_g```
|
||||
* ```asym_eager_defer_pk```
|
||||
|
||||
### Use your own debouncing code
|
||||
You have the option to implement you own debouncing algorithm. To do this:
|
||||
|
@@ -162,4 +162,28 @@ This will set what sequence HPT_RST will set as the active mode. If not defined,
|
||||
|
||||
### DRV2605L Continuous Haptic Mode
|
||||
|
||||
This mode sets continuous haptic feedback with the option to increase or decrease strength.
|
||||
This mode sets continuous haptic feedback with the option to increase or decrease strength.
|
||||
|
||||
## Haptic Key Exclusion
|
||||
The Haptic Exclusion is implemented as `__attribute__((weak)) bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t *record)` in haptic.c. This allows a re-definition at the required level with the specific requirement / exclusion.
|
||||
|
||||
### NO_HAPTIC_MOD
|
||||
With the entry of `#define NO_HAPTIC_MOD` in config.h, modifiers from Left Control to Right GUI will not trigger a feedback. This also includes modifiers in a Mod Tap configuration.
|
||||
|
||||
### NO_HAPTIC_FN
|
||||
With the entry of `#define NO_HAPTIC_FN` in config.h, layer keys will not rigger a feedback.
|
||||
|
||||
### NO_HAPTIC_ALPHA
|
||||
With the entry of `#define NO_HAPTIC_ALPHA` in config.h, none of the alpha keys (A ... Z) will trigger a feedback.
|
||||
|
||||
### NO_HAPTIC_PUNCTUATION
|
||||
With the entry of `#define NO_HAPTIC_PUNCTUATION` in config.h, none of the following keys will trigger a feedback: Enter, ESC, Backspace, Space, Minus, Equal, Left Bracket, Right Bracket, Backslash, Non-US Hash, Semicolon, Quote, Grave, Comma, Slash, Dot, Non-US Backslash.
|
||||
|
||||
### NO_HAPTIC_LOCKKEYS
|
||||
With the entry of `#define NO_HAPTIC_LOCKKEYS` in config.h, none of the following keys will trigger a feedback: Caps Lock, Scroll Lock, Num Lock.
|
||||
|
||||
### NO_HAPTIC_NAV
|
||||
With the entry of `#define NO_HAPTIC_NAV` in config.h, none of the following keys will trigger a feedback: Print Screen, Pause, Insert, Delete, Page Down, Page Up, Left Arrow, Up Arrow, Right Arrow, Down Arrow, End, Home.
|
||||
|
||||
### NO_HAPTIC_NUMERIC
|
||||
With the entry of `#define NO_HAPTIC_NUMERIC` in config.h, none of the following keys between 0 and 9 (KC_1 ... KC_0) will trigger a feedback.
|
@@ -346,6 +346,10 @@ bool oled_scroll_left(void);
|
||||
// Returns true if the screen was not scrolling or stops scrolling
|
||||
bool oled_scroll_off(void);
|
||||
|
||||
// Inverts the display
|
||||
// Returns true if the screen was or is inverted
|
||||
bool oled_invert(bool invert);
|
||||
|
||||
// Returns the maximum number of characters that will fit on a line
|
||||
uint8_t oled_max_chars(void);
|
||||
|
||||
|
@@ -227,6 +227,74 @@ Configure the hardware via your `config.h`:
|
||||
#define DRIVER_LED_TOTAL 70
|
||||
```
|
||||
|
||||
---
|
||||
### AW20216 :id=aw20216
|
||||
There is basic support for addressable RGB matrix lighting with the SPI AW20216 RGB controller. To enable it, add this to your `rules.mk`:
|
||||
|
||||
```makefile
|
||||
RGB_MATRIX_ENABLE = yes
|
||||
RGB_MATRIX_DRIVER = AW20216
|
||||
```
|
||||
|
||||
You can use up to 2 AW20216 IC's. Do not specify `DRIVER_<N>_xxx` defines for IC's that are not present on your keyboard. You can define the following items in `config.h`:
|
||||
|
||||
| Variable | Description | Default |
|
||||
|----------|-------------|---------|
|
||||
| `DRIVER_1_CS` | (Required) MCU pin connected to first RGB driver chip select line | B13 |
|
||||
| `DRIVER_2_CS` | (Optional) MCU pin connected to second RGB driver chip select line | |
|
||||
| `DRIVER_1_EN` | (Required) MCU pin connected to first RGB driver hardware enable line | C13 |
|
||||
| `DRIVER_2_EN` | (Optional) MCU pin connected to second RGB driver hardware enable line | |
|
||||
| `DRIVER_1_LED_TOTAL` | (Required) How many RGB lights are connected to first RGB driver | |
|
||||
| `DRIVER_2_LED_TOTAL` | (Optional) How many RGB lights are connected to second RGB driver | |
|
||||
| `DRIVER_COUNT` | (Required) How many RGB driver IC's are present | |
|
||||
| `DRIVER_LED_TOTAL` | (Required) How many RGB lights are present across all drivers | |
|
||||
| `AW_SCALING_MAX` | (Optional) LED current scaling value (0-255, higher values mean LED is brighter at full PWM) | 150 |
|
||||
| `AW_GLOBAL_CURRENT_MAX` | (Optional) Driver global current limit (0-255, higher values means the driver may consume more power) | 150 |
|
||||
|
||||
Here is an example using 2 drivers.
|
||||
|
||||
```c
|
||||
#define DRIVER_1_CS B13
|
||||
#define DRIVER_2_CS B14
|
||||
// Hardware enable lines may be connected to the same pin
|
||||
#define DRIVER_1_EN C13
|
||||
#define DRIVER_2_EN C13
|
||||
|
||||
#define DRIVER_COUNT 2
|
||||
#define DRIVER_1_LED_TOTAL 66
|
||||
#define DRIVER_2_LED_TOTAL 32
|
||||
#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
|
||||
```
|
||||
|
||||
!> Note the parentheses, this is so when `DRIVER_LED_TOTAL` is used in code and expanded, the values are added together before any additional math is applied to them. As an example, `rand() % (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)` will give very different results than `rand() % DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL`.
|
||||
|
||||
Define these arrays listing all the LEDs in your `<keyboard>.c`:
|
||||
|
||||
```c
|
||||
const aw_led g_aw_leds[DRIVER_LED_TOTAL] = {
|
||||
/* Each AW20216 channel is controlled by a register at some offset between 0x00
|
||||
* and 0xD7 inclusive.
|
||||
* See drivers/awinic/aw20216.h for the mapping between register offsets and
|
||||
* driver pin locations.
|
||||
* driver
|
||||
* | R location
|
||||
* | | G location
|
||||
* | | | B location
|
||||
* | | | | */
|
||||
{ 0, CS1_SW1, CS2_SW1, CS3_SW1 },
|
||||
{ 0, CS4_SW1, CS5_SW1, CS6_SW1 },
|
||||
{ 0, CS7_SW1, CS8_SW1, CS9_SW1 },
|
||||
{ 0, CS10_SW1, CS11_SW1, CS12_SW1 },
|
||||
{ 0, CS13_SW1, CS14_SW1, CS15_SW1 },
|
||||
...
|
||||
{ 1, CS1_SW1, CS2_SW1, CS3_SW1 },
|
||||
{ 1, CS13_SW1, CS14_SW1, CS15_SW1 },
|
||||
{ 1, CS16_SW1, CS17_SW1, CS18_SW1 },
|
||||
{ 1, CS4_SW2, CS5_SW2, CS6_SW2 },
|
||||
...
|
||||
};
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Common Configuration :id=common-configuration
|
||||
|
@@ -8,8 +8,7 @@ QMK Firmware has a generic implementation that is usable by any board, as well a
|
||||
|
||||
For this, we will mostly be talking about the generic implementation used by the Let's Split and other keyboards.
|
||||
|
||||
!> ARM is not yet fully supported for Split Keyboards and has many limitations. Progress is being made, but we have not yet reached 100% feature parity.
|
||||
|
||||
!> ARM split supports most QMK subsystems when using the 'serial' and 'serial_usart' drivers. I2C slave is currently unsupported.
|
||||
|
||||
## Compatibility Overview
|
||||
|
||||
@@ -169,7 +168,7 @@ Because not every split keyboard is identical, there are a number of additional
|
||||
#define USE_I2C
|
||||
```
|
||||
|
||||
This enables I<sup>2</sup>C support for split keyboards. This isn't strictly for communication, but can be used for OLED or other I<sup>2</sup>C-based devices.
|
||||
This configures the use of I<sup>2</sup>C support for split keyboard transport (AVR only).
|
||||
|
||||
```c
|
||||
#define SOFT_SERIAL_PIN D0
|
||||
@@ -193,20 +192,115 @@ If you're having issues with serial communication, you can change this value, as
|
||||
* **`5`**: about 20kbps
|
||||
|
||||
```c
|
||||
#define SPLIT_MODS_ENABLE
|
||||
#define FORCED_SYNC_THROTTLE_MS 100
|
||||
```
|
||||
|
||||
This enables transmitting modifier state (normal, weak and oneshot) to the non
|
||||
primary side of the split keyboard. This adds a few bytes of data to the split
|
||||
communication protocol and may impact the matrix scan speed when enabled.
|
||||
The purpose of this feature is to support cosmetic use of modifer state (e.g.
|
||||
displaying status on an OLED screen).
|
||||
This sets the maximum number of milliseconds before forcing a synchronization of data from master to slave. Under normal circumstances this sync occurs whenever the data _changes_, for safety a data transfer occurs after this number of milliseconds if no change has been detected since the last sync.
|
||||
|
||||
```c
|
||||
#define SPLIT_TRANSPORT_MIRROR
|
||||
```
|
||||
|
||||
This mirrors the master side matrix to the slave side for features that react or require knowledge of master side key presses on the slave side. This adds a few bytes of data to the split communication protocol and may impact the matrix scan speed when enabled. The purpose of this feature is to support cosmetic use of key events (e.g. RGB reacting to Keypresses).
|
||||
This mirrors the master side matrix to the slave side for features that react or require knowledge of master side key presses on the slave side. The purpose of this feature is to support cosmetic use of key events (e.g. RGB reacting to keypresses). This adds overhead to the split communication protocol and may negatively impact the matrix scan speed when enabled.
|
||||
|
||||
```c
|
||||
#define SPLIT_LAYER_STATE_ENABLE
|
||||
```
|
||||
|
||||
This enables syncing of the layer state between both halves of the split keyboard. The main purpose of this feature is to enable support for use of things like OLED display of the currently active layer. This adds overhead to the split communication protocol and may negatively impact the matrix scan speed when enabled.
|
||||
|
||||
```c
|
||||
#define SPLIT_LED_STATE_ENABLE
|
||||
```
|
||||
|
||||
This enables syncing of the Host LED status (caps lock, num lock, etc) between both halves of the split keyboard. The main purpose of this feature is to enable support for use of things like OLED display of the Host LED status. This adds overhead to the split communication protocol and may negatively impact the matrix scan speed when enabled.
|
||||
|
||||
```c
|
||||
#define SPLIT_MODS_ENABLE
|
||||
```
|
||||
|
||||
This enables transmitting modifier state (normal, weak and oneshot) to the non primary side of the split keyboard. The purpose of this feature is to support cosmetic use of modifer state (e.g. displaying status on an OLED screen). This adds overhead to the split communication protocol and may negatively impact the matrix scan speed when enabled.
|
||||
|
||||
```c
|
||||
#define SPLIT_WPM_ENABLE
|
||||
```
|
||||
|
||||
This enables transmitting the current WPM to the slave side of the split keyboard. The purpose of this feature is to support cosmetic use of WPM (e.g. displaying the current value on an OLED screen). This adds overhead to the split communication protocol and may negatively impact the matrix scan speed when enabled.
|
||||
|
||||
### Custom data sync between sides :id=custom-data-sync
|
||||
|
||||
QMK's split transport allows for arbitrary data transactions at both the keyboard and user levels. This is modelled on a remote procedure call, with the master invoking a function on the slave side, with the ability to send data from master to slave, process it slave side, and send data back from slave to master.
|
||||
|
||||
To leverage this, a keyboard or user/keymap can define a comma-separated list of _transaction IDs_:
|
||||
|
||||
```c
|
||||
// for keyboard-level data sync:
|
||||
#define SPLIT_TRANSACTION_IDS_KB KEYBOARD_SYNC_A, KEYBOARD_SYNC_B
|
||||
// or, for user:
|
||||
#define SPLIT_TRANSACTION_IDS_USER USER_SYNC_A, USER_SYNC_B, USER_SYNC_C
|
||||
```
|
||||
|
||||
These _transaction IDs_ then need a slave-side handler function to be registered with the split transport, for example:
|
||||
|
||||
```c
|
||||
typedef struct _master_to_slave_t {
|
||||
int m2s_data;
|
||||
} master_to_slave_t;
|
||||
|
||||
typedef struct _slave_to_master_t {
|
||||
int s2m_data;
|
||||
} slave_to_master_t;
|
||||
|
||||
void user_sync_a_slave_handler(uint8_t in_buflen, const void* in_data, uint8_t out_buflen, void* out_data) {
|
||||
const master_to_slave_t *m2s = (const master_to_slave_t*)in_data;
|
||||
slave_to_master_t *s2m = (slave_to_master_t*)out_data;
|
||||
s2m->s2m_data = m2s->m2s_data + 5; // whatever comes in, add 5 so it can be sent back
|
||||
}
|
||||
|
||||
void keyboard_post_init_user(void) {
|
||||
transaction_register_rpc(USER_SYNC_A, user_sync_a_slave_handler);
|
||||
}
|
||||
```
|
||||
|
||||
The master side can then invoke the slave-side handler - for normal keyboard functionality to be minimally affected, any keyboard- or user-level code attempting to sync data should be throttled:
|
||||
|
||||
```c
|
||||
void housekeeping_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
// Interact with slave every 500ms
|
||||
static uint32_t last_sync = 0;
|
||||
if (timer_elapsed32(last_sync) > 500) {
|
||||
master_to_slave_t m2s = {6};
|
||||
slave_to_master_t s2m = {0};
|
||||
if(transaction_rpc_exec(USER_SYNC_A, sizeof(m2s), &m2s, sizeof(s2m), &s2m)) {
|
||||
last_sync = timer_read32();
|
||||
dprintf("Slave value: %d\n", s2m.s2m_data); // this will now be 11, as the slave adds 5
|
||||
} else {
|
||||
dprint("Slave sync failed!\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
!> It is recommended that any data sync between halves happens during the master side's _housekeeping task_. This ensures timely retries should failures occur.
|
||||
|
||||
If only one-way data transfer is needed, helper methods are provided:
|
||||
|
||||
```c
|
||||
bool transaction_rpc_exec(int8_t transaction_id, uint8_t initiator2target_buffer_size, const void *initiator2target_buffer, uint8_t target2initiator_buffer_size, void *target2initiator_buffer);
|
||||
bool transaction_rpc_send(int8_t transaction_id, uint8_t initiator2target_buffer_size, const void *initiator2target_buffer);
|
||||
bool transaction_rpc_recv(int8_t transaction_id, uint8_t target2initiator_buffer_size, void *target2initiator_buffer);
|
||||
```
|
||||
|
||||
By default, the inbound and outbound data is limited to a maximum of 32 bytes each. The sizes can be altered if required:
|
||||
|
||||
```c
|
||||
// Master to slave:
|
||||
#define RPC_M2S_BUFFER_SIZE 48
|
||||
// Slave to master:
|
||||
#define RPC_S2M_BUFFER_SIZE 48
|
||||
```
|
||||
|
||||
### Hardware Configuration Options
|
||||
|
||||
|
274
docs/feature_st7565.md
Normal file
274
docs/feature_st7565.md
Normal file
@@ -0,0 +1,274 @@
|
||||
# ST7565 LCD Driver
|
||||
|
||||
## Supported Hardware
|
||||
|
||||
LCD modules using ST7565 driver IC, communicating over SPI.
|
||||
|
||||
|Module |IC |Size |Notes |
|
||||
|------------------------------|-------|------|----------------------------------------------------------|
|
||||
|Newhaven Display NHD-C12832A1Z|ST7565R|128x32|Used by Ergodox Infinity; primary consumer of this feature|
|
||||
|Zolentech ZLE12864B |ST7565P|128x64|Requires contrast adjustment |
|
||||
|
||||
## Usage
|
||||
|
||||
To enable the feature, there are three steps. First, when compiling your keyboard, you'll need to add the following to your `rules.mk`:
|
||||
|
||||
```make
|
||||
ST7565_ENABLE = yes
|
||||
```
|
||||
|
||||
Then in your `keymap.c` file, implement the ST7565 task call. This example assumes your keymap has three layers named `_QWERTY`, `_FN` and `_ADJ`:
|
||||
|
||||
```c
|
||||
#ifdef ST7565_ENABLE
|
||||
void st7565_task_user(void) {
|
||||
// Host Keyboard Layer Status
|
||||
st7565_write_P(PSTR("Layer: "), false);
|
||||
|
||||
switch (get_highest_layer(layer_state)) {
|
||||
case _QWERTY:
|
||||
st7565_write_P(PSTR("Default\n"), false);
|
||||
break;
|
||||
case _FN:
|
||||
st7565_write_P(PSTR("FN\n"), false);
|
||||
break;
|
||||
case _ADJ:
|
||||
st7565_write_P(PSTR("ADJ\n"), false);
|
||||
break;
|
||||
default:
|
||||
// Or use the write_ln shortcut over adding '\n' to the end of your string
|
||||
st7565_write_ln_P(PSTR("Undefined"), false);
|
||||
}
|
||||
|
||||
// Host Keyboard LED Status
|
||||
led_t led_state = host_keyboard_led_state();
|
||||
st7565_write_P(led_state.num_lock ? PSTR("NUM ") : PSTR(" "), false);
|
||||
st7565_write_P(led_state.caps_lock ? PSTR("CAP ") : PSTR(" "), false);
|
||||
st7565_write_P(led_state.scroll_lock ? PSTR("SCR ") : PSTR(" "), false);
|
||||
}
|
||||
#endif
|
||||
```
|
||||
|
||||
## Logo Example
|
||||
|
||||
In the default font, certain ranges of characters are reserved for a QMK logo. To render this logo to the screen, use the following code example:
|
||||
|
||||
```c
|
||||
static void render_logo(void) {
|
||||
static const char PROGMEM qmk_logo[] = {
|
||||
0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94,
|
||||
0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4,
|
||||
0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00
|
||||
};
|
||||
|
||||
st7565_write_P(qmk_logo, false);
|
||||
}
|
||||
```
|
||||
|
||||
## Buffer Read Example
|
||||
For some purposes, you may need to read the current state of the display buffer. The `st7565_read_raw` function can be used to safely read bytes from the buffer.
|
||||
|
||||
In this example, calling `fade_display` in the `st7565_task_user` function will slowly fade away whatever is on the screen by turning random pixels off over time.
|
||||
```c
|
||||
//Setup some mask which can be or'd with bytes to turn off pixels
|
||||
const uint8_t single_bit_masks[8] = {127, 191, 223, 239, 247, 251, 253, 254};
|
||||
|
||||
static void fade_display(void) {
|
||||
//Define the reader structure
|
||||
display_buffer_reader_t reader;
|
||||
uint8_t buff_char;
|
||||
if (random() % 30 == 0) {
|
||||
srand(timer_read());
|
||||
// Fetch a pointer for the buffer byte at index 0. The return structure
|
||||
// will have the pointer and the number of bytes remaining from this
|
||||
// index position if we want to perform a sequential read by
|
||||
// incrementing the buffer pointer
|
||||
reader = st7565_read_raw(0);
|
||||
//Loop over the remaining buffer and erase pixels as we go
|
||||
for (uint16_t i = 0; i < reader.remaining_element_count; i++) {
|
||||
//Get the actual byte in the buffer by dereferencing the pointer
|
||||
buff_char = *reader.current_element;
|
||||
if (buff_char != 0) {
|
||||
st7565_write_raw_byte(buff_char & single_bit_masks[rand() % 8], i);
|
||||
}
|
||||
//increment the pointer to fetch a new byte during the next loop
|
||||
reader.current_element++;
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Other Examples
|
||||
|
||||
In split keyboards, it is very common to have two displays that each render different content and are oriented or flipped differently. You can do this by switching which content to render by using the return value from `is_keyboard_master()` or `is_keyboard_left()` found in `split_util.h`, e.g:
|
||||
|
||||
```c
|
||||
#ifdef ST7565_ENABLE
|
||||
display_rotation_t st7565_init_user(display_rotation_t rotation) {
|
||||
if (!is_keyboard_master()) {
|
||||
return DISPLAY_ROTATION_180; // flips the display 180 degrees if offhand
|
||||
}
|
||||
|
||||
return rotation;
|
||||
}
|
||||
|
||||
void st7565_task_user(void) {
|
||||
if (is_keyboard_master()) {
|
||||
render_status(); // Renders the current keyboard state (layer, lock, caps, scroll, etc)
|
||||
} else {
|
||||
render_logo(); // Renders a static logo
|
||||
}
|
||||
}
|
||||
#endif
|
||||
```
|
||||
|
||||
## Basic Configuration
|
||||
|
||||
|Define |Default |Description |
|
||||
|------------------------|--------------|-----------------------------------------------------------------------------------------------------|
|
||||
|`ST7565_A0_PIN` |*Not defined* |(Required) The GPIO connected to the display's A0 (data/command) pin |
|
||||
|`ST7565_RST_PIN` |*Not defined* |(Required) The GPIO connected to the display's reset pin |
|
||||
|`ST7565_SS_PIN` |*Not defined* |(Required) The GPIO connected to the display's slave select pin |
|
||||
|`ST7565_SPI_CLK_DIVISOR`|`4` |The SPI clock divisor to use |
|
||||
|`ST7565_FONT_H` |`"glcdfont.c"`|The font code file to use for custom fonts |
|
||||
|`ST7565_FONT_START` |`0` |The starting character index for custom fonts |
|
||||
|`ST7565_FONT_END` |`223` |The ending character index for custom fonts |
|
||||
|`ST7565_FONT_WIDTH` |`6` |The font width |
|
||||
|`ST7565_FONT_HEIGHT` |`8` |The font height (untested) |
|
||||
|`ST7565_TIMEOUT` |`60000` |Turns off the screen after 60000ms of keyboard inactivity. Helps reduce burn-in. Set to 0 to disable.|
|
||||
|`ST7565_COLUMN_OFFSET` |`0` |Shift output to the right this many pixels. |
|
||||
|`ST7565_CONTRAST` |`32` |The default contrast level of the display, from 0 to 255. |
|
||||
|`ST7565_UPDATE_INTERVAL`|`0` |Set the time interval for updating the display in ms. This will improve the matrix scan rate. |
|
||||
|
||||
## Custom sized displays
|
||||
|
||||
The default display size for this feature is 128x32 and all necessary defines are precalculated with that in mind.
|
||||
|
||||
|Define |Default |Description |
|
||||
|-----------------------|----------|-----------------------------------------------------------------------------------------------------------|
|
||||
|`ST7565_DISPLAY_WIDTH` |`128` |The width of the display. |
|
||||
|`ST7565_DISPLAY_HEIGHT`|`32` |The height of the display. |
|
||||
|`ST7565_MATRIX_SIZE` |`512` |The local buffer size to allocate.<br>`(ST7565_DISPLAY_HEIGHT / 8 * ST7565_DISPLAY_WIDTH)`. |
|
||||
|`ST7565_BLOCK_TYPE` |`uint16_t`|The unsigned integer type to use for dirty rendering. |
|
||||
|`ST7565_BLOCK_COUNT` |`16` |The number of blocks the display is divided into for dirty rendering.<br>`(sizeof(ST7565_BLOCK_TYPE) * 8)`.|
|
||||
|`ST7565_BLOCK_SIZE` |`32` |The size of each block for dirty rendering<br>`(ST7565_MATRIX_SIZE / ST7565_BLOCK_COUNT)`. |
|
||||
|
||||
## API
|
||||
|
||||
```c
|
||||
// Rotation enum values are flags
|
||||
typedef enum {
|
||||
DISPLAY_ROTATION_0,
|
||||
DISPLAY_ROTATION_180
|
||||
} display_rotation_t;
|
||||
|
||||
// Initialize the display, rotating the rendered output based on the define passed in.
|
||||
// Returns true if the was initialized successfully
|
||||
bool st7565_init(display_rotation_t rotation);
|
||||
|
||||
// Called at the start of st7565_init, weak function overridable by the user
|
||||
// rotation - the value passed into st7565_init
|
||||
// Return new display_rotation_t if you want to override default rotation
|
||||
display_rotation_t st7565_init_user(display_rotation_t rotation);
|
||||
|
||||
// Clears the display buffer, resets cursor position to 0, and sets the buffer to dirty for rendering
|
||||
void st7565_clear(void);
|
||||
|
||||
// Renders the dirty chunks of the buffer to display
|
||||
void st7565_render(void);
|
||||
|
||||
// Moves cursor to character position indicated by column and line, wraps if out of bounds
|
||||
// Max column denoted by 'st7565_max_chars()' and max lines by 'st7565_max_lines()' functions
|
||||
void st7565_set_cursor(uint8_t col, uint8_t line);
|
||||
|
||||
// Advances the cursor to the next page, writing ' ' if true
|
||||
// Wraps to the begining when out of bounds
|
||||
void st7565_advance_page(bool clearPageRemainder);
|
||||
|
||||
// Moves the cursor forward 1 character length
|
||||
// Advance page if there is not enough room for the next character
|
||||
// Wraps to the begining when out of bounds
|
||||
void st7565_advance_char(void);
|
||||
|
||||
// Writes a single character to the buffer at current cursor position
|
||||
// Advances the cursor while writing, inverts the pixels if true
|
||||
// Main handler that writes character data to the display buffer
|
||||
void st7565_write_char(const char data, bool invert);
|
||||
|
||||
// Writes a string to the buffer at current cursor position
|
||||
// Advances the cursor while writing, inverts the pixels if true
|
||||
void st7565_write(const char *data, bool invert);
|
||||
|
||||
// Writes a string to the buffer at current cursor position
|
||||
// Advances the cursor while writing, inverts the pixels if true
|
||||
// Advances the cursor to the next page, wiring ' ' to the remainder of the current page
|
||||
void st7565_write_ln(const char *data, bool invert);
|
||||
|
||||
// Pans the buffer to the right (or left by passing true) by moving contents of the buffer
|
||||
// Useful for moving the screen in preparation for new drawing
|
||||
void st7565_pan(bool left);
|
||||
|
||||
// Returns a pointer to the requested start index in the buffer plus remaining
|
||||
// buffer length as struct
|
||||
display_buffer_reader_t st7565_read_raw(uint16_t start_index);
|
||||
|
||||
// Writes a string to the buffer at current cursor position
|
||||
void st7565_write_raw(const char *data, uint16_t size);
|
||||
|
||||
// Writes a single byte into the buffer at the specified index
|
||||
void st7565_write_raw_byte(const char data, uint16_t index);
|
||||
|
||||
// Sets a specific pixel on or off
|
||||
// Coordinates start at top-left and go right and down for positive x and y
|
||||
void st7565_write_pixel(uint8_t x, uint8_t y, bool on);
|
||||
|
||||
// Writes a PROGMEM string to the buffer at current cursor position
|
||||
// Advances the cursor while writing, inverts the pixels if true
|
||||
// Remapped to call 'void st7565_write(const char *data, bool invert);' on ARM
|
||||
void st7565_write_P(const char *data, bool invert);
|
||||
|
||||
// Writes a PROGMEM string to the buffer at current cursor position
|
||||
// Advances the cursor while writing, inverts the pixels if true
|
||||
// Advances the cursor to the next page, wiring ' ' to the remainder of the current page
|
||||
// Remapped to call 'void st7565_write_ln(const char *data, bool invert);' on ARM
|
||||
void st7565_write_ln_P(const char *data, bool invert);
|
||||
|
||||
// Writes a PROGMEM string to the buffer at current cursor position
|
||||
void st7565_write_raw_P(const char *data, uint16_t size);
|
||||
|
||||
// Can be used to manually turn on the screen if it is off
|
||||
// Returns true if the screen was on or turns on
|
||||
bool st7565_on(void);
|
||||
|
||||
// Called when st7565_on() turns on the screen, weak function overridable by the user
|
||||
// Not called if the screen is already on
|
||||
void st7565_on_user(void);
|
||||
|
||||
// Can be used to manually turn off the screen if it is on
|
||||
// Returns true if the screen was off or turns off
|
||||
bool st7565_off(void);
|
||||
|
||||
// Called when st7565_off() turns off the screen, weak function overridable by the user
|
||||
// Not called if the screen is already off
|
||||
void st7565_off_user(void);
|
||||
|
||||
// Returns true if the screen is currently on, false if it is
|
||||
// not
|
||||
bool st7565_is_on(void);
|
||||
|
||||
// Basically it's st7565_render, but with timeout management and st7565_task_user calling!
|
||||
void st7565_task(void);
|
||||
|
||||
// Called at the start of st7565_task, weak function overridable by the user
|
||||
void st7565_task_user(void);
|
||||
|
||||
// Inverts the display
|
||||
// Returns true if the screen was or is inverted
|
||||
bool st7565_invert(bool invert);
|
||||
|
||||
// Returns the maximum number of characters that will fit on a line
|
||||
uint8_t st7565_max_chars(void);
|
||||
|
||||
// Returns the maximum number of lines that will fit on the display
|
||||
uint8_t st7565_max_lines(void);
|
||||
```
|
@@ -1,8 +1,8 @@
|
||||
# よくあるビルドの質問
|
||||
|
||||
<!---
|
||||
original document: 0.10.33:docs/faq_build.md
|
||||
git diff 0.10.33 HEAD -- docs/faq_build.md | cat
|
||||
original document: 0.12.43:docs/faq_build.md
|
||||
git diff 0.12.43 HEAD -- docs/faq_build.md | cat
|
||||
-->
|
||||
|
||||
このページは QMK のビルドに関する質問を説明します。まだビルドをしていない場合は、[ビルド環境のセットアップ](ja/getting_started_build_tools.md) および [Make 手順](ja/getting_started_make_guide.md)ガイドを読むべきです。
|
||||
@@ -22,73 +22,9 @@
|
||||
|
||||
`make` を `sudo` で実行することは一般的には良い考えでは***なく***、可能であれば前者の方法のいずれかを使うべきです。
|
||||
|
||||
### Linux の `udev` ルール
|
||||
### Linux の `udev` ルール :id=linux-udev-rules
|
||||
|
||||
Linux では、ブートローダデバイスと通信するには適切な権限が必要です。ファームウェアを書き込む時に `sudo` を使うか、`/etc/udev/rules.d/` にこのファイルを配置することで、通信することができます。
|
||||
|
||||
**/etc/udev/rules.d/50-qmk.rules:**
|
||||
```
|
||||
# Atmel DFU
|
||||
### ATmega16U2
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FEF", TAG+="uaccess", RUN{builtin}+="uaccess"
|
||||
### ATmega32U2
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF0", TAG+="uaccess", RUN{builtin}+="uaccess"
|
||||
### ATmega16U4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF3", TAG+="uaccess", RUN{builtin}+="uaccess"
|
||||
### ATmega32U4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF4", TAG+="uaccess", RUN{builtin}+="uaccess"
|
||||
### AT90USB64
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FF9", TAG+="uaccess", RUN{builtin}+="uaccess"
|
||||
### AT90USB128
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="2FFB", TAG+="uaccess", RUN{builtin}+="uaccess"
|
||||
|
||||
# Input Club
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1C11", ATTRS{idProduct}=="B007", TAG+="uaccess", RUN{builtin}+="uaccess"
|
||||
|
||||
# STM32duino
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1EAF", ATTRS{idProduct}=="0003", TAG+="uaccess", RUN{builtin}+="uaccess"
|
||||
# STM32 DFU
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="DF11", TAG+="uaccess", RUN{builtin}+="uaccess"
|
||||
|
||||
# BootloadHID
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16C0", ATTRS{idProduct}=="05DF", TAG+="uaccess", RUN{builtin}+="uaccess"
|
||||
|
||||
# USBAspLoader
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="16C0", ATTRS{idProduct}=="05DC", TAG+="uaccess", RUN{builtin}+="uaccess"
|
||||
|
||||
# ModemManager should ignore the following devices
|
||||
# Atmel SAM-BA (Massdrop)
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="03EB", ATTRS{idProduct}=="6124", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
|
||||
# Caterina (Pro Micro)
|
||||
## Spark Fun Electronics
|
||||
### Pro Micro 3V3/8MHz
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1B4F", ATTRS{idProduct}=="9203", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### Pro Micro 5V/16MHz
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1B4F", ATTRS{idProduct}=="9205", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### LilyPad 3V3/8MHz (and some Pro Micro clones)
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1B4F", ATTRS{idProduct}=="9207", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
## Pololu Electronics
|
||||
### A-Star 32U4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1FFB", ATTRS{idProduct}=="0101", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
## Arduino SA
|
||||
### Leonardo
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### Micro
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0037", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
## Adafruit Industries LLC
|
||||
### Feather 32U4
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="239A", ATTRS{idProduct}=="000C", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### ItsyBitsy 32U4 3V3/8MHz
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="239A", ATTRS{idProduct}=="000D", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### ItsyBitsy 32U4 5V/16MHz
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="239A", ATTRS{idProduct}=="000E", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
## dog hunter AG
|
||||
### Leonardo
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2A03", ATTRS{idProduct}=="0036", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
### Micro
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2A03", ATTRS{idProduct}=="0037", TAG+="uaccess", RUN{builtin}+="uaccess", ENV{ID_MM_DEVICE_IGNORE}="1"
|
||||
```
|
||||
Linux では、ブートローダデバイスと通信するには適切な権限が必要です。ファームウェアを書き込む時に `sudo` を使うか(非推奨)、`/etc/udev/rules.d/` に[このファイル](https://github.com/qmk/qmk_firmware/tree/master/util/udev/50-qmk.rules)を配置することで、通信することができます。
|
||||
|
||||
追加が完了したら、以下を実行します:
|
||||
|
||||
@@ -129,9 +65,9 @@ https://github.com/tmk/tmk_keyboard/issues/150
|
||||
- https://www.mcselec.com/index.php?page=shop.product_details&flypage=shop.flypage&product_id=92&option=com_phpshop&Itemid=1
|
||||
|
||||
### キーボードに書き込んだが何も起こらない、あるいはキーの押下が登録されない - ARM (rev6 planck、clueboard 60、hs60v2 など) でも同じ (Feb 2019)
|
||||
ARM ベースのチップ上での EEPROM の動作によって、保存された設定が無効になる場合があります。これはデフォルトレイヤに影響し、まだ調査中の特定の環境下でキーボードが使えなくなる*しれません*。EEPROM のリセットでこれが修正されます。
|
||||
ARM ベースのチップ上での EEPROM の動作によって、保存された設定が無効になる場合があります。これはデフォルトレイヤに影響し、まだ調査中の特定の環境下でキーボードが使えなくなるかも*しれません*。EEPROM のリセットでこれが修正されます。
|
||||
|
||||
[Planck rev6 reset EEPROM](https://cdn.discordapp.com/attachments/473506116718952450/539284620861243409/planck_rev6_default.bin) を使って eeprom のリセットを強制することができます。このイメージを書き込んだ後で、通常のファームウェアを書き込むと、キーボードが_通常_ の動作順序に復元されます。
|
||||
[Planck rev6 reset EEPROM](https://cdn.discordapp.com/attachments/473506116718952450/539284620861243409/planck_rev6_default.bin) を使って eeprom のリセットを強制することができます。このイメージを書き込んだ後で、通常のファームウェアを書き込むと、キーボードが _通常_ の動作順序に復元されます。
|
||||
[Preonic rev3 reset EEPROM](https://cdn.discordapp.com/attachments/473506116718952450/537849497313738762/preonic_rev3_default.bin)
|
||||
|
||||
いずれかの形式でブートマジックが有効になっている場合は、これも実行できるはずです (実行方法の詳細については、[ブートマジックドキュメント](ja/feature_bootmagic.md)とキーボード情報を見てください)。
|
||||
|
@@ -1,16 +1,17 @@
|
||||
# Docker クイックスタート
|
||||
|
||||
<!---
|
||||
original document: 0.9.32:docs/getting_started_docker.md
|
||||
git diff 0.9.32 HEAD -- docs/getting_started_docker.md | cat
|
||||
original document: 0.12.43:docs/getting_started_docker.md
|
||||
git diff 0.12.43 HEAD -- docs/getting_started_docker.md | cat
|
||||
-->
|
||||
|
||||
このプロジェクトは、プライマリオペレーティングシステムに大きな変更を加えることなくキーボードの新しいファームウェアを非常に簡単に構築することができる Docker ワークフローを含みます。これは、あなたがプロジェクトをクローンしビルドを実行した時に、他の人とまったく同じ環境と QMK ビルド基盤を持つことも保証します。これにより、人々はあなたが遭遇した問題の解決をより簡単に行えるようになります。
|
||||
|
||||
## 必要事項
|
||||
|
||||
主な前提条件は動作する `docker` がインストールされていることです。
|
||||
主な前提条件は動作する `docker` または `podman` がインストールされていることです。
|
||||
* [Docker CE](https://docs.docker.com/install/#supported-platforms)
|
||||
* [Podman](https://podman.io/getting-started/installation)
|
||||
|
||||
## 使い方
|
||||
|
||||
@@ -29,7 +30,7 @@ util/docker_build.sh <keyboard>:<keymap>
|
||||
|
||||
これは目的のキーボード/キーマップをコンパイルし、結果として書き込み用に `.hex` あるいは `.bin` ファイルを QMK ディレクトリの中に残します。`:keymap` が省略された場合は全てのキーマップが使われます。パラメータの形式は、`make` を使ってビルドする時と同じであることに注意してください。
|
||||
|
||||
`target` を指定して Docker から直接キーボードをビルドし、_かつ_書き込むためのサポートもあります。
|
||||
`target` を指定して Docker から直接キーボードをビルドし、_かつ_ 書き込むためのサポートもあります。
|
||||
|
||||
```bash
|
||||
util/docker_build.sh keyboard:keymap:target
|
||||
@@ -43,10 +44,17 @@ util/docker_build.sh
|
||||
# パラメータを入力として読み込みます (空白にすると全てのキーボード/キーマップ)
|
||||
```
|
||||
|
||||
`RUNTIME` 環境変数にコンテナランタイム名やパスを設定することで、使用したいコンテナランタイムを手動で設定できます。
|
||||
デフォルトでは docker や podman は自動的に検出され、podman より docker が優先されます。
|
||||
|
||||
```bash
|
||||
RUNTIME="podman" util/docker_build.sh keyboard:keymap:target
|
||||
```
|
||||
|
||||
## FAQ
|
||||
|
||||
### なぜ Windows/macOS 上で書き込めないのですか?
|
||||
|
||||
Windows と macOS では、実行するために [Docker Machine](http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos/) が必要です。これはセットアップが面倒なので、お勧めではありません: 代わりに [QMK Toolbox](https://github.com/qmk/qmk_toolbox) を使ってください。
|
||||
|
||||
!> Docker for Windows は[Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) を有効にする必要があります。これは、Windows 7、Windows 8 および **Windows 10 Home** のような Hyper-V を搭載していない Windows のバージョンでは機能しないことを意味します。
|
||||
!> Docker for Windows は [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) を有効にする必要があります。これは、Windows 7、Windows 8 および **Windows 10 Home** のような Hyper-V を搭載していない Windows のバージョンでは機能しないことを意味します。
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# QMK で GitHub を使う方法
|
||||
|
||||
<!---
|
||||
original document: 0.9.43:docs/getting_started_github.md
|
||||
git diff 0.9.43 HEAD -- docs/getting_started_github.md | cat
|
||||
original document: 0.12.43:docs/getting_started_github.md
|
||||
git diff 0.12.43 HEAD -- docs/getting_started_github.md | cat
|
||||
-->
|
||||
|
||||
GitHub は慣れていない人には少し注意が必要です - このガイドは、QMK におけるフォーク、クローン、プルリクエストのサブミットの各ステップについて説明します。
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# より詳細な `make` 手順
|
||||
|
||||
<!---
|
||||
original document: 0.10.33:docs/getting_started_make_guide.md
|
||||
git diff 0.10.33 HEAD -- docs/getting_started_make_guide.md | cat
|
||||
original document: 0.12.43:docs/getting_started_make_guide.md
|
||||
git diff 0.12.43 HEAD -- docs/getting_started_make_guide.md | cat
|
||||
-->
|
||||
|
||||
`make` コマンドの完全な構文は `<keyboard_folder>:<keymap>:<target>` です:
|
||||
@@ -19,16 +19,32 @@
|
||||
`<target>` は以下を意味します
|
||||
* target が指定されない場合は、以下の `all` と同じです
|
||||
* `all` は指定されたキーボード/リビジョン/キーマップの可能な全ての組み合わせのコンパイルを行います。例えば、`make planck/rev4:default` は1つの .hex を生成しますが、`make planck/rev4:all` は planck で利用可能な全てのキーマップについて hex を生成します。
|
||||
* `flash`、`dfu`、`teensy`、`avrdude`、`dfu-util` または `bootloadHID` はファームウェアをコンパイルし、キーボードにアップロードします。コンパイルが失敗すると、何もアップロードされません。使用するプログラマはキーボードに依存します。ほとんどのキーボードでは `dfu` ですが、ChibiOS キーボードについては `dfu-util` 、標準的な Teensy については `teensy` を使います。キーボードに使うコマンドを見つけるには、キーボード固有の readme をチェックしてください。
|
||||
* **注意**: 一部のオペレーティングシステムではこれらのコマンドが機能するためには root アクセスが必要です。その場合、例えば `sudo make planck/rev4:default:flash` を実行する必要があります。
|
||||
* `flash`、`dfu`、`teensy`、`avrdude`、`dfu-util`、`bootloadHID` はファームウェアをコンパイルし、キーボードにアップロードします。コンパイルが失敗すると、何もアップロードされません。使用するプログラマはキーボードに依存します。ほとんどのキーボードでは `dfu` ですが、ChibiOS キーボードについては `dfu-util` 、標準的な Teensy については `teensy` を使います。キーボードに使うコマンドを見つけるには、キーボード固有の readme をチェックしてください。
|
||||
利用可能なブートローダの詳細は[ファームウェアの書き込み](ja/flashing.md)ガイドを参照してください。
|
||||
* **Note**: 一部のオペレーティングシステムでは、これらのコマンドが機能するためには特権アクセスが必要です。これは、root アクセスなしでこれらにアクセスするために [`udev ルール`](ja/faq_build.md#linux-udev-rules) を設定するか、あるいは root アクセスでコマンドを実行する (`sudo make planck/rev4:default:flash`) 必要があるかもしれないことを意味します。
|
||||
* `clean` は、全てをゼロからビルドするためにビルド出力フォルダを掃除します。説明できない問題がある場合は、通常のコンパイルの前にこれを実行してください。
|
||||
* `distclean` は、.hex ファイルと .bin ファイルを削除します。
|
||||
|
||||
次のターゲットは開発者向けです:
|
||||
|
||||
* `show_path` ソースとオブジェクトファイルのパスを表示します。
|
||||
* `dump_vars` makefile 変数をダンプします。
|
||||
* `objs-size` 個々のオブジェクトファイルのサイズを表示します。
|
||||
* `show_build_options` 'rules.mk' のオプションセットを表示します。
|
||||
* `check-md5` 生成されたバイナリファイルの md5 チェックサムを表示します。
|
||||
|
||||
make コマンドの最後、つまり target の後に追加のオプションを追加することもできます
|
||||
|
||||
* `make COLOR=false` - カラー出力をオフ
|
||||
* `make SILENT=true` - エラー/警告以外の出力をオフ
|
||||
* `make VERBOSE=true` - 全ての gcc のものを出力 (デバッグする必要が無い限り面白くありません)
|
||||
* `make EXTRAFLAGS=-E` - コンパイルせずにコードを前処理 (#define コマンドをデバッグしようとする場合に便利)
|
||||
* `make VERBOSE_LD_CMD=yes` - -v オプションを指定して ld コマンドを実行します。
|
||||
* `make VERBOSE_AS_CMD=yes` - -v オプションを指定して as コマンドを実行します。
|
||||
* `make VERBOSE_C_CMD=<c_source_file>` - 指定された C ソースファイルをコンパイルするときに -v オプションを追加します。
|
||||
* `make DUMP_C_MACROS=<c_source_file>` - 指定された C ソースファイルをコンパイルするときにプリプロセッサマクロをダンプします。
|
||||
* `make DUMP_C_MACROS=<c_source_file> > <logfile>` - 指定された C ソースファイルをコンパイルするときにプリプロセッサマクロを `<logfile>` にダンプします。
|
||||
* `make VERBOSE_C_INCLUDE=<c_source_file>` - 指定された C ソースファイルをコンパイルするときにインクルードされるファイル名をダンプします。
|
||||
* `make VERBOSE_C_INCLUDE=<c_source_file> 2> <logfile>` - 指定された C ソースファイルをコンパイルするときにインクルードされるファイル名を `<logfile>` にダンプします。
|
||||
|
||||
make コマンド自体にもいくつかの追加オプションがあります。詳細は `make --help` を入力してください。最も有用なのはおそらく `-jx` です。これは複数の CPU を使ってコンパイルしたいことを指定し、`x` は使用したい CPU の数を表します。設定すると、特に多くのキーボード/キーマップをコンパイルしている場合は、コンパイル時間を大幅に短縮することができます。通常は、コンパイル中に他の作業を行うための余裕をもたせるために、持っている CPU の数より1つ少ない値に設定します。全てのオペレーティングシステムと make バージョンがオプションをサポートしているわけではないことに注意してください。
|
||||
|
||||
@@ -104,7 +120,7 @@ make コマンド自体にもいくつかの追加オプションがあります
|
||||
|
||||
これにより、送信したい文字に対応するニーモニックを入力することで Unicode 文字を送信することができます。キーマップファイル内にマッピングテーブルを保持する必要があります。可能な全てのコードポイント( `0x10FFFF` まで)がサポートされます。
|
||||
|
||||
詳細と制限については、[Unicode ページ](ja/feature_unicode.md) を見てください。
|
||||
詳細と制限については、[Unicode ページ](ja/feature_unicode.md)を見てください。
|
||||
|
||||
`AUDIO_ENABLE`
|
||||
|
||||
@@ -116,11 +132,11 @@ C6 ピン(抽象化が必要)でオーディオ出力できます。詳細は[
|
||||
|
||||
`API_SYSEX_ENABLE`
|
||||
|
||||
これにより Quantum SYSEX API を使って文字列を送信することができます (どこに?)
|
||||
これにより Quantum SYSEX API を使って文字列を(どこかに?)送信することができます
|
||||
|
||||
`KEY_LOCK_ENABLE`
|
||||
|
||||
これは [キーロック](ja/feature_key_lock.md) を有効にします。
|
||||
これは[キーロック](ja/feature_key_lock.md)を有効にします。
|
||||
|
||||
`SPLIT_KEYBOARD`
|
||||
|
||||
@@ -132,7 +148,7 @@ ARM ベースの分割キーボード用の標準分割通信ドライバはま
|
||||
|
||||
`CUSTOM_MATRIX`
|
||||
|
||||
デフォルトのマトリックス走査ルーチンを独自のコードで置き換えます。詳細については、[カスタムマトリックスページ](ja/custom_matrix.md) を見てください。
|
||||
デフォルトのマトリックス走査ルーチンを独自のコードで置き換えます。詳細については、[カスタムマトリックスページ](ja/custom_matrix.md)を見てください。
|
||||
|
||||
`DEBOUNCE_TYPE`
|
||||
|
||||
|
@@ -1,8 +1,8 @@
|
||||
# Vagrant クイックスタート
|
||||
|
||||
<!---
|
||||
original document: 0.9.10:docs/getting_started_vagrant.md
|
||||
git diff 0.9.10 HEAD -- docs/getting_started_vagrant.md | cat
|
||||
original document: 0.12.43:docs/getting_started_vagrant.md
|
||||
git diff 0.12.43 HEAD -- docs/getting_started_vagrant.md | cat
|
||||
-->
|
||||
|
||||
このプロジェクトは、プライマリオペレーティングシステムに大きな変更を加えることなくキーボードの新しいファームウェアを非常に簡単に構築することができる `Vagrantfile` を含みます。これは、あなたがプロジェクトをクローンしビルドを実行した時に、ビルドのために Vagrantfile を使っている他のユーザと全く同じ環境を持つことも保証します。これにより、人々はあなたが遭遇した問題の解決をより簡単に行えるようになります。
|
||||
@@ -12,16 +12,16 @@
|
||||
このリポジトリ内の `Vagrantfile` を使うには、[Vagrant](https://www.vagrantup.com/) およびサポートされるプロバイダがインストールされている必要があります:
|
||||
|
||||
* [VirtualBox](https://www.virtualbox.org/) (バージョン 5.0.12 以降)
|
||||
* 'Vagrant を使うために最もアクセスしやすいプラットフォーム' として販売
|
||||
* 「Vagrant を使うために最もアクセスしやすいプラットフォーム」とうたわれています。
|
||||
* [VMware Workstation](https://www.vmware.com/products/workstation) および [Vagrant VMware プラグイン](https://www.vagrantup.com/vmware)
|
||||
* (有料) VMware プラグインには、ライセンスされた VMware Workstation/Fusion のコピーが必要です。
|
||||
* [Docker](https://www.docker.com/)
|
||||
|
||||
Vagrant 以外に、適切なプロバイダがインストールされ、その後におそらくコンピュータを再起動すると、このプロジェクトをチェックアウトしたフォルダ内の任意の場所で 'vagrant up' を単純に実行することができ、このプロジェクトをビルドするのに必要な全てのツールが含まれる環境(仮想マシンあるいはコンテナ)が開始されます。Vagrant をうまく始めるためのヒントの投稿がありますが、それ以外に、以下のビルドドキュメントを参照することもできます。
|
||||
Vagrant 以外に、適切なプロバイダがインストールされ、その後におそらくコンピュータを再起動すると、このプロジェクトをチェックアウトしたフォルダ内の任意の場所で 'vagrant up' を単純に実行することができ、このプロジェクトをビルドするのに必要な全てのツールが含まれる環境(仮想マシンあるいはコンテナ)が開始されます。Vagrant 起動時にうまく始めるためのヒントが表示されますが、それ以外に、以下のビルドドキュメントを参照することもできます。
|
||||
|
||||
## ファームウェアの書き込み
|
||||
|
||||
ファームウェアを書き込む"簡単"な方法は、ホスト OS からツールを使うことです:
|
||||
ファームウェアを書き込む「簡単な」方法は、ホスト OS からツールを使うことです:
|
||||
|
||||
* [QMK Toolbox](https://github.com/qmk/qmk_toolbox) (推奨)
|
||||
* [Teensy ローダー](https://www.pjrc.com/teensy/loader.html)
|
||||
|
@@ -28,8 +28,14 @@
|
||||
# define F_SCL 400000UL // SCL frequency
|
||||
#endif
|
||||
|
||||
#ifndef I2C_START_RETRY_COUNT
|
||||
# define I2C_START_RETRY_COUNT 20
|
||||
#endif // I2C_START_RETRY_COUNT
|
||||
|
||||
#define TWBR_val (((F_CPU / F_SCL) - 16) / 2)
|
||||
|
||||
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
|
||||
|
||||
void i2c_init(void) {
|
||||
TWSR = 0; /* no prescaler */
|
||||
TWBR = (uint8_t)TWBR_val;
|
||||
@@ -47,7 +53,7 @@ void i2c_init(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
i2c_status_t i2c_start(uint8_t address, uint16_t timeout) {
|
||||
static i2c_status_t i2c_start_impl(uint8_t address, uint16_t timeout) {
|
||||
// reset TWI control register
|
||||
TWCR = 0;
|
||||
// transmit START condition
|
||||
@@ -86,6 +92,17 @@ i2c_status_t i2c_start(uint8_t address, uint16_t timeout) {
|
||||
return I2C_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
i2c_status_t i2c_start(uint8_t address, uint16_t timeout) {
|
||||
// Retry i2c_start_impl a bunch times in case the remote side has interrupts disabled.
|
||||
uint16_t timeout_timer = timer_read();
|
||||
uint16_t time_slice = MAX(1, (timeout == (I2C_TIMEOUT_INFINITE)) ? 5 : (timeout / (I2C_START_RETRY_COUNT))); // if it's infinite, wait 1ms between attempts, otherwise split up the entire timeout into the number of retries
|
||||
i2c_status_t status;
|
||||
do {
|
||||
status = i2c_start_impl(address, time_slice);
|
||||
} while ((status < 0) && ((timeout == I2C_TIMEOUT_INFINITE) || (timer_elapsed(timeout_timer) < timeout)));
|
||||
return status;
|
||||
}
|
||||
|
||||
i2c_status_t i2c_write(uint8_t data, uint16_t timeout) {
|
||||
// load data into data register
|
||||
TWDR = data;
|
||||
|
@@ -17,6 +17,7 @@
|
||||
* GitHub repository: https://github.com/g4lvanix/I2C-slave-lib
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <avr/io.h>
|
||||
#include <util/twi.h>
|
||||
#include <avr/interrupt.h>
|
||||
@@ -24,6 +25,12 @@
|
||||
|
||||
#include "i2c_slave.h"
|
||||
|
||||
#if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
|
||||
# include "transactions.h"
|
||||
|
||||
static volatile bool is_callback_executor = false;
|
||||
#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
|
||||
|
||||
volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT];
|
||||
|
||||
static volatile uint8_t buffer_address;
|
||||
@@ -48,11 +55,14 @@ ISR(TWI_vect) {
|
||||
case TW_SR_SLA_ACK:
|
||||
// The device is now a slave receiver
|
||||
slave_has_register_set = false;
|
||||
#if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
|
||||
is_callback_executor = false;
|
||||
#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
|
||||
break;
|
||||
|
||||
case TW_SR_DATA_ACK:
|
||||
// This device is a slave receiver and has received data
|
||||
// First byte is the location then the bytes will be writen in buffer with auto-incriment
|
||||
// First byte is the location then the bytes will be writen in buffer with auto-increment
|
||||
if (!slave_has_register_set) {
|
||||
buffer_address = TWDR;
|
||||
|
||||
@@ -60,10 +70,25 @@ ISR(TWI_vect) {
|
||||
ack = 0;
|
||||
buffer_address = 0;
|
||||
}
|
||||
slave_has_register_set = true; // address has been receaved now fill in buffer
|
||||
slave_has_register_set = true; // address has been received now fill in buffer
|
||||
|
||||
#if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
|
||||
// Work out if we're attempting to execute a callback
|
||||
is_callback_executor = buffer_address == split_transaction_table[I2C_EXECUTE_CALLBACK].initiator2target_offset;
|
||||
#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
|
||||
} else {
|
||||
i2c_slave_reg[buffer_address] = TWDR;
|
||||
buffer_address++;
|
||||
|
||||
#if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
|
||||
// If we're intending to execute a transaction callback, do so, as we've just received the transaction ID
|
||||
if (is_callback_executor) {
|
||||
split_transaction_desc_t *trans = &split_transaction_table[split_shmem->transaction_id];
|
||||
if (trans->slave_callback) {
|
||||
trans->slave_callback(trans->initiator2target_buffer_size, split_trans_initiator2target_buffer(trans), trans->target2initiator_buffer_size, split_trans_target2initiator_buffer(trans));
|
||||
}
|
||||
}
|
||||
#endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
|
||||
}
|
||||
break;
|
||||
|
||||
|
@@ -22,7 +22,18 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define I2C_SLAVE_REG_COUNT 30
|
||||
#ifndef I2C_SLAVE_REG_COUNT
|
||||
|
||||
# if defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
|
||||
# include "transport.h"
|
||||
# define I2C_SLAVE_REG_COUNT sizeof(split_shared_memory_t)
|
||||
# else // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
|
||||
# define I2C_SLAVE_REG_COUNT 30
|
||||
# endif // defined(USE_I2C) && defined(SPLIT_COMMON_TRANSACTIONS)
|
||||
|
||||
#endif // I2C_SLAVE_REG_COUNT
|
||||
|
||||
_Static_assert(I2C_SLAVE_REG_COUNT < 256, "I2C target registers must be single byte");
|
||||
|
||||
extern volatile uint8_t i2c_slave_reg[I2C_SLAVE_REG_COUNT];
|
||||
|
||||
|
@@ -224,15 +224,8 @@
|
||||
# define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY / 2)
|
||||
|
||||
# define SLAVE_INT_WIDTH_US 1
|
||||
# ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
# define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY
|
||||
# else
|
||||
# define SLAVE_INT_ACK_WIDTH_UNIT 2
|
||||
# define SLAVE_INT_ACK_WIDTH 4
|
||||
# endif
|
||||
|
||||
static SSTD_t *Transaction_table = NULL;
|
||||
static uint8_t Transaction_table_size = 0;
|
||||
# define SLAVE_INT_ACK_WIDTH_UNIT 2
|
||||
# define SLAVE_INT_ACK_WIDTH 4
|
||||
|
||||
inline static void serial_delay(void) ALWAYS_INLINE;
|
||||
inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); }
|
||||
@@ -259,16 +252,12 @@ inline static void serial_low(void) { writePinLow(SOFT_SERIAL_PIN); }
|
||||
inline static void serial_high(void) ALWAYS_INLINE;
|
||||
inline static void serial_high(void) { writePinHigh(SOFT_SERIAL_PIN); }
|
||||
|
||||
void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) {
|
||||
Transaction_table = sstd_table;
|
||||
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||
void soft_serial_initiator_init(void) {
|
||||
serial_output();
|
||||
serial_high();
|
||||
}
|
||||
|
||||
void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) {
|
||||
Transaction_table = sstd_table;
|
||||
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||
void soft_serial_target_init(void) {
|
||||
serial_input_with_pullup();
|
||||
|
||||
// Enable INT0-INT7
|
||||
@@ -395,19 +384,14 @@ static inline uint8_t nibble_bits_count(uint8_t bits) {
|
||||
|
||||
// interrupt handle to be used by the target device
|
||||
ISR(SERIAL_PIN_INTERRUPT) {
|
||||
# ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
serial_low();
|
||||
serial_output();
|
||||
SSTD_t *trans = Transaction_table;
|
||||
# else
|
||||
// recive transaction table index
|
||||
uint8_t tid, bits;
|
||||
uint8_t pecount = 0;
|
||||
sync_recv();
|
||||
bits = serial_read_chunk(&pecount, 7);
|
||||
bits = serial_read_chunk(&pecount, 8);
|
||||
tid = bits >> 3;
|
||||
bits = (bits & 7) != nibble_bits_count(tid);
|
||||
if (bits || pecount > 0 || tid > Transaction_table_size) {
|
||||
bits = (bits & 7) != (nibble_bits_count(tid) & 7);
|
||||
if (bits || pecount > 0 || tid > NUM_TOTAL_TRANSACTIONS) {
|
||||
return;
|
||||
}
|
||||
serial_delay_half1();
|
||||
@@ -415,18 +399,22 @@ ISR(SERIAL_PIN_INTERRUPT) {
|
||||
serial_high(); // response step1 low->high
|
||||
serial_output();
|
||||
_delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT * SLAVE_INT_ACK_WIDTH);
|
||||
SSTD_t *trans = &Transaction_table[tid];
|
||||
split_transaction_desc_t *trans = &split_transaction_table[tid];
|
||||
serial_low(); // response step2 ack high->low
|
||||
# endif
|
||||
|
||||
// If the transaction has a callback, we can execute it now
|
||||
if (trans->slave_callback) {
|
||||
trans->slave_callback(trans->initiator2target_buffer_size, split_trans_initiator2target_buffer(trans), trans->target2initiator_buffer_size, split_trans_target2initiator_buffer(trans));
|
||||
}
|
||||
|
||||
// target send phase
|
||||
if (trans->target2initiator_buffer_size > 0) serial_send_packet((uint8_t *)trans->target2initiator_buffer, trans->target2initiator_buffer_size);
|
||||
if (trans->target2initiator_buffer_size > 0) serial_send_packet((uint8_t *)split_trans_target2initiator_buffer(trans), trans->target2initiator_buffer_size);
|
||||
// target switch to input
|
||||
change_sender2reciver();
|
||||
|
||||
// target recive phase
|
||||
if (trans->initiator2target_buffer_size > 0) {
|
||||
if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, trans->initiator2target_buffer_size)) {
|
||||
if (serial_recive_packet((uint8_t *)split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size)) {
|
||||
*trans->status = TRANSACTION_ACCEPTED;
|
||||
} else {
|
||||
*trans->status = TRANSACTION_DATA_ERROR;
|
||||
@@ -448,14 +436,12 @@ ISR(SERIAL_PIN_INTERRUPT) {
|
||||
// TRANSACTION_NO_RESPONSE
|
||||
// TRANSACTION_DATA_ERROR
|
||||
// this code is very time dependent, so we need to disable interrupts
|
||||
# ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_transaction(void) {
|
||||
SSTD_t *trans = Transaction_table;
|
||||
# else
|
||||
int soft_serial_transaction(int sstd_index) {
|
||||
if (sstd_index > Transaction_table_size) return TRANSACTION_TYPE_ERROR;
|
||||
SSTD_t *trans = &Transaction_table[sstd_index];
|
||||
# endif
|
||||
if (sstd_index > NUM_TOTAL_TRANSACTIONS) return TRANSACTION_TYPE_ERROR;
|
||||
split_transaction_desc_t *trans = &split_transaction_table[sstd_index];
|
||||
|
||||
if (!trans->status) return TRANSACTION_TYPE_ERROR; // not registered
|
||||
|
||||
cli();
|
||||
|
||||
// signal to the target that we want to start a transaction
|
||||
@@ -463,27 +449,11 @@ int soft_serial_transaction(int sstd_index) {
|
||||
serial_low();
|
||||
_delay_us(SLAVE_INT_WIDTH_US);
|
||||
|
||||
# ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
// wait for the target response
|
||||
serial_input_with_pullup();
|
||||
_delay_us(SLAVE_INT_RESPONSE_TIME);
|
||||
|
||||
// check if the target is present
|
||||
if (serial_read_pin()) {
|
||||
// target failed to pull the line low, assume not present
|
||||
serial_output();
|
||||
serial_high();
|
||||
*trans->status = TRANSACTION_NO_RESPONSE;
|
||||
sei();
|
||||
return TRANSACTION_NO_RESPONSE;
|
||||
}
|
||||
|
||||
# else
|
||||
// send transaction table index
|
||||
int tid = (sstd_index << 3) | (7 & nibble_bits_count(sstd_index));
|
||||
sync_send();
|
||||
_delay_sub_us(TID_SEND_ADJUST);
|
||||
serial_write_chunk(tid, 7);
|
||||
serial_write_chunk(tid, 8);
|
||||
serial_delay_half1();
|
||||
|
||||
// wait for the target response (step1 low->high)
|
||||
@@ -504,12 +474,11 @@ int soft_serial_transaction(int sstd_index) {
|
||||
}
|
||||
_delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT);
|
||||
}
|
||||
# endif
|
||||
|
||||
// initiator recive phase
|
||||
// if the target is present syncronize with it
|
||||
if (trans->target2initiator_buffer_size > 0) {
|
||||
if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, trans->target2initiator_buffer_size)) {
|
||||
if (!serial_recive_packet((uint8_t *)split_trans_target2initiator_buffer(trans), trans->target2initiator_buffer_size)) {
|
||||
serial_output();
|
||||
serial_high();
|
||||
*trans->status = TRANSACTION_DATA_ERROR;
|
||||
@@ -523,7 +492,7 @@ int soft_serial_transaction(int sstd_index) {
|
||||
|
||||
// initiator send phase
|
||||
if (trans->initiator2target_buffer_size > 0) {
|
||||
serial_send_packet((uint8_t *)trans->initiator2target_buffer, trans->initiator2target_buffer_size);
|
||||
serial_send_packet((uint8_t *)split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size);
|
||||
}
|
||||
|
||||
// always, release the line when not in use
|
||||
@@ -534,9 +503,8 @@ int soft_serial_transaction(int sstd_index) {
|
||||
return TRANSACTION_END;
|
||||
}
|
||||
|
||||
# ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_get_and_clean_status(int sstd_index) {
|
||||
SSTD_t *trans = &Transaction_table[sstd_index];
|
||||
split_transaction_desc_t *trans = &split_transaction_table[sstd_index];
|
||||
cli();
|
||||
int retval = *trans->status;
|
||||
*trans->status = 0;
|
||||
@@ -544,8 +512,6 @@ int soft_serial_get_and_clean_status(int sstd_index) {
|
||||
sei();
|
||||
return retval;
|
||||
}
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
// Helix serial.c history
|
||||
|
@@ -1,62 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
// Need Soft Serial defines in config.h
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
// ex.
|
||||
// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6
|
||||
// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5
|
||||
// // 1: about 137kbps (default)
|
||||
// // 2: about 75kbps
|
||||
// // 3: about 39kbps
|
||||
// // 4: about 26kbps
|
||||
// // 5: about 20kbps
|
||||
//
|
||||
// //// USE simple API (using signle-type transaction function)
|
||||
// /* nothing */
|
||||
// //// USE flexible API (using multi-type transaction function)
|
||||
// #define SERIAL_USE_MULTI_TRANSACTION
|
||||
//
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
|
||||
// Soft Serial Transaction Descriptor
|
||||
typedef struct _SSTD_t {
|
||||
uint8_t *status;
|
||||
uint8_t initiator2target_buffer_size;
|
||||
uint8_t *initiator2target_buffer;
|
||||
uint8_t target2initiator_buffer_size;
|
||||
uint8_t *target2initiator_buffer;
|
||||
} SSTD_t;
|
||||
#define TID_LIMIT(table) (sizeof(table) / sizeof(SSTD_t))
|
||||
|
||||
// initiator is transaction start side
|
||||
void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size);
|
||||
// target is interrupt accept side
|
||||
void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size);
|
||||
|
||||
// initiator resullt
|
||||
#define TRANSACTION_END 0
|
||||
#define TRANSACTION_NO_RESPONSE 0x1
|
||||
#define TRANSACTION_DATA_ERROR 0x2
|
||||
#define TRANSACTION_TYPE_ERROR 0x4
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_transaction(void);
|
||||
#else
|
||||
int soft_serial_transaction(int sstd_index);
|
||||
#endif
|
||||
|
||||
// target status
|
||||
// *SSTD_t.status has
|
||||
// initiator:
|
||||
// TRANSACTION_END
|
||||
// or TRANSACTION_NO_RESPONSE
|
||||
// or TRANSACTION_DATA_ERROR
|
||||
// target:
|
||||
// TRANSACTION_DATA_ERROR
|
||||
// or TRANSACTION_ACCEPTED
|
||||
#define TRANSACTION_ACCEPTED 0x8
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_get_and_clean_status(int sstd_index);
|
||||
#endif
|
166
drivers/awinic/aw20216.c
Normal file
166
drivers/awinic/aw20216.c
Normal file
@@ -0,0 +1,166 @@
|
||||
/* Copyright 2021 Jasper Chan
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "aw20216.h"
|
||||
#include "spi_master.h"
|
||||
|
||||
/* The AW20216 appears to be somewhat similar to the IS31FL743, although quite
|
||||
* a few things are different, such as the command byte format and page ordering.
|
||||
* The LED addresses start from 0x00 instead of 0x01.
|
||||
*/
|
||||
#define AWINIC_ID 0b1010 << 4
|
||||
|
||||
#define AW_PAGE_FUNCTION 0x00 << 1 // PG0, Function registers
|
||||
#define AW_PAGE_PWM 0x01 << 1 // PG1, LED PWM control
|
||||
#define AW_PAGE_SCALING 0x02 << 1 // PG2, LED current scaling control
|
||||
#define AW_PAGE_PATCHOICE 0x03 << 1 // PG3, Pattern choice?
|
||||
#define AW_PAGE_PWMSCALING 0x04 << 1 // PG4, LED PWM + Scaling control?
|
||||
|
||||
#define AW_WRITE 0
|
||||
#define AW_READ 1
|
||||
|
||||
#define AW_REG_CONFIGURATION 0x00 // PG0
|
||||
#define AW_REG_GLOBALCURRENT 0x01 // PG0
|
||||
|
||||
// Default value of AW_REG_CONFIGURATION
|
||||
// D7:D4 = 1011, SWSEL (SW1~SW12 active)
|
||||
// D3 = 0?, reserved (apparently this should be 1 but it doesn't seem to matter)
|
||||
// D2:D1 = 00, OSDE (open/short detection enable)
|
||||
// D0 = 0, CHIPEN (write 1 to enable LEDs when hardware enable pulled high)
|
||||
#define AW_CONFIG_DEFAULT 0b10110000
|
||||
#define AW_CHIPEN 1
|
||||
|
||||
#ifndef AW_SCALING_MAX
|
||||
# define AW_SCALING_MAX 150
|
||||
#endif
|
||||
|
||||
#ifndef AW_GLOBAL_CURRENT_MAX
|
||||
# define AW_GLOBAL_CURRENT_MAX 150
|
||||
#endif
|
||||
|
||||
#ifndef DRIVER_1_CS
|
||||
# define DRIVER_1_CS B13
|
||||
#endif
|
||||
|
||||
#ifndef DRIVER_1_EN
|
||||
# define DRIVER_1_EN C13
|
||||
#endif
|
||||
|
||||
uint8_t g_spi_transfer_buffer[20] = {0};
|
||||
aw_led g_pwm_buffer[DRIVER_LED_TOTAL];
|
||||
bool g_pwm_buffer_update_required[DRIVER_LED_TOTAL];
|
||||
|
||||
bool AW20216_write_register(pin_t slave_pin, uint8_t page, uint8_t reg, uint8_t data) {
|
||||
// Do we need to call spi_stop() if this fails?
|
||||
if (!spi_start(slave_pin, false, 0, 16)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
g_spi_transfer_buffer[0] = (AWINIC_ID | page | AW_WRITE);
|
||||
g_spi_transfer_buffer[1] = reg;
|
||||
g_spi_transfer_buffer[2] = data;
|
||||
|
||||
if (spi_transmit(g_spi_transfer_buffer, 3) != SPI_STATUS_SUCCESS) {
|
||||
spi_stop();
|
||||
return false;
|
||||
}
|
||||
spi_stop();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AW20216_init_scaling(void) {
|
||||
// Set constant current to the max, control brightness with PWM
|
||||
aw_led led;
|
||||
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||
led = g_aw_leds[i];
|
||||
if (led.driver == 0) {
|
||||
AW20216_write_register(DRIVER_1_CS, AW_PAGE_SCALING, led.r, AW_SCALING_MAX);
|
||||
AW20216_write_register(DRIVER_1_CS, AW_PAGE_SCALING, led.g, AW_SCALING_MAX);
|
||||
AW20216_write_register(DRIVER_1_CS, AW_PAGE_SCALING, led.b, AW_SCALING_MAX);
|
||||
}
|
||||
#ifdef DRIVER_2_CS
|
||||
else if (led.driver == 1) {
|
||||
AW20216_write_register(DRIVER_2_CS, AW_PAGE_SCALING, led.r, AW_SCALING_MAX);
|
||||
AW20216_write_register(DRIVER_2_CS, AW_PAGE_SCALING, led.g, AW_SCALING_MAX);
|
||||
AW20216_write_register(DRIVER_2_CS, AW_PAGE_SCALING, led.b, AW_SCALING_MAX);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool AW20216_soft_enable(void) {
|
||||
AW20216_write_register(DRIVER_1_CS, AW_PAGE_FUNCTION, AW_REG_CONFIGURATION, AW_CONFIG_DEFAULT | AW_CHIPEN);
|
||||
#ifdef DRIVER_2_CS
|
||||
AW20216_write_register(DRIVER_2_CS, AW_PAGE_FUNCTION, AW_REG_CONFIGURATION, AW_CONFIG_DEFAULT | AW_CHIPEN);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
void AW20216_update_pwm(int index, uint8_t red, uint8_t green, uint8_t blue) {
|
||||
aw_led led = g_aw_leds[index];
|
||||
if (led.driver == 0) {
|
||||
AW20216_write_register(DRIVER_1_CS, AW_PAGE_PWM, led.r, red);
|
||||
AW20216_write_register(DRIVER_1_CS, AW_PAGE_PWM, led.g, green);
|
||||
AW20216_write_register(DRIVER_1_CS, AW_PAGE_PWM, led.b, blue);
|
||||
}
|
||||
#ifdef DRIVER_2_CS
|
||||
else if (led.driver == 1) {
|
||||
AW20216_write_register(DRIVER_2_CS, AW_PAGE_PWM, led.r, red);
|
||||
AW20216_write_register(DRIVER_2_CS, AW_PAGE_PWM, led.g, green);
|
||||
AW20216_write_register(DRIVER_2_CS, AW_PAGE_PWM, led.b, blue);
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
void AW20216_init(void) {
|
||||
// All LEDs should start with all scaling and PWM registers as off
|
||||
setPinOutput(DRIVER_1_EN);
|
||||
writePinHigh(DRIVER_1_EN);
|
||||
AW20216_write_register(DRIVER_1_CS, AW_PAGE_FUNCTION, AW_REG_GLOBALCURRENT, AW_GLOBAL_CURRENT_MAX);
|
||||
#ifdef DRIVER_2_EN
|
||||
setPinOutput(DRIVER_2_EN);
|
||||
writePinHigh(DRIVER_2_EN);
|
||||
AW20216_write_register(DRIVER_2_CS, AW_PAGE_FUNCTION, AW_REG_GLOBALCURRENT, AW_GLOBAL_CURRENT_MAX);
|
||||
#endif
|
||||
AW20216_init_scaling();
|
||||
AW20216_soft_enable();
|
||||
return;
|
||||
}
|
||||
|
||||
void AW20216_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
|
||||
g_pwm_buffer[index].r = red;
|
||||
g_pwm_buffer[index].g = green;
|
||||
g_pwm_buffer[index].b = blue;
|
||||
g_pwm_buffer_update_required[index] = true;
|
||||
return;
|
||||
}
|
||||
void AW20216_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
|
||||
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||
AW20216_set_color(i, red, green, blue);
|
||||
}
|
||||
return;
|
||||
}
|
||||
void AW20216_update_pwm_buffers(void) {
|
||||
for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||
if (g_pwm_buffer_update_required[i]) {
|
||||
AW20216_update_pwm(i, g_pwm_buffer[i].r, g_pwm_buffer[i].g, g_pwm_buffer[i].b);
|
||||
g_pwm_buffer_update_required[i] = false;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
251
drivers/awinic/aw20216.h
Normal file
251
drivers/awinic/aw20216.h
Normal file
@@ -0,0 +1,251 @@
|
||||
/* Copyright 2021 Jasper Chan (Gigahawk)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct aw_led {
|
||||
uint8_t driver : 2;
|
||||
uint8_t r;
|
||||
uint8_t g;
|
||||
uint8_t b;
|
||||
} aw_led;
|
||||
|
||||
extern const aw_led g_aw_leds[DRIVER_LED_TOTAL];
|
||||
|
||||
void AW20216_init(void);
|
||||
void AW20216_set_color(int index, uint8_t red, uint8_t green, uint8_t blue);
|
||||
void AW20216_set_color_all(uint8_t red, uint8_t green, uint8_t blue);
|
||||
void AW20216_update_pwm_buffers(void);
|
||||
|
||||
#define CS1_SW1 0x00
|
||||
#define CS2_SW1 0x01
|
||||
#define CS3_SW1 0x02
|
||||
#define CS4_SW1 0x03
|
||||
#define CS5_SW1 0x04
|
||||
#define CS6_SW1 0x05
|
||||
#define CS7_SW1 0x06
|
||||
#define CS8_SW1 0x07
|
||||
#define CS9_SW1 0x08
|
||||
#define CS10_SW1 0x09
|
||||
#define CS11_SW1 0x0A
|
||||
#define CS12_SW1 0x0B
|
||||
#define CS13_SW1 0x0C
|
||||
#define CS14_SW1 0x0D
|
||||
#define CS15_SW1 0x0E
|
||||
#define CS16_SW1 0x0F
|
||||
#define CS17_SW1 0x10
|
||||
#define CS18_SW1 0x11
|
||||
#define CS1_SW2 0x12
|
||||
#define CS2_SW2 0x13
|
||||
#define CS3_SW2 0x14
|
||||
#define CS4_SW2 0x15
|
||||
#define CS5_SW2 0x16
|
||||
#define CS6_SW2 0x17
|
||||
#define CS7_SW2 0x18
|
||||
#define CS8_SW2 0x19
|
||||
#define CS9_SW2 0x1A
|
||||
#define CS10_SW2 0x1B
|
||||
#define CS11_SW2 0x1C
|
||||
#define CS12_SW2 0x1D
|
||||
#define CS13_SW2 0x1E
|
||||
#define CS14_SW2 0x1F
|
||||
#define CS15_SW2 0x20
|
||||
#define CS16_SW2 0x21
|
||||
#define CS17_SW2 0x22
|
||||
#define CS18_SW2 0x23
|
||||
#define CS1_SW3 0x24
|
||||
#define CS2_SW3 0x25
|
||||
#define CS3_SW3 0x26
|
||||
#define CS4_SW3 0x27
|
||||
#define CS5_SW3 0x28
|
||||
#define CS6_SW3 0x29
|
||||
#define CS7_SW3 0x2A
|
||||
#define CS8_SW3 0x2B
|
||||
#define CS9_SW3 0x2C
|
||||
#define CS10_SW3 0x2D
|
||||
#define CS11_SW3 0x2E
|
||||
#define CS12_SW3 0x2F
|
||||
#define CS13_SW3 0x30
|
||||
#define CS14_SW3 0x31
|
||||
#define CS15_SW3 0x32
|
||||
#define CS16_SW3 0x33
|
||||
#define CS17_SW3 0x34
|
||||
#define CS18_SW3 0x35
|
||||
#define CS1_SW4 0x36
|
||||
#define CS2_SW4 0x37
|
||||
#define CS3_SW4 0x38
|
||||
#define CS4_SW4 0x39
|
||||
#define CS5_SW4 0x3A
|
||||
#define CS6_SW4 0x3B
|
||||
#define CS7_SW4 0x3C
|
||||
#define CS8_SW4 0x3D
|
||||
#define CS9_SW4 0x3E
|
||||
#define CS10_SW4 0x3F
|
||||
#define CS11_SW4 0x40
|
||||
#define CS12_SW4 0x41
|
||||
#define CS13_SW4 0x42
|
||||
#define CS14_SW4 0x43
|
||||
#define CS15_SW4 0x44
|
||||
#define CS16_SW4 0x45
|
||||
#define CS17_SW4 0x46
|
||||
#define CS18_SW4 0x47
|
||||
#define CS1_SW5 0x48
|
||||
#define CS2_SW5 0x49
|
||||
#define CS3_SW5 0x4A
|
||||
#define CS4_SW5 0x4B
|
||||
#define CS5_SW5 0x4C
|
||||
#define CS6_SW5 0x4D
|
||||
#define CS7_SW5 0x4E
|
||||
#define CS8_SW5 0x4F
|
||||
#define CS9_SW5 0x50
|
||||
#define CS10_SW5 0x51
|
||||
#define CS11_SW5 0x52
|
||||
#define CS12_SW5 0x53
|
||||
#define CS13_SW5 0x54
|
||||
#define CS14_SW5 0x55
|
||||
#define CS15_SW5 0x56
|
||||
#define CS16_SW5 0x57
|
||||
#define CS17_SW5 0x58
|
||||
#define CS18_SW5 0x59
|
||||
#define CS1_SW6 0x5A
|
||||
#define CS2_SW6 0x5B
|
||||
#define CS3_SW6 0x5C
|
||||
#define CS4_SW6 0x5D
|
||||
#define CS5_SW6 0x5E
|
||||
#define CS6_SW6 0x5F
|
||||
#define CS7_SW6 0x60
|
||||
#define CS8_SW6 0x61
|
||||
#define CS9_SW6 0x62
|
||||
#define CS10_SW6 0x63
|
||||
#define CS11_SW6 0x64
|
||||
#define CS12_SW6 0x65
|
||||
#define CS13_SW6 0x66
|
||||
#define CS14_SW6 0x67
|
||||
#define CS15_SW6 0x68
|
||||
#define CS16_SW6 0x69
|
||||
#define CS17_SW6 0x6A
|
||||
#define CS18_SW6 0x6B
|
||||
#define CS1_SW7 0x6C
|
||||
#define CS2_SW7 0x6D
|
||||
#define CS3_SW7 0x6E
|
||||
#define CS4_SW7 0x6F
|
||||
#define CS5_SW7 0x70
|
||||
#define CS6_SW7 0x71
|
||||
#define CS7_SW7 0x72
|
||||
#define CS8_SW7 0x73
|
||||
#define CS9_SW7 0x74
|
||||
#define CS10_SW7 0x75
|
||||
#define CS11_SW7 0x76
|
||||
#define CS12_SW7 0x77
|
||||
#define CS13_SW7 0x78
|
||||
#define CS14_SW7 0x79
|
||||
#define CS15_SW7 0x7A
|
||||
#define CS16_SW7 0x7B
|
||||
#define CS17_SW7 0x7C
|
||||
#define CS18_SW7 0x7D
|
||||
#define CS1_SW8 0x7E
|
||||
#define CS2_SW8 0x7F
|
||||
#define CS3_SW8 0x80
|
||||
#define CS4_SW8 0x81
|
||||
#define CS5_SW8 0x82
|
||||
#define CS6_SW8 0x83
|
||||
#define CS7_SW8 0x84
|
||||
#define CS8_SW8 0x85
|
||||
#define CS9_SW8 0x86
|
||||
#define CS10_SW8 0x87
|
||||
#define CS11_SW8 0x88
|
||||
#define CS12_SW8 0x89
|
||||
#define CS13_SW8 0x8A
|
||||
#define CS14_SW8 0x8B
|
||||
#define CS15_SW8 0x8C
|
||||
#define CS16_SW8 0x8D
|
||||
#define CS17_SW8 0x8E
|
||||
#define CS18_SW8 0x8F
|
||||
#define CS1_SW9 0x90
|
||||
#define CS2_SW9 0x91
|
||||
#define CS3_SW9 0x92
|
||||
#define CS4_SW9 0x93
|
||||
#define CS5_SW9 0x94
|
||||
#define CS6_SW9 0x95
|
||||
#define CS7_SW9 0x96
|
||||
#define CS8_SW9 0x97
|
||||
#define CS9_SW9 0x98
|
||||
#define CS10_SW9 0x99
|
||||
#define CS11_SW9 0x9A
|
||||
#define CS12_SW9 0x9B
|
||||
#define CS13_SW9 0x9C
|
||||
#define CS14_SW9 0x9D
|
||||
#define CS15_SW9 0x9E
|
||||
#define CS16_SW9 0x9F
|
||||
#define CS17_SW9 0xA0
|
||||
#define CS18_SW9 0xA1
|
||||
#define CS1_SW10 0xA2
|
||||
#define CS2_SW10 0xA3
|
||||
#define CS3_SW10 0xA4
|
||||
#define CS4_SW10 0xA5
|
||||
#define CS5_SW10 0xA6
|
||||
#define CS6_SW10 0xA7
|
||||
#define CS7_SW10 0xA8
|
||||
#define CS8_SW10 0xA9
|
||||
#define CS9_SW10 0xAA
|
||||
#define CS10_SW10 0xAB
|
||||
#define CS11_SW10 0xAC
|
||||
#define CS12_SW10 0xAD
|
||||
#define CS13_SW10 0xAE
|
||||
#define CS14_SW10 0xAF
|
||||
#define CS15_SW10 0xB0
|
||||
#define CS16_SW10 0xB1
|
||||
#define CS17_SW10 0xB2
|
||||
#define CS18_SW10 0xB3
|
||||
#define CS1_SW11 0xB4
|
||||
#define CS2_SW11 0xB5
|
||||
#define CS3_SW11 0xB6
|
||||
#define CS4_SW11 0xB7
|
||||
#define CS5_SW11 0xB8
|
||||
#define CS6_SW11 0xB9
|
||||
#define CS7_SW11 0xBA
|
||||
#define CS8_SW11 0xBB
|
||||
#define CS9_SW11 0xBC
|
||||
#define CS10_SW11 0xBD
|
||||
#define CS11_SW11 0xBE
|
||||
#define CS12_SW11 0xBF
|
||||
#define CS13_SW11 0xC0
|
||||
#define CS14_SW11 0xC1
|
||||
#define CS15_SW11 0xC2
|
||||
#define CS16_SW11 0xC3
|
||||
#define CS17_SW11 0xC4
|
||||
#define CS18_SW11 0xC5
|
||||
#define CS1_SW12 0xC6
|
||||
#define CS2_SW12 0xC7
|
||||
#define CS3_SW12 0xC8
|
||||
#define CS4_SW12 0xC9
|
||||
#define CS5_SW12 0xCA
|
||||
#define CS6_SW12 0xCB
|
||||
#define CS7_SW12 0xCC
|
||||
#define CS8_SW12 0xCD
|
||||
#define CS9_SW12 0xCE
|
||||
#define CS10_SW12 0xCF
|
||||
#define CS11_SW12 0xD0
|
||||
#define CS12_SW12 0xD1
|
||||
#define CS13_SW12 0xD2
|
||||
#define CS14_SW12 0xD3
|
||||
#define CS15_SW12 0xD4
|
||||
#define CS16_SW12 0xD5
|
||||
#define CS17_SW12 0xD6
|
||||
#define CS18_SW12 0xD7
|
@@ -74,21 +74,12 @@ static THD_FUNCTION(Thread1, arg) {
|
||||
}
|
||||
}
|
||||
|
||||
static SSTD_t *Transaction_table = NULL;
|
||||
static uint8_t Transaction_table_size = 0;
|
||||
|
||||
void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) {
|
||||
Transaction_table = sstd_table;
|
||||
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||
|
||||
void soft_serial_initiator_init(void) {
|
||||
serial_output();
|
||||
serial_high();
|
||||
}
|
||||
|
||||
void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) {
|
||||
Transaction_table = sstd_table;
|
||||
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||
|
||||
void soft_serial_target_init(void) {
|
||||
serial_input();
|
||||
|
||||
palEnablePadEvent(PAL_PORT(SOFT_SERIAL_PIN), PAL_PAD(SOFT_SERIAL_PIN), PAL_EVENT_MODE_FALLING_EDGE);
|
||||
@@ -154,16 +145,14 @@ void interrupt_handler(void *arg) {
|
||||
uint8_t checksum_computed = 0;
|
||||
int sstd_index = 0;
|
||||
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
sstd_index = serial_read_byte();
|
||||
sync_send();
|
||||
#endif
|
||||
|
||||
SSTD_t *trans = &Transaction_table[sstd_index];
|
||||
split_transaction_desc_t *trans = &split_transaction_table[sstd_index];
|
||||
for (int i = 0; i < trans->initiator2target_buffer_size; ++i) {
|
||||
trans->initiator2target_buffer[i] = serial_read_byte();
|
||||
split_trans_initiator2target_buffer(trans)[i] = serial_read_byte();
|
||||
sync_send();
|
||||
checksum_computed += trans->initiator2target_buffer[i];
|
||||
checksum_computed += split_trans_initiator2target_buffer(trans)[i];
|
||||
}
|
||||
checksum_computed ^= 7;
|
||||
uint8_t checksum_received = serial_read_byte();
|
||||
@@ -172,12 +161,17 @@ void interrupt_handler(void *arg) {
|
||||
// wait for the sync to finish sending
|
||||
serial_delay();
|
||||
|
||||
// Allow any slave processing to occur
|
||||
if (trans->slave_callback) {
|
||||
trans->slave_callback(trans->initiator2target_buffer_size, split_trans_initiator2target_buffer(trans), trans->target2initiator_buffer_size, split_trans_target2initiator_buffer(trans));
|
||||
}
|
||||
|
||||
uint8_t checksum = 0;
|
||||
for (int i = 0; i < trans->target2initiator_buffer_size; ++i) {
|
||||
serial_write_byte(trans->target2initiator_buffer[i]);
|
||||
serial_write_byte(split_trans_target2initiator_buffer(trans)[i]);
|
||||
sync_send();
|
||||
serial_delay_half();
|
||||
checksum += trans->target2initiator_buffer[i];
|
||||
checksum += split_trans_target2initiator_buffer(trans)[i];
|
||||
}
|
||||
serial_write_byte(checksum ^ 7);
|
||||
sync_send();
|
||||
@@ -206,15 +200,10 @@ void interrupt_handler(void *arg) {
|
||||
// TRANSACTION_NO_RESPONSE
|
||||
// TRANSACTION_DATA_ERROR
|
||||
// this code is very time dependent, so we need to disable interrupts
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_transaction(void) {
|
||||
int sstd_index = 0;
|
||||
#else
|
||||
int soft_serial_transaction(int sstd_index) {
|
||||
#endif
|
||||
|
||||
if (sstd_index > Transaction_table_size) return TRANSACTION_TYPE_ERROR;
|
||||
SSTD_t *trans = &Transaction_table[sstd_index];
|
||||
if (sstd_index > NUM_TOTAL_TRANSACTIONS) return TRANSACTION_TYPE_ERROR;
|
||||
split_transaction_desc_t *trans = &split_transaction_table[sstd_index];
|
||||
if (!trans->status) return TRANSACTION_TYPE_ERROR; // not registered
|
||||
|
||||
// TODO: remove extra delay between transactions
|
||||
serial_delay();
|
||||
@@ -244,14 +233,13 @@ int soft_serial_transaction(int sstd_index) {
|
||||
|
||||
uint8_t checksum = 0;
|
||||
// send data to the slave
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
serial_write_byte(sstd_index); // first chunk is transaction id
|
||||
sync_recv();
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < trans->initiator2target_buffer_size; ++i) {
|
||||
serial_write_byte(trans->initiator2target_buffer[i]);
|
||||
serial_write_byte(split_trans_initiator2target_buffer(trans)[i]);
|
||||
sync_recv();
|
||||
checksum += trans->initiator2target_buffer[i];
|
||||
checksum += split_trans_initiator2target_buffer(trans)[i];
|
||||
}
|
||||
serial_write_byte(checksum ^ 7);
|
||||
sync_recv();
|
||||
@@ -262,9 +250,9 @@ int soft_serial_transaction(int sstd_index) {
|
||||
// receive data from the slave
|
||||
uint8_t checksum_computed = 0;
|
||||
for (int i = 0; i < trans->target2initiator_buffer_size; ++i) {
|
||||
trans->target2initiator_buffer[i] = serial_read_byte();
|
||||
split_trans_target2initiator_buffer(trans)[i] = serial_read_byte();
|
||||
sync_recv();
|
||||
checksum_computed += trans->target2initiator_buffer[i];
|
||||
checksum_computed += split_trans_target2initiator_buffer(trans)[i];
|
||||
}
|
||||
checksum_computed ^= 7;
|
||||
uint8_t checksum_received = serial_read_byte();
|
||||
|
@@ -1,62 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
// Need Soft Serial defines in config.h
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
// ex.
|
||||
// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6
|
||||
// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5
|
||||
// // 1: about 137kbps (default)
|
||||
// // 2: about 75kbps
|
||||
// // 3: about 39kbps
|
||||
// // 4: about 26kbps
|
||||
// // 5: about 20kbps
|
||||
//
|
||||
// //// USE simple API (using signle-type transaction function)
|
||||
// /* nothing */
|
||||
// //// USE flexible API (using multi-type transaction function)
|
||||
// #define SERIAL_USE_MULTI_TRANSACTION
|
||||
//
|
||||
// /////////////////////////////////////////////////////////////////
|
||||
|
||||
// Soft Serial Transaction Descriptor
|
||||
typedef struct _SSTD_t {
|
||||
uint8_t *status;
|
||||
uint8_t initiator2target_buffer_size;
|
||||
uint8_t *initiator2target_buffer;
|
||||
uint8_t target2initiator_buffer_size;
|
||||
uint8_t *target2initiator_buffer;
|
||||
} SSTD_t;
|
||||
#define TID_LIMIT(table) (sizeof(table) / sizeof(SSTD_t))
|
||||
|
||||
// initiator is transaction start side
|
||||
void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size);
|
||||
// target is interrupt accept side
|
||||
void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size);
|
||||
|
||||
// initiator result
|
||||
#define TRANSACTION_END 0
|
||||
#define TRANSACTION_NO_RESPONSE 0x1
|
||||
#define TRANSACTION_DATA_ERROR 0x2
|
||||
#define TRANSACTION_TYPE_ERROR 0x4
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_transaction(void);
|
||||
#else
|
||||
int soft_serial_transaction(int sstd_index);
|
||||
#endif
|
||||
|
||||
// target status
|
||||
// *SSTD_t.status has
|
||||
// initiator:
|
||||
// TRANSACTION_END
|
||||
// or TRANSACTION_NO_RESPONSE
|
||||
// or TRANSACTION_DATA_ERROR
|
||||
// target:
|
||||
// TRANSACTION_DATA_ERROR
|
||||
// or TRANSACTION_ACCEPTED
|
||||
#define TRANSACTION_ACCEPTED 0x8
|
||||
#ifdef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_get_and_clean_status(int sstd_index);
|
||||
#endif
|
@@ -113,37 +113,29 @@ void usart_slave_init(void) {
|
||||
chThdCreateStatic(waSlaveThread, sizeof(waSlaveThread), HIGHPRIO, SlaveThread, NULL);
|
||||
}
|
||||
|
||||
static SSTD_t* Transaction_table = NULL;
|
||||
static uint8_t Transaction_table_size = 0;
|
||||
void soft_serial_initiator_init(void) { usart_master_init(); }
|
||||
|
||||
void soft_serial_initiator_init(SSTD_t* sstd_table, int sstd_table_size) {
|
||||
Transaction_table = sstd_table;
|
||||
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||
|
||||
usart_master_init();
|
||||
}
|
||||
|
||||
void soft_serial_target_init(SSTD_t* sstd_table, int sstd_table_size) {
|
||||
Transaction_table = sstd_table;
|
||||
Transaction_table_size = (uint8_t)sstd_table_size;
|
||||
|
||||
usart_slave_init();
|
||||
}
|
||||
void soft_serial_target_init(void) { usart_slave_init(); }
|
||||
|
||||
void handle_soft_serial_slave(void) {
|
||||
uint8_t sstd_index = sdGet(&SERIAL_USART_DRIVER); // first chunk is always transaction id
|
||||
SSTD_t* trans = &Transaction_table[sstd_index];
|
||||
uint8_t sstd_index = sdGet(&SERIAL_USART_DRIVER); // first chunk is always transaction id
|
||||
split_transaction_desc_t* trans = &split_transaction_table[sstd_index];
|
||||
|
||||
// Always write back the sstd_index as part of a basic handshake
|
||||
sstd_index ^= HANDSHAKE_MAGIC;
|
||||
sdWrite(&SERIAL_USART_DRIVER, &sstd_index, sizeof(sstd_index));
|
||||
|
||||
if (trans->initiator2target_buffer_size) {
|
||||
sdRead(&SERIAL_USART_DRIVER, trans->initiator2target_buffer, trans->initiator2target_buffer_size);
|
||||
sdRead(&SERIAL_USART_DRIVER, split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size);
|
||||
}
|
||||
|
||||
// Allow any slave processing to occur
|
||||
if (trans->slave_callback) {
|
||||
trans->slave_callback(trans->initiator2target_buffer_size, split_trans_initiator2target_buffer(trans), trans->target2initiator_buffer_size, split_trans_target2initiator_buffer(trans));
|
||||
}
|
||||
|
||||
if (trans->target2initiator_buffer_size) {
|
||||
sdWrite(&SERIAL_USART_DRIVER, trans->target2initiator_buffer, trans->target2initiator_buffer_size);
|
||||
sdWrite(&SERIAL_USART_DRIVER, split_trans_target2initiator_buffer(trans), trans->target2initiator_buffer_size);
|
||||
}
|
||||
|
||||
if (trans->status) {
|
||||
@@ -160,17 +152,14 @@ void handle_soft_serial_slave(void) {
|
||||
// TRANSACTION_END
|
||||
// TRANSACTION_NO_RESPONSE
|
||||
// TRANSACTION_DATA_ERROR
|
||||
#ifndef SERIAL_USE_MULTI_TRANSACTION
|
||||
int soft_serial_transaction(void) {
|
||||
uint8_t sstd_index = 0;
|
||||
#else
|
||||
int soft_serial_transaction(int index) {
|
||||
uint8_t sstd_index = index;
|
||||
#endif
|
||||
|
||||
if (sstd_index > Transaction_table_size) return TRANSACTION_TYPE_ERROR;
|
||||
SSTD_t* trans = &Transaction_table[sstd_index];
|
||||
msg_t res = 0;
|
||||
if (sstd_index > NUM_TOTAL_TRANSACTIONS) return TRANSACTION_TYPE_ERROR;
|
||||
split_transaction_desc_t* trans = &split_transaction_table[sstd_index];
|
||||
msg_t res = 0;
|
||||
|
||||
if (!trans->status) return TRANSACTION_TYPE_ERROR; // not registered
|
||||
|
||||
sdClear(&SERIAL_USART_DRIVER);
|
||||
|
||||
@@ -189,7 +178,7 @@ int soft_serial_transaction(int index) {
|
||||
}
|
||||
|
||||
if (trans->initiator2target_buffer_size) {
|
||||
res = sdWriteTimeout(&SERIAL_USART_DRIVER, trans->initiator2target_buffer, trans->initiator2target_buffer_size, TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||
res = sdWriteTimeout(&SERIAL_USART_DRIVER, split_trans_initiator2target_buffer(trans), trans->initiator2target_buffer_size, TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||
if (res < 0) {
|
||||
dprintf("serial::usart_transmit NO_RESPONSE\n");
|
||||
return TRANSACTION_NO_RESPONSE;
|
||||
@@ -197,7 +186,7 @@ int soft_serial_transaction(int index) {
|
||||
}
|
||||
|
||||
if (trans->target2initiator_buffer_size) {
|
||||
res = sdReadTimeout(&SERIAL_USART_DRIVER, trans->target2initiator_buffer, trans->target2initiator_buffer_size, TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||
res = sdReadTimeout(&SERIAL_USART_DRIVER, split_trans_target2initiator_buffer(trans), trans->target2initiator_buffer_size, TIME_MS2I(SERIAL_USART_TIMEOUT));
|
||||
if (res < 0) {
|
||||
dprintf("serial::usart_receive NO_RESPONSE\n");
|
||||
return TRANSACTION_NO_RESPONSE;
|
||||
|
@@ -18,8 +18,13 @@
|
||||
|
||||
#include "timer.h"
|
||||
|
||||
static pin_t currentSlavePin = NO_PIN;
|
||||
static SPIConfig spiConfig = {false, NULL, 0, 0, 0, 0};
|
||||
static pin_t currentSlavePin = NO_PIN;
|
||||
|
||||
#if defined(K20x) || defined(KL2x)
|
||||
static SPIConfig spiConfig = {NULL, 0, 0, 0};
|
||||
#else
|
||||
static SPIConfig spiConfig = {false, NULL, 0, 0, 0, 0};
|
||||
#endif
|
||||
|
||||
__attribute__((weak)) void spi_init(void) {
|
||||
static bool is_initialised = false;
|
||||
@@ -27,15 +32,15 @@ __attribute__((weak)) void spi_init(void) {
|
||||
is_initialised = true;
|
||||
|
||||
// Try releasing special pins for a short time
|
||||
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_INPUT);
|
||||
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_INPUT);
|
||||
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_INPUT);
|
||||
setPinInput(SPI_SCK_PIN);
|
||||
setPinInput(SPI_MOSI_PIN);
|
||||
setPinInput(SPI_MISO_PIN);
|
||||
|
||||
chThdSleepMilliseconds(10);
|
||||
#if defined(USE_GPIOV1)
|
||||
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
||||
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
||||
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), PAL_MODE_STM32_ALTERNATE_PUSHPULL);
|
||||
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), SPI_SCK_PAL_MODE);
|
||||
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), SPI_MOSI_PAL_MODE);
|
||||
palSetPadMode(PAL_PORT(SPI_MISO_PIN), PAL_PAD(SPI_MISO_PIN), SPI_MISO_PAL_MODE);
|
||||
#else
|
||||
palSetPadMode(PAL_PORT(SPI_SCK_PIN), PAL_PAD(SPI_SCK_PIN), PAL_MODE_ALTERNATE(SPI_SCK_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
|
||||
palSetPadMode(PAL_PORT(SPI_MOSI_PIN), PAL_PAD(SPI_MOSI_PIN), PAL_MODE_ALTERNATE(SPI_MOSI_PAL_MODE) | PAL_STM32_OTYPE_PUSHPULL | PAL_STM32_OSPEED_HIGHEST);
|
||||
@@ -58,6 +63,54 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#if defined(K20x) || defined(KL2x)
|
||||
spiConfig.tar0 = SPIx_CTARn_FMSZ(7) | SPIx_CTARn_ASC(1);
|
||||
|
||||
if (lsbFirst) {
|
||||
spiConfig.tar0 |= SPIx_CTARn_LSBFE;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
spiConfig.tar0 |= SPIx_CTARn_CPHA;
|
||||
break;
|
||||
case 2:
|
||||
spiConfig.tar0 |= SPIx_CTARn_CPOL;
|
||||
break;
|
||||
case 3:
|
||||
spiConfig.tar0 |= SPIx_CTARn_CPHA | SPIx_CTARn_CPOL;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (roundedDivisor) {
|
||||
case 2:
|
||||
spiConfig.tar0 |= SPIx_CTARn_BR(0);
|
||||
break;
|
||||
case 4:
|
||||
spiConfig.tar0 |= SPIx_CTARn_BR(1);
|
||||
break;
|
||||
case 8:
|
||||
spiConfig.tar0 |= SPIx_CTARn_BR(3);
|
||||
break;
|
||||
case 16:
|
||||
spiConfig.tar0 |= SPIx_CTARn_BR(4);
|
||||
break;
|
||||
case 32:
|
||||
spiConfig.tar0 |= SPIx_CTARn_BR(5);
|
||||
break;
|
||||
case 64:
|
||||
spiConfig.tar0 |= SPIx_CTARn_BR(6);
|
||||
break;
|
||||
case 128:
|
||||
spiConfig.tar0 |= SPIx_CTARn_BR(7);
|
||||
break;
|
||||
case 256:
|
||||
spiConfig.tar0 |= SPIx_CTARn_BR(8);
|
||||
break;
|
||||
}
|
||||
#else
|
||||
spiConfig.cr1 = 0;
|
||||
|
||||
if (lsbFirst) {
|
||||
@@ -103,6 +156,7 @@ bool spi_start(pin_t slavePin, bool lsbFirst, uint8_t mode, uint16_t divisor) {
|
||||
spiConfig.cr1 |= SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
currentSlavePin = slavePin;
|
||||
spiConfig.ssport = PAL_PORT(slavePin);
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "gpio.h"
|
||||
#include "chibios_config.h"
|
||||
|
||||
#ifndef SPI_DRIVER
|
||||
# define SPI_DRIVER SPID2
|
||||
@@ -31,7 +32,11 @@
|
||||
#endif
|
||||
|
||||
#ifndef SPI_SCK_PAL_MODE
|
||||
# define SPI_SCK_PAL_MODE 5
|
||||
# if defined(USE_GPIOV1)
|
||||
# define SPI_SCK_PAL_MODE PAL_MODE_STM32_ALTERNATE_PUSHPULL
|
||||
# else
|
||||
# define SPI_SCK_PAL_MODE 5
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SPI_MOSI_PIN
|
||||
@@ -39,7 +44,11 @@
|
||||
#endif
|
||||
|
||||
#ifndef SPI_MOSI_PAL_MODE
|
||||
# define SPI_MOSI_PAL_MODE 5
|
||||
# if defined(USE_GPIOV1)
|
||||
# define SPI_MOSI_PAL_MODE PAL_MODE_STM32_ALTERNATE_PUSHPULL
|
||||
# else
|
||||
# define SPI_MOSI_PAL_MODE 5
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SPI_MISO_PIN
|
||||
@@ -47,7 +56,11 @@
|
||||
#endif
|
||||
|
||||
#ifndef SPI_MISO_PAL_MODE
|
||||
# define SPI_MISO_PAL_MODE 5
|
||||
# if defined(USE_GPIOV1)
|
||||
# define SPI_MISO_PAL_MODE PAL_MODE_STM32_ALTERNATE_PUSHPULL
|
||||
# else
|
||||
# define SPI_MISO_PAL_MODE 5
|
||||
# endif
|
||||
#endif
|
||||
|
||||
typedef int16_t spi_status_t;
|
||||
|
@@ -291,6 +291,73 @@ void haptic_play(void) {
|
||||
#endif
|
||||
}
|
||||
|
||||
__attribute__((weak)) bool get_haptic_enabled_key(uint16_t keycode, keyrecord_t *record) {
|
||||
switch(keycode) {
|
||||
# ifdef NO_HAPTIC_MOD
|
||||
case QK_MOD_TAP ... QK_MOD_TAP_MAX:
|
||||
if (record->tap.count == 0) return false;
|
||||
break;
|
||||
case QK_LAYER_TAP_TOGGLE ... QK_LAYER_TAP_TOGGLE_MAX:
|
||||
if (record->tap.count != TAPPING_TOGGLE) return false;
|
||||
break;
|
||||
case QK_LAYER_TAP ... QK_LAYER_TAP_MAX:
|
||||
if (record->tap.count == 0) return false;
|
||||
break;
|
||||
case KC_LCTRL ... KC_RGUI:
|
||||
case QK_MOMENTARY ... QK_MOMENTARY_MAX:
|
||||
# endif
|
||||
# ifdef NO_HAPTIC_FN
|
||||
case KC_FN0 ... KC_FN31:
|
||||
# endif
|
||||
# ifdef NO_HAPTIC_ALPHA
|
||||
case KC_A ... KC_Z:
|
||||
# endif
|
||||
# ifdef NO_HAPTIC_PUNCTUATION
|
||||
case KC_ENTER:
|
||||
case KC_ESCAPE:
|
||||
case KC_BSPACE:
|
||||
case KC_SPACE:
|
||||
case KC_MINUS:
|
||||
case KC_EQUAL:
|
||||
case KC_LBRACKET:
|
||||
case KC_RBRACKET:
|
||||
case KC_BSLASH:
|
||||
case KC_NONUS_HASH:
|
||||
case KC_SCOLON:
|
||||
case KC_QUOTE:
|
||||
case KC_GRAVE:
|
||||
case KC_COMMA:
|
||||
case KC_SLASH:
|
||||
case KC_DOT:
|
||||
case KC_NONUS_BSLASH:
|
||||
# endif
|
||||
# ifdef NO_HAPTIC_LOCKKEYS
|
||||
case KC_CAPSLOCK:
|
||||
case KC_SCROLLLOCK:
|
||||
case KC_NUMLOCK:
|
||||
# endif
|
||||
# ifdef NO_HAPTIC_NAV
|
||||
case KC_PSCREEN:
|
||||
case KC_PAUSE:
|
||||
case KC_INSERT:
|
||||
case KC_DELETE:
|
||||
case KC_PGDOWN:
|
||||
case KC_PGUP:
|
||||
case KC_LEFT:
|
||||
case KC_UP:
|
||||
case KC_RIGHT:
|
||||
case KC_DOWN:
|
||||
case KC_END:
|
||||
case KC_HOME:
|
||||
# endif
|
||||
# ifdef NO_HAPTIC_NUMERIC
|
||||
case KC_1 ... KC_0:
|
||||
# endif
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool process_haptic(uint16_t keycode, keyrecord_t *record) {
|
||||
if (keycode == HPT_ON && record->event.pressed) {
|
||||
haptic_enable();
|
||||
@@ -335,12 +402,12 @@ bool process_haptic(uint16_t keycode, keyrecord_t *record) {
|
||||
if (haptic_config.enable) {
|
||||
if (record->event.pressed) {
|
||||
// keypress
|
||||
if (haptic_config.feedback < 2) {
|
||||
if (haptic_config.feedback < 2 && get_haptic_enabled_key(keycode, record)) {
|
||||
haptic_play();
|
||||
}
|
||||
} else {
|
||||
// keyrelease
|
||||
if (haptic_config.feedback > 0) {
|
||||
if (haptic_config.feedback > 0 && get_haptic_enabled_key(keycode, record)) {
|
||||
haptic_play();
|
||||
}
|
||||
}
|
||||
|
496
drivers/lcd/st7565.c
Normal file
496
drivers/lcd/st7565.c
Normal file
@@ -0,0 +1,496 @@
|
||||
/*
|
||||
Copyright 2021
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "st7565.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "keyboard.h"
|
||||
#include "progmem.h"
|
||||
#include "timer.h"
|
||||
#include "wait.h"
|
||||
|
||||
#include ST7565_FONT_H
|
||||
|
||||
// Fundamental Commands
|
||||
#define CONTRAST 0x81
|
||||
#define DISPLAY_ALL_ON 0xA5
|
||||
#define DISPLAY_ALL_ON_RESUME 0xA4
|
||||
#define NORMAL_DISPLAY 0xA6
|
||||
#define INVERT_DISPLAY 0xA7
|
||||
#define DISPLAY_ON 0xAF
|
||||
#define DISPLAY_OFF 0xAE
|
||||
#define NOP 0xE3
|
||||
|
||||
// Addressing Setting Commands
|
||||
#define PAM_SETCOLUMN_LSB 0x00
|
||||
#define PAM_SETCOLUMN_MSB 0x10
|
||||
#define PAM_PAGE_ADDR 0xB0 // 0xb0 -- 0xb7
|
||||
|
||||
// Hardware Configuration Commands
|
||||
#define DISPLAY_START_LINE 0x40
|
||||
#define SEGMENT_REMAP 0xA0
|
||||
#define SEGMENT_REMAP_INV 0xA1
|
||||
#define COM_SCAN_INC 0xC0
|
||||
#define COM_SCAN_DEC 0xC8
|
||||
#define LCD_BIAS_7 0xA3
|
||||
#define LCD_BIAS_9 0xA2
|
||||
#define RESISTOR_RATIO 0x20
|
||||
#define POWER_CONTROL 0x28
|
||||
|
||||
// Misc defines
|
||||
#ifndef ST7565_BLOCK_COUNT
|
||||
# define ST7565_BLOCK_COUNT (sizeof(ST7565_BLOCK_TYPE) * 8)
|
||||
#endif
|
||||
#ifndef ST7565_BLOCK_SIZE
|
||||
# define ST7565_BLOCK_SIZE (ST7565_MATRIX_SIZE / ST7565_BLOCK_COUNT)
|
||||
#endif
|
||||
|
||||
#define ST7565_ALL_BLOCKS_MASK (((((ST7565_BLOCK_TYPE)1 << (ST7565_BLOCK_COUNT - 1)) - 1) << 1) | 1)
|
||||
|
||||
#define HAS_FLAGS(bits, flags) ((bits & flags) == flags)
|
||||
|
||||
// Display buffer's is the same as the display memory layout
|
||||
// this is so we don't end up with rounding errors with
|
||||
// parts of the display unusable or don't get cleared correctly
|
||||
// and also allows for drawing & inverting
|
||||
uint8_t st7565_buffer[ST7565_MATRIX_SIZE];
|
||||
uint8_t * st7565_cursor;
|
||||
ST7565_BLOCK_TYPE st7565_dirty = 0;
|
||||
bool st7565_initialized = false;
|
||||
bool st7565_active = false;
|
||||
bool st7565_inverted = false;
|
||||
display_rotation_t st7565_rotation = DISPLAY_ROTATION_0;
|
||||
#if ST7565_TIMEOUT > 0
|
||||
uint32_t st7565_timeout;
|
||||
#endif
|
||||
#if ST7565_UPDATE_INTERVAL > 0
|
||||
uint16_t st7565_update_timeout;
|
||||
#endif
|
||||
|
||||
// Flips the rendering bits for a character at the current cursor position
|
||||
static void InvertCharacter(uint8_t *cursor) {
|
||||
const uint8_t *end = cursor + ST7565_FONT_WIDTH;
|
||||
while (cursor < end) {
|
||||
*cursor = ~(*cursor);
|
||||
cursor++;
|
||||
}
|
||||
}
|
||||
|
||||
bool st7565_init(display_rotation_t rotation) {
|
||||
setPinOutput(ST7565_A0_PIN);
|
||||
writePinHigh(ST7565_A0_PIN);
|
||||
setPinOutput(ST7565_RST_PIN);
|
||||
writePinHigh(ST7565_RST_PIN);
|
||||
|
||||
st7565_rotation = st7565_init_user(rotation);
|
||||
|
||||
spi_init();
|
||||
spi_start(ST7565_SS_PIN, false, 0, ST7565_SPI_CLK_DIVISOR);
|
||||
|
||||
st7565_reset();
|
||||
|
||||
st7565_send_cmd(LCD_BIAS_7);
|
||||
if (!HAS_FLAGS(st7565_rotation, DISPLAY_ROTATION_180)) {
|
||||
st7565_send_cmd(SEGMENT_REMAP);
|
||||
st7565_send_cmd(COM_SCAN_DEC);
|
||||
} else {
|
||||
st7565_send_cmd(SEGMENT_REMAP_INV);
|
||||
st7565_send_cmd(COM_SCAN_INC);
|
||||
}
|
||||
st7565_send_cmd(DISPLAY_START_LINE | 0x00);
|
||||
st7565_send_cmd(CONTRAST);
|
||||
st7565_send_cmd(ST7565_CONTRAST);
|
||||
st7565_send_cmd(RESISTOR_RATIO | 0x01);
|
||||
st7565_send_cmd(POWER_CONTROL | 0x04);
|
||||
wait_ms(50);
|
||||
st7565_send_cmd(POWER_CONTROL | 0x06);
|
||||
wait_ms(50);
|
||||
st7565_send_cmd(POWER_CONTROL | 0x07);
|
||||
wait_ms(10);
|
||||
st7565_send_cmd(DISPLAY_ON);
|
||||
st7565_send_cmd(DISPLAY_ALL_ON_RESUME);
|
||||
st7565_send_cmd(NORMAL_DISPLAY);
|
||||
|
||||
spi_stop();
|
||||
|
||||
#if ST7565_TIMEOUT > 0
|
||||
st7565_timeout = timer_read32() + ST7565_TIMEOUT;
|
||||
#endif
|
||||
|
||||
st7565_clear();
|
||||
st7565_initialized = true;
|
||||
st7565_active = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
__attribute__((weak)) display_rotation_t st7565_init_user(display_rotation_t rotation) { return rotation; }
|
||||
|
||||
void st7565_clear(void) {
|
||||
memset(st7565_buffer, 0, sizeof(st7565_buffer));
|
||||
st7565_cursor = &st7565_buffer[0];
|
||||
st7565_dirty = ST7565_ALL_BLOCKS_MASK;
|
||||
}
|
||||
|
||||
uint8_t crot(uint8_t a, int8_t n) {
|
||||
const uint8_t mask = 0x7;
|
||||
n &= mask;
|
||||
return a << n | a >> (-n & mask);
|
||||
}
|
||||
|
||||
void st7565_render(void) {
|
||||
if (!st7565_initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Do we have work to do?
|
||||
st7565_dirty &= ST7565_ALL_BLOCKS_MASK;
|
||||
if (!st7565_dirty) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Find first dirty block
|
||||
uint8_t update_start = 0;
|
||||
while (!(st7565_dirty & ((ST7565_BLOCK_TYPE)1 << update_start))) {
|
||||
++update_start;
|
||||
}
|
||||
|
||||
// Calculate commands to set memory addressing bounds.
|
||||
uint8_t start_page = ST7565_BLOCK_SIZE * update_start / ST7565_DISPLAY_WIDTH;
|
||||
uint8_t start_column = ST7565_BLOCK_SIZE * update_start % ST7565_DISPLAY_WIDTH;
|
||||
// IC has 132 segment drivers, for panels with less width we need to offset the starting column
|
||||
if (HAS_FLAGS(st7565_rotation, DISPLAY_ROTATION_180)) {
|
||||
start_column += (132 - ST7565_DISPLAY_WIDTH);
|
||||
}
|
||||
|
||||
spi_start(ST7565_SS_PIN, false, 0, ST7565_SPI_CLK_DIVISOR);
|
||||
|
||||
st7565_send_cmd(PAM_PAGE_ADDR | start_page);
|
||||
st7565_send_cmd(PAM_SETCOLUMN_LSB | ((ST7565_COLUMN_OFFSET + start_column) & 0x0f));
|
||||
st7565_send_cmd(PAM_SETCOLUMN_MSB | ((ST7565_COLUMN_OFFSET + start_column) >> 4 & 0x0f));
|
||||
|
||||
st7565_send_data(&st7565_buffer[ST7565_BLOCK_SIZE * update_start], ST7565_BLOCK_SIZE);
|
||||
|
||||
// Turn on display if it is off
|
||||
st7565_on();
|
||||
|
||||
// Clear dirty flag
|
||||
st7565_dirty &= ~((ST7565_BLOCK_TYPE)1 << update_start);
|
||||
}
|
||||
|
||||
void st7565_set_cursor(uint8_t col, uint8_t line) {
|
||||
uint16_t index = line * ST7565_DISPLAY_WIDTH + col * ST7565_FONT_WIDTH;
|
||||
|
||||
// Out of bounds?
|
||||
if (index >= ST7565_MATRIX_SIZE) {
|
||||
index = 0;
|
||||
}
|
||||
|
||||
st7565_cursor = &st7565_buffer[index];
|
||||
}
|
||||
|
||||
void st7565_advance_page(bool clearPageRemainder) {
|
||||
uint16_t index = st7565_cursor - &st7565_buffer[0];
|
||||
uint8_t remaining = ST7565_DISPLAY_WIDTH - (index % ST7565_DISPLAY_WIDTH);
|
||||
|
||||
if (clearPageRemainder) {
|
||||
// Remaining Char count
|
||||
remaining = remaining / ST7565_FONT_WIDTH;
|
||||
|
||||
// Write empty character until next line
|
||||
while (remaining--) st7565_write_char(' ', false);
|
||||
} else {
|
||||
// Next page index out of bounds?
|
||||
if (index + remaining >= ST7565_MATRIX_SIZE) {
|
||||
index = 0;
|
||||
remaining = 0;
|
||||
}
|
||||
|
||||
st7565_cursor = &st7565_buffer[index + remaining];
|
||||
}
|
||||
}
|
||||
|
||||
void st7565_advance_char(void) {
|
||||
uint16_t nextIndex = st7565_cursor - &st7565_buffer[0] + ST7565_FONT_WIDTH;
|
||||
uint8_t remainingSpace = ST7565_DISPLAY_WIDTH - (nextIndex % ST7565_DISPLAY_WIDTH);
|
||||
|
||||
// Do we have enough space on the current line for the next character
|
||||
if (remainingSpace < ST7565_FONT_WIDTH) {
|
||||
nextIndex += remainingSpace;
|
||||
}
|
||||
|
||||
// Did we go out of bounds
|
||||
if (nextIndex >= ST7565_MATRIX_SIZE) {
|
||||
nextIndex = 0;
|
||||
}
|
||||
|
||||
// Update cursor position
|
||||
st7565_cursor = &st7565_buffer[nextIndex];
|
||||
}
|
||||
|
||||
// Main handler that writes character data to the display buffer
|
||||
void st7565_write_char(const char data, bool invert) {
|
||||
// Advance to the next line if newline
|
||||
if (data == '\n') {
|
||||
// Old source wrote ' ' until end of line...
|
||||
st7565_advance_page(true);
|
||||
return;
|
||||
}
|
||||
|
||||
if (data == '\r') {
|
||||
st7565_advance_page(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// copy the current render buffer to check for dirty after
|
||||
static uint8_t st7565_temp_buffer[ST7565_FONT_WIDTH];
|
||||
memcpy(&st7565_temp_buffer, st7565_cursor, ST7565_FONT_WIDTH);
|
||||
|
||||
_Static_assert(sizeof(font) >= ((ST7565_FONT_END + 1 - ST7565_FONT_START) * ST7565_FONT_WIDTH), "ST7565_FONT_END references outside array");
|
||||
|
||||
// set the reder buffer data
|
||||
uint8_t cast_data = (uint8_t)data; // font based on unsigned type for index
|
||||
if (cast_data < ST7565_FONT_START || cast_data > ST7565_FONT_END) {
|
||||
memset(st7565_cursor, 0x00, ST7565_FONT_WIDTH);
|
||||
} else {
|
||||
const uint8_t *glyph = &font[(cast_data - ST7565_FONT_START) * ST7565_FONT_WIDTH];
|
||||
memcpy_P(st7565_cursor, glyph, ST7565_FONT_WIDTH);
|
||||
}
|
||||
|
||||
// Invert if needed
|
||||
if (invert) {
|
||||
InvertCharacter(st7565_cursor);
|
||||
}
|
||||
|
||||
// Dirty check
|
||||
if (memcmp(&st7565_temp_buffer, st7565_cursor, ST7565_FONT_WIDTH)) {
|
||||
uint16_t index = st7565_cursor - &st7565_buffer[0];
|
||||
st7565_dirty |= ((ST7565_BLOCK_TYPE)1 << (index / ST7565_BLOCK_SIZE));
|
||||
// Edgecase check if the written data spans the 2 chunks
|
||||
st7565_dirty |= ((ST7565_BLOCK_TYPE)1 << ((index + ST7565_FONT_WIDTH - 1) / ST7565_BLOCK_SIZE));
|
||||
}
|
||||
|
||||
// Finally move to the next char
|
||||
st7565_advance_char();
|
||||
}
|
||||
|
||||
void st7565_write(const char *data, bool invert) {
|
||||
const char *end = data + strlen(data);
|
||||
while (data < end) {
|
||||
st7565_write_char(*data, invert);
|
||||
data++;
|
||||
}
|
||||
}
|
||||
|
||||
void st7565_write_ln(const char *data, bool invert) {
|
||||
st7565_write(data, invert);
|
||||
st7565_advance_page(true);
|
||||
}
|
||||
|
||||
void st7565_pan(bool left) {
|
||||
uint16_t i = 0;
|
||||
for (uint16_t y = 0; y < ST7565_DISPLAY_HEIGHT / 8; y++) {
|
||||
if (left) {
|
||||
for (uint16_t x = 0; x < ST7565_DISPLAY_WIDTH - 1; x++) {
|
||||
i = y * ST7565_DISPLAY_WIDTH + x;
|
||||
st7565_buffer[i] = st7565_buffer[i + 1];
|
||||
}
|
||||
} else {
|
||||
for (uint16_t x = ST7565_DISPLAY_WIDTH - 1; x > 0; x--) {
|
||||
i = y * ST7565_DISPLAY_WIDTH + x;
|
||||
st7565_buffer[i] = st7565_buffer[i - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
st7565_dirty = ST7565_ALL_BLOCKS_MASK;
|
||||
}
|
||||
|
||||
display_buffer_reader_t st7565_read_raw(uint16_t start_index) {
|
||||
if (start_index > ST7565_MATRIX_SIZE) start_index = ST7565_MATRIX_SIZE;
|
||||
display_buffer_reader_t ret_reader;
|
||||
ret_reader.current_element = &st7565_buffer[start_index];
|
||||
ret_reader.remaining_element_count = ST7565_MATRIX_SIZE - start_index;
|
||||
return ret_reader;
|
||||
}
|
||||
|
||||
void st7565_write_raw_byte(const char data, uint16_t index) {
|
||||
if (index > ST7565_MATRIX_SIZE) index = ST7565_MATRIX_SIZE;
|
||||
if (st7565_buffer[index] == data) return;
|
||||
st7565_buffer[index] = data;
|
||||
st7565_dirty |= ((ST7565_BLOCK_TYPE)1 << (index / ST7565_BLOCK_SIZE));
|
||||
}
|
||||
|
||||
void st7565_write_raw(const char *data, uint16_t size) {
|
||||
uint16_t cursor_start_index = st7565_cursor - &st7565_buffer[0];
|
||||
if ((size + cursor_start_index) > ST7565_MATRIX_SIZE) size = ST7565_MATRIX_SIZE - cursor_start_index;
|
||||
for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) {
|
||||
uint8_t c = *data++;
|
||||
if (st7565_buffer[i] == c) continue;
|
||||
st7565_buffer[i] = c;
|
||||
st7565_dirty |= ((ST7565_BLOCK_TYPE)1 << (i / ST7565_BLOCK_SIZE));
|
||||
}
|
||||
}
|
||||
|
||||
void st7565_write_pixel(uint8_t x, uint8_t y, bool on) {
|
||||
if (x >= ST7565_DISPLAY_WIDTH) {
|
||||
return;
|
||||
}
|
||||
uint16_t index = x + (y / 8) * ST7565_DISPLAY_WIDTH;
|
||||
if (index >= ST7565_MATRIX_SIZE) {
|
||||
return;
|
||||
}
|
||||
uint8_t data = st7565_buffer[index];
|
||||
if (on) {
|
||||
data |= (1 << (y % 8));
|
||||
} else {
|
||||
data &= ~(1 << (y % 8));
|
||||
}
|
||||
if (st7565_buffer[index] != data) {
|
||||
st7565_buffer[index] = data;
|
||||
st7565_dirty |= ((ST7565_BLOCK_TYPE)1 << (index / ST7565_BLOCK_SIZE));
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__AVR__)
|
||||
void st7565_write_P(const char *data, bool invert) {
|
||||
uint8_t c = pgm_read_byte(data);
|
||||
while (c != 0) {
|
||||
st7565_write_char(c, invert);
|
||||
c = pgm_read_byte(++data);
|
||||
}
|
||||
}
|
||||
|
||||
void st7565_write_ln_P(const char *data, bool invert) {
|
||||
st7565_write_P(data, invert);
|
||||
st7565_advance_page(true);
|
||||
}
|
||||
|
||||
void st7565_write_raw_P(const char *data, uint16_t size) {
|
||||
uint16_t cursor_start_index = st7565_cursor - &st7565_buffer[0];
|
||||
if ((size + cursor_start_index) > ST7565_MATRIX_SIZE) size = ST7565_MATRIX_SIZE - cursor_start_index;
|
||||
for (uint16_t i = cursor_start_index; i < cursor_start_index + size; i++) {
|
||||
uint8_t c = pgm_read_byte(data++);
|
||||
if (st7565_buffer[i] == c) continue;
|
||||
st7565_buffer[i] = c;
|
||||
st7565_dirty |= ((ST7565_BLOCK_TYPE)1 << (i / ST7565_BLOCK_SIZE));
|
||||
}
|
||||
}
|
||||
#endif // defined(__AVR__)
|
||||
|
||||
bool st7565_on(void) {
|
||||
if (!st7565_initialized) {
|
||||
return st7565_active;
|
||||
}
|
||||
|
||||
#if ST7565_TIMEOUT > 0
|
||||
st7565_timeout = timer_read32() + ST7565_TIMEOUT;
|
||||
#endif
|
||||
|
||||
if (!st7565_active) {
|
||||
spi_start(ST7565_SS_PIN, false, 0, ST7565_SPI_CLK_DIVISOR);
|
||||
st7565_send_cmd(DISPLAY_ON);
|
||||
spi_stop();
|
||||
st7565_active = true;
|
||||
st7565_on_user();
|
||||
}
|
||||
return st7565_active;
|
||||
}
|
||||
|
||||
__attribute__((weak)) void st7565_on_user(void) {}
|
||||
|
||||
bool st7565_off(void) {
|
||||
if (!st7565_initialized) {
|
||||
return !st7565_active;
|
||||
}
|
||||
|
||||
if (st7565_active) {
|
||||
spi_start(ST7565_SS_PIN, false, 0, ST7565_SPI_CLK_DIVISOR);
|
||||
st7565_send_cmd(DISPLAY_OFF);
|
||||
spi_stop();
|
||||
st7565_active = false;
|
||||
st7565_off_user();
|
||||
}
|
||||
return !st7565_active;
|
||||
}
|
||||
|
||||
__attribute__((weak)) void st7565_off_user(void) {}
|
||||
|
||||
bool st7565_is_on(void) { return st7565_active; }
|
||||
|
||||
bool st7565_invert(bool invert) {
|
||||
if (!st7565_initialized) {
|
||||
return st7565_inverted;
|
||||
}
|
||||
|
||||
if (invert != st7565_inverted) {
|
||||
spi_start(ST7565_SS_PIN, false, 0, ST7565_SPI_CLK_DIVISOR);
|
||||
st7565_send_cmd(invert ? INVERT_DISPLAY : NORMAL_DISPLAY);
|
||||
spi_stop();
|
||||
st7565_inverted = invert;
|
||||
}
|
||||
return st7565_inverted;
|
||||
}
|
||||
|
||||
uint8_t st7565_max_chars(void) { return ST7565_DISPLAY_WIDTH / ST7565_FONT_WIDTH; }
|
||||
|
||||
uint8_t st7565_max_lines(void) { return ST7565_DISPLAY_HEIGHT / ST7565_FONT_HEIGHT; }
|
||||
|
||||
void st7565_task(void) {
|
||||
if (!st7565_initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
#if ST7565_UPDATE_INTERVAL > 0
|
||||
if (timer_elapsed(st7565_update_timeout) >= ST7565_UPDATE_INTERVAL) {
|
||||
st7565_update_timeout = timer_read();
|
||||
st7565_set_cursor(0, 0);
|
||||
st7565_task_user();
|
||||
}
|
||||
#else
|
||||
st7565_set_cursor(0, 0);
|
||||
st7565_task_user();
|
||||
#endif
|
||||
|
||||
// Smart render system, no need to check for dirty
|
||||
st7565_render();
|
||||
|
||||
// Display timeout check
|
||||
#if ST7565_TIMEOUT > 0
|
||||
if (st7565_active && timer_expired32(timer_read32(), st7565_timeout)) {
|
||||
st7565_off();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
__attribute__((weak)) void st7565_task_user(void) {}
|
||||
|
||||
void st7565_reset(void) {
|
||||
writePinLow(ST7565_RST_PIN);
|
||||
wait_ms(20);
|
||||
writePinHigh(ST7565_RST_PIN);
|
||||
wait_ms(20);
|
||||
}
|
||||
|
||||
spi_status_t st7565_send_cmd(uint8_t cmd) {
|
||||
writePinLow(ST7565_A0_PIN);
|
||||
return spi_write(cmd);
|
||||
}
|
||||
|
||||
spi_status_t st7565_send_data(uint8_t *data, uint16_t length) {
|
||||
writePinHigh(ST7565_A0_PIN);
|
||||
return spi_transmit(data, length);
|
||||
}
|
219
drivers/lcd/st7565.h
Normal file
219
drivers/lcd/st7565.h
Normal file
@@ -0,0 +1,219 @@
|
||||
/*
|
||||
Copyright 2021
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include "spi_master.h"
|
||||
|
||||
#ifndef ST7565_DISPLAY_WIDTH
|
||||
# define ST7565_DISPLAY_WIDTH 128
|
||||
#endif
|
||||
#ifndef ST7565_DISPLAY_HEIGHT
|
||||
# define ST7565_DISPLAY_HEIGHT 32
|
||||
#endif
|
||||
#ifndef ST7565_MATRIX_SIZE
|
||||
# define ST7565_MATRIX_SIZE (ST7565_DISPLAY_HEIGHT / 8 * ST7565_DISPLAY_WIDTH) // 1024 (compile time mathed)
|
||||
#endif
|
||||
#ifndef ST7565_BLOCK_TYPE
|
||||
# define ST7565_BLOCK_TYPE uint16_t
|
||||
#endif
|
||||
#ifndef ST7565_BLOCK_COUNT
|
||||
# define ST7565_BLOCK_COUNT (sizeof(ST7565_BLOCK_TYPE) * 8) // 32 (compile time mathed)
|
||||
#endif
|
||||
#ifndef ST7565_BLOCK_SIZE
|
||||
# define ST7565_BLOCK_SIZE (ST7565_MATRIX_SIZE / ST7565_BLOCK_COUNT) // 32 (compile time mathed)
|
||||
#endif
|
||||
|
||||
// the column address corresponding to the first column in the display hardware
|
||||
#if !defined(ST7565_COLUMN_OFFSET)
|
||||
# define ST7565_COLUMN_OFFSET 0
|
||||
#endif
|
||||
|
||||
// spi clock divisor
|
||||
#if !defined(ST7565_SPI_CLK_DIVISOR)
|
||||
# define ST7565_SPI_CLK_DIVISOR 4
|
||||
#endif
|
||||
|
||||
// Custom font file to use
|
||||
#if !defined(ST7565_FONT_H)
|
||||
# define ST7565_FONT_H "glcdfont.c"
|
||||
#endif
|
||||
// unsigned char value of the first character in the font file
|
||||
#if !defined(ST7565_FONT_START)
|
||||
# define ST7565_FONT_START 0
|
||||
#endif
|
||||
// unsigned char value of the last character in the font file
|
||||
#if !defined(ST7565_FONT_END)
|
||||
# define ST7565_FONT_END 223
|
||||
#endif
|
||||
// Font render width
|
||||
#if !defined(ST7565_FONT_WIDTH)
|
||||
# define ST7565_FONT_WIDTH 6
|
||||
#endif
|
||||
// Font render height
|
||||
#if !defined(ST7565_FONT_HEIGHT)
|
||||
# define ST7565_FONT_HEIGHT 8
|
||||
#endif
|
||||
// Default contrast level
|
||||
#if !defined(ST7565_CONTRAST)
|
||||
# define ST7565_CONTRAST 32
|
||||
#endif
|
||||
|
||||
#if !defined(ST7565_TIMEOUT)
|
||||
# if defined(ST7565_DISABLE_TIMEOUT)
|
||||
# define ST7565_TIMEOUT 0
|
||||
# else
|
||||
# define ST7565_TIMEOUT 60000
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#if !defined(ST7565_UPDATE_INTERVAL) && defined(SPLIT_KEYBOARD)
|
||||
# define ST7565_UPDATE_INTERVAL 50
|
||||
#endif
|
||||
|
||||
typedef struct __attribute__((__packed__)) {
|
||||
uint8_t *current_element;
|
||||
uint16_t remaining_element_count;
|
||||
} display_buffer_reader_t;
|
||||
|
||||
// Rotation enum values are flags
|
||||
typedef enum { DISPLAY_ROTATION_0, DISPLAY_ROTATION_180 } display_rotation_t;
|
||||
|
||||
// Initialize the display, rotating the rendered output based on the define passed in.
|
||||
// Returns true if the display was initialized successfully
|
||||
bool st7565_init(display_rotation_t rotation);
|
||||
|
||||
// Called at the start of st7565_init, weak function overridable by the user
|
||||
// rotation - the value passed into st7565_init
|
||||
// Return new display_rotation_t if you want to override default rotation
|
||||
display_rotation_t st7565_init_user(display_rotation_t rotation);
|
||||
|
||||
// Clears the display buffer, resets cursor position to 0, and sets the buffer to dirty for rendering
|
||||
void st7565_clear(void);
|
||||
|
||||
// Renders the dirty chunks of the buffer to display
|
||||
void st7565_render(void);
|
||||
|
||||
// Moves cursor to character position indicated by column and line, wraps if out of bounds
|
||||
// Max column denoted by 'st7565_max_chars()' and max lines by 'st7565_max_lines()' functions
|
||||
void st7565_set_cursor(uint8_t col, uint8_t line);
|
||||
|
||||
// Advances the cursor to the next page, writing ' ' if true
|
||||
// Wraps to the begining when out of bounds
|
||||
void st7565_advance_page(bool clearPageRemainder);
|
||||
|
||||
// Moves the cursor forward 1 character length
|
||||
// Advance page if there is not enough room for the next character
|
||||
// Wraps to the begining when out of bounds
|
||||
void st7565_advance_char(void);
|
||||
|
||||
// Writes a single character to the buffer at current cursor position
|
||||
// Advances the cursor while writing, inverts the pixels if true
|
||||
// Main handler that writes character data to the display buffer
|
||||
void st7565_write_char(const char data, bool invert);
|
||||
|
||||
// Writes a string to the buffer at current cursor position
|
||||
// Advances the cursor while writing, inverts the pixels if true
|
||||
void st7565_write(const char *data, bool invert);
|
||||
|
||||
// Writes a string to the buffer at current cursor position
|
||||
// Advances the cursor while writing, inverts the pixels if true
|
||||
// Advances the cursor to the next page, wiring ' ' to the remainder of the current page
|
||||
void st7565_write_ln(const char *data, bool invert);
|
||||
|
||||
// Pans the buffer to the right (or left by passing true) by moving contents of the buffer
|
||||
// Useful for moving the screen in preparation for new drawing
|
||||
void st7565_pan(bool left);
|
||||
|
||||
// Returns a pointer to the requested start index in the buffer plus remaining
|
||||
// buffer length as struct
|
||||
display_buffer_reader_t st7565_read_raw(uint16_t start_index);
|
||||
|
||||
// Writes a string to the buffer at current cursor position
|
||||
void st7565_write_raw(const char *data, uint16_t size);
|
||||
|
||||
// Writes a single byte into the buffer at the specified index
|
||||
void st7565_write_raw_byte(const char data, uint16_t index);
|
||||
|
||||
// Sets a specific pixel on or off
|
||||
// Coordinates start at top-left and go right and down for positive x and y
|
||||
void st7565_write_pixel(uint8_t x, uint8_t y, bool on);
|
||||
|
||||
#if defined(__AVR__)
|
||||
// Writes a PROGMEM string to the buffer at current cursor position
|
||||
// Advances the cursor while writing, inverts the pixels if true
|
||||
// Remapped to call 'void st7565_write(const char *data, bool invert);' on ARM
|
||||
void st7565_write_P(const char *data, bool invert);
|
||||
|
||||
// Writes a PROGMEM string to the buffer at current cursor position
|
||||
// Advances the cursor while writing, inverts the pixels if true
|
||||
// Advances the cursor to the next page, wiring ' ' to the remainder of the current page
|
||||
// Remapped to call 'void st7565_write_ln(const char *data, bool invert);' on ARM
|
||||
void st7565_write_ln_P(const char *data, bool invert);
|
||||
|
||||
// Writes a PROGMEM string to the buffer at current cursor position
|
||||
void st7565_write_raw_P(const char *data, uint16_t size);
|
||||
#else
|
||||
# define st7565_write_P(data, invert) st7565_write(data, invert)
|
||||
# define st7565_write_ln_P(data, invert) st7565_write_ln(data, invert)
|
||||
# define st7565_write_raw_P(data, size) st7565_write_raw(data, size)
|
||||
#endif // defined(__AVR__)
|
||||
|
||||
// Can be used to manually turn on the screen if it is off
|
||||
// Returns true if the screen was on or turns on
|
||||
bool st7565_on(void);
|
||||
|
||||
// Called when st7565_on() turns on the screen, weak function overridable by the user
|
||||
// Not called if the screen is already on
|
||||
void st7565_on_user(void);
|
||||
|
||||
// Can be used to manually turn off the screen if it is on
|
||||
// Returns true if the screen was off or turns off
|
||||
bool st7565_off(void);
|
||||
|
||||
// Called when st7565_off() turns off the screen, weak function overridable by the user
|
||||
// Not called if the screen is already off
|
||||
void st7565_off_user(void);
|
||||
|
||||
// Returns true if the screen is currently on, false if it is
|
||||
// not
|
||||
bool st7565_is_on(void);
|
||||
|
||||
// Basically it's st7565_render, but with timeout management and st7565_task_user calling!
|
||||
void st7565_task(void);
|
||||
|
||||
// Called at the start of st7565_task, weak function overridable by the user
|
||||
void st7565_task_user(void);
|
||||
|
||||
// Inverts the display
|
||||
// Returns true if the screen was or is inverted
|
||||
bool st7565_invert(bool invert);
|
||||
|
||||
// Returns the maximum number of characters that will fit on a line
|
||||
uint8_t st7565_max_chars(void);
|
||||
|
||||
// Returns the maximum number of lines that will fit on the display
|
||||
uint8_t st7565_max_lines(void);
|
||||
|
||||
void st7565_reset(void);
|
||||
|
||||
spi_status_t st7565_send_cmd(uint8_t cmd);
|
||||
|
||||
spi_status_t st7565_send_data(uint8_t *data, uint16_t length);
|
@@ -4,7 +4,7 @@
|
||||
// Online editor: http://teripom.x0.com/
|
||||
|
||||
static const unsigned char font[] PROGMEM = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00,
|
||||
0x07, 0x08, 0x7F, 0x08, 0x07, 0x00, 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00,
|
||||
0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00,
|
||||
0x72, 0x49, 0x49, 0x49, 0x46, 0x00, 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00,
|
||||
0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, 0x38, 0x44, 0x44, 0x44, 0x28, 0x00,
|
||||
|
@@ -34,6 +34,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define DISPLAY_ALL_ON 0xA5
|
||||
#define DISPLAY_ALL_ON_RESUME 0xA4
|
||||
#define NORMAL_DISPLAY 0xA6
|
||||
#define INVERT_DISPLAY 0xA7
|
||||
#define DISPLAY_ON 0xAF
|
||||
#define DISPLAY_OFF 0xAE
|
||||
#define NOP 0xE3
|
||||
@@ -114,6 +115,7 @@ OLED_BLOCK_TYPE oled_dirty = 0;
|
||||
bool oled_initialized = false;
|
||||
bool oled_active = false;
|
||||
bool oled_scrolling = false;
|
||||
bool oled_inverted = false;
|
||||
uint8_t oled_brightness = OLED_BRIGHTNESS;
|
||||
oled_rotation_t oled_rotation = 0;
|
||||
uint8_t oled_rotation_width = 0;
|
||||
@@ -690,6 +692,30 @@ bool oled_scroll_off(void) {
|
||||
return !oled_scrolling;
|
||||
}
|
||||
|
||||
bool oled_invert(bool invert) {
|
||||
if (!oled_initialized) {
|
||||
return oled_inverted;
|
||||
}
|
||||
|
||||
if (invert && !oled_inverted) {
|
||||
static const uint8_t PROGMEM display_inverted[] = {I2C_CMD, INVERT_DISPLAY};
|
||||
if (I2C_TRANSMIT_P(display_inverted) != I2C_STATUS_SUCCESS) {
|
||||
print("oled_invert cmd failed\n");
|
||||
return oled_inverted;
|
||||
}
|
||||
oled_inverted = true;
|
||||
} else if (!invert && oled_inverted) {
|
||||
static const uint8_t PROGMEM display_normal[] = {I2C_CMD, NORMAL_DISPLAY};
|
||||
if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) {
|
||||
print("oled_invert cmd failed\n");
|
||||
return oled_inverted;
|
||||
}
|
||||
oled_inverted = false;
|
||||
}
|
||||
|
||||
return oled_inverted;
|
||||
}
|
||||
|
||||
uint8_t oled_max_chars(void) {
|
||||
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
|
||||
return OLED_DISPLAY_WIDTH / OLED_FONT_WIDTH;
|
||||
|
@@ -313,6 +313,10 @@ bool oled_scroll_left(void);
|
||||
// Returns true if the screen was not scrolling or stops scrolling
|
||||
bool oled_scroll_off(void);
|
||||
|
||||
// Inverts the display
|
||||
// Returns true if the screen was or is inverted
|
||||
bool oled_invert(bool invert);
|
||||
|
||||
// Returns the maximum number of characters that will fit on a line
|
||||
uint8_t oled_max_chars(void);
|
||||
|
||||
|
46
drivers/serial.h
Normal file
46
drivers/serial.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/* Copyright 2021 QMK
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <transactions.h>
|
||||
|
||||
// initiator is transaction start side
|
||||
void soft_serial_initiator_init(void);
|
||||
// target is interrupt accept side
|
||||
void soft_serial_target_init(void);
|
||||
|
||||
// initiator result
|
||||
#define TRANSACTION_END 0
|
||||
#define TRANSACTION_NO_RESPONSE 0x1
|
||||
#define TRANSACTION_DATA_ERROR 0x2
|
||||
#define TRANSACTION_TYPE_ERROR 0x4
|
||||
int soft_serial_transaction(int sstd_index);
|
||||
|
||||
// target status
|
||||
// *SSTD_t.status has
|
||||
// initiator:
|
||||
// TRANSACTION_END
|
||||
// or TRANSACTION_NO_RESPONSE
|
||||
// or TRANSACTION_DATA_ERROR
|
||||
// target:
|
||||
// TRANSACTION_DATA_ERROR
|
||||
// or TRANSACTION_ACCEPTED
|
||||
#define TRANSACTION_ACCEPTED 0x8
|
||||
int soft_serial_get_and_clean_status(int sstd_index);
|
@@ -1,4 +1,5 @@
|
||||
/* Copyright 2018 Jason Williams (Wilba)
|
||||
* Copyright 2021 Harrison Chan (Xelus)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -16,4 +17,4 @@
|
||||
|
||||
// Nothing to see here, move along... ;-)
|
||||
|
||||
#include "constellation.h"
|
||||
#include "constellation.h"
|
||||
|
@@ -1,4 +1,5 @@
|
||||
/* Copyright 2018 Jason Williams (Wilba)
|
||||
* Copyright 2021 Harrison Chan (Xelus)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -18,18 +19,8 @@
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define ____ KC_NO
|
||||
|
||||
#define LAYOUT_all( \
|
||||
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K213, K014, \
|
||||
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
|
||||
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
|
||||
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K312, K313, K314, \
|
||||
K400, K401, K402, K408, K409, K410, K412, K413, K414 \
|
||||
) { \
|
||||
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
|
||||
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
|
||||
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \
|
||||
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, ____, K312, K313, K314 }, \
|
||||
{ K400, K401, K402, ____, ____, ____, ____, ____, K408, K409, K410, ____, K412, K413, K414 } \
|
||||
}
|
||||
#if defined(KEYBOARD_aeboards_constellation_rev1)
|
||||
#include "rev1.h"
|
||||
#elif defined(KEYBOARD_aeboards_constellation_rev2)
|
||||
#include "rev2.h"
|
||||
#endif
|
||||
|
@@ -1,4 +1,5 @@
|
||||
/* Copyright 2018 Jason Williams (Wilba)
|
||||
* Copyright 2021 Harrison Chan (Xelus)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -23,7 +24,7 @@
|
||||
#define PRODUCT_ID 0x065C // 65 - Constellation
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER AEBoards
|
||||
#define PRODUCT AEBoards Constellation
|
||||
#define PRODUCT AEBoards Constellation Rev1
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
20
keyboards/aeboards/constellation/rev1/readme.md
Executable file
20
keyboards/aeboards/constellation/rev1/readme.md
Executable file
@@ -0,0 +1,20 @@
|
||||
# CONSTELLATION REV1
|
||||
|
||||
A gasket 65% keyboard by [aeboards](https://aeboards.com/)
|
||||
|
||||
* Keyboard Maintainer: [Xelus22](https://github.com/Xelus22)
|
||||
* Hardware Supported: CONSTELLATION
|
||||
* Hardware Availability: Custom keyboard group buys
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make aeboards/constellation/rev1:default
|
||||
|
||||
Reset your keyboard in 3 ways:
|
||||
<ol>
|
||||
<li>Software reset on Fn + Backspace</li>
|
||||
<li>Bootmagic reset: hold down the top left key (usually escape) and plugin the keyboard</li>
|
||||
<li>Physical reset: on the back of the PCB, there is a ISP header which you should short the RST and GND together</li>
|
||||
</ol>
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
18
keyboards/aeboards/constellation/rev1/rev1.c
Executable file
18
keyboards/aeboards/constellation/rev1/rev1.c
Executable file
@@ -0,0 +1,18 @@
|
||||
/* Copyright 2018 Jason Williams (Wilba)
|
||||
* Copyright 2021 Harrison Chan (Xelus)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "rev1.h"
|
36
keyboards/aeboards/constellation/rev1/rev1.h
Executable file
36
keyboards/aeboards/constellation/rev1/rev1.h
Executable file
@@ -0,0 +1,36 @@
|
||||
/* Copyright 2018 Jason Williams (Wilba)
|
||||
* Copyright 2021 Harrison Chan (Xelus)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define ____ KC_NO
|
||||
|
||||
#define LAYOUT_all( \
|
||||
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K213, K014, \
|
||||
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
|
||||
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
|
||||
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K312, K313, K314, \
|
||||
K400, K401, K402, K408, K409, K410, K412, K413, K414 \
|
||||
) { \
|
||||
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
|
||||
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
|
||||
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \
|
||||
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, ____, K312, K313, K314 }, \
|
||||
{ K400, K401, K402, ____, ____, ____, ____, ____, K408, K409, K410, ____, K412, K413, K414 } \
|
||||
}
|
22
keyboards/aeboards/constellation/rev1/rules.mk
Executable file
22
keyboards/aeboards/constellation/rev1/rules.mk
Executable file
@@ -0,0 +1,22 @@
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Bootloader selection
|
||||
BOOTLOADER = atmel-dfu
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = yes # Console for debug
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
LTO_ENABLE = yes
|
61
keyboards/aeboards/constellation/rev2/config.h
Executable file
61
keyboards/aeboards/constellation/rev2/config.h
Executable file
@@ -0,0 +1,61 @@
|
||||
/* Copyright 2021 Harrison Chan (Xelus)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "config_common.h"
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0x4145 // AE
|
||||
#define PRODUCT_ID 0x065C // 65 - Constellation
|
||||
#define DEVICE_VER 0x0001
|
||||
#define MANUFACTURER AEBoards
|
||||
#define PRODUCT AEBoards Constellation Rev2
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 5
|
||||
#define MATRIX_COLS 15
|
||||
|
||||
/* key matrix pins */
|
||||
#define MATRIX_ROW_PINS { B15, A14, A2, B13, B14 }
|
||||
#define MATRIX_COL_PINS { B12, H0, C15, C14, B11, B10, B2, B1, B0, A7, A6, A5, A4, A3 }
|
||||
#define UNUSED_PINS
|
||||
|
||||
/* COL2ROW or ROW2COL */
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
/* Set 0 if debouncing isn't needed */
|
||||
#define DEBOUNCE 5
|
||||
|
||||
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
// I2C setup
|
||||
#define I2C1_SCL 8
|
||||
#define I2C1_SDA 9
|
||||
#define I2C1_SCL_PAL_MODE 4
|
||||
#define I2C1_SDA_PAL_MODE 4
|
||||
#define I2C1_TIMINGR_PRESC 0U
|
||||
#define I2C1_TIMINGR_SCLDEL 11U
|
||||
#define I2C1_TIMINGR_SDADEL 0U
|
||||
#define I2C1_TIMINGR_SCLH 14U
|
||||
#define I2C1_TIMINGR_SCLL 42U
|
||||
|
||||
// I2C EEPROM
|
||||
#define EEPROM_I2C_24LC64
|
27
keyboards/aeboards/constellation/rev2/halconf.h
Normal file
27
keyboards/aeboards/constellation/rev2/halconf.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/* Copyright 2020 QMK
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file was auto-generated by:
|
||||
* `qmk chibios-confmigrate -i keyboards/aeboards/ext65/rev2/halconf.h -r platforms/chibios/common/configs/halconf.h`
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define HAL_USE_I2C TRUE
|
||||
|
||||
#include_next <halconf.h>
|
||||
|
85
keyboards/aeboards/constellation/rev2/info.json
Normal file
85
keyboards/aeboards/constellation/rev2/info.json
Normal file
@@ -0,0 +1,85 @@
|
||||
{
|
||||
"keyboard_name": "Constellation",
|
||||
"url": "",
|
||||
"maintainer": "Xelus22",
|
||||
"width": 16,
|
||||
"height": 5,
|
||||
"layouts": {
|
||||
"LAYOUT_all": {
|
||||
"layout": [
|
||||
{"x":0, "y":0},
|
||||
{"x":1, "y":0},
|
||||
{"x":2, "y":0},
|
||||
{"x":3, "y":0},
|
||||
{"x":4, "y":0},
|
||||
{"x":5, "y":0},
|
||||
{"x":6, "y":0},
|
||||
{"x":7, "y":0},
|
||||
{"x":8, "y":0},
|
||||
{"x":9, "y":0},
|
||||
{"x":10, "y":0},
|
||||
{"x":11, "y":0},
|
||||
{"x":12, "y":0},
|
||||
{"x":13, "y":0},
|
||||
{"x":14, "y":0},
|
||||
{"x":15, "y":0},
|
||||
|
||||
{"x":0, "y":1, "w":1.5},
|
||||
{"x":1.5, "y":1},
|
||||
{"x":2.5, "y":1},
|
||||
{"x":3.5, "y":1},
|
||||
{"x":4.5, "y":1},
|
||||
{"x":5.5, "y":1},
|
||||
{"x":6.5, "y":1},
|
||||
{"x":7.5, "y":1},
|
||||
{"x":8.5, "y":1},
|
||||
{"x":9.5, "y":1},
|
||||
{"x":10.5, "y":1},
|
||||
{"x":11.5, "y":1},
|
||||
{"x":12.5, "y":1},
|
||||
{"x":13.5, "y":1, "w":1.5},
|
||||
{"x":15, "y":1},
|
||||
|
||||
{"x":0, "y":2, "w":1.75},
|
||||
{"x":1.75, "y":2},
|
||||
{"x":2.75, "y":2},
|
||||
{"x":3.75, "y":2},
|
||||
{"x":4.75, "y":2},
|
||||
{"x":5.75, "y":2},
|
||||
{"x":6.75, "y":2},
|
||||
{"x":7.75, "y":2},
|
||||
{"x":8.75, "y":2},
|
||||
{"x":9.75, "y":2},
|
||||
{"x":10.75, "y":2},
|
||||
{"label":"\"", "x":11.75, "y":2},
|
||||
{"x":12.75, "y":2, "w":2.25},
|
||||
{"x":15, "y":2},
|
||||
|
||||
{"x":0, "y":3, "w":2.25},
|
||||
{"x":2.25, "y":3},
|
||||
{"x":3.25, "y":3},
|
||||
{"x":4.25, "y":3},
|
||||
{"x":5.25, "y":3},
|
||||
{"x":6.25, "y":3},
|
||||
{"x":7.25, "y":3},
|
||||
{"x":8.25, "y":3},
|
||||
{"x":9.25, "y":3},
|
||||
{"x":10.25, "y":3},
|
||||
{"x":11.25, "y":3},
|
||||
{"x":12.25, "y":3, "w":1.75},
|
||||
{"x":14, "y":3},
|
||||
{"x":15, "y":3},
|
||||
|
||||
{"x":0, "y":4, "w":1.25},
|
||||
{"x":1.25, "y":4, "w":1.25},
|
||||
{"x":2.5, "y":4, "w":1.25},
|
||||
{"x":3.75, "y":4, "w":6.25},
|
||||
{"x":10, "y":4, "w":1.5},
|
||||
{"x":11.5, "y":4, "w":1.5},
|
||||
{"x":13, "y":4},
|
||||
{"x":14, "y":4},
|
||||
{"x":15, "y":4}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
27
keyboards/aeboards/constellation/rev2/mcuconf.h
Normal file
27
keyboards/aeboards/constellation/rev2/mcuconf.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/* Copyright 2020 QMK
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file was auto-generated by:
|
||||
* `qmk chibios-confmigrate -i keyboards/aeboards/ext65/rev2/mcuconf.h -r platforms/chibios/GENERIC_STM32_F072XB/configs/mcuconf.h`
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include_next <mcuconf.h>
|
||||
|
||||
#undef STM32_I2C_USE_I2C1
|
||||
#define STM32_I2C_USE_I2C1 TRUE
|
20
keyboards/aeboards/constellation/rev2/readme.md
Executable file
20
keyboards/aeboards/constellation/rev2/readme.md
Executable file
@@ -0,0 +1,20 @@
|
||||
# CONSTELLATION REV2
|
||||
|
||||
A gasket 65% keyboard by [aeboards](https://aeboards.com/)
|
||||
|
||||
* Keyboard Maintainer: [Xelus22](https://github.com/Xelus22)
|
||||
* Hardware Supported: CONSTELLATION
|
||||
* Hardware Availability: Custom keyboard group buys
|
||||
|
||||
Make example for this keyboard (after setting up your build environment):
|
||||
|
||||
make aeboards/constellation/rev2:default
|
||||
|
||||
Reset your keyboard in 3 ways:
|
||||
<ol>
|
||||
<li>Software reset on Fn + Backspace</li>
|
||||
<li>Bootmagic reset: hold down the top left key (usually escape) and plugin the keyboard</li>
|
||||
<li>Physical reset button: on the back of the PCB, there are 2 open pins which you can short, labelled RESET</li>
|
||||
</ol>
|
||||
|
||||
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
21
keyboards/aeboards/constellation/rev2/rev2.c
Executable file
21
keyboards/aeboards/constellation/rev2/rev2.c
Executable file
@@ -0,0 +1,21 @@
|
||||
/* Copyright 2021 Harrison Chan (Xelus)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "rev2.h"
|
||||
|
||||
void matrix_io_delay(void) {
|
||||
__asm__ volatile("nop\nnop\nnop\n");
|
||||
}
|
35
keyboards/aeboards/constellation/rev2/rev2.h
Executable file
35
keyboards/aeboards/constellation/rev2/rev2.h
Executable file
@@ -0,0 +1,35 @@
|
||||
/* Copyright 2021 Harrison Chan (Xelus)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "quantum.h"
|
||||
|
||||
#define ____ KC_NO
|
||||
|
||||
#define LAYOUT_all( \
|
||||
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K213, K014, \
|
||||
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \
|
||||
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \
|
||||
K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K312, K313, K314, \
|
||||
K400, K401, K402, K408, K409, K410, K412, K413, K414 \
|
||||
) { \
|
||||
{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \
|
||||
{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \
|
||||
{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \
|
||||
{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, ____, K312, K313, K314 }, \
|
||||
{ K400, K401, K402, ____, ____, ____, ____, ____, K408, K409, K410, ____, K412, K413, K414 } \
|
||||
}
|
20
keyboards/aeboards/constellation/rev2/rules.mk
Executable file
20
keyboards/aeboards/constellation/rev2/rules.mk
Executable file
@@ -0,0 +1,20 @@
|
||||
# MCU name
|
||||
MCU = STM32L433
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = yes # Console for debug
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
|
||||
EEPROM_DRIVER = i2c
|
@@ -1,22 +1 @@
|
||||
# MCU name
|
||||
MCU = atmega32u4
|
||||
|
||||
# Bootloader selection
|
||||
BOOTLOADER = atmel-dfu
|
||||
|
||||
# Build Options
|
||||
# change yes to no to disable
|
||||
#
|
||||
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = yes # Console for debug
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
NKRO_ENABLE = yes # USB Nkey Rollover
|
||||
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
LTO_ENABLE = yes
|
||||
DEFAULT_FOLDER = aeboards/constellation/rev1
|
||||
|
19
keyboards/anavi/macropad8/keymaps/default/config.h
Normal file
19
keyboards/anavi/macropad8/keymaps/default/config.h
Normal file
@@ -0,0 +1,19 @@
|
||||
/* Copyright 2021 QMK
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define LAYER_STATE_8BIT
|
@@ -80,11 +80,11 @@
|
||||
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||
// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
|
||||
// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
//# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
//# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
# define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
|
||||
# define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
|
||||
# define RGB_MATRIX_HUE_STEP 8
|
||||
# define RGB_MATRIX_SAT_STEP 8
|
||||
# define RGB_MATRIX_VAL_STEP 8
|
||||
|
@@ -50,6 +50,6 @@
|
||||
#ifdef RGB_DI_PIN
|
||||
#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||
#endif
|
||||
#ifndef RGB_DISABLE_WHEN_USB_SUSPENDED
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
#endif
|
||||
|
@@ -64,7 +64,7 @@
|
||||
// #define RGBLIGHT_SAT_STEP 25 // Units to step when in/decreasing saturation
|
||||
// #define RGBLIGHT_VAL_STEP 12 // Units to step when in/decreasing value (brightness)
|
||||
// #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
// #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
|
||||
// #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
// #define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
|
||||
// #define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
|
||||
// #define RGBLIGHT_ANIMATIONS // Run RGB animations
|
||||
|
@@ -59,7 +59,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define DRIVER_LED_TOTAL 24 // Number of LEDs
|
||||
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200
|
||||
# ifndef RGB_DISABLE_WHEN_USB_SUSPENDED
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
@@ -1,15 +1,143 @@
|
||||
{
|
||||
"keyboard_name": "nop60",
|
||||
"url": "",
|
||||
"maintainer": "nasp",
|
||||
"width": 15,
|
||||
"height": 5,
|
||||
"width": 15,
|
||||
"url": "",
|
||||
"layouts": {
|
||||
"LAYOUT": {
|
||||
"2x3u": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Bksp", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":3}, {"x":7, "y":4}, {"x":8, "y":4, "w":3}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}]
|
||||
"layout": [
|
||||
{ "label": "Esc", "x": 0, "y": 0 },
|
||||
{ "label": "!", "x": 1, "y": 0 },
|
||||
{ "label": "@", "x": 2, "y": 0 },
|
||||
{ "label": "#", "x": 3, "y": 0 },
|
||||
{ "label": "$", "x": 4, "y": 0 },
|
||||
{ "label": "%", "x": 5, "y": 0 },
|
||||
{ "label": "^", "x": 6, "y": 0 },
|
||||
{ "label": "&", "x": 7, "y": 0 },
|
||||
{ "label": "*", "x": 8, "y": 0 },
|
||||
{ "label": "(", "x": 9, "y": 0 },
|
||||
{ "label": ")", "x": 10, "y": 0 },
|
||||
{ "label": "_", "x": 11, "y": 0 },
|
||||
{ "label": "+", "x": 12, "y": 0 },
|
||||
{ "label": "~", "x": 13, "y": 0 },
|
||||
{ "label": "Bksp", "x": 14, "y": 0 },
|
||||
{ "label": "Tab", "w": 1.5, "x": 0, "y": 1 },
|
||||
{ "label": "Q", "x": 1.5, "y": 1 },
|
||||
{ "label": "W", "x": 2.5, "y": 1 },
|
||||
{ "label": "E", "x": 3.5, "y": 1 },
|
||||
{ "label": "R", "x": 4.5, "y": 1 },
|
||||
{ "label": "T", "x": 5.5, "y": 1 },
|
||||
{ "label": "Y", "x": 6.5, "y": 1 },
|
||||
{ "label": "U", "x": 7.5, "y": 1 },
|
||||
{ "label": "I", "x": 8.5, "y": 1 },
|
||||
{ "label": "O", "x": 9.5, "y": 1 },
|
||||
{ "label": "P", "x": 10.5, "y": 1 },
|
||||
{ "label": "{", "x": 11.5, "y": 1 },
|
||||
{ "label": "}", "x": 12.5, "y": 1 },
|
||||
{ "label": "|", "w": 1.5, "x": 13.5, "y": 1 },
|
||||
{ "label": "Caps Lock", "w": 1.75, "x": 0, "y": 2 },
|
||||
{ "label": "A", "x": 1.75, "y": 2 },
|
||||
{ "label": "S", "x": 2.75, "y": 2 },
|
||||
{ "label": "D", "x": 3.75, "y": 2 },
|
||||
{ "label": "F", "x": 4.75, "y": 2 },
|
||||
{ "label": "G", "x": 5.75, "y": 2 },
|
||||
{ "label": "H", "x": 6.75, "y": 2 },
|
||||
{ "label": "J", "x": 7.75, "y": 2 },
|
||||
{ "label": "K", "x": 8.75, "y": 2 },
|
||||
{ "label": "L", "x": 9.75, "y": 2 },
|
||||
{ "label": ":", "x": 10.75, "y": 2 },
|
||||
{ "label": "\"", "x": 11.75, "y": 2 },
|
||||
{ "label": "Enter", "w": 2.25, "x": 12.75, "y": 2 },
|
||||
{ "label": "Shift", "w": 2.25, "x": 0, "y": 3 },
|
||||
{ "label": "Z", "x": 2.25, "y": 3 },
|
||||
{ "label": "X", "x": 3.25, "y": 3 },
|
||||
{ "label": "C", "x": 4.25, "y": 3 },
|
||||
{ "label": "V", "x": 5.25, "y": 3 },
|
||||
{ "label": "B", "x": 6.25, "y": 3 },
|
||||
{ "label": "N", "x": 7.25, "y": 3 },
|
||||
{ "label": "M", "x": 8.25, "y": 3 },
|
||||
{ "label": "<", "x": 9.25, "y": 3 },
|
||||
{ "label": ">", "x": 10.25, "y": 3 },
|
||||
{ "label": "?", "x": 11.25, "y": 3 },
|
||||
{ "label": "Shift", "w": 1.75, "x": 12.25, "y": 3 },
|
||||
{ "label": "Fn", "x": 14, "y": 3 },
|
||||
{ "label": "Ctrl", "w": 1.5, "x": 0, "y": 4 },
|
||||
{ "label": "Win", "x": 1.5, "y": 4 },
|
||||
{ "label": "Alt", "w": 1.5, "x": 2.5, "y": 4 },
|
||||
{ "w": 7, "x": 4, "y": 4 },
|
||||
{ "label": "Alt", "w": 1.5, "x": 11, "y": 4 },
|
||||
{ "label": "Win", "x": 12.5, "y": 4 },
|
||||
{ "label": "Ctrl", "w": 1.5, "x": 13.5, "y": 4 }
|
||||
]
|
||||
},
|
||||
"LAYOUT": {
|
||||
"7u": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Bksp", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}]
|
||||
"LAYOUT_2x3u": {
|
||||
"layout": [
|
||||
{ "label": "Esc", "x": 0, "y": 0 },
|
||||
{ "label": "!", "x": 1, "y": 0 },
|
||||
{ "label": "@", "x": 2, "y": 0 },
|
||||
{ "label": "#", "x": 3, "y": 0 },
|
||||
{ "label": "$", "x": 4, "y": 0 },
|
||||
{ "label": "%", "x": 5, "y": 0 },
|
||||
{ "label": "^", "x": 6, "y": 0 },
|
||||
{ "label": "&", "x": 7, "y": 0 },
|
||||
{ "label": "*", "x": 8, "y": 0 },
|
||||
{ "label": "(", "x": 9, "y": 0 },
|
||||
{ "label": ")", "x": 10, "y": 0 },
|
||||
{ "label": "_", "x": 11, "y": 0 },
|
||||
{ "label": "+", "x": 12, "y": 0 },
|
||||
{ "label": "~", "x": 13, "y": 0 },
|
||||
{ "label": "Bksp", "x": 14, "y": 0 },
|
||||
{ "label": "Tab", "w": 1.5, "x": 0, "y": 1 },
|
||||
{ "label": "Q", "x": 1.5, "y": 1 },
|
||||
{ "label": "W", "x": 2.5, "y": 1 },
|
||||
{ "label": "E", "x": 3.5, "y": 1 },
|
||||
{ "label": "R", "x": 4.5, "y": 1 },
|
||||
{ "label": "T", "x": 5.5, "y": 1 },
|
||||
{ "label": "Y", "x": 6.5, "y": 1 },
|
||||
{ "label": "U", "x": 7.5, "y": 1 },
|
||||
{ "label": "I", "x": 8.5, "y": 1 },
|
||||
{ "label": "O", "x": 9.5, "y": 1 },
|
||||
{ "label": "P", "x": 10.5, "y": 1 },
|
||||
{ "label": "{", "x": 11.5, "y": 1 },
|
||||
{ "label": "}", "x": 12.5, "y": 1 },
|
||||
{ "label": "|", "w": 1.5, "x": 13.5, "y": 1 },
|
||||
{ "label": "Caps Lock", "w": 1.75, "x": 0, "y": 2 },
|
||||
{ "label": "A", "x": 1.75, "y": 2 },
|
||||
{ "label": "S", "x": 2.75, "y": 2 },
|
||||
{ "label": "D", "x": 3.75, "y": 2 },
|
||||
{ "label": "F", "x": 4.75, "y": 2 },
|
||||
{ "label": "G", "x": 5.75, "y": 2 },
|
||||
{ "label": "H", "x": 6.75, "y": 2 },
|
||||
{ "label": "J", "x": 7.75, "y": 2 },
|
||||
{ "label": "K", "x": 8.75, "y": 2 },
|
||||
{ "label": "L", "x": 9.75, "y": 2 },
|
||||
{ "label": ":", "x": 10.75, "y": 2 },
|
||||
{ "label": "\"", "x": 11.75, "y": 2 },
|
||||
{ "label": "Enter", "w": 2.25, "x": 12.75, "y": 2 },
|
||||
{ "label": "Shift", "w": 2.25, "x": 0, "y": 3 },
|
||||
{ "label": "Z", "x": 2.25, "y": 3 },
|
||||
{ "label": "X", "x": 3.25, "y": 3 },
|
||||
{ "label": "C", "x": 4.25, "y": 3 },
|
||||
{ "label": "V", "x": 5.25, "y": 3 },
|
||||
{ "label": "B", "x": 6.25, "y": 3 },
|
||||
{ "label": "N", "x": 7.25, "y": 3 },
|
||||
{ "label": "M", "x": 8.25, "y": 3 },
|
||||
{ "label": "<", "x": 9.25, "y": 3 },
|
||||
{ "label": ">", "x": 10.25, "y": 3 },
|
||||
{ "label": "?", "x": 11.25, "y": 3 },
|
||||
{ "label": "Shift", "w": 1.75, "x": 12.25, "y": 3 },
|
||||
{ "label": "Fn", "x": 14, "y": 3 },
|
||||
{ "label": "Ctrl", "w": 1.5, "x": 0, "y": 4 },
|
||||
{ "label": "Win", "x": 1.5, "y": 4 },
|
||||
{ "label": "Alt", "w": 1.5, "x": 2.5, "y": 4 },
|
||||
{ "w": 3, "x": 4, "y": 4 },
|
||||
{ "x": 7, "y": 4 },
|
||||
{ "w": 3, "x": 8, "y": 4 },
|
||||
{ "label": "Alt", "w": 1.5, "x": 11, "y": 4 },
|
||||
{ "label": "Win", "x": 12.5, "y": 4 },
|
||||
{ "label": "Ctrl", "w": 1.5, "x": 13.5, "y": 4 }
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#define CUSTOM_FONT
|
||||
|
||||
#define CUSTOM_LAYER_READ //if you remove this it causes issues - needs better guarding
|
||||
#define CUSTOM_LAYER_READ //if you remove this it causes issues - needs better guarding
|
||||
|
||||
#define TAPPING_FORCE_HOLD
|
||||
#define TAPPING_TERM 200
|
||||
@@ -43,7 +43,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
#undef RGBLED_NUM
|
||||
|
||||
|
||||
//#define RGBLIGHT_ANIMATIONS
|
||||
#define RGBLIGHT_EFFECT_BREATHING
|
||||
#define RGBLIGHT_EFFECT_RAINBOW_MOOD
|
||||
@@ -55,11 +55,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//#define RGBLIGHT_EFFECT_RGB_TEST
|
||||
//#define RGBLIGHT_EFFECT_ALTERNATING
|
||||
//#define RGBLIGHT_EFFECT_TWINKLE
|
||||
|
||||
|
||||
//#define RGBLED_NUM 54
|
||||
//#define RGBLED_SPLIT 27
|
||||
//#define RGBLED_SPLIT { 27, 27 } // haven't figured out how to use this yet
|
||||
|
||||
//#define RGBLED_SPLIT { 27, 27 } // haven't figured out how to use this yet
|
||||
|
||||
#define RGBLED_NUM 27
|
||||
#define RGBLIGHT_LIMIT_VAL 120
|
||||
#define RGBLIGHT_HUE_STEP 10
|
||||
@@ -71,11 +71,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||
// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
|
||||
// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
|
||||
// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
|
||||
|
||||
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_GRADIENT_LEFT_RIGHT
|
||||
|
||||
|
@@ -39,7 +39,7 @@
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
|
||||
# define RGB_MATRIX_HUE_STEP 32
|
||||
# define RGB_MATRIX_SAT_STEP 64
|
||||
|
@@ -56,7 +56,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||
// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
|
||||
// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
|
||||
// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
|
||||
|
@@ -42,7 +42,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define NO_ACTION_ONESHOT
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150
|
||||
|
||||
# define RGB_MATRIX_HUE_STEP 8
|
||||
|
@@ -59,11 +59,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||
// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
|
||||
// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
# define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
|
||||
# define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 // limits maximum brightness of LEDs to 150 out of 255. Higher may cause the controller to crash.
|
||||
# define RGB_MATRIX_HUE_STEP 8
|
||||
# define RGB_MATRIX_SAT_STEP 8
|
||||
# define RGB_MATRIX_VAL_STEP 8
|
||||
|
@@ -38,7 +38,7 @@ And in your `config.h` file, add the following:
|
||||
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||
// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
|
||||
// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
// # define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
|
||||
// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
|
||||
|
@@ -65,3 +65,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define UNUSED_PINS
|
||||
|
||||
#define EE_HANDS
|
||||
|
||||
#define LAYER_STATE_8BIT
|
@@ -37,7 +37,7 @@
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_KEYPRESSES
|
||||
# define RGB_MATRIX_LED_PROCESS_LIMIT 4
|
||||
# define RGB_MATRIX_LED_FLUSH_LIMIT 26
|
||||
|
@@ -37,7 +37,7 @@
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_KEYPRESSES
|
||||
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
|
@@ -37,7 +37,7 @@
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_KEYPRESSES
|
||||
# define RGB_MATRIX_LED_PROCESS_LIMIT 4
|
||||
# define RGB_MATRIX_LED_FLUSH_LIMIT 26
|
||||
|
@@ -37,7 +37,7 @@
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_KEYPRESSES
|
||||
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
|
@@ -37,7 +37,7 @@
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_KEYPRESSES
|
||||
# define RGB_MATRIX_LED_PROCESS_LIMIT 4
|
||||
# define RGB_MATRIX_LED_FLUSH_LIMIT 26
|
||||
|
@@ -37,7 +37,7 @@
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_KEYPRESSES
|
||||
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
|
@@ -51,9 +51,9 @@
|
||||
# define RGB_MATRIX_LED_FLUSH_LIMIT 26
|
||||
# define DEBOUNCE 3
|
||||
# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_KEYPRESSES
|
||||
# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
# define DISABLE_RGB_MATRIX_BAND_SAT
|
||||
# define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
|
||||
# define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT
|
||||
|
@@ -51,7 +51,7 @@
|
||||
# define RGB_MATRIX_LED_FLUSH_LIMIT 26
|
||||
# define DEBOUNCE 3
|
||||
# define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_KEYPRESSES
|
||||
# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
# define DISABLE_RGB_MATRIX_BAND_SAT
|
||||
|
@@ -22,3 +22,4 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
RGB_MATRIX_ENABLE = yes # Use RGB matrix
|
||||
RGB_MATRIX_DRIVER = IS31FL3741
|
||||
LTO_ENABLE = yes
|
||||
|
@@ -129,7 +129,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_MATRIX_LED_PROCESS_LIMIT 5
|
||||
#define RGB_MATRIX_LED_FLUSH_LIMIT 26
|
||||
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED
|
||||
|
||||
// #define RGBLIGHT_COLOR_LAYER_0 0x00, 0x00, 0xFF
|
||||
/* #define RGBLIGHT_COLOR_LAYER_1 0x00, 0x00, 0xFF */
|
||||
|
@@ -14,7 +14,7 @@
|
||||
#undef IGNORE_MOD_TAP_INTERRUPT
|
||||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED
|
||||
|
||||
#undef FORCE_NKRO
|
||||
#define FORCE_NKRO
|
||||
|
@@ -62,6 +62,21 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define LED_BRIGHTNESS_LO 100
|
||||
#define LED_BRIGHTNESS_HI 255
|
||||
|
||||
/* LED matrix driver */
|
||||
#define LED_DRIVER_ADDR_1 0x74
|
||||
#define LED_DRIVER_COUNT 1
|
||||
#define DRIVER_LED_TOTAL 76
|
||||
#define LED_MATRIX_SPLIT { 38, 38 }
|
||||
#define LED_DISABLE_WHEN_USB_SUSPENDED
|
||||
|
||||
/* i2c (for LED matrix) */
|
||||
#define I2C1_CLOCK_SPEED 400000
|
||||
#define I2C1_SCL_PAL_MODE PAL_MODE_ALTERNATIVE_2
|
||||
#define I2C1_SDA_PAL_MODE PAL_MODE_ALTERNATIVE_2
|
||||
#define I2C1_BANK GPIOB
|
||||
#define I2C1_SCL 0
|
||||
#define I2C1_SDA 1
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
|
@@ -1,20 +1,45 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
#include <ch.h>
|
||||
#include <hal.h>
|
||||
#include <string.h>
|
||||
#include "eeconfig.h"
|
||||
#include "serial_link/system/serial_link.h"
|
||||
#ifdef VISUALIZER_ENABLE
|
||||
#include "lcd_backlight.h"
|
||||
# include "lcd_backlight.h"
|
||||
#endif
|
||||
|
||||
#ifdef WPM_ENABLE
|
||||
# include "serial_link/protocol/transport.h"
|
||||
# include "wpm.h"
|
||||
#if (defined(LED_MATRIX_ENABLE) || defined(WPM_ENABLE))
|
||||
# include "serial_link/protocol/transport.h"
|
||||
|
||||
# ifdef LED_MATRIX_ENABLE
|
||||
MASTER_TO_ALL_SLAVES_OBJECT(led_matrix, led_eeconfig_t);
|
||||
MASTER_TO_ALL_SLAVES_OBJECT(led_suspend_state, bool);
|
||||
static led_eeconfig_t last_sent_led_matrix;
|
||||
static uint16_t led_matrix_sent_timer = 0;
|
||||
|
||||
void send_led_suspend_state(void) {
|
||||
if (is_serial_link_master()) {
|
||||
*begin_write_led_suspend_state() = led_matrix_get_suspend_state();
|
||||
end_write_led_suspend_state();
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
# ifdef WPM_ENABLE
|
||||
# include "wpm.h"
|
||||
MASTER_TO_ALL_SLAVES_OBJECT(current_wpm, uint8_t);
|
||||
static remote_object_t* remote_objects[] = {
|
||||
REMOTE_OBJECT(current_wpm),
|
||||
};
|
||||
static uint8_t last_sent_wpm = 0;
|
||||
# endif
|
||||
|
||||
static remote_object_t *remote_objects[] = {
|
||||
# ifdef LED_MATRIX_ENABLE
|
||||
REMOTE_OBJECT(led_matrix),
|
||||
REMOTE_OBJECT(led_suspend_state),
|
||||
# endif
|
||||
# ifdef WPM_ENABLE
|
||||
REMOTE_OBJECT(current_wpm),
|
||||
# endif
|
||||
};
|
||||
#endif
|
||||
|
||||
void init_serial_link_hal(void) {
|
||||
@@ -52,7 +77,7 @@ void init_serial_link_hal(void) {
|
||||
void lcd_backlight_hal_init(void) {
|
||||
// Setup Backlight
|
||||
SIM->SCGC6 |= SIM_SCGC6_FTM0;
|
||||
FTM0->CNT = 0; // Reset counter
|
||||
FTM0->CNT = 0; // Reset counter
|
||||
|
||||
// PWM Period
|
||||
// 16-bit maximum
|
||||
@@ -60,25 +85,25 @@ void lcd_backlight_hal_init(void) {
|
||||
|
||||
// Set FTM to PWM output - Edge Aligned, Low-true pulses
|
||||
#define CNSC_MODE FTM_SC_CPWMS | FTM_SC_PS(4) | FTM_SC_CLKS(0)
|
||||
CHANNEL_RED.CnSC = CNSC_MODE;
|
||||
CHANNEL_RED.CnSC = CNSC_MODE;
|
||||
CHANNEL_GREEN.CnSC = CNSC_MODE;
|
||||
CHANNEL_BLUE.CnSC = CNSC_MODE;
|
||||
CHANNEL_BLUE.CnSC = CNSC_MODE;
|
||||
|
||||
// System clock, /w prescalar setting
|
||||
FTM0->SC = FTM_SC_CLKS(1) | FTM_SC_PS(PRESCALAR_DEFINE);
|
||||
|
||||
CHANNEL_RED.CnV = 0;
|
||||
CHANNEL_RED.CnV = 0;
|
||||
CHANNEL_GREEN.CnV = 0;
|
||||
CHANNEL_BLUE.CnV = 0;
|
||||
CHANNEL_BLUE.CnV = 0;
|
||||
|
||||
RGB_PORT_GPIO->PDDR |= (1 << RED_PIN);
|
||||
RGB_PORT_GPIO->PDDR |= (1 << GREEN_PIN);
|
||||
RGB_PORT_GPIO->PDDR |= (1 << BLUE_PIN);
|
||||
|
||||
#define RGB_MODE PORTx_PCRn_SRE | PORTx_PCRn_DSE | PORTx_PCRn_MUX(4)
|
||||
RGB_PORT->PCR[RED_PIN] = RGB_MODE;
|
||||
RGB_PORT->PCR[RED_PIN] = RGB_MODE;
|
||||
RGB_PORT->PCR[GREEN_PIN] = RGB_MODE;
|
||||
RGB_PORT->PCR[BLUE_PIN] = RGB_MODE;
|
||||
RGB_PORT->PCR[BLUE_PIN] = RGB_MODE;
|
||||
}
|
||||
|
||||
static uint16_t cie_lightness(uint16_t v) {
|
||||
@@ -89,12 +114,11 @@ static uint16_t cie_lightness(uint16_t v) {
|
||||
// Y = (L* / 902.3) if L* <= 8
|
||||
// Y = ((L* + 16) / 116)^3 if L* > 8
|
||||
|
||||
float l = 100.0f * (v / 65535.0f);
|
||||
float l = 100.0f * (v / 65535.0f);
|
||||
float y = 0.0f;
|
||||
if (l <= 8.0f) {
|
||||
y = l / 902.3;
|
||||
}
|
||||
else {
|
||||
y = l / 902.3;
|
||||
} else {
|
||||
y = ((l + 16.0f) / 116.0f);
|
||||
y = y * y * y;
|
||||
if (y > 1.0f) {
|
||||
@@ -105,31 +129,48 @@ static uint16_t cie_lightness(uint16_t v) {
|
||||
}
|
||||
|
||||
void lcd_backlight_hal_color(uint16_t r, uint16_t g, uint16_t b) {
|
||||
CHANNEL_RED.CnV = cie_lightness(r);
|
||||
CHANNEL_RED.CnV = cie_lightness(r);
|
||||
CHANNEL_GREEN.CnV = cie_lightness(g);
|
||||
CHANNEL_BLUE.CnV = cie_lightness(b);
|
||||
CHANNEL_BLUE.CnV = cie_lightness(b);
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_init_user(void) {
|
||||
}
|
||||
__attribute__ ((weak)) void matrix_init_user(void) {}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void matrix_scan_user(void) {
|
||||
}
|
||||
__attribute__ ((weak)) void matrix_scan_user(void) {}
|
||||
|
||||
|
||||
void keyboard_pre_init_kb() {
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
// Turn on LED controller
|
||||
setPinOutput(B16);
|
||||
writePinHigh(B16);
|
||||
#endif
|
||||
keyboard_pre_init_user();
|
||||
}
|
||||
|
||||
void matrix_init_kb(void) {
|
||||
// put your keyboard start-up code here
|
||||
// runs once when the firmware starts up
|
||||
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
/*
|
||||
* Since K20x is stuck with a 32 byte EEPROM (see tmk_core/common/chibios/eeprom_teensy.c),
|
||||
* and neither led_matrix_eeconfig.speed or .flags fit in this boundary, just force their values to default on boot.
|
||||
*/
|
||||
# if !defined(LED_MATRIX_STARTUP_SPD)
|
||||
# define LED_MATRIX_STARTUP_SPD UINT8_MAX / 2
|
||||
# endif
|
||||
led_matrix_set_speed(LED_MATRIX_STARTUP_SPD);
|
||||
led_matrix_set_flags(LED_FLAG_ALL);
|
||||
#endif
|
||||
|
||||
matrix_init_user();
|
||||
// The backlight always has to be initialized, otherwise it will stay lit
|
||||
#ifndef VISUALIZER_ENABLE
|
||||
lcd_backlight_hal_init();
|
||||
#endif
|
||||
#ifdef WPM_ENABLE
|
||||
add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t*));
|
||||
#if (defined(LED_MATRIX_ENABLE) || defined(WPM_ENABLE))
|
||||
add_remote_objects(remote_objects, sizeof(remote_objects) / sizeof(remote_object_t *));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -137,6 +178,30 @@ void matrix_scan_kb(void) {
|
||||
// put your looping keyboard code here
|
||||
// runs every cycle (a lot)
|
||||
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
if (is_serial_link_master()) {
|
||||
if (!led_matrix_get_suspend_state()) {
|
||||
if (timer_elapsed(led_matrix_sent_timer) >= 5000 || memcmp((void *)&last_sent_led_matrix, (void *)&led_matrix_eeconfig, sizeof(last_sent_led_matrix))) {
|
||||
led_matrix_sent_timer = timer_read();
|
||||
memcpy((void *)&last_sent_led_matrix, (void *)&led_matrix_eeconfig, sizeof(last_sent_led_matrix));
|
||||
*begin_write_led_matrix() = last_sent_led_matrix;
|
||||
end_write_led_matrix();
|
||||
}
|
||||
}
|
||||
} else if (is_serial_link_connected()) {
|
||||
bool *new_led_suspend_state = read_led_suspend_state();
|
||||
if (new_led_suspend_state) {
|
||||
led_matrix_set_suspend_state(*new_led_suspend_state);
|
||||
}
|
||||
if (!led_matrix_get_suspend_state()) {
|
||||
led_eeconfig_t *new_led_matrix = read_led_matrix();
|
||||
if (new_led_matrix) {
|
||||
memcpy((void *)&led_matrix_eeconfig, (void *)new_led_matrix, sizeof(last_sent_led_matrix));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WPM_ENABLE
|
||||
if (is_serial_link_master()) {
|
||||
uint8_t current_wpm = get_current_wpm();
|
||||
@@ -146,67 +211,68 @@ void matrix_scan_kb(void) {
|
||||
last_sent_wpm = current_wpm;
|
||||
}
|
||||
} else if (is_serial_link_connected()) {
|
||||
uint8_t* new_wpm = read_current_wpm();
|
||||
uint8_t *new_wpm = read_current_wpm();
|
||||
if (new_wpm) {
|
||||
set_current_wpm(*new_wpm);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
matrix_scan_user();
|
||||
}
|
||||
|
||||
bool is_keyboard_master(void) {
|
||||
return is_serial_link_master();
|
||||
bool is_keyboard_master(void) { return is_serial_link_master(); }
|
||||
|
||||
bool is_keyboard_left(void) {
|
||||
#if defined(EE_HANDS)
|
||||
return eeconfig_read_handedness();
|
||||
#elif defined(MASTER_IS_ON_RIGHT)
|
||||
return !is_keyboard_master();
|
||||
#else
|
||||
return is_keyboard_master();
|
||||
#endif
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void ergodox_board_led_on(void){
|
||||
__attribute__ ((weak)) void ergodox_board_led_on(void) {}
|
||||
|
||||
__attribute__ ((weak)) void ergodox_right_led_1_on(void) {}
|
||||
|
||||
__attribute__ ((weak)) void ergodox_right_led_2_on(void) {}
|
||||
|
||||
__attribute__ ((weak)) void ergodox_right_led_3_on(void) {}
|
||||
|
||||
__attribute__ ((weak)) void ergodox_board_led_off(void) {}
|
||||
|
||||
__attribute__ ((weak)) void ergodox_right_led_1_off(void) {}
|
||||
|
||||
__attribute__ ((weak)) void ergodox_right_led_2_off(void) {}
|
||||
|
||||
__attribute__ ((weak)) void ergodox_right_led_3_off(void) {}
|
||||
|
||||
__attribute__ ((weak)) void ergodox_right_led_1_set(uint8_t n) {}
|
||||
|
||||
__attribute__ ((weak)) void ergodox_right_led_2_set(uint8_t n) {}
|
||||
|
||||
__attribute__ ((weak)) void ergodox_right_led_3_set(uint8_t n) {}
|
||||
|
||||
void suspend_power_down_kb(void) {
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
send_led_suspend_state();
|
||||
#endif
|
||||
suspend_power_down_user();
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void ergodox_right_led_1_on(void){
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void ergodox_right_led_2_on(void){
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void ergodox_right_led_3_on(void){
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void ergodox_board_led_off(void){
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void ergodox_right_led_1_off(void){
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void ergodox_right_led_2_off(void){
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void ergodox_right_led_3_off(void){
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void ergodox_right_led_1_set(uint8_t n) {
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void ergodox_right_led_2_set(uint8_t n) {
|
||||
}
|
||||
|
||||
__attribute__ ((weak))
|
||||
void ergodox_right_led_3_set(uint8_t n) {
|
||||
void suspend_wakeup_init_kb(void) {
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
send_led_suspend_state();
|
||||
#endif
|
||||
suspend_wakeup_init_user();
|
||||
}
|
||||
|
||||
#ifdef SWAP_HANDS_ENABLE
|
||||
__attribute__ ((weak))
|
||||
const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
|
||||
{{0, 9}, {1, 9}, {2, 9}, {3, 9}, {4, 9}},
|
||||
{{0, 9}, {1, 9}, {2, 9}, {3, 9}, {4, 9}},
|
||||
{{0, 10}, {1, 10}, {2, 10}, {3, 10}, {4, 10}},
|
||||
{{0, 11}, {1, 11}, {2, 11}, {3, 11}, {4, 11}},
|
||||
{{0, 12}, {1, 12}, {2, 12}, {3, 12}, {4, 12}},
|
||||
@@ -226,3 +292,115 @@ const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = {
|
||||
{{0, 8}, {1, 8}, {2, 8}, {3, 8}, {4, 8}},
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef LED_MATRIX_ENABLE
|
||||
const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
|
||||
// The numbers in the comments are the led numbers DXX on the PCB
|
||||
/* Refer to IS31 manual for these locations
|
||||
* driver
|
||||
* | LED address
|
||||
* | | */
|
||||
// Left half
|
||||
// 45 44 43 42 41 40 39
|
||||
{ 0, C2_2 }, { 0, C1_2 }, { 0, C5_1 }, { 0, C4_1 }, { 0, C3_1 }, { 0, C2_1 }, { 0, C1_1 },
|
||||
// 52 51 50 49 48 47 46
|
||||
{ 0, C4_3 }, { 0, C3_3 }, { 0, C2_3 }, { 0, C1_3 }, { 0, C5_2 }, { 0, C4_2 }, { 0, C3_2 },
|
||||
// 58 57 56 55 54 53
|
||||
{ 0, C5_4 }, { 0, C4_4 }, { 0, C3_4 }, { 0, C2_4 }, { 0, C1_4 }, { 0, C5_3 },
|
||||
// 67 66 65 64 63 62 61
|
||||
{ 0, C4_6 }, { 0, C3_6 }, { 0, C2_6 }, { 0, C1_6 }, { 0, C5_5 }, { 0, C4_5 }, { 0, C3_5 },
|
||||
// 76 75 74 73 72
|
||||
{ 0, C4_8 }, { 0, C3_8 }, { 0, C2_8 }, { 0, C1_8 }, { 0, C4_7 },
|
||||
// 60 59
|
||||
{ 0, C2_5 }, { 0, C1_5 },
|
||||
// 68
|
||||
{ 0, C5_6 },
|
||||
// 71 70 69
|
||||
{ 0, C3_7 }, { 0, C2_7 }, { 0, C1_7 },
|
||||
// Right half (mirrored)
|
||||
// Due to how LED_MATRIX_SPLIT is implemented, only the first half of g_is31_leds is actually used.
|
||||
// Luckily, the right half has the same LED pinouts, just mirrored.
|
||||
// 45 44 43 42 41 40 39
|
||||
{ 0, C2_2 }, { 0, C1_2 }, { 0, C5_1 }, { 0, C4_1 }, { 0, C3_1 }, { 0, C2_1 }, { 0, C1_1 },
|
||||
// 52 51 50 49 48 47 46
|
||||
{ 0, C4_3 }, { 0, C3_3 }, { 0, C2_3 }, { 0, C1_3 }, { 0, C5_2 }, { 0, C4_2 }, { 0, C3_2 },
|
||||
// 58 57 56 55 54 53
|
||||
{ 0, C5_4 }, { 0, C4_4 }, { 0, C3_4 }, { 0, C2_4 }, { 0, C1_4 }, { 0, C5_3 },
|
||||
// 67 66 65 64 63 62 61
|
||||
{ 0, C4_6 }, { 0, C3_6 }, { 0, C2_6 }, { 0, C1_6 }, { 0, C5_5 }, { 0, C4_5 }, { 0, C3_5 },
|
||||
// 76 75 74 73 72
|
||||
{ 0, C4_8 }, { 0, C3_8 }, { 0, C2_8 }, { 0, C1_8 }, { 0, C4_7 },
|
||||
// 60 59
|
||||
{ 0, C2_5 }, { 0, C1_5 },
|
||||
// 68
|
||||
{ 0, C5_6 },
|
||||
// 71 70 69
|
||||
{ 0, C3_7 }, { 0, C2_7 }, { 0, C1_7 },
|
||||
};
|
||||
|
||||
led_config_t g_led_config = {
|
||||
{
|
||||
// Key Matrix to LED Index
|
||||
// Left half
|
||||
{ NO_LED, NO_LED, NO_LED, 33, 34 },
|
||||
{ NO_LED, NO_LED, NO_LED, 32, 37 },
|
||||
{ 6, 13, NO_LED, 26, 36 },
|
||||
{ 5, 12, 19, 25, 35 },
|
||||
{ 4, 11, 18, 24, 31 },
|
||||
{ 3, 10, 17, 23, 30 },
|
||||
{ 2, 9, 16, 22, 29 },
|
||||
{ 1, 8, 15, 21, 28 },
|
||||
{ 0, 7, 14, 20, 27 },
|
||||
// Right half
|
||||
{ NO_LED, NO_LED, NO_LED, 71, 72 },
|
||||
{ NO_LED, NO_LED, NO_LED, 70, 75 },
|
||||
{ 44, 51, NO_LED, 64, 74 },
|
||||
{ 43, 50, 57, 63, 73 },
|
||||
{ 42, 49, 56, 62, 69 },
|
||||
{ 41, 48, 55, 61, 68 },
|
||||
{ 40, 47, 54, 60, 67 },
|
||||
{ 39, 46, 53, 59, 66 },
|
||||
{ 38, 45, 52, 58, 65 },
|
||||
}, {
|
||||
// LED Index to Physical Position (assumes a reasonable gap between halves)
|
||||
// Left half
|
||||
{ 0, 3 }, { 15, 3 }, { 27, 1 }, { 39, 0 }, { 51, 1 }, { 63, 2 }, { 75, 2 },
|
||||
{ 0, 13 }, { 15, 13 }, { 27, 11 }, { 39, 10 }, { 51, 11 }, { 63, 12 }, { 78, 17 },
|
||||
{ 0, 23 }, { 15, 23 }, { 27, 21 }, { 39, 20 }, { 51, 21 }, { 63, 22 },
|
||||
{ 0, 33 }, { 15, 33 }, { 27, 31 }, { 39, 30 }, { 51, 31 }, { 63, 32 }, { 78, 32 },
|
||||
{ 4, 43 }, { 15, 43 }, { 27, 41 }, { 39, 40 }, { 51, 41 },
|
||||
{ 89, 41 }, { 100, 46 },
|
||||
{ 95, 55 },
|
||||
{ 72, 54 }, { 83, 59 }, { 90, 64 },
|
||||
// Right half (mirrored)
|
||||
{ 224, 3 }, { 209, 3 }, { 197, 1 }, { 185, 0 }, { 173, 1 }, { 161, 2 }, { 149, 2 },
|
||||
{ 224, 13 }, { 209, 13 }, { 197, 11 }, { 185, 10 }, { 173, 11 }, { 161, 12 }, { 146, 17 },
|
||||
{ 224, 23 }, { 209, 23 }, { 197, 21 }, { 185, 20 }, { 173, 21 }, { 161, 22 },
|
||||
{ 224, 33 }, { 209, 33 }, { 197, 31 }, { 185, 30 }, { 173, 31 }, { 161, 32 }, { 146, 32 },
|
||||
{ 220, 43 }, { 209, 43 }, { 197, 41 }, { 185, 40 }, { 173, 41 },
|
||||
{ 135, 41 }, { 124, 46 },
|
||||
{ 129, 55 },
|
||||
{ 152, 54 }, { 141, 59 }, { 134, 64 },
|
||||
}, {
|
||||
// LED Index to Flag
|
||||
// Left half
|
||||
1, 4, 4, 4, 4, 4, 1,
|
||||
1, 4, 4, 4, 4, 4, 1,
|
||||
1, 4, 4, 4, 4, 4,
|
||||
1, 4, 4, 4, 4, 4, 1,
|
||||
1, 1, 1, 1, 1,
|
||||
1, 1,
|
||||
1,
|
||||
1, 1, 1,
|
||||
// Right half (mirrored)
|
||||
1, 4, 4, 4, 4, 4, 1,
|
||||
1, 4, 4, 4, 4, 4, 1,
|
||||
1, 4, 4, 4, 4, 4,
|
||||
1, 4, 4, 4, 4, 4, 1,
|
||||
1, 1, 1, 1, 1,
|
||||
1, 1,
|
||||
1,
|
||||
1, 1, 1,
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
@@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#include "print.h"
|
||||
#include "debug.h"
|
||||
#include "matrix.h"
|
||||
#include "eeconfig.h"
|
||||
#include "keyboard.h"
|
||||
#include "serial_link/system/serial_link.h"
|
||||
|
||||
|
||||
@@ -119,15 +119,9 @@ uint8_t matrix_scan(void)
|
||||
}
|
||||
|
||||
uint8_t offset = 0;
|
||||
#if (defined(EE_HANDS) || defined(MASTER_IS_ON_RIGHT))
|
||||
#ifdef EE_HANDS
|
||||
if (is_serial_link_master() && !eeconfig_read_handedness()) {
|
||||
#else
|
||||
if (is_serial_link_master()) {
|
||||
#endif
|
||||
if (is_serial_link_master() && !is_keyboard_left()) {
|
||||
offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
|
||||
for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) {
|
||||
@@ -167,17 +161,11 @@ void matrix_print(void)
|
||||
|
||||
void matrix_set_remote(matrix_row_t* rows, uint8_t index) {
|
||||
uint8_t offset = 0;
|
||||
#ifdef EE_HANDS
|
||||
if (eeconfig_read_handedness()) {
|
||||
if (is_keyboard_left()) {
|
||||
offset = LOCAL_MATRIX_ROWS * (index + 1);
|
||||
} else {
|
||||
offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2);
|
||||
}
|
||||
#elif defined(MASTER_IS_ON_RIGHT)
|
||||
offset = MATRIX_ROWS - LOCAL_MATRIX_ROWS * (index + 2);
|
||||
#else
|
||||
offset = LOCAL_MATRIX_ROWS * (index + 1);
|
||||
#endif
|
||||
for (int row = 0; row < LOCAL_MATRIX_ROWS; row++) {
|
||||
matrix[offset + row] = rows[row];
|
||||
}
|
||||
|
@@ -22,8 +22,6 @@ CUSTOM_MATRIX = yes # Custom matrix file
|
||||
SERIAL_LINK_ENABLE = yes
|
||||
VISUALIZER_ENABLE = yes
|
||||
LCD_ENABLE = yes
|
||||
BACKLIGHT_ENABLE = yes
|
||||
BACKLIGHT_DRIVER = custom
|
||||
LCD_BACKLIGHT_ENABLE = yes
|
||||
MIDI_ENABLE = no
|
||||
RGBLIGHT_ENABLE = no
|
||||
@@ -32,9 +30,8 @@ LCD_DRIVER = st7565
|
||||
LCD_WIDTH = 128
|
||||
LCD_HEIGHT = 32
|
||||
|
||||
LED_DRIVER = is31fl3731c
|
||||
LED_WIDTH = 7
|
||||
LED_HEIGHT = 7
|
||||
LED_MATRIX_ENABLE = yes
|
||||
LED_MATRIX_DRIVER = IS31FL3731
|
||||
|
||||
# project specific files
|
||||
SRC = matrix.c \
|
||||
|
@@ -41,7 +41,7 @@
|
||||
#define WS2812_DMA_CHANNEL 3
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
#define RGB_MATRIX_KEYPRESSES
|
||||
#define RGB_MATRIX_KEYPRESSES
|
||||
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
#define DISABLE_RGB_MATRIX_ALPHAS_MODS
|
||||
#define DISABLE_RGB_MATRIX_BAND_SAT
|
||||
@@ -67,7 +67,7 @@
|
||||
#define RGB_MATRIX_STARTUP_SPD 30
|
||||
#endif //RGB_MATRIX_ENABLE
|
||||
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED
|
||||
#define WAIT_FOR_USB
|
||||
|
||||
/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
|
||||
|
@@ -24,7 +24,7 @@
|
||||
#define DEBOUNCE 3
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
#define RGB_DISABLE_AFTER_TIMEOUT 0
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED
|
||||
#define RGB_MATRIX_KEYPRESSES
|
||||
#define DISABLE_RGB_MATRIX_SPLASH
|
||||
#define DISABLE_RGB_MATRIX_MULTISPLASH
|
||||
@@ -36,4 +36,4 @@
|
||||
#define DRIVER_1_LED_TOTAL 8
|
||||
#define DRIVER_2_LED_TOTAL 0
|
||||
#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -46,3 +46,20 @@
|
||||
#define LOCKING_SUPPORT_ENABLE
|
||||
/* Locking resynchronize hack */
|
||||
#define LOCKING_RESYNC_ENABLE
|
||||
|
||||
/* SPI Config for LED Driver */
|
||||
#define SPI_DRIVER SPID1
|
||||
#define SPI_SCK_PIN A5
|
||||
#define SPI_MOSI_PIN A6
|
||||
#define SPI_MISO_PIN A7
|
||||
|
||||
#define DRIVER_1_CS B13
|
||||
#define DRIVER_2_CS B14
|
||||
#define DRIVER_1_EN C13
|
||||
#define DRIVER_2_EN C13
|
||||
|
||||
#define DRIVER_COUNT 2
|
||||
#define DRIVER_1_LED_TOTAL 66
|
||||
#define DRIVER_2_LED_TOTAL 32
|
||||
#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
|
||||
|
||||
|
7
keyboards/gmmk/pro/halconf.h
Normal file
7
keyboards/gmmk/pro/halconf.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#define HAL_USE_SPI TRUE
|
||||
#define SPI_USE_WAIT TRUE
|
||||
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
|
||||
|
||||
#include_next <halconf.h>
|
6
keyboards/gmmk/pro/mcuconf.h
Normal file
6
keyboards/gmmk/pro/mcuconf.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include_next <mcuconf.h>
|
||||
|
||||
#undef STM32_SPI_USE_SPI1
|
||||
#define STM32_SPI_USE_SPI1 TRUE
|
@@ -14,3 +14,225 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "pro.h"
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
led_config_t g_led_config = { {
|
||||
{ 4, NO_LED, NO_LED, 95, 65, 79, 5, 28 },
|
||||
{ 8, 2, 9, 0, 10, 75, 1, 7 },
|
||||
{ 14, 3, 15, NO_LED, 16, 86, 6, 13 },
|
||||
{ 20, 18, 21, 23, 22, 94, 12, 19 },
|
||||
{ 25, 30, 26, 31, 27, 32, 29, 24 },
|
||||
{ 41, 36, 42, 37, 43, 38, 35, 40 },
|
||||
{ 46, 89, 47, 34, 48, 72, 78, 45 },
|
||||
{ 52, 39, 53, 97, 54, 82, 44, 51 },
|
||||
{ 58, 63, 59, 64, NO_LED, 60, 62, 57 },
|
||||
{ 11, 90, 55, 17, 33, 49, NO_LED, 69 },
|
||||
{ NO_LED, 85, 93, 61, 96, 66, 50, 56 }
|
||||
}, {
|
||||
{ 0, 0 }, // 0, ESC, k13
|
||||
{ 0, 15 }, // 1, ~, k16
|
||||
{ 4, 26 }, // 2, Tab, k11
|
||||
{ 5, 38 }, // 3, Caps, k21
|
||||
{ 9, 49 }, // 4, Sh_L, k00
|
||||
{ 2, 61 }, // 5, Ct_L, k06
|
||||
{ 18, 0 }, // 6, F1, k26
|
||||
{ 14, 15 }, // 7, 1, k17
|
||||
{ 22, 26 }, // 8, Q, k10
|
||||
{ 25, 38 }, // 9, A, k12
|
||||
{ 33, 49 }, // 10, Z, k14
|
||||
{ 20, 61 }, // 11, Win_L, k90
|
||||
{ 33, 0 }, // 12, F2, k36
|
||||
{ 29, 15 }, // 13, 2, k27
|
||||
{ 36, 26 }, // 14, W, k20
|
||||
{ 40, 38 }, // 15, S, k22
|
||||
{ 47, 49 }, // 16, X, k24
|
||||
{ 38, 61 }, // 17, Alt_L, k93
|
||||
{ 47, 0 }, // 18, F3, k31
|
||||
{ 43, 15 }, // 19, 3, k37
|
||||
{ 51, 26 }, // 20, E, k30
|
||||
{ 54, 38 }, // 21, D, k32
|
||||
{ 61, 49 }, // 22, C, k34
|
||||
{ 61, 0 }, // 23, F4, k33
|
||||
{ 58, 15 }, // 24, 4, k47
|
||||
{ 65, 26 }, // 25, R, k40
|
||||
{ 69, 38 }, // 26, F, k42
|
||||
{ 76, 49 }, // 27, V, k44
|
||||
{ 79, 0 }, // 28, F5, k07
|
||||
{ 72, 15 }, // 29, 5, k46
|
||||
{ 79, 26 }, // 30, T, k41
|
||||
{ 83, 38 }, // 31, G, k43
|
||||
{ 90, 49 }, // 32, B, k45
|
||||
{ 92, 61 }, // 33, SPACE, k94
|
||||
{ 94, 0 }, // 34, F6, k63
|
||||
{ 87, 15 }, // 35, 6, k56
|
||||
{ 94, 26 }, // 36, Y, k51
|
||||
{ 98, 38 }, // 37, H, k53
|
||||
{ 105, 49 }, // 38, N, k55
|
||||
{ 108, 0 }, // 39, F7, k71
|
||||
{ 101, 15 }, // 40, 7, k57
|
||||
{ 108, 26 }, // 41, U, k50
|
||||
{ 112, 38 }, // 42, J, k52
|
||||
{ 119, 49 }, // 43, M, k54
|
||||
{ 123, 0 }, // 44, F8, k76
|
||||
{ 116, 15 }, // 45, 8, k67
|
||||
{ 123, 26 }, // 46, I, k60
|
||||
{ 126, 38 }, // 47, K, k62
|
||||
{ 134, 49 }, // 48, ,, k64
|
||||
{ 145, 61 }, // 49, Alt_R, k95
|
||||
{ 141, 0 }, // 50, F9, ka6
|
||||
{ 130, 15 }, // 51, 9, k77
|
||||
{ 137, 26 }, // 52, O, k70
|
||||
{ 141, 38 }, // 53, L, k72
|
||||
{ 148, 49 }, // 54, ., k74
|
||||
{ 159, 61 }, // 55, FN, k92
|
||||
{ 155, 0 }, // 56, F10, ka7
|
||||
{ 145, 15 }, // 57, 0, k87
|
||||
{ 152, 26 }, // 58, P, k80
|
||||
{ 155, 38 }, // 59, ;, k82
|
||||
{ 163, 49 }, // 60, ?, k85
|
||||
{ 170, 0 }, // 61, F11, ka3
|
||||
{ 159, 15 }, // 62, -, k86
|
||||
{ 166, 26 }, // 63, [, k81
|
||||
{ 170, 38 }, // 64, ", k83
|
||||
{ 173, 61 }, // 65, Ct_R, k04
|
||||
{ 184, 0 }, // 66, F12, ka5
|
||||
{ 0, 8 }, // 67, LED, l01
|
||||
{ 224, 8 }, // 68, LED, l11
|
||||
{ 202, 0 }, // 69, Prt, k97
|
||||
{ 0, 15 }, // 70, LED, l02
|
||||
{ 224, 15 }, // 71, LED, l12
|
||||
{ 224, 15 }, // 72, Del, k65
|
||||
{ 0, 21 }, // 73, LED, l03
|
||||
{ 224, 21 }, // 74, LED, l13
|
||||
{ 224, 26 }, // 75, PgUp, k15
|
||||
{ 0, 28 }, // 76, LED, l04
|
||||
{ 224, 28 }, // 77, LED, l14
|
||||
{ 173, 15 }, // 78, =, k66
|
||||
{ 220, 64 }, // 79, Right, k05
|
||||
{ 0, 35 }, // 80, LED, l05
|
||||
{ 224, 35 }, // 81, LED, l15
|
||||
{ 224, 49 }, // 82, End, k75
|
||||
{ 0, 42 }, // 83, LED, l06
|
||||
{ 224, 42 }, // 84, LED, l16
|
||||
{ 195, 15 }, // 85, BSpc, ka1
|
||||
{ 224, 38 }, // 86, PgDn, k25
|
||||
{ 0, 48 }, // 87, LED, l07
|
||||
{ 224, 48 }, // 88, LED, l17
|
||||
{ 181, 26 }, // 89, ], k61
|
||||
{ 182, 49 }, // 90, Sh_R, k91
|
||||
{ 0, 55 }, // 91, LED, l08
|
||||
{ 224, 55 }, // 92, LED, l18
|
||||
{ 199, 26 }, // 93, \, ka2
|
||||
{ 206, 52 }, // 94, Up, k35
|
||||
{ 191, 64 }, // 95, Left, k03
|
||||
{ 193, 38 }, // 96, Enter, ka4
|
||||
{ 206, 64 } // 97, Down, k73
|
||||
}, {
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
|
||||
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 2, 2, 4, 2, 2,
|
||||
4, 2, 2, 4, 4, 2, 2, 4, 2, 2, 4, 4, 2, 2, 4, 4, 2, 2, 4, 4, 4, 4, 4
|
||||
} };
|
||||
|
||||
const aw_led g_aw_leds[DRIVER_LED_TOTAL] = {
|
||||
{ 0, CS1_SW1, CS2_SW1, CS3_SW1 }, // 0, ESC, k13
|
||||
{ 0, CS4_SW1, CS5_SW1, CS6_SW1 }, // 1, ~, k16
|
||||
{ 0, CS7_SW1, CS8_SW1, CS9_SW1 }, // 2, Tab, k11
|
||||
{ 0, CS10_SW1, CS11_SW1, CS12_SW1 }, // 3, Caps, k21
|
||||
{ 0, CS13_SW1, CS14_SW1, CS15_SW1 }, // 4, Sh_L, k00
|
||||
{ 0, CS16_SW1, CS17_SW1, CS18_SW1 }, // 5, Ct_L, k06
|
||||
{ 0, CS1_SW2, CS2_SW2, CS3_SW2 }, // 6, F1, k26
|
||||
{ 0, CS4_SW2, CS5_SW2, CS6_SW2 }, // 7, 1, k17
|
||||
{ 0, CS7_SW2, CS8_SW2, CS9_SW2 }, // 8, Q, k10
|
||||
{ 0, CS10_SW2, CS11_SW2, CS12_SW2 }, // 9, A, k12
|
||||
{ 0, CS13_SW2, CS14_SW2, CS15_SW2 }, // 10, Z, k14
|
||||
{ 0, CS16_SW2, CS17_SW2, CS18_SW2 }, // 11, Win_L, k90
|
||||
{ 0, CS1_SW3, CS2_SW3, CS3_SW3 }, // 12, F2, k36
|
||||
{ 0, CS4_SW3, CS5_SW3, CS6_SW3 }, // 13, 2, k27
|
||||
{ 0, CS7_SW3, CS8_SW3, CS9_SW3 }, // 14, W, k20
|
||||
{ 0, CS10_SW3, CS11_SW3, CS12_SW3 }, // 15, S, k22
|
||||
{ 0, CS13_SW3, CS14_SW3, CS15_SW3 }, // 16, X, k24
|
||||
{ 0, CS16_SW3, CS17_SW3, CS18_SW3 }, // 17, Alt_L, k93
|
||||
{ 0, CS1_SW4, CS2_SW4, CS3_SW4 }, // 18, F3, k31
|
||||
{ 0, CS4_SW4, CS5_SW4, CS6_SW4 }, // 19, 3, k37
|
||||
{ 0, CS7_SW4, CS8_SW4, CS9_SW4 }, // 20, E, k30
|
||||
{ 0, CS10_SW4, CS11_SW4, CS12_SW4 }, // 21, D, k32
|
||||
{ 0, CS13_SW4, CS14_SW4, CS15_SW4 }, // 22, C, k34
|
||||
{ 0, CS1_SW5, CS2_SW5, CS3_SW5 }, // 23, F4, k33
|
||||
{ 0, CS4_SW5, CS5_SW5, CS6_SW5 }, // 24, 4, k47
|
||||
{ 0, CS7_SW5, CS8_SW5, CS9_SW5 }, // 25, R, k40
|
||||
{ 0, CS10_SW5, CS11_SW5, CS12_SW5 }, // 26, F, k42
|
||||
{ 0, CS13_SW5, CS14_SW5, CS15_SW5 }, // 27, V, k44
|
||||
{ 0, CS1_SW6, CS2_SW6, CS3_SW6 }, // 28, F5, k07
|
||||
{ 0, CS4_SW6, CS5_SW6, CS6_SW6 }, // 29, 5, k46
|
||||
{ 0, CS7_SW6, CS8_SW6, CS9_SW6 }, // 30, T, k41
|
||||
{ 0, CS10_SW6, CS11_SW6, CS12_SW6 }, // 31, G, k43
|
||||
{ 0, CS13_SW6, CS14_SW6, CS15_SW6 }, // 32, B, k45
|
||||
{ 0, CS16_SW6, CS17_SW6, CS18_SW6 }, // 33, SPACE, k94
|
||||
{ 0, CS1_SW7, CS2_SW7, CS3_SW7 }, // 34, F6, k63
|
||||
{ 0, CS4_SW7, CS5_SW7, CS6_SW7 }, // 35, 6, k56
|
||||
{ 0, CS7_SW7, CS8_SW7, CS9_SW7 }, // 36, Y, k51
|
||||
{ 0, CS10_SW7, CS11_SW7, CS12_SW7 }, // 37, H, k53
|
||||
{ 0, CS13_SW7, CS14_SW7, CS15_SW7 }, // 38, N, k55
|
||||
{ 0, CS1_SW8, CS2_SW8, CS3_SW8 }, // 39, F7, k71
|
||||
{ 0, CS4_SW8, CS5_SW8, CS6_SW8 }, // 40, 7, k57
|
||||
{ 0, CS7_SW8, CS8_SW8, CS9_SW8 }, // 41, U, k50
|
||||
{ 0, CS10_SW8, CS11_SW8, CS12_SW8 }, // 42, J, k52
|
||||
{ 0, CS13_SW8, CS14_SW8, CS15_SW8 }, // 43, M, k54
|
||||
{ 0, CS1_SW9, CS2_SW9, CS3_SW9 }, // 44, F8, k76
|
||||
{ 0, CS4_SW9, CS5_SW9, CS6_SW9 }, // 45, 8, k67
|
||||
{ 0, CS7_SW9, CS8_SW9, CS9_SW9 }, // 46, I, k60
|
||||
{ 0, CS10_SW9, CS11_SW9, CS12_SW9 }, // 47, K, k62
|
||||
{ 0, CS13_SW9, CS14_SW9, CS15_SW9 }, // 48, ,, k64
|
||||
{ 0, CS16_SW9, CS17_SW9, CS18_SW9 }, // 49, Alt_R, k95
|
||||
{ 0, CS1_SW10, CS2_SW10, CS3_SW10 }, // 50, F9, ka6
|
||||
{ 0, CS4_SW10, CS5_SW10, CS6_SW10 }, // 51, 9, k77
|
||||
{ 0, CS7_SW10, CS8_SW10, CS9_SW10 }, // 52, O, k70
|
||||
{ 0, CS10_SW10, CS11_SW10, CS12_SW10 }, // 53, L, k72
|
||||
{ 0, CS13_SW10, CS14_SW10, CS15_SW10 }, // 54, ., k74
|
||||
{ 0, CS16_SW10, CS17_SW10, CS18_SW10 }, // 55, FN, k92
|
||||
{ 0, CS1_SW11, CS2_SW11, CS3_SW11 }, // 56, F10, ka7
|
||||
{ 0, CS4_SW11, CS5_SW11, CS6_SW11 }, // 57, 0, k87
|
||||
{ 0, CS7_SW11, CS8_SW11, CS9_SW11 }, // 58, P, k80
|
||||
{ 0, CS10_SW11, CS11_SW11, CS12_SW11 }, // 59, ;, k82
|
||||
{ 0, CS13_SW11, CS14_SW11, CS15_SW11 }, // 60, ?, k85
|
||||
{ 0, CS1_SW12, CS2_SW12, CS3_SW12 }, // 61, F11, ka3
|
||||
{ 0, CS4_SW12, CS5_SW12, CS6_SW12 }, // 62, -, k86
|
||||
{ 0, CS7_SW12, CS8_SW12, CS9_SW12 }, // 63, [, k81
|
||||
{ 0, CS10_SW12, CS11_SW12, CS12_SW12 }, // 64, ", k83
|
||||
{ 0, CS16_SW12, CS17_SW12, CS18_SW12 }, // 65, Ct_R, k04
|
||||
|
||||
{ 1, CS1_SW1, CS2_SW1, CS3_SW1 }, // 66, F12, ka5
|
||||
{ 1, CS13_SW1, CS14_SW1, CS15_SW1 }, // 67, LED, l01
|
||||
{ 1, CS16_SW1, CS17_SW1, CS18_SW1 }, // 68, LED, l11
|
||||
{ 1, CS4_SW2, CS5_SW2, CS6_SW2 }, // 69, Prt, k97
|
||||
{ 1, CS13_SW2, CS14_SW2, CS15_SW2 }, // 70, LED, l02
|
||||
{ 1, CS16_SW2, CS17_SW2, CS18_SW2 }, // 71, LED, l12
|
||||
{ 1, CS4_SW3, CS5_SW3, CS6_SW3 }, // 72, Del, k65
|
||||
{ 1, CS13_SW3, CS14_SW3, CS15_SW3 }, // 73, LED, l03
|
||||
{ 1, CS16_SW3, CS17_SW3, CS18_SW3 }, // 74, LED, l13
|
||||
{ 1, CS4_SW4, CS5_SW4, CS6_SW4 }, // 75, PgUp, k15
|
||||
{ 1, CS13_SW4, CS14_SW4, CS15_SW4 }, // 76, LED, l04
|
||||
{ 1, CS16_SW4, CS17_SW4, CS18_SW4 }, // 77, LED, l14
|
||||
{ 1, CS1_SW5, CS2_SW5, CS3_SW5 }, // 78, =, k66
|
||||
{ 1, CS10_SW5, CS11_SW5, CS12_SW5 }, // 79, Right, k05
|
||||
{ 1, CS13_SW5, CS14_SW5, CS15_SW5 }, // 80, LED, l05
|
||||
{ 1, CS16_SW5, CS17_SW5, CS18_SW5 }, // 81, LED, l15
|
||||
{ 1, CS4_SW6, CS5_SW6, CS6_SW6 }, // 82, End, k75
|
||||
{ 1, CS13_SW6, CS14_SW6, CS15_SW6 }, // 83, LED, l06
|
||||
{ 1, CS16_SW6, CS17_SW6, CS18_SW6 }, // 84, LED, l16
|
||||
{ 1, CS1_SW7, CS2_SW7, CS3_SW7 }, // 85, BSpc, ka1
|
||||
{ 1, CS4_SW7, CS5_SW7, CS6_SW7 }, // 86, PgDn, k25
|
||||
{ 1, CS13_SW7, CS14_SW7, CS15_SW7 }, // 87, LED, l07
|
||||
{ 1, CS16_SW7, CS17_SW7, CS18_SW7 }, // 88, LED, l17
|
||||
{ 1, CS1_SW8, CS2_SW8, CS3_SW8 }, // 89, ], k61
|
||||
{ 1, CS4_SW8, CS5_SW8, CS6_SW8 }, // 90, Sh_R, k91
|
||||
{ 1, CS13_SW8, CS14_SW8, CS15_SW8 }, // 91, LED, l08
|
||||
{ 1, CS16_SW8, CS17_SW8, CS18_SW8 }, // 92, LED, l18
|
||||
{ 1, CS1_SW9, CS2_SW9, CS3_SW9 }, // 93, \, ka2
|
||||
{ 1, CS4_SW9, CS5_SW9, CS6_SW9 }, // 94, Up, k35
|
||||
{ 1, CS4_SW10, CS5_SW10, CS6_SW10 }, // 95, Left, k03
|
||||
{ 1, CS1_SW11, CS2_SW11, CS3_SW11 }, // 96, Enter, ka4
|
||||
{ 1, CS4_SW11, CS5_SW11, CS6_SW11 }, // 97, Down, k73
|
||||
};
|
||||
#endif
|
||||
|
@@ -21,3 +21,5 @@ RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
ENCODER_ENABLE = yes
|
||||
RGB_MATRIX_ENABLE = yes
|
||||
RGB_MATRIX_DRIVER = AW20216
|
||||
|
@@ -49,7 +49,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
/* RGB LEDs */
|
||||
#define RGB_DI_PIN B1
|
||||
#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
#define RGB_MATRIX_KEYPRESSES
|
||||
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
#define RGB_MATRIX_LED_PROCESS_LIMIT 4
|
||||
|
@@ -0,0 +1,19 @@
|
||||
/* Copyright 2021 QMK
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#define LAYER_STATE_8BIT
|
@@ -11,7 +11,7 @@ BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
|
||||
MOUSEKEY_ENABLE = yes # Mouse keys
|
||||
EXTRAKEY_ENABLE = yes # Audio control and System control
|
||||
CONSOLE_ENABLE = no # Console for debug
|
||||
COMMAND_ENABLE = yes # Commands for debug and configuration
|
||||
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
|
||||
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||
# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||
@@ -21,4 +21,4 @@ RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow
|
||||
BLUETOOTH_ENABLE = no # Enable Bluetooth
|
||||
AUDIO_ENABLE = no # Audio output
|
||||
VELOCIKEY_ENABLE = yes
|
||||
SPLIT_KEYBOARD = yes
|
||||
SPLIT_KEYBOARD = yes
|
||||
|
@@ -60,7 +60,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
|
||||
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
|
||||
// #define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
|
||||
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
|
||||
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user