Commit | Line | Data |
---|---|---|
81d8e6ef M |
1 | /* Copyright 2019 MechMerlin |
2 | * | |
3 | * This program is free software: you can redistribute it and/or modify | |
4 | * it under the terms of the GNU General Public License as published by | |
5 | * the Free Software Foundation, either version 2 of the License, or | |
6 | * (at your option) any later version. | |
7 | * | |
8 | * This program is distributed in the hope that it will be useful, | |
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 | * GNU General Public License for more details. | |
12 | * | |
13 | * You should have received a copy of the GNU General Public License | |
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
15 | */ | |
16 | #include "rgb.h" | |
17 | ||
18 | // Optional override functions below. | |
19 | // You can leave any or all of these undefined. | |
20 | // These are only required if you want to perform custom actions. | |
21 | ||
22 | ||
23 | ||
24 | void matrix_init_kb(void) { | |
25 | // put your keyboard start-up code here | |
26 | // runs once when the firmware starts up | |
27 | setPinOutput(E6); | |
28 | matrix_init_user(); | |
29 | } | |
30 | ||
31 | void matrix_scan_kb(void) { | |
32 | // put your looping keyboard code here | |
33 | // runs every cycle (a lot) | |
34 | ||
35 | matrix_scan_user(); | |
36 | } | |
37 | ||
38 | bool process_record_kb(uint16_t keycode, keyrecord_t *record) { | |
39 | // put your per-action keyboard code here | |
40 | // runs for every action, just before processing by the firmware | |
41 | ||
42 | return process_record_user(keycode, record); | |
43 | } | |
44 | ||
45 | void led_set_kb(uint8_t usb_led) { | |
46 | // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here | |
47 | if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) { | |
48 | writePinLow(E6); | |
49 | } else { | |
50 | writePinHigh(E6); | |
51 | } | |
52 | led_set_user(usb_led); | |
53 | } | |
54 | ||
55 | const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { | |
56 | {{0|(0<<4)}, {15*0, 0}, 0}, // Esc | |
57 | {{0|(1<<4)}, {15*1, 0}, 0}, // 1 | |
58 | {{0|(2<<4)}, {15*2, 0}, 0}, // 2 | |
59 | {{0|(3<<4)}, {15*3, 0}, 0}, // 3 | |
60 | {{0|(4<<4)}, {15*4, 0}, 0}, // 4 | |
61 | {{0|(5<<4)}, {15*5, 0}, 0}, // 5 | |
62 | {{0|(6<<4)}, {15*6, 0}, 0}, // 6 | |
63 | {{0|(7<<4)}, {15*7, 0}, 0}, // 7 | |
64 | {{0|(8<<4)}, {15*8, 0}, 0}, // 8 | |
65 | {{0|(9<<4)}, {15*9, 0}, 0}, // 9 | |
66 | {{0|(10<<4)}, {15*10, 0}, 0}, // 0 | |
67 | {{0|(11<<4)}, {15*11, 0}, 0}, // - | |
68 | {{0|(12<<4)}, {15*12, 0}, 0}, // = | |
69 | {{0|(13<<4)}, {15*13.5, 0}, 1}, // Backspace | |
70 | {{0|(14<<4)}, {15*15, 0}, 1}, // Ins | |
71 | ||
72 | {{1|(0<<4)}, {15*0.5, 16}, 1}, // Tab | |
73 | {{1|(1<<4)}, {15*1.5, 16}, 0}, // Q | |
74 | {{1|(2<<4)}, {15*2.5, 16}, 0}, // W | |
75 | {{1|(3<<4)}, {15*3.5, 16}, 0}, // E | |
76 | {{1|(4<<4)}, {15*4.5, 16}, 0}, // R | |
77 | {{1|(5<<4)}, {15*5.5, 16}, 0}, // T | |
78 | {{1|(6<<4)}, {15*6.5, 16}, 0}, // Y | |
79 | {{1|(7<<4)}, {15*7.5, 16}, 0}, // U | |
80 | {{1|(8<<4)}, {15*8.5, 16}, 0}, // I | |
81 | {{1|(9<<4)}, {15*9.5, 16}, 0}, // O | |
82 | {{1|(10<<4)}, {15*10.5, 16}, 0}, // P | |
83 | {{1|(11<<4)}, {15*11.5, 16}, 0}, // [ | |
84 | {{1|(12<<4)}, {15*12.5, 16}, 0}, // ] | |
85 | {{1|(13<<4)}, {15*13.75, 16}, 1}, // | |
86 | {{1|(14<<4)}, {15*15, 16}, 1}, // Del | |
87 | ||
88 | {{2|(0<<4)}, {15*0.75, 32}, 1}, // Capslock | |
89 | {{2|(1<<4)}, {15*1.75, 32}, 0}, // A | |
90 | {{2|(2<<4)}, {15*2.75, 32}, 0}, // S | |
91 | {{2|(3<<4)}, {15*3.75, 32}, 0}, // D | |
92 | {{2|(4<<4)}, {15*4.75, 32}, 0}, // F | |
93 | {{2|(5<<4)}, {15*5.75, 32}, 0}, // G | |
94 | {{2|(6<<4)}, {15*6.75, 32}, 0}, // H | |
95 | {{2|(7<<4)}, {15*7.75, 32}, 0}, // J | |
96 | {{2|(8<<4)}, {15*8.75, 32}, 0}, // K | |
97 | {{2|(9<<4)}, {15*9.75, 32}, 0}, // L | |
98 | {{2|(10<<4)}, {15*10.75, 32}, 0}, // ; | |
99 | {{2|(11<<4)}, {15*11.75, 32}, 0}, // ' | |
100 | {{2|(13<<4)}, {15*13.25, 32}, 1}, // Enter | |
101 | {{2|(14<<4)}, {15*15, 32}, 1}, // Pgup | |
102 | ||
103 | {{3|(0<<4)}, {15*1.25, 48}, 1}, // LShift | |
104 | {{3|(2<<4)}, {15*2, 48}, 0}, // Z | |
105 | {{3|(3<<4)}, {15*3, 48}, 0}, // X | |
106 | {{3|(4<<4)}, {15*4, 48}, 0}, // C | |
107 | {{3|(5<<4)}, {15*5, 48}, 0}, // V | |
108 | {{3|(6<<4)}, {15*6, 48}, 0}, // B | |
109 | {{3|(7<<4)}, {15*7, 48}, 0}, // N | |
110 | {{3|(8<<4)}, {15*8, 48}, 0}, // M | |
111 | {{3|(9<<4)}, {15*9, 48}, 0}, // , | |
112 | {{3|(10<<4)}, {15*10, 48}, 0}, // . | |
113 | {{3|(11<<4)}, {15*11, 48}, 0}, // / | |
114 | {{3|(12<<4)}, {15*12.75, 48}, 1}, // Shift | |
115 | {{3|(13<<4)}, {15*14, 48}, 1}, // Up | |
116 | {{3|(14<<4)}, {15*15, 48}, 1}, // Pgdn | |
117 | ||
118 | {{4|(0<<4)}, {15*0.25, 64}, 1}, // Ctrl | |
119 | {{4|(1<<4)}, {15*1.5, 64}, 1}, // GUI | |
120 | {{4|(2<<4)}, {15*2.25, 64}, 1}, // Alt | |
121 | {{4|(3<<4)}, {15*6.75, 64}, 0}, // Space | |
122 | {{4|(9<<4)}, {15*9, 64}, 1}, // RAlt | |
123 | {{4|(10<<4)}, {15*10.25, 64}, 1}, // FN | |
124 | {{4|(12<<4)}, {15*13, 64}, 1}, // Left | |
125 | {{4|(13<<4)}, {15*14, 64}, 1}, // Down | |
126 | {{4|(14<<4)}, {15*15, 64}, 1}, // Right | |
127 | }; |