|
|
před 8 roky | |
|---|---|---|
| .. | ||
| Makefile | před 8 roky | |
| config.h | před 8 roky | |
| keymap.c | před 8 roky | |
| readme.md | před 8 roky | |
The Infinity60 pcb uses the IS31FL3731C matrix LED driver from ISSI datasheet. The IS31 has the ability to control two led matrices (A & B), each matrix controlling 9 pins, each pin controlling 8 leds. The Infinity only utilizes matrix A.
Infinity60 LED MAP: digits mean "row" and "col", i.e. 45 means C4-5 in the IS31 datasheet, matrix A
11 12 13 14 15 16 17 18 21 22 23 24 25 26 27*
28 31 32 33 34 35 36 37 38 41 42 43 44 45
46 47 48 51 52 53 54 55 56 57 58 61 62
63 64 65 66 67 68 71 72 73 74 75 76 77*
78 81 82 83 84 85 86 87
*Unused in Alphabet Layout
The IS31 includes 8 pages (or frames) 0-7 and each page consists of 0xB4 (144) bytes
led_controller.c sets up ability to write led layers at startup or control leds on demand as part of fn_actions. By default led_controller.c assumes page 0 will be used for full on/off and page 7 for controlling individual leds. The remaining 6 pages (1-6) are free to preset led maps at init or on demand. Communication with the IS31 is primarily done through the led_mailbox using chMBPost described further below under "Sending messages in Keymap.c"
One function is available to directly control leds:
write_led_page(page#, array of leds by address, # of leds in array)
This function saves a full page using a supplied array of led locations such as:
uint8_t led_numpad[16] = {
18,21,22,23,
37,38,41,42,
55,56,57,58,
72,73,74,75
}
write_led_page(5, led_numpad, 16);
Remaining led control is done through the led mailbox using these message types.
set_leds function to check state of numlock or capslock. If all leds are on (e.i. TOGGLE_ALL) then this sets numlock to blink instead (this is still a little buggy if toggling on/off quickly).Sending an action to the led mailbox is done using chMBPost with the following form.
chMBPost(&led_mailbox, message, timeout);
An example:
msg=(ON_LED << 8) | 42;chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);Another:
msg=(BLINK_TOGGLE_LED << 8) | 46;
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);
Finally, SET_FULL_ROW requires an extra byte with row information in the message so sending this message looks like:
msg=(row<<16) | (SET_FULL_ROW << 8) | (led_pin_byte);
chMBPost(&led_mailbox, msg, TIME_IMMEDIATE);