aboutsummaryrefslogtreecommitdiff
path: root/keyboards/hub20/hub20.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/hub20/hub20.c')
-rw-r--r--keyboards/hub20/hub20.c155
1 files changed, 154 insertions, 1 deletions
diff --git a/keyboards/hub20/hub20.c b/keyboards/hub20/hub20.c
index 306ab788d..f7171c521 100644
--- a/keyboards/hub20/hub20.c
+++ b/keyboards/hub20/hub20.c
@@ -1,4 +1,4 @@
1/* Copyright 2020 joshajohnson 1/* Copyright 2020 joshajohnson 2021 peepeetee
2 * 2 *
3 * This program is free software: you can redistribute it and/or modify 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 4 * it under the terms of the GNU General Public License as published by
@@ -16,3 +16,156 @@
16 16
17#include "hub20.h" 17#include "hub20.h"
18 18
19
20#ifdef RGB_MATRIX_ENABLE
21led_config_t g_led_config = { {
22 // Key Matrix to LED Index
23 {NO_LED,NO_LED,NO_LED,NO_LED},
24 { 7, 8, 9, 10},
25 { 11, 12, 13, 14},
26 { 15, 16, 17, 18},
27 { 19, 20, 21, 22},
28 { 23, 24, 25, 26}
29 //todo: assign leds to keys differently for the different layouts
30}, {
31 // LED Index to Physical Position
32 { 190, 50}, { 111, 50}, { 35, 50}, {38, 0}, {38, 35}, {186, 35}, {186, 0}, // UNDERGLOW
33 //todo: underglow location needs to be recalculated. The top row is above row 4, and for now they have the same y value 0
34 { 0, 0}, {75, 0}, {150, 0}, {225, 0}, // row 4
35 { 0, 16}, {75, 16}, {150, 16}, {225, 16}, // row 3
36 { 0, 32}, {75, 32}, {150, 32}, {225, 32}, // row 2
37 { 0, 48}, {75, 48}, {150, 48}, {225, 48}, // row 1
38 { 0, 64}, {75, 64}, {150, 64}, {225, 64} // row 0
39
40}, {
41 // LED Index to Flag
42 LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, LED_FLAG_UNDERGLOW, // UNDERGLOW
43 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 4
44 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 3
45 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 2
46 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, // row 1
47 LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT, LED_FLAG_KEYLIGHT // row 0
48
49} };
50#endif
51
52
53
54// #if LED_MERGE_NUMPAD_LEFT_HANDED_ENTER && LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO
55// #error lower left enter conflicts with lower left zero
56// #endif
57
58// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER && LED_MERGE_NUMPAD_LEFT_HANDED_ZERO
59// #error lower right enter conflicts with lower right zero
60// #endif
61
62// /* LAYOUT_left_handed
63
64
65// * ┌───┬───┐
66// * │01 │02 │
67// * ┌───┼───┼───┼───┐
68// * │10 │11 │12 │13 │
69// * ├───┼───┼───┼───┤
70// * │ │21 │22 │23 │
71// * │20 ├───┼───┼───┤
72// * │ │31 │32 │33 │
73// * ├───┼───┼───┼───┤
74// * │ │41 │42 │43 │
75// * │40 ├───┼───┴───┤
76// * │ │51 │ 52 │
77// * └───┴───┴───────┘
78// */
79
80// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_PLUS //key 20
81// #define LED_MERGE_NUMPAD_LEFT_HANDED_PLUS FALSE
82// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_PLUS
83
84// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_ENTER //key 40
85// #define LED_MERGE_NUMPAD_LEFT_HANDED_ENTER FALSE
86// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_ENTER
87
88// #ifndef LED_MERGE_NUMPAD_LEFT_HANDED_ZERO //key 52
89// #define LED_MERGE_NUMPAD_LEFT_HANDED_ZERO FALSE
90// #endif // LED_MERGE_NUMPAD_LEFT_HANDED_ZERO
91
92
93// /* LAYOUT_right_handed
94
95
96// * ┌───┬───┐
97// * │01 │02 │
98// * ┌───┼───┼───┼───┐
99// * │10 │11 │12 │13 │
100// * ├───┼───┼───┼───┤
101// * │20 │21 │22 │ │
102// * ├───┼───┼───┤23 │
103// * │30 │31 │32 │ │
104// * ├───┼───┼───┼───┤
105// * │40 │41 │42 │ │
106// * ├───┴───┼───┤43 │
107// * │ 50 │52 │ │
108// * └───────┴───┴───┘
109// */
110// //LOCATION OF bottom row 0 NOT TESTED, WAITING ENDORSEMENT FROM MANUFACTURER
111
112// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS // key 23
113// #define LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS FALSE
114// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS
115
116// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER // key 43
117// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER FALSE
118// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER
119
120// #ifndef LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO // key 50 (confirm with manufacturer)
121// #define LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO FALSE
122// #endif // LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO
123
124// uint8_t rgb_matrix_map_row_column_to_led_kb(uint8_t row, uint8_t column, uint8_t *led_i) {
125// // Keys here have 2 leds. Here we add the led that is not bound to the key
126// // and the default led would be added
127// // by the default code that runs after this in rgb_matrix_map_row_column_to_led
128
129// uint8_t counter = 0;
130
131// #if LED_MERGE_NUMPAD_LEFT_HANDED_PLUS //key 20, leds 7 and 11, 7 already bound
132
133// if (row == 2 && column == 0) {
134// led_i[counter] = 11;
135// counter ++;
136// }
137// #endif
138// #if LED_MERGE_NUMPAD_LEFT_HANDED_ENTER //key 40, leds 19 and 23, 23 already bound
139// if (row == 4 && column == 0) {
140// led_i[counter] = 23;
141// counter ++;
142// }
143// #endif
144// #if LED_MERGE_NUMPAD_LEFT_HANDED_ZERO //key 52, leds 25 and 26, 26 already bound
145// if (row == 5 && column == 2) {
146// led_i[counter] = 26;
147// counter ++;
148// }
149// #endif
150
151// #if LED_MERGE_NUMPAD_RIGHT_HANDED_PLUS // key 23, led 14 and 18, 14 already bound
152// if (row == 2 && column == 3) {
153// led_i[counter] = 18;
154// counter ++;
155// }
156// #endif
157// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ENTER // key 43, led 22 and 26, 22 already bound
158// if (row == 4 && column == 3) {
159// led_i[counter] = 26;
160// counter ++;
161// }
162// #endif
163// #if LED_MERGE_NUMPAD_RIGHT_HANDED_ZERO // key 50 (confirm with manufacturer)
164// // LED 23 and 24, 23(?) already bound
165// if (row == 5 && column == 0) {
166// led_i[counter] = 24;
167// counter ++;
168// }
169// #endif
170// return counter;
171// }