aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvuhopkep <boy9x0@gmail.com>2019-10-24 06:38:44 +0700
committernoroadsleft <18669334+noroadsleft@users.noreply.github.com>2019-10-23 16:38:44 -0700
commit23f89ff7cf4bce42d46e99183a977c5c74384c57 (patch)
tree824a6259ef2a3958afd84b0d5f1186b12445751b
parente264f0151da0025dbb53dfc5a70bce13105a04d8 (diff)
downloadqmk_firmware-23f89ff7cf4bce42d46e99183a977c5c74384c57.tar.gz
qmk_firmware-23f89ff7cf4bce42d46e99183a977c5c74384c57.zip
[Keyboard] add new keyboard hnah40rgb (#7083)
* add new keyboard hnah40rgb * update * Update hnah40rgb.c * update
-rw-r--r--keyboards/handwired/hnah40rgb/config.h68
-rw-r--r--keyboards/handwired/hnah40rgb/hnah40rgb.c47
-rw-r--r--keyboards/handwired/hnah40rgb/hnah40rgb.h44
-rw-r--r--keyboards/handwired/hnah40rgb/info.json100
-rw-r--r--keyboards/handwired/hnah40rgb/keymaps/ansi/config.h18
-rw-r--r--keyboards/handwired/hnah40rgb/keymaps/ansi/keymap.c67
-rw-r--r--keyboards/handwired/hnah40rgb/keymaps/ansi/readme.md1
-rw-r--r--keyboards/handwired/hnah40rgb/keymaps/default/config.h17
-rw-r--r--keyboards/handwired/hnah40rgb/keymaps/default/keymap.c67
-rw-r--r--keyboards/handwired/hnah40rgb/keymaps/default/readme.md1
-rw-r--r--keyboards/handwired/hnah40rgb/readme.md14
-rw-r--r--keyboards/handwired/hnah40rgb/rules.mk33
12 files changed, 477 insertions, 0 deletions
diff --git a/keyboards/handwired/hnah40rgb/config.h b/keyboards/handwired/hnah40rgb/config.h
new file mode 100644
index 000000000..7741f3965
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/config.h
@@ -0,0 +1,68 @@
1/*
2Copyright 2019 HnahKB
3
4This program is free software: you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation, either version 2 of the License, or
7(at your option) any later version.
8
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/
17
18#pragma once
19
20#include "config_common.h"
21
22/* USB Device descriptor parameter */
23#define VENDOR_ID 0xFEED
24#define PRODUCT_ID 0x0000
25#define DEVICE_VER 0x0001
26#define MANUFACTURER HnahKB
27#define PRODUCT Hnah40V2
28#define DESCRIPTION A custom rgb keyboard
29
30/* key matrix size */
31#define MATRIX_ROWS 4
32#define MATRIX_COLS 11
33
34/*
35 * Keyboard Matrix Assignments
36 *
37 * Change this to how you wired your keyboard
38 * COLS: AVR pins used for columns, left to right
39 * ROWS: AVR pins used for rows, top to bottom
40 * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
41 * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
42 *
43 */
44#define MATRIX_ROW_PINS \
45 { B7, D7, F1, F0 }
46#define MATRIX_COL_PINS \
47 { D5, D6, D3, D2, B6, C6, C7, F7, F6, F5, F4 }
48
49/* COL2ROW, ROW2COL*/
50#define DIODE_DIRECTION COL2ROW
51
52
53// #define BACKLIGHT_PIN B7
54// #define BACKLIGHT_BREATHING
55// #define BACKLIGHT_LEVELS 3
56
57#ifdef RGB_MATRIX_ENABLE
58#define RGB_DI_PIN E2
59#define DRIVER_LED_TOTAL 50
60#define RGB_MATRIX_KEYPRESSES // reacts to keypresses
61#define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
62#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
63#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
64#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended
65#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
66#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
67#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_PINWHEEL // Sets the default mode, if none has been set
68#endif
diff --git a/keyboards/handwired/hnah40rgb/hnah40rgb.c b/keyboards/handwired/hnah40rgb/hnah40rgb.c
new file mode 100644
index 000000000..2bf1373d9
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/hnah40rgb.c
@@ -0,0 +1,47 @@
1#include "hnah40rgb.h"
2#ifdef RGB_MATRIX_ENABLE
3#if defined (ansi)
4led_config_t g_led_config = { {
5 //Key Matrix to LED Index
6 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
7 {22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12 },
8 {23, 24, 25, 26, 27, 28, 29, 30, 31, NO_LED, 34},
9 {43, 42, 41, NO_LED, NO_LED, NO_LED, 38, NO_LED, 36, 35, 11}
10}, {
11 //LED Index to Physical Positon
12 { 0, 0}, { 20, 0}, { 40, 0 }, { 61, 0 }, { 81, 0}, { 101, 0}, { 122, 0}, { 142, 0}, { 162, 0}, { 183, 0}, { 224, 0}, { 224, 0},
13 {224, 21}, {183, 21}, {162,21 }, {142, 21}, {122,21}, { 101,21}, { 81 ,21}, { 61 ,21}, { 40 ,21}, { 20 ,21}, { 0 ,21},
14 { 0, 42}, { 20, 42}, { 40,42 }, { 61, 42}, { 81,42}, { 101,42}, { 122,42}, { 142,42}, { 162,42}, { 183,42}, { 224,42},
15 {224, 64}, {224, 64}, {181,64 }, {162, 64}, {122,64}, {101,64}, { 61,64}, { 40,64}, { 20,64}, { 0,64},
16 { 0,64}, { 0,0}, { 224,10}, { 224,18}, { 224,30}, { 224,47},
17}, {
18 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
19 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
20 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 1,
21 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
22 1, 1, 1, 1, 1, 1,
23} };
24
25#else
26led_config_t g_led_config = { {
27 //Key Matrix to LED Index
28 {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10},
29 {22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12 },
30 {23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 34},
31 {43, 42, 41, NO_LED, 40, 39, 38, 37, 36, 35, 11}
32}, {
33 //LED Index to Physical Positon
34 { 0, 0}, { 20, 0}, { 40, 0 }, { 61, 0 }, { 81, 0}, { 101, 0}, { 122, 0}, { 142, 0}, { 162, 0}, { 183, 0}, { 224, 0}, { 224, 0},
35 {224, 21}, {183, 21}, {162,21 }, {142, 21}, {122,21}, { 101,21}, { 81 ,21}, { 61 ,21}, { 40 ,21}, { 20 ,21}, { 0 ,21},
36 { 0, 42}, { 20, 42}, { 40,42 }, { 61, 42}, { 81,42}, { 101,42}, { 122,42}, { 142,42}, { 162,42}, { 183,42}, { 224,42},
37 {224, 64}, {224, 64}, {181,64 }, {162, 64}, {122,64}, {101,64}, { 61,64}, { 40,64}, { 20,64}, { 0,64},
38 { 0,64}, { 0,0}, { 224,10}, { 224,18}, { 224,30}, { 224,47},
39}, {
40 1, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
41 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4,
42 1, 1, 4, 4, 4, 4, 4, 4, 4, 4, 4,
43 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
44 1, 1, 1, 1, 1, 1,
45} };
46#endif
47#endif \ No newline at end of file
diff --git a/keyboards/handwired/hnah40rgb/hnah40rgb.h b/keyboards/handwired/hnah40rgb/hnah40rgb.h
new file mode 100644
index 000000000..182c68603
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/hnah40rgb.h
@@ -0,0 +1,44 @@
1/* Copyright 2019 HnahKB
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#pragma once
17
18#include "quantum.h"
19
20#define LAYOUT_all( \
21k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k41, \
22k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, \
23k23, k24, k25, k26, k27, k28, k29, k30, k31, k32, k33,\
24k34, k35, k36, k37, k38, k39, k40 \
25) \
26{ \
27 {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10}, \
28 {k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21}, \
29 {k22, k23, k24, k25, k26, k27, k28, k29, k30, k31, k32}, \
30 {k33, k34, k35, KC_NO,k36, KC_NO, k37, k38, k39, k40, k41}, \
31}
32
33#define LAYOUT_ansi( \
34k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k41, \
35k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, \
36k22, k23, k24, k25, k26, k27, k28, k29, k30, k32,\
37k33, k34, k35, k38, k39, k40 \
38) \
39{ \
40 {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10}, \
41 {k11, k12, k13, k14, k15, k16, k17, k18, k19, k20, k21}, \
42 {k22, k23, k24, k25, k26, k27, k28, k29, k30, KC_NO, k32}, \
43 {k33, k34, k35, KC_NO, KC_NO, KC_NO, k38, KC_NO, k39, k40, k41}, \
44}
diff --git a/keyboards/handwired/hnah40rgb/info.json b/keyboards/handwired/hnah40rgb/info.json
new file mode 100644
index 000000000..dd1b42325
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/info.json
@@ -0,0 +1,100 @@
1{
2 "keyboard_name": "Hnah40",
3 "url": "",
4 "maintainer": "HnahKB",
5 "width": 12,
6 "height": 4,
7 "layouts": {
8 "LAYOUT_all": {
9 "key_count": 42,
10 "layout": [
11 {"label":"Esc", "x":0, "y":0},
12 {"label":"Q", "x":1, "y":0},
13 {"label":"W", "x":2, "y":0},
14 {"label":"E", "x":3, "y":0},
15 {"label":"R", "x":4, "y":0},
16 {"label":"T", "x":5, "y":0},
17 {"label":"Y", "x":6, "y":0},
18 {"label":"U", "x":7, "y":0},
19 {"label":"I", "x":8, "y":0},
20 {"label":"O", "x":9, "y":0},
21 {"label":"P", "x":10, "y":0},
22 {"label":"BSPC", "x":11, "y":0},
23 {"label":"Caps Lock", "x":0, "y":1, "w":1.5},
24 {"label":"A", "x":1.5, "y":1},
25 {"label":"S", "x":2.5, "y":1},
26 {"label":"D", "x":3.5, "y":1},
27 {"label":"F", "x":4.5, "y":1},
28 {"label":"G", "x":5.5, "y":1},
29 {"label":"H", "x":6.5, "y":1},
30 {"label":"J", "x":7.5, "y":1},
31 {"label":"K", "x":8.5, "y":1},
32 {"label":"L", "x":9.5, "y":1},
33 {"label":"Enter", "x":10.5, "y":1, "w":1.5},
34 {"label":"Shift", "x":0, "y":2, "w":1.75},
35 {"label":"Z", "x":1.75, "y":2},
36 {"label":"X", "x":2.75, "y":2},
37 {"label":"C", "x":3.75, "y":2},
38 {"label":"V", "x":4.75, "y":2},
39 {"label":"B", "x":5.75, "y":2},
40 {"label":"N", "x":6.75, "y":2},
41 {"label":"M", "x":7.75, "y":2},
42 {"label":",", "x":8.75, "y":2},
43 {"label":".", "x":9.75, "y":2},
44 {"label":"Shift", "x":10.75, "y":2, "w":1.25},
45 {"label":"Ctrl", "x":0, "y":3, "w":1.25},
46 {"label":"Win", "x":1.25, "y":3, "w":1},
47 {"label":"Alt", "x":2.25, "y":3, "w":1.25},
48 {"label":"Space", "x":3.5, "y":3, "w":2.25},
49 {"label":"Space", "x":5.75, "y":3, "w":2.75},
50 {"label":"App", "x":8.5, "y":3, "w":1.25},
51 {"label":"Fn", "x":9.75, "y":3, "w":1},
52 {"label":"Ctrl", "x":10.75, "y":3, "w":1.25}
53 ]
54 },
55 "LAYOUT_ansi": {
56 "key_count": 39,
57 "layout": [
58 {"label":"Esc", "x":0, "y":0},
59 {"label":"Q", "x":1, "y":0},
60 {"label":"W", "x":2, "y":0},
61 {"label":"E", "x":3, "y":0},
62 {"label":"R", "x":4, "y":0},
63 {"label":"T", "x":5, "y":0},
64 {"label":"Y", "x":6, "y":0},
65 {"label":"U", "x":7, "y":0},
66 {"label":"I", "x":8, "y":0},
67 {"label":"O", "x":9, "y":0},
68 {"label":"P", "x":10, "y":0},
69 {"label":"BSPC", "x":11, "y":0},
70 {"label":"Caps Lock", "x":0, "y":1, "w":1.5},
71 {"label":"A", "x":1.5, "y":1},
72 {"label":"S", "x":2.5, "y":1},
73 {"label":"D", "x":3.5, "y":1},
74 {"label":"F", "x":4.5, "y":1},
75 {"label":"G", "x":5.5, "y":1},
76 {"label":"H", "x":6.5, "y":1},
77 {"label":"J", "x":7.5, "y":1},
78 {"label":"K", "x":8.5, "y":1},
79 {"label":"L", "x":9.5, "y":1},
80 {"label":"Enter", "x":10.5, "y":1, "w":1.5},
81 {"label":"Shift", "x":0, "y":2, "w":1.75},
82 {"label":"Z", "x":1.75, "y":2},
83 {"label":"X", "x":2.75, "y":2},
84 {"label":"C", "x":3.75, "y":2},
85 {"label":"V", "x":4.75, "y":2},
86 {"label":"B", "x":5.75, "y":2},
87 {"label":"N", "x":6.75, "y":2},
88 {"label":"M", "x":7.75, "y":2},
89 {"label":",", "x":8.75, "y":2},
90 {"label":"Shift", "x":9.75, "y":2, "w":2.25},
91 {"label":"Ctrl", "x":0, "y":3, "w":1.25},
92 {"label":"Win", "x":1.25, "y":3},
93 {"label":"Alt", "x":2.25, "y":3, "w":1.25},
94 {"label":"Space", "x":3.5, "y":3, "w":6},
95 {"label":"App", "x":9.5, "y":3, "w":1.25},
96 {"label":"Ctrl", "x":10.75, "y":3, "w":1.25}
97 ]
98 }
99 }
100}
diff --git a/keyboards/handwired/hnah40rgb/keymaps/ansi/config.h b/keyboards/handwired/hnah40rgb/keymaps/ansi/config.h
new file mode 100644
index 000000000..66cd76a90
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/keymaps/ansi/config.h
@@ -0,0 +1,18 @@
1/* Copyright 2019 HnahKB
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
17#pragma once
18#define ansi \ No newline at end of file
diff --git a/keyboards/handwired/hnah40rgb/keymaps/ansi/keymap.c b/keyboards/handwired/hnah40rgb/keymaps/ansi/keymap.c
new file mode 100644
index 000000000..320f7d93e
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/keymaps/ansi/keymap.c
@@ -0,0 +1,67 @@
1/* Copyright 2019 HnahKB
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 QMK_KEYBOARD_H
17
18enum hnah_layers{
19 _BASE,
20 _L1,
21 _L2
22};
23
24enum hnah_keycodes{
25 BASE,
26 L1,
27 L2
28};
29
30#define L1 MO(_L1)
31#define L2 MO(_L2)
32
33// Defines the keycodes used by our macros in process_record_user
34
35const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
36 [_BASE] = LAYOUT_ansi(/* Base */
37 KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
38 LT(_L2,KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT,
39 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_RSFT,
40 KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, L1, KC_RCTL ),
41 [_L1] = LAYOUT_ansi(/* Base */
42 RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
43 KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_SCLN, KC_QUOT,
44 KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS,
45 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
46 [_L2] = LAYOUT_ansi(/* Base */
47 RGB_TOG, RGB_RMOD, KC_UP, RGB_MOD, RGB_HUI, RGB_VAI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
48 KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, RGB_HUD, RGB_VAD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS,
49 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
50 KC_TRNS, KC_TRNS, KC_TRNS, KC_TAB, KC_TRNS, KC_TRNS ),
51};
52
53void rgb_matrix_indicators_user(void)
54{
55 if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK))
56 {
57 rgb_matrix_set_color(22, 255, 255, 255);
58 }
59 if (IS_LAYER_ON(_L1))
60 {
61 rgb_matrix_set_color(46, 255, 255, 255);
62 }
63 if (IS_LAYER_ON(_L2))
64 {
65 rgb_matrix_set_color(45, 255, 255, 255);
66 }
67} \ No newline at end of file
diff --git a/keyboards/handwired/hnah40rgb/keymaps/ansi/readme.md b/keyboards/handwired/hnah40rgb/keymaps/ansi/readme.md
new file mode 100644
index 000000000..825a57ab0
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/keymaps/ansi/readme.md
@@ -0,0 +1 @@
# The ansi keymap for hnah40rgb \ No newline at end of file
diff --git a/keyboards/handwired/hnah40rgb/keymaps/default/config.h b/keyboards/handwired/hnah40rgb/keymaps/default/config.h
new file mode 100644
index 000000000..aa9325a59
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/keymaps/default/config.h
@@ -0,0 +1,17 @@
1/* Copyright 2019 HnahKB
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
17#pragma once
diff --git a/keyboards/handwired/hnah40rgb/keymaps/default/keymap.c b/keyboards/handwired/hnah40rgb/keymaps/default/keymap.c
new file mode 100644
index 000000000..2906f8bdb
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/keymaps/default/keymap.c
@@ -0,0 +1,67 @@
1/* Copyright 2019 HnahKB
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 QMK_KEYBOARD_H
17
18enum hnah_layers{
19 _BASE,
20 _L1,
21 _L2
22};
23
24enum hnah_keycodes{
25 BASE,
26 L1,
27 L2
28};
29
30#define L1 MO(_L1)
31#define L2 MO(_L2)
32
33// Defines the keycodes used by our macros in process_record_user
34
35const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
36 [_BASE] = LAYOUT_all(/* Base */
37 KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
38 LT(_L2,KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT,
39 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT,
40 KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_RALT, L1, KC_RCTL ),
41 [_L1] = LAYOUT_all(/* Base */
42 RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
43 KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_SCLN, KC_QUOT,
44 KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_SLSH, KC_TRNS,
45 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
46 [_L2] = LAYOUT_all(/* Base */
47 RGB_TOG, RGB_RMOD, KC_UP, RGB_MOD, RGB_HUI, RGB_VAI, RGB_SAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
48 KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, RGB_HUD, RGB_VAD, RGB_SAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_BSLS,
49 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
50 KC_TRNS, KC_TRNS, KC_TRNS, KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
51};
52
53void rgb_matrix_indicators_user(void)
54{
55 if (IS_HOST_LED_ON(USB_LED_CAPS_LOCK))
56 {
57 rgb_matrix_set_color(22, 255, 255, 255);
58 }
59 if (IS_LAYER_ON(_L1))
60 {
61 rgb_matrix_set_color(46, 255, 255, 255);
62 }
63 if (IS_LAYER_ON(_L2))
64 {
65 rgb_matrix_set_color(45, 255, 255, 255);
66 }
67} \ No newline at end of file
diff --git a/keyboards/handwired/hnah40rgb/keymaps/default/readme.md b/keyboards/handwired/hnah40rgb/keymaps/default/readme.md
new file mode 100644
index 000000000..866686644
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/keymaps/default/readme.md
@@ -0,0 +1 @@
# The default keymap for hnah40rgb \ No newline at end of file
diff --git a/keyboards/handwired/hnah40rgb/readme.md b/keyboards/handwired/hnah40rgb/readme.md
new file mode 100644
index 000000000..80876f8da
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/readme.md
@@ -0,0 +1,14 @@
1# hnah40rgb
2
3![hnah40rgb](https://i.imgur.com/wmqx6oL.jpg)
4
5A 40 percent keyboard Hnah40v2 rgb version
6
7Keyboard Maintainer: [HnahKB](https://github.com/vuhopkep)
8Hardware Availability: Hnah40V2 RGB
9
10Make example for this keyboard (after setting up your build environment):
11
12 make handwired/hnah40rgb:default
13
14See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/handwired/hnah40rgb/rules.mk b/keyboards/handwired/hnah40rgb/rules.mk
new file mode 100644
index 000000000..5ad9f40c3
--- /dev/null
+++ b/keyboards/handwired/hnah40rgb/rules.mk
@@ -0,0 +1,33 @@
1# MCU name
2MCU = atmega32u4
3
4# Bootloader selection
5# Teensy halfkay
6# Pro Micro caterina
7# Atmel DFU atmel-dfu
8# LUFA DFU lufa-dfu
9# QMK DFU qmk-dfu
10# atmega32A bootloadHID
11BOOTLOADER = atmel-dfu
12
13# Build Options
14# change yes to no to disable
15#
16BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration
17MOUSEKEY_ENABLE = no # Mouse keys
18EXTRAKEY_ENABLE = no # Audio control and System control
19CONSOLE_ENABLE = no # Console for debug
20COMMAND_ENABLE = no # Commands for debug and configuration
21# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
22SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
23# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
24NKRO_ENABLE = no # USB Nkey Rollover
25BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
26RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
27MIDI_ENABLE = no # MIDI support
28UNICODE_ENABLE = no # Unicode
29BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
30AUDIO_ENABLE = no # Audio output on port C6
31FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
32HD44780_ENABLE = no # Enable support for HD44780 based LCDs
33RGB_MATRIX_ENABLE = WS2812 \ No newline at end of file