dc2dfe2a6c8fa14839959680cae1d063b2f9546e

Author
N2-Sumikko <54104281+N2-Sumikko@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

[Keyboard] Add halfcliff keyboard (#13515)

Co-authored-by: Drashna Jaelre <drashna@live.com>
Co-authored-by: Ryan <fauxpark@gmail.com>

Diff

This diff is truncated to protect this page.

  1diff --git a/keyboards/halfcliff/config.h b/keyboards/halfcliff/config.h
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..287fd2f4ac7bd72f68b9123e6c79f6a86c37283d
  4--- /dev/null
  5+++ b/keyboards/halfcliff/config.h
  6@@ -0,0 +1,69 @@
  7+/*
  8+Copyright 2021 n2
  9+
 10+This program is free software: you can redistribute it and/or modify
 11+it under the terms of the GNU General Public License as published by
 12+the Free Software Foundation, either version 2 of the License, or
 13+(at your option) any later version.
 14+
 15+This program is distributed in the hope that it will be useful,
 16+but WITHOUT ANY WARRANTY; without even the implied warranty of
 17+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 18+GNU General Public License for more details.
 19+
 20+You should have received a copy of the GNU General Public License
 21+along with this program.  If not, see <http://www.gnu.org/licenses/>.
 22+*/
 23+
 24+#pragma once
 25+
 26+#include "config_common.h"
 27+
 28+/* USB Device descriptor parameter */
 29+#define VENDOR_ID    0x0335
 30+#define PRODUCT_ID   0x0021
 31+#define DEVICE_VER   0x0001
 32+#define MANUFACTURER n2
 33+#define PRODUCT      halfcliff
 34+
 35+/* key matrix size */
 36+#define MATRIX_ROWS 20
 37+#define MATRIX_COLS 5
 38+
 39+#define MATRIX_ROW_PINS { F5, F6, F7, D7, B5, F5, F6, F7, D7, B5 }
 40+#define MATRIX_COL_PINS { B4, E6, C6, B6, B2 }
 41+#define UNUSED_PINS
 42+
 43+//#define NUMBER_OF_ENCODERS 1
 44+#define ENCODERS_PAD_A { D4 }
 45+#define ENCODERS_PAD_B { F4 }
 46+#define ENCODER_RESOLUTION 2
 47+
 48+/*
 49+ * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN.
 50+ */
 51+#define SOFT_SERIAL_PIN D2  // or D1, D2, D3, E6
 52+
 53+ #define RGB_DI_PIN D3
 54+ #ifdef RGB_DI_PIN
 55+   #define RGBLED_NUM 10
 56+   #define RGBLIGHT_SPLIT
 57+   #define RGBLED_SPLIT { 5, 5 }
 58+   #define RGBLIGHT_HUE_STEP 8
 59+   #define RGBLIGHT_SAT_STEP 8
 60+   #define RGBLIGHT_VAL_STEP 8
 61+   #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */
 62+   #define RGBLIGHT_SLEEP  /* If defined, the RGB lighting will be switched off when the host goes to sleep */
 63+ #endif
 64+
 65+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
 66+#define DEBOUNCE 5
 67+
 68+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
 69+#define LOCKING_SUPPORT_ENABLE
 70+/* Locking resynchronize hack */
 71+#define LOCKING_RESYNC_ENABLE
 72+
 73+/* disable these deprecated features by default */
 74+#define NO_ACTION_MACRO
 75+#define NO_ACTION_FUNCTION
 76diff --git a/keyboards/halfcliff/halfcliff.c b/keyboards/halfcliff/halfcliff.c
 77new file mode 100644
 78index 0000000000000000000000000000000000000000..999e9036db5b58da20283a29e1483db09aa1e83c
 79--- /dev/null
 80+++ b/keyboards/halfcliff/halfcliff.c
 81@@ -0,0 +1,92 @@
 82+/* Copyright 2021 n2
 83+ *
 84+ * This program is free software: you can redistribute it and/or modify
 85+ * it under the terms of the GNU General Public License as published by
 86+ * the Free Software Foundation, either version 2 of the License, or
 87+ * (at your option) any later version.
 88+ *
 89+ * This program is distributed in the hope that it will be useful,
 90+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 91+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 92+ * GNU General Public License for more details.
 93+ *
 94+ * You should have received a copy of the GNU General Public License
 95+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 96+ */
 97+
 98+#include "halfcliff.h"
 99+
100+#ifdef OLED_DRIVER_ENABLE
101+
102+// Defines names for use in layer keycodes and the keymap
103+enum layer_names {
104+    _DEFAULT = 0,
105+    _RAISE,
106+    _LOWER,
107+    _ADJUST
108+/*    _FN */
109+};
110+
111+__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) {
112+    if (!is_keyboard_master()) {
113+        return OLED_ROTATION_180;  // flips the display 180 degrees if offhand
114+    }
115+    return rotation;
116+}
117+
118+__attribute__((weak)) void oled_task_user(void) {
119+  if (!is_keyboard_master()) {
120+    static const char PROGMEM qmk_logo[] = {
121+        0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F, 0x90, 0x91, 0x92, 0x93, 0x94,
122+        0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5, 0xA6, 0xA7, 0xA8, 0xA9, 0xAA, 0xAB, 0xAC, 0xAD, 0xAE, 0xAF, 0xB0, 0xB1, 0xB2, 0xB3, 0xB4,
123+        0xC0, 0xC1, 0xC2, 0xC3, 0xC4, 0xC5, 0xC6, 0xC7, 0xC8, 0xC9, 0xCA, 0xCB, 0xCC, 0xCD, 0xCE, 0xCF, 0xD0, 0xD1, 0xD2, 0xD3, 0xD4, 0x00
124+    };
125+    oled_write_P(qmk_logo, false);
126+  } else {
127+      // Host Keyboard Layer Status
128+      oled_write_P(PSTR("Layer: "), false);
129+      switch (get_highest_layer(layer_state)) {
130+          case _DEFAULT:
131+              oled_write_P(PSTR("DEFAULT\n"), false);
132+              break;
133+          case _RAISE:
134+              oled_write_P(PSTR("RAISE\n"), false);
135+              break;
136+          case _LOWER:
137+              oled_write_P(PSTR("LOWER\n"), false);
138+          break;
139+          case _ADJUST:
140+              oled_write_P(PSTR("ADJUST\n"), false);
141+          break;
142+          default:
143+              // Or use the write_ln shortcut over adding '\n' to the end of your string
144+          oled_write_ln_P(PSTR("Undefined"), false);
145+      };
146+      // Host Keyboard LED Status
147+      led_t led_state = host_keyboard_led_state();
148+      oled_write_P(led_state.num_lock ? PSTR("NUMLCK ") : PSTR("       "), false);
149+      oled_write_P(led_state.caps_lock ? PSTR("CAPLCK ") : PSTR("       "), false);
150+      oled_write_P(led_state.scroll_lock ? PSTR("SCRLCK\n") : PSTR("      \n"), false);
151+    }
152+}
153+#endif
154+
155+#ifdef ENCODER_ENABLE
156+bool encoder_update_kb(uint8_t index, bool clockwise) {
157+    if (!encoder_update_user(index, clockwise)) { return false; }
158+    if (index == 0) { /* Left side encoder */
159+        if (clockwise) {
160+            tap_code(KC_WH_U);
161+        } else {
162+            tap_code(KC_WH_D);
163+        }
164+    } else if (index == 1) { /* Right side encoder */
165+        if (clockwise) {
166+            tap_code(KC_WH_U);
167+        } else {
168+            tap_code(KC_WH_D);
169+        }
170+    }
171+    return true;
172+}
173+#endif
174diff --git a/keyboards/halfcliff/halfcliff.h b/keyboards/halfcliff/halfcliff.h
175new file mode 100644
176index 0000000000000000000000000000000000000000..6e4c808641e51cb6b72a3bbe5fa7f6d705eb1501
177--- /dev/null
178+++ b/keyboards/halfcliff/halfcliff.h
179@@ -0,0 +1,58 @@
180+/* Copyright 2021 n2
181+ *
182+ * This program is free software: you can redistribute it and/or modify
183+ * it under the terms of the GNU General Public License as published by
184+ * the Free Software Foundation, either version 2 of the License, or
185+ * (at your option) any later version.
186+ *
187+ * This program is distributed in the hope that it will be useful,
188+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
189+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
190+ * GNU General Public License for more details.
191+ *
192+ * You should have received a copy of the GNU General Public License
193+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
194+ */
195+
196+#pragma once
197+
198+#include "quantum.h"
199+
200+/* This is a shortcut to help you visually see your layout.
201+ *
202+ * The first section contains all of the arguments representing the physical
203+ * layout of the board and position of the keys.
204+ *
205+ * The second converts the arguments into a two-dimensional array which
206+ * represents the switch matrix.
207+ */
208+
209+#define LAYOUT( \
210+    l51,l50,l00,l01,l02,l03,l04,r04,r03,r02,r01,r00,r50,r51,r52,\
211+    l61,l60,l10,l11,l12,l13,l14,r14,r13,r12,r11,r10,r60,r61,r62,\
212+    l71,l70,l20,l21,l22,l23,l24,r24,r23,r22,r21,r20,r70,r71,r72,\
213+    l81,l80,l30,l31,l32,l33,l34,r34,r33,r32,r31,r30,r80,r81,r82,\
214+    l91,l90,l40,l41,l42,l43,l44,r44,r43,r42,r41,r40,r90,r91,r92\
215+) \
216+{ \
217+    {l00,  l01,  l02,  l03,  l04  }, \
218+    {l10,  l11,  l12,  l13,  l14  }, \
219+    {l20,  l21,  l22,  l23,  l24  }, \
220+    {l30,  l31,  l32,  l33,  l34  }, \
221+    {l40,  l41,  l42,  l43,  l44  }, \
222+    {l50,  l51,  KC_NO,KC_NO,KC_NO}, \
223+    {l60,  l61,  KC_NO,KC_NO,KC_NO}, \
224+    {l70,  l71,  KC_NO,KC_NO,KC_NO}, \
225+    {l80,  l81,  KC_NO,KC_NO,KC_NO}, \
226+    {l90,  l91,  KC_NO,KC_NO,KC_NO}, \
227+    {r00,  r01,  r02,  r03,  r04  }, \
228+    {r10,  r11,  r12,  r13,  r14  }, \
229+    {r20,  r21,  r22,  r23,  r24  }, \
230+    {r30,  r31,  r32,  r33,  r34  }, \
231+    {r40,  r41,  r42,  r43,  r44  }, \
232+    {r50,  r51,  r52,  KC_NO,KC_NO}, \
233+    {r60,  r61,  r62,  KC_NO,KC_NO}, \
234+    {r70,  r71,  r72,  KC_NO,KC_NO}, \
235+    {r80,  r81,  r82,  KC_NO,KC_NO}, \
236+    {r90,  r91,  r92,  KC_NO,KC_NO}, \
237+}
238diff --git a/keyboards/halfcliff/info.json b/keyboards/halfcliff/info.json
239new file mode 100644
240index 0000000000000000000000000000000000000000..2a859bb4c3cbc7143958556f6c76797668a8e605
241--- /dev/null
242+++ b/keyboards/halfcliff/info.json
243@@ -0,0 +1,88 @@
244+{
245+    "keyboard_name": "halfcliff", 
246+    "url": "https://github.com/N2-Sumikko", 
247+    "maintainer": "n2", 
248+    "width": 17.25, 
249+    "height": 5, 
250+    "layouts": {
251+        "LAYOUT": {
252+            "layout": [
253+                          {"x":0.75,"y":0},
254+                          {"x":1.75,"y":0},
255+                          {"x":2.75,"y":0},
256+                          {"x":3.75,"y":0},
257+                          {"x":4.75,"y":0},
258+                          {"x":5.75,"y":0},
259+                          {"x":6.75,"y":0},
260+                          {"x":8.25,"y":0},
261+                          {"x":9.25,"y":0},
262+                          {"x":10.25,"y":0},
263+                          {"x":11.25,"y":0},
264+                          {"x":12.25,"y":0},
265+                          {"x":13.25,"y":0},
266+                          {"x":14.25,"y":0},
267+                          {"x":15.25,"y":0},
268+                          {"x":0.25,"y":1,"w":1.5},
269+                          {"x":1.75,"y":1},
270+                          {"x":2.75,"y":1},
271+                          {"x":3.75,"y":1},
272+                          {"x":4.75,"y":1},
273+                          {"x":5.75,"y":1},
274+                          {"x":6.75,"y":1},
275+                          {"x":8.25,"y":1},
276+                          {"x":9.25,"y":1},
277+                          {"x":10.25,"y":1},
278+                          {"x":11.25,"y":1},
279+                          {"x":12.25,"y":1},
280+                          {"x":13.25,"y":1},
281+                          {"x":14.25,"y":1},
282+                          {"x":16.25,"y":0},
283+                          {"x":0,"y":2,"w":1.75},
284+                          {"x":1.75,"y":2},
285+                          {"x":2.75,"y":2},
286+                          {"x":3.75,"y":2},
287+                          {"x":4.75,"y":2},
288+                          {"x":5.75,"y":2},
289+                          {"x":6.75,"y":2},
290+                          {"x":8.25,"y":2},
291+                          {"x":9.25,"y":2},
292+                          {"x":10.25,"y":2},
293+                          {"x":11.25,"y":2},
294+                          {"x":12.25,"y":2},
295+                          {"x":13.25,"y":2},
296+                          {"x":14.25,"y":2},
297+                          {"x":15.5,"y":1,"w":1.25,"h":2},
298+                          {"x":0,"y":3,"w":1.75},
299+                          {"x":1.75,"y":3},
300+                          {"x":2.75,"y":3},
301+                          {"x":3.75,"y":3},
302+                          {"x":4.75,"y":3},
303+                          {"x":5.75,"y":3},
304+                          {"x":6.75,"y":3},
305+                          {"x":8.25,"y":3},
306+                          {"x":9.25,"y":3},
307+                          {"x":10.25,"y":3},
308+                          {"x":11.25,"y":3},
309+                          {"x":12.25,"y":3},
310+                          {"x":13.25,"y":3},
311+                          {"x":14.25,"y":3},
312+                          {"x":15.25,"y":3,"w":2},
313+                          {"x":0.5,"y":4,"w":1.25},
314+                          {"x":1.75,"y":4},
315+                          {"x":2.75,"y":4},
316+                          {"x":3.75,"y":4},
317+                          {"x":4.75,"y":4},
318+                          {"x":5.75,"y":4},
319+                          {"x":6.75,"y":4},
320+                          {"x":8.25,"y":4},
321+                          {"x":9.25,"y":4},
322+                          {"x":10.25,"y":4},
323+                          {"x":11.25,"y":4},
324+                          {"x":12.25,"y":4},
325+                          {"x":13.25,"y":4},
326+                          {"x":14.25,"y":4},
327+                          {"x":15.25,"y":4}
328+                      ]
329+        }
330+    }
331+}
332diff --git a/keyboards/halfcliff/keymaps/default/keymap.c b/keyboards/halfcliff/keymaps/default/keymap.c
333new file mode 100644
334index 0000000000000000000000000000000000000000..02743f5d4949e94e4a4c9a18f8935a7a48f29308
335--- /dev/null
336+++ b/keyboards/halfcliff/keymaps/default/keymap.c
337@@ -0,0 +1,109 @@
338+/* Copyright 2021 n2
339+ *
340+ * This program is free software: you can redistribute it and/or modify
341+ * it under the terms of the GNU General Public License as published by
342+ * the Free Software Foundation, either version 2 of the License, or
343+ * (at your option) any later version.
344+ *
345+ * This program is distributed in the hope that it will be useful,
346+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
347+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
348+ * GNU General Public License for more details.
349+ *
350+ * You should have received a copy of the GNU General Public License
351+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
352+ */
353+#include QMK_KEYBOARD_H
354+#include "keymap_jp.h"
355+
356+// Defines names for use in layer keycodes and the keymap
357+enum layer_names {
358+    _DEFAULT = 0,
359+    _RAISE,
360+    _LOWER,
361+    _ADJUST
362+/*    _FN */
363+};
364+
365+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
366+   /* DEFAULT
367+    * ,--------------------------------------------------------------------------------------------------------------------------------------.
368+    * |ZEN/HAN |   1    |   2    |   3    |   4    |   5    |        |   6    |   7    |   8    |   9    |   0    |   -    |   ^    |   \    |
369+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
370+    * | TAB    |   q    |   w    |   e    |   r    |   t    |        |   y    |   u    |   i    |   o    |   p    |   @    |   [    | BSPC   |
371+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
372+    * | CAPS   |   a    |   s    |   d    |   f    |   g    |        |   h    |   j    |   k    |   l    |   ;    |   :    |   ]    | ENT    |
373+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
374+    * | LSHIFT |   z    |   x    |   c    |   v    |   b    |        |   n    |   m    |   ,    |   .    |   /    |   \    |  UP    | RSHIFT |
375+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
376+    * | CTRL   | LGUI   | ALT    | MUHEN  | SPACE  | SPACE  | LOWER  | RAISE  | SPACE  | HENKAN | KANA   | APP    | LEFT   | DOWN   | RIGHT  |
377+    * `--------------------------------------------------------------------------------------------------------------------------------------'
378+    */
379+    [_DEFAULT] = LAYOUT(
380+      KC_ZKHK, KC_1,    KC_2,    KC_3,    KC_4,    KC_5,   _______,    KC_6,       KC_7,   KC_8,    KC_9,    KC_0,    JP_MINS, JP_CIRC, JP_YEN,
381+      KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,   _______,    KC_Y,       KC_U,   KC_I,    KC_O,    KC_P,    JP_AT  , JP_LBRC, KC_BSPC,
382+      KC_CAPS, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,   _______,    KC_H,       KC_J,   KC_K,    KC_L,    KC_SCLN, JP_COLN, JP_RBRC, KC_ENT,
383+      KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,   _______,    KC_N,       KC_M,   KC_COMM, KC_DOT,  KC_SLSH, JP_BSLS, KC_UP,   KC_RSFT,
384+      KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,  KC_SPC, MO(_LOWER), MO(_RAISE), KC_SPC, KC_HENK, KC_KANA, KC_APP,  KC_LEFT, KC_DOWN, KC_RGHT
385+    ),
386+   /* RAISE
387+    * ,--------------------------------------------------------------------------------------------------------------------------------------.
388+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
389+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
390+    * |        |   1    |   2    |   3    |   4    |   5    |        |   6    |   7    |   8    |   9    |   0    |        |        |        |
391+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
392+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
393+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
394+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
395+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
396+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
397+    * `--------------------------------------------------------------------------------------------------------------------------------------'
398+    */
399+    [_RAISE] = LAYOUT(
400+      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
401+      _______, KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    _______, KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    _______, _______, _______,
402+      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
403+      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
404+      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
405+    ),
406+   /* LOWER
407+    * ,--------------------------------------------------------------------------------------------------------------------------------------.
408+    * |        |        |        |        |        |        |RGB_TOG |        |        |        |        |        |        |        |        |
409+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
410+    * |        |        |        |        |        |        |RGB_VAI |        |        |        |        |        |        |        |        |
411+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
412+    * |        |        |        |        |        |        |RGB_HUI |        |        |        |        |        |        |        |        |
413+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
414+    * |        |        |        |        |        |        |RGB_SAI |        |        |        |        |        |        |        |        |
415+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
416+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
417+    * `--------------------------------------------------------------------------------------------------------------------------------------'
418+    */
419+    [_LOWER] = LAYOUT(
420+      _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______,
421+      _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______,
422+      _______, _______, _______, _______, _______, _______, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______,
423+      _______, _______, _______, _______, _______, _______, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______,
424+      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
425+    ),
426+   /* ADJUST
427+    * ,--------------------------------------------------------------------------------------------------------------------------------------.
428+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
429+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
430+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
431+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
432+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
433+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
434+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
435+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
436+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
437diff --git a/keyboards/halfcliff/keymaps/default/readme.md b/keyboards/halfcliff/keymaps/default/readme.md
438new file mode 100644
439index 0000000000000000000000000000000000000000..2924c68c24aadc85220109e390909782a241b009
440--- /dev/null
441+++ b/keyboards/halfcliff/keymaps/default/readme.md
442@@ -0,0 +1 @@
443+# The default keymap for halfcliff
444diff --git a/keyboards/halfcliff/keymaps/via/keymap.c b/keyboards/halfcliff/keymaps/via/keymap.c
445new file mode 100644
446index 0000000000000000000000000000000000000000..e0a825e7c307aa3bbd893cea88e7b449d2293f9a
447--- /dev/null
448+++ b/keyboards/halfcliff/keymaps/via/keymap.c
449@@ -0,0 +1,112 @@
450+/* Copyright 2021 n2
451+ *
452+ * This program is free software: you can redistribute it and/or modify
453+ * it under the terms of the GNU General Public License as published by
454+ * the Free Software Foundation, either version 2 of the License, or
455+ * (at your option) any later version.
456+ *
457+ * This program is distributed in the hope that it will be useful,
458+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
459+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
460+ * GNU General Public License for more details.
461+ *
462+ * You should have received a copy of the GNU General Public License
463+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
464+ */
465+#include QMK_KEYBOARD_H
466+#include "keymap_jp.h"
467+
468+#define RAISE FN_MO13
469+#define LOWER FN_MO23
470+
471+// Defines names for use in layer keycodes and the keymap
472+enum layer_names {
473+    _DEFAULT = 0,
474+    _RAISE,
475+    _LOWER,
476+    _ADJUST
477+/*    _FN */
478+};
479+
480+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
481+   /* DEFAULT
482+    * ,--------------------------------------------------------------------------------------------------------------------------------------.
483+    * |ZEN/HAN |   1    |   2    |   3    |   4    |   5    |        |   6    |   7    |   8    |   9    |   0    |   -    |   ^    |   \    |
484+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
485+    * | TAB    |   q    |   w    |   e    |   r    |   t    |        |   y    |   u    |   i    |   o    |   p    |   @    |   [    | BSPC   |
486+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
487+    * | CAPS   |   a    |   s    |   d    |   f    |   g    |        |   h    |   j    |   k    |   l    |   ;    |   :    |   ]    | ENT    |
488+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
489+    * | LSHIFT |   z    |   x    |   c    |   v    |   b    |        |   n    |   m    |   ,    |   .    |   /    |   \    |  UP    | RSHIFT |
490+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
491+    * | CTRL   | LGUI   | ALT    | MUHEN  | SPACE  | SPACE  | LOWER  | RAISE  | SPACE  | HENKAN | KANA   | APP    | LEFT   | DOWN   | RIGHT  |
492+    * `--------------------------------------------------------------------------------------------------------------------------------------'
493+    */
494+    [_DEFAULT] = LAYOUT(
495+      KC_ZKHK, KC_1,    KC_2,    KC_3,    KC_4,    KC_5,   _______,    KC_6,       KC_7,   KC_8,    KC_9,    KC_0,    JP_MINS, JP_CIRC, JP_YEN,
496+      KC_TAB,  KC_Q,    KC_W,    KC_E,    KC_R,    KC_T,   _______,    KC_Y,       KC_U,   KC_I,    KC_O,    KC_P,    JP_AT  , JP_LBRC, KC_BSPC,
497+      KC_CAPS, KC_A,    KC_S,    KC_D,    KC_F,    KC_G,   _______,    KC_H,       KC_J,   KC_K,    KC_L,    KC_SCLN, JP_COLN, JP_RBRC, KC_ENT,
498+      KC_LSFT, KC_Z,    KC_X,    KC_C,    KC_V,    KC_B,   _______,    KC_N,       KC_M,   KC_COMM, KC_DOT,  KC_SLSH, JP_BSLS, KC_UP,   KC_RSFT,
499+      KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_SPC,  KC_SPC, FN_MO23,    FN_MO13,    KC_SPC, KC_HENK, KC_KANA, KC_APP,  KC_LEFT, KC_DOWN, KC_RGHT
500+    ),
501+   /* RAISE
502+    * ,--------------------------------------------------------------------------------------------------------------------------------------.
503+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
504+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
505+    * |        |   1    |   2    |   3    |   4    |   5    |        |   6    |   7    |   8    |   9    |   0    |        |        |        |
506+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
507+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
508+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
509+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
510+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
511+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
512+    * `--------------------------------------------------------------------------------------------------------------------------------------'
513+    */
514+    [_RAISE] = LAYOUT(
515+      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
516+      _______, KC_1,    KC_2,    KC_3,    KC_4,    KC_5,    _______, KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    _______, _______, _______,
517+      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
518+      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
519+      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
520+    ),
521+   /* LOWER
522+    * ,--------------------------------------------------------------------------------------------------------------------------------------.
523+    * |        |        |        |        |        |        |RGB_TOG |        |        |        |        |        |        |        |        |
524+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
525+    * |        |        |        |        |        |        |RGB_VAI |        |        |        |        |        |        |        |        |
526+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
527+    * |        |        |        |        |        |        |RGB_HUI |        |        |        |        |        |        |        |        |
528+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
529+    * |        |        |        |        |        |        |RGB_SAI |        |        |        |        |        |        |        |        |
530+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
531+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
532+    * `--------------------------------------------------------------------------------------------------------------------------------------'
533+    */
534+    [_LOWER] = LAYOUT(
535+      _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______,
536+      _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______,
537+      _______, _______, _______, _______, _______, _______, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______,
538+      _______, _______, _______, _______, _______, _______, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______,
539+      _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
540+    ),
541+   /* ADJUST
542+    * ,--------------------------------------------------------------------------------------------------------------------------------------.
543+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
544+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
545+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
546+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
547+    * |        |        |        |        |        |        |        |        |        |        |        |        |        |        |        |
548+    * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------|
549diff --git a/keyboards/halfcliff/keymaps/via/readme.md b/keyboards/halfcliff/keymaps/via/readme.md
550new file mode 100644
551index 0000000000000000000000000000000000000000..2924c68c24aadc85220109e390909782a241b009
552--- /dev/null
553+++ b/keyboards/halfcliff/keymaps/via/readme.md
554@@ -0,0 +1 @@
555+# The default keymap for halfcliff
556diff --git a/keyboards/halfcliff/keymaps/via/rules.mk b/keyboards/halfcliff/keymaps/via/rules.mk
557new file mode 100644
558index 0000000000000000000000000000000000000000..1e5b99807cb7a90b282a3001a38bf303774544ba
559--- /dev/null
560+++ b/keyboards/halfcliff/keymaps/via/rules.mk
561@@ -0,0 +1 @@
562+VIA_ENABLE = yes
563diff --git a/keyboards/halfcliff/matrix.c b/keyboards/halfcliff/matrix.c
564new file mode 100644
565index 0000000000000000000000000000000000000000..556b75ca5901cb9eafab00f8567564cde6fbd3e2
566--- /dev/null
567+++ b/keyboards/halfcliff/matrix.c
568@@ -0,0 +1,277 @@
569+/*
570+Copyright 2012 Jun Wako <wakojun@gmail.com>
571+
572+This program is free software: you can redistribute it and/or modify
573+it under the terms of the GNU General Public License as published by
574+the Free Software Foundation, either version 2 of the License, or
575+(at your option) any later version.
576+
577+This program is distributed in the hope that it will be useful,
578+but WITHOUT ANY WARRANTY; without even the implied warranty of
579+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
580+GNU General Public License for more details.
581+
582+You should have received a copy of the GNU General Public License
583+along with this program.  If not, see <http://www.gnu.org/licenses/>.
584+*/
585+#include <stdint.h>
586+#include <stdbool.h>
587+#include "util.h"
588+#include "matrix.h"
589+#include "debounce.h"
590+#include "quantum.h"
591+#include "split_util.h"
592+#include "config.h"
593+#include "transport.h"
594+
595+#define ERROR_DISCONNECT_COUNT 5
596+
597+#define ROWS_PER_HAND (MATRIX_ROWS / 2)
598+
599+static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS;
600+static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS;
601+
602+/* matrix state(1:on, 0:off) */
603+static matrix_row_t raw_matrix[MATRIX_ROWS];  // raw values
604+static matrix_row_t matrix[MATRIX_ROWS];      // debounced values
605+
606+// row offsets for each hand
607+uint8_t thisHand, thatHand;
608+
609+// user-defined overridable functions
610+__attribute__((weak)) void matrix_init_kb(void) { matrix_init_user(); }
611+
612+__attribute__((weak)) void matrix_scan_kb(void) { matrix_scan_user(); }
613+
614+__attribute__((weak)) void matrix_init_user(void) {}
615+
616+__attribute__((weak)) void matrix_scan_user(void) {}
617+
618+__attribute__((weak)) void matrix_slave_scan_user(void) {}
619+
620+matrix_row_t matrix_get_row(uint8_t row) { return matrix[row]; }
621+
622+void matrix_print(void) {}
623+
624+static inline void setPinOutput_writeLow(pin_t pin) {
625+    ATOMIC_BLOCK_FORCEON {
626+        setPinOutput(pin);
627+        writePinLow(pin);
628+    }
629+}
630+
631+static inline void setPinInputHigh_atomic(pin_t pin) {
632+    ATOMIC_BLOCK_FORCEON { setPinInputHigh(pin); }
633+}
634+
635+// matrix code
636+static void select_row(uint8_t row) { setPinOutput_writeLow(row_pins[row]); }
637+
638+static void unselect_row(uint8_t row) { setPinInputHigh_atomic(row_pins[row]); }
639+
640+static void unselect_rows(void) {
641+    for (uint8_t x = 0; x < ROWS_PER_HAND; x++) {
642+        setPinInputHigh_atomic(row_pins[x]);
643+    }
644+}
645+
646+static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
647+    // Start with a clear matrix row
648+    matrix_row_t current_row_value = 0;
649+
650+    // Select row
651+    select_row(current_row);
652+    wait_us(30);
653+
654+    // For each col...
655+    for (uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) {
656+        // Select the col pin to read (active low)
657+        uint8_t pin_state = readPin(col_pins[col_index]);
658+
659+        // Populate the matrix row with the state of the col pin
660+        current_row_value |= pin_state ? 0 : (MATRIX_ROW_SHIFTER << col_index);
661+    }
662+
663+    // Unselect row
664+    unselect_row(current_row);
665+    if (current_row + 1 < MATRIX_ROWS) {
666+    wait_us(30);  // wait for row signal to go HIGH
667+    }
668diff --git a/keyboards/halfcliff/readme.md b/keyboards/halfcliff/readme.md
669new file mode 100644
670index 0000000000000000000000000000000000000000..37e8d85c20fc16bfda126aea443fb7ce45e94f3b
671--- /dev/null
672+++ b/keyboards/halfcliff/readme.md
673@@ -0,0 +1,19 @@
674+# halfcliff
675+
676+![halfcliff](https://user-images.githubusercontent.com/54104281/125184713-0b096b00-e25b-11eb-8237-5f4d2a286bc4.jpg)
677+
678+Halfcliff keyboard is a split keyboard using a single-sided board.
679+
680+* Keyboard Maintainer: [n2](https://github.com/N2-Sumikko)
681+* Hardware Supported:  halfcliff PCB, Pro Micro
682+* Hardware Availability: [PCB & Plate Data](https://github.com/N2-Sumikko/HalfCliff.git)
683+
684+Make example for this keyboard (after setting up your build environment):
685+
686+    make halfcliff:default
687+
688+Flashing example for this keyboard:
689+
690+    make halfcliff:default:flash
691+
692diff --git a/keyboards/halfcliff/rules.mk b/keyboards/halfcliff/rules.mk
693new file mode 100644
694index 0000000000000000000000000000000000000000..f8883f6a47795f4a777b77359825e78374b55d70
695--- /dev/null
696+++ b/keyboards/halfcliff/rules.mk
697@@ -0,0 +1,29 @@
698+# MCU name
699+MCU = atmega32u4
700+
701+# Bootloader selection
702+BOOTLOADER = caterina
703+
704+# Build Options
705+#   change yes to no to disable
706+#
707+BOOTMAGIC_ENABLE = no       # Virtual DIP switch configuration
708+MOUSEKEY_ENABLE = no       # Mouse keys
709+EXTRAKEY_ENABLE = no       # Audio control and System control
710+CONSOLE_ENABLE = no        # Console for debug
711+COMMAND_ENABLE = no        # Commands for debug and configuration
712+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
713+SLEEP_LED_ENABLE = no       # Breathing sleep LED during USB suspend
714+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
715+NKRO_ENABLE = no            # USB Nkey Rollover
716+BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality
717+RGBLIGHT_ENABLE = no        # Enable keyboard RGB underglow
718+BLUETOOTH_ENABLE = no       # Enable Bluetooth
719+AUDIO_ENABLE = no           # Audio output
720+SPLIT_KEYBOARD = yes
721+ENCODER_ENABLE = no
722+POINTING_DEVICE_ENABLE = no
723+CUSTOM_MATRIX = yes
724+OLED_DRIVER_ENABLE = no
725+
726+SRC += matrix.c