[Keyboard] add new keyboard hnah40rgb (#7083)
authorvuhopkep <boy9x0@gmail.com>
Wed, 23 Oct 2019 23:38:44 +0000 (06:38 +0700)
committernoroadsleft <18669334+noroadsleft@users.noreply.github.com>
Wed, 23 Oct 2019 23:38:44 +0000 (16:38 -0700)
* add new keyboard hnah40rgb

* update

* Update hnah40rgb.c

* update

12 files changed:
keyboards/handwired/hnah40rgb/config.h [new file with mode: 0644]
keyboards/handwired/hnah40rgb/hnah40rgb.c [new file with mode: 0644]
keyboards/handwired/hnah40rgb/hnah40rgb.h [new file with mode: 0644]
keyboards/handwired/hnah40rgb/info.json [new file with mode: 0644]
keyboards/handwired/hnah40rgb/keymaps/ansi/config.h [new file with mode: 0644]
keyboards/handwired/hnah40rgb/keymaps/ansi/keymap.c [new file with mode: 0644]
keyboards/handwired/hnah40rgb/keymaps/ansi/readme.md [new file with mode: 0644]
keyboards/handwired/hnah40rgb/keymaps/default/config.h [new file with mode: 0644]
keyboards/handwired/hnah40rgb/keymaps/default/keymap.c [new file with mode: 0644]
keyboards/handwired/hnah40rgb/keymaps/default/readme.md [new file with mode: 0644]
keyboards/handwired/hnah40rgb/readme.md [new file with mode: 0644]
keyboards/handwired/hnah40rgb/rules.mk [new file with mode: 0644]

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