aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--keyboards/dp60/config.h11
-rw-r--r--keyboards/dp60/dp60.c12
-rw-r--r--keyboards/dp60/dp60.h11
-rw-r--r--keyboards/dp60/keymaps/allleds/keymap.c15
-rw-r--r--keyboards/dp60/keymaps/default/keymap.c15
-rw-r--r--keyboards/dp60/keymaps/indicator/config.h25
-rw-r--r--keyboards/dp60/keymaps/indicator/indicator.c101
-rw-r--r--keyboards/dp60/keymaps/indicator/keymap.c32
-rw-r--r--keyboards/dp60/keymaps/indicator/led_driver.c26
-rw-r--r--keyboards/dp60/keymaps/indicator/readme.md10
-rw-r--r--keyboards/dp60/keymaps/indicator/rules.mk4
-rw-r--r--keyboards/dp60/keymaps/via/keymap.c15
-rw-r--r--keyboards/dp60/matrix.c17
13 files changed, 293 insertions, 1 deletions
diff --git a/keyboards/dp60/config.h b/keyboards/dp60/config.h
index 2bedf5197..d1cbd6500 100644
--- a/keyboards/dp60/config.h
+++ b/keyboards/dp60/config.h
@@ -1,6 +1,17 @@
1/** 1/**
2 * config.h 2 * config.h
3 * 3 *
4 Copyright 2020 astro <yuleiz@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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/>.
4 */ 15 */
5#pragma once 16#pragma once
6 17
diff --git a/keyboards/dp60/dp60.c b/keyboards/dp60/dp60.c
index 3e4780246..475084b04 100644
--- a/keyboards/dp60/dp60.c
+++ b/keyboards/dp60/dp60.c
@@ -1,5 +1,17 @@
1/** 1/**
2 * dp60.c 2 * dp60.c
3 *
4 Copyright 2020 astro <yuleiz@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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/>.
3 */ 15 */
4 16
5#include "dp60.h" 17#include "dp60.h"
diff --git a/keyboards/dp60/dp60.h b/keyboards/dp60/dp60.h
index a197ac2fa..9d8bffa64 100644
--- a/keyboards/dp60/dp60.h
+++ b/keyboards/dp60/dp60.h
@@ -1,6 +1,17 @@
1/** 1/**
2 * dp60.h 2 * dp60.h
3 * 3 *
4 Copyright 2020 astro <yuleiz@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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/>.
4 */ 15 */
5#pragma once 16#pragma once
6 17
diff --git a/keyboards/dp60/keymaps/allleds/keymap.c b/keyboards/dp60/keymaps/allleds/keymap.c
index f3862c38f..66cc628d4 100644
--- a/keyboards/dp60/keymaps/allleds/keymap.c
+++ b/keyboards/dp60/keymaps/allleds/keymap.c
@@ -1,3 +1,18 @@
1/**
2 * keymap.c
3 *
4 Copyright 2020 astro <yuleiz@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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*/
1#include QMK_KEYBOARD_H 16#include QMK_KEYBOARD_H
2 17
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
diff --git a/keyboards/dp60/keymaps/default/keymap.c b/keyboards/dp60/keymaps/default/keymap.c
index f3862c38f..66cc628d4 100644
--- a/keyboards/dp60/keymaps/default/keymap.c
+++ b/keyboards/dp60/keymaps/default/keymap.c
@@ -1,3 +1,18 @@
1/**
2 * keymap.c
3 *
4 Copyright 2020 astro <yuleiz@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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*/
1#include QMK_KEYBOARD_H 16#include QMK_KEYBOARD_H
2 17
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
diff --git a/keyboards/dp60/keymaps/indicator/config.h b/keyboards/dp60/keymaps/indicator/config.h
new file mode 100644
index 000000000..0476faca9
--- /dev/null
+++ b/keyboards/dp60/keymaps/indicator/config.h
@@ -0,0 +1,25 @@
1/**
2 * config.h
3 *
4 Copyright 2020 astro <yuleiz@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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#pragma once
17
18#include "config_common.h"
19
20#define RGB_INDICATOR_NUM 8
21#undef RGBLED_NUM
22#define RGBLED_NUM (18+RGB_INDICATOR_NUM)
23
24#define RGB_INDICATOR_PIN B1
25#define RGBLIGHT_LAYERS
diff --git a/keyboards/dp60/keymaps/indicator/indicator.c b/keyboards/dp60/keymaps/indicator/indicator.c
new file mode 100644
index 000000000..a3a826e8a
--- /dev/null
+++ b/keyboards/dp60/keymaps/indicator/indicator.c
@@ -0,0 +1,101 @@
1/**
2 * indicator.c
3 *
4 Copyright 2020 astro <yuleiz@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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
17#include "dp60.h"
18
19#include "rgblight_list.h"
20#include "rgblight.h"
21
22
23// caps led
24const rgblight_segment_t PROGMEM dp60_capslock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
25 {18, 1, HSV_RED}
26);
27
28// scroll led
29const rgblight_segment_t PROGMEM dp60_scrolllock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
30 {19, 1, HSV_GREEN}
31);
32
33// num led
34const rgblight_segment_t PROGMEM dp60_numlock_layer[] = RGBLIGHT_LAYER_SEGMENTS(
35 {20, 1, HSV_BLUE}
36);
37
38// light 21 to 26 for layer 1-5
39const rgblight_segment_t PROGMEM dp60_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS(
40 {21, 1, HSV_PURPLE}
41);
42const rgblight_segment_t PROGMEM dp60_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS(
43 {22, 1, HSV_CYAN}
44);
45const rgblight_segment_t PROGMEM dp60_layer3_layer[] = RGBLIGHT_LAYER_SEGMENTS(
46 {23, 1, HSV_YELLOW}
47);
48const rgblight_segment_t PROGMEM dp60_layer4_layer[] = RGBLIGHT_LAYER_SEGMENTS(
49 {24, 1, HSV_PINK}
50);
51const rgblight_segment_t PROGMEM dp60_layer5_layer[] = RGBLIGHT_LAYER_SEGMENTS(
52 {25, 1, HSV_ORANGE}
53);
54
55// rgb light layers
56const rgblight_segment_t* const PROGMEM dp60_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
57 dp60_capslock_layer,
58 dp60_scrolllock_layer,
59 dp60_numlock_layer,
60 dp60_layer1_layer,
61 dp60_layer2_layer,
62 dp60_layer3_layer,
63 dp60_layer4_layer,
64 dp60_layer5_layer
65);
66
67void keyboard_post_init_user(void) {
68 // Enable the LED layers
69 rgblight_layers = dp60_rgb_layers;
70}
71
72extern rgblight_config_t rgblight_config;
73extern void rgblight_layers_write(void);
74extern void indicator_write(LED_TYPE *start_led, uint8_t num_leds);
75
76void rgblight_call_driver(LED_TYPE *start_led, uint8_t num_leds)
77{
78 ws2812_setleds(start_led, RGBLED_NUM-RGB_INDICATOR_NUM);
79
80 indicator_write(start_led + (RGBLED_NUM - RGB_INDICATOR_NUM), RGB_INDICATOR_NUM);
81}
82
83bool led_update_kb(led_t led_state) {
84 bool res = led_update_user(led_state);
85 if (res) {
86 rgblight_set_layer_state(0, led_state.caps_lock);
87 rgblight_set_layer_state(1, led_state.scroll_lock);
88 rgblight_set_layer_state(2, led_state.num_lock);
89 }
90 return res;
91}
92
93layer_state_t layer_state_set_kb(layer_state_t state) {
94 state = layer_state_set_user(state);
95 rgblight_set_layer_state(3, layer_state_cmp(state, 1));
96 rgblight_set_layer_state(4, layer_state_cmp(state, 2));
97 rgblight_set_layer_state(5, layer_state_cmp(state, 3));
98 rgblight_set_layer_state(6, layer_state_cmp(state, 4));
99 rgblight_set_layer_state(7, layer_state_cmp(state, 5));
100 return state;
101}
diff --git a/keyboards/dp60/keymaps/indicator/keymap.c b/keyboards/dp60/keymaps/indicator/keymap.c
new file mode 100644
index 000000000..170d4eb95
--- /dev/null
+++ b/keyboards/dp60/keymaps/indicator/keymap.c
@@ -0,0 +1,32 @@
1/**
2 * keymap.c
3 *
4 Copyright 2020 astro <yuleiz@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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 QMK_KEYBOARD_H
17
18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
19 [0] = LAYOUT_60_hhkb(
20 KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,KC_EQL, KC_BSLS, KC_GRV,
21 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,KC_RBRC,KC_BSPC,
22 KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_ENT,
23 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, MO(1),
24 KC_LGUI, KC_LALT, LT(1,KC_SPC), KC_RALT,KC_RGUI ),
25
26 [1] = LAYOUT_60_hhkb(
27 _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,_______,KC_PSCR,
28 RESET, RGB_TOG,RGB_MOD,_______,KC_F13,KC_F14,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,
29 KC_CAPS, _______,_______,_______,_______,_______,KC_LEFT,KC_DOWN, KC_UP,KC_RIGHT,KC_HOME,KC_END,_______,
30 _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,
31 _______,_______, _______, _______,_______),
32};
diff --git a/keyboards/dp60/keymaps/indicator/led_driver.c b/keyboards/dp60/keymaps/indicator/led_driver.c
new file mode 100644
index 000000000..2a1ac5a38
--- /dev/null
+++ b/keyboards/dp60/keymaps/indicator/led_driver.c
@@ -0,0 +1,26 @@
1/**
2 * led_driver.c
3 *
4 Copyright 2020 astro <yuleiz@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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
17#undef RGB_DI_PIN
18#define RGB_DI_PIN RGB_INDICATOR_PIN
19#define ws2812_setleds indicator_setleds
20#define ws2812_setleds_pin indicator_setleds_pin
21#include "ws2812.c"
22
23void indicator_write(LED_TYPE *start_led, uint8_t num_leds)
24{
25 indicator_setleds(start_led, num_leds);
26}
diff --git a/keyboards/dp60/keymaps/indicator/readme.md b/keyboards/dp60/keymaps/indicator/readme.md
new file mode 100644
index 000000000..bb3fbbbe0
--- /dev/null
+++ b/keyboards/dp60/keymaps/indicator/readme.md
@@ -0,0 +1,10 @@
1
2Indicator RGB leds support for the open source viper/eagle fr4 [plate](https://github.com/yulei/viper_plate.git)
3
4Three wires need to be soldered:
5
6B1 pin (SCLK at the board) to the plate's D pin
7
8VCC to plate's V
9
10GND to plate's G
diff --git a/keyboards/dp60/keymaps/indicator/rules.mk b/keyboards/dp60/keymaps/indicator/rules.mk
new file mode 100644
index 000000000..a8891659f
--- /dev/null
+++ b/keyboards/dp60/keymaps/indicator/rules.mk
@@ -0,0 +1,4 @@
1
2RGBLIGHT_ENABLE = yes # Use RGB underglow light
3
4SRC += indicator.c led_driver.c
diff --git a/keyboards/dp60/keymaps/via/keymap.c b/keyboards/dp60/keymaps/via/keymap.c
index 1742f17b5..5f2b00727 100644
--- a/keyboards/dp60/keymaps/via/keymap.c
+++ b/keyboards/dp60/keymaps/via/keymap.c
@@ -1,3 +1,18 @@
1/**
2 * keymap.c
3 *
4 Copyright 2020 astro <yuleiz@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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*/
1#include QMK_KEYBOARD_H 16#include QMK_KEYBOARD_H
2 17
3const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 18const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
diff --git a/keyboards/dp60/matrix.c b/keyboards/dp60/matrix.c
index 3aa5925fe..a9974757d 100644
--- a/keyboards/dp60/matrix.c
+++ b/keyboards/dp60/matrix.c
@@ -1,3 +1,18 @@
1/**
2 * matrix.c
3 *
4 Copyright 2020 astro <yuleiz@gmail.com>
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
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*/
1#include "quantum.h" 16#include "quantum.h"
2 17
3static uint8_t debouncing = DEBOUNCE; 18static uint8_t debouncing = DEBOUNCE;
@@ -242,4 +257,4 @@ static void select_col(uint8_t col) {
242 writePinHigh(D5); 257 writePinHigh(D5);
243 break; 258 break;
244 } 259 }
245} \ No newline at end of file 260}