Skip to content

Commit faf79f0

Browse files
committed
docs: add custom mode description
1 parent 730fc99 commit faf79f0

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

docs/custom-mode.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Backlight custom effect
2+
3+
In addition to the preset effects, the keyboard is able to display a custom one. It is static (has no animation) and allows you to configure separate colors for each key.
4+
5+
## Read
6+
7+
To read a custom effect, you have to send a request:
8+
9+
```sh
10+
0x05 0x89 0xBC 0x00 0x00 0x00
11+
```
12+
13+
The response will be a sequence of 1050 bytes. The colors for the keys are encoded in these bytes.
14+
15+
The first will be the header, which is always `0x89`. Followed by 6 zeros.
16+
17+
Then comes the effect colors. Keys positions are sampled from byte 7. You can see an example of positions in [template_backlight.go](../layout/template_backlight.go).
18+
19+
Colors are written in a rather strange way: first comes red, after 126 bytes comes green and after another 126 bytes comes blue.
20+
That is, if you have white color written for the first and second button, then 255 will be written to the bytes under the indexes:
21+
22+
```sh
23+
# First
24+
7, 133, 259
25+
# Second
26+
8, 134, 260
27+
```
28+
29+
## Write
30+
31+
To record the effect you need to send a sequence of bytes in the same format but with a different header. Cut off the first 7 bytes and add the command:
32+
33+
```sh
34+
0x06 0x09 0xBC 0x00 0x40 0x00 0x00 0x00 # command
35+
0xFF 0xFF 0x00 0x00 0x00 0x00 0x00 0x00 # payload
36+
...
37+
```
38+
39+
## Pages
40+
41+
It seems that the keyboard can store several pages of custom effects, but I haven't figured out how to activate them yet. There are the following commands to work with them:
42+
43+
```sh
44+
# Read
45+
0x05 0x89 0xC0 0x00 0x00 0x00
46+
# Write
47+
0x06 0x09 0xC0 0x00 0x40 0x00 0x00 0x00
48+
```

0 commit comments

Comments
 (0)