bb754069e95237bec69cc23845e2515eea5f33e4

Author
zhouqiong19840119 <82140728+zhouqiong19840119@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

[Keyboard] smallkeyboard support (#12817)

Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: James Young <18669334+noroadsleft@users.noreply.github.com>
Co-authored-by: Drashna Jaelre <drashna@live.com>

Diff

This diff is truncated to protect this page.

  1diff --git a/keyboards/smallkeyboard/config.h b/keyboards/smallkeyboard/config.h
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..689d53d54eb8df844abad6649956c39f126b8020
  4--- /dev/null
  5+++ b/keyboards/smallkeyboard/config.h
  6@@ -0,0 +1,104 @@
  7+/* Copyright 2021 zhouqiong19840119
  8+  * 
  9+  * This program is free software: you can redistribute it and/or modify 
 10+  * it under the terms of the GNU General Public License as published by 
 11+  * the Free Software Foundation, either version 2 of the License, or 
 12+  * (at your option) any later version. 
 13+  * 
 14+  * This program is distributed in the hope that it will be useful, 
 15+  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 16+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 17+  * GNU General Public License for more details. 
 18+  * 
 19+  * You should have received a copy of the GNU General Public License 
 20+  * along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 21+  */ 
 22+
 23+
 24+#pragma once
 25+
 26+/* USB Device descriptor parameter */
 27+#include "config_common.h"
 28+#define VENDOR_ID       0x7A71 // "zq" = zhouqiong19840119
 29+#define PRODUCT_ID      0x736B // "sk" = smallkeyboard
 30+#define DEVICE_VER      0x0001
 31+#define MANUFACTURER    zhouqiong19840119
 32+#define PRODUCT         smallkeyboard
 33+
 34+/* key matrix size */
 35+#define MATRIX_ROWS 2
 36+#define MATRIX_COLS 3
 37+
 38+/*
 39+ * Keyboard Matrix Assignments
 40+ *
 41+ * Change this to how you wired your keyboard
 42+ * COLS: AVR pins used for columns, left to right
 43+ * ROWS: AVR pins used for rows, top to bottom
 44+ * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode)
 45+ *                  ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode)
 46+ *
 47+ */
 48+#define MATRIX_ROW_PINS {C7, C6 }
 49+#define MATRIX_COL_PINS {F7, F6, F5}
 50+#define UNUSED_PINS
 51+
 52+/* COL2ROW, ROW2COL*/
 53+#define DIODE_DIRECTION ROW2COL
 54+
 55+/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
 56+#define DEBOUNCE 3
 57+
 58+/* disable these deprecated features by default */
 59+//#ifndef LINK_TIME_OPTIMIZATION_ENABLE
 60+//#    define NO_ACTION_MACRO
 61+//#    define NO_ACTION_FUNCTION
 62+//#endif
 63+
 64+#ifdef RGB_MATRIX_ENABLE
 65+#    define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
 66+#    define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
 67+#    define RGB_MATRIX_KEYPRESSES
 68+#    define RGB_MATRIX_FRAMEBUFFER_EFFECTS
 69+#    define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN
 70+#    define DISABLE_RGB_MATRIX_BAND_SAT
 71+#    define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
 72+#    define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT
 73+#    define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
 74+#    define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
 75+#    define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
 76+#    define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
 77+#    define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
 78+#    define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
 79+#    define DISABLE_RGB_MATRIX_SPLASH
 80+#    define DISABLE_RGB_MATRIX_MULTISPLASH
 81+#    define DISABLE_RGB_MATRIX_SOLID_SPLASH
 82+#    define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH
 83+#    define DISABLE_RGB_MATRIX_DIGITAL_RAIN
 84+
 85+// This is a 7-bit address, that gets left-shifted and bit 0
 86+// set to 0 for write, 1 for read (as per I2C protocol)
 87+// The address will vary depending on your wiring:
 88+// 0b1110100 AD <-> GND
 89+// 0b1110111 AD <-> VCC
 90+// 0b1110101 AD <-> SCL
 91+// 0b1110110 AD <-> SDA
 92+#define DRIVER_ADDR_1 0b1110100
 93+//#define DRIVER_ADDR_2 0b1110110
 94+
 95+#define DRIVER_COUNT 1
 96+#define DRIVER_1_LED_TOTAL 6
 97+//#define DRIVER_1_LED_TOTAL 25
 98+//#define DRIVER_2_LED_TOTAL 24
 99+//#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
100+#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL
101+#endif
102+//#define RGB_DI_PIN B7
103+//#ifdef RGB_DI_PIN
104+//#define RGBLIGHT_ANIMATIONS
105+//#define RGBLED_NUM 8
106diff --git a/keyboards/smallkeyboard/info.json b/keyboards/smallkeyboard/info.json
107new file mode 100644
108index 0000000000000000000000000000000000000000..8d1d642c108b91acfe3ca7375107d59394e922bf
109--- /dev/null
110+++ b/keyboards/smallkeyboard/info.json
111@@ -0,0 +1,17 @@
112+{
113+  "keyboard_name": "smallkeyboard",
114+  "url": "",
115+  "maintainer": "zhouqiong19840119",
116+  "layouts": {
117+    "LAYOUT_ortho_2x3": {
118+      "layout": [
119+                {"x":0, "y":0},
120+                {"x":1, "y":0},
121+                {"x":2, "y":0},
122+                {"x":0, "y":1},
123+                {"x":1, "y":1},
124+                {"x":2, "y":1}
125+      ]
126+    }
127+  }
128+}
129diff --git a/keyboards/smallkeyboard/keymaps/default/keymap.c b/keyboards/smallkeyboard/keymaps/default/keymap.c
130new file mode 100644
131index 0000000000000000000000000000000000000000..9ab00be05cbf59d0823540df58880afde2ca9e40
132--- /dev/null
133+++ b/keyboards/smallkeyboard/keymaps/default/keymap.c
134@@ -0,0 +1,28 @@
135+/* Copyright 2021 zhouqiong19840119
136+  * 
137+  * This program is free software: you can redistribute it and/or modify 
138+  * it under the terms of the GNU General Public License as published by 
139+  * the Free Software Foundation, either version 2 of the License, or 
140+  * (at your option) any later version. 
141+  * 
142+  * This program is distributed in the hope that it will be useful, 
143+  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
144+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
145+  * GNU General Public License for more details. 
146+  * 
147+  * You should have received a copy of the GNU General Public License 
148+  * along with this program.  If not, see <http://www.gnu.org/licenses/>. 
149+  */ 
150+
151+#include QMK_KEYBOARD_H
152+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
153+    [0] = LAYOUT_ortho_2x3(
154+        KC_P1, KC_P2, MO(1),
155+        KC_P3, KC_P4, KC_P3),
156+    [1] = LAYOUT_ortho_2x3(
157+        RGB_TOG, RGB_MOD, MO(1),
158+        AU_ON,   AU_OFF,  MI_ON),
159+    [2] = LAYOUT_ortho_2x3(
160+        KC_P4, KC_P5, MO(1),
161+        KC_P1, KC_P2, KC_P3),
162+};
163diff --git a/keyboards/smallkeyboard/keymaps/via/keymap.c b/keyboards/smallkeyboard/keymaps/via/keymap.c
164new file mode 100644
165index 0000000000000000000000000000000000000000..9ab00be05cbf59d0823540df58880afde2ca9e40
166--- /dev/null
167+++ b/keyboards/smallkeyboard/keymaps/via/keymap.c
168@@ -0,0 +1,28 @@
169+/* Copyright 2021 zhouqiong19840119
170+  * 
171+  * This program is free software: you can redistribute it and/or modify 
172+  * it under the terms of the GNU General Public License as published by 
173+  * the Free Software Foundation, either version 2 of the License, or 
174+  * (at your option) any later version. 
175+  * 
176+  * This program is distributed in the hope that it will be useful, 
177+  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
178+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
179+  * GNU General Public License for more details. 
180+  * 
181+  * You should have received a copy of the GNU General Public License 
182+  * along with this program.  If not, see <http://www.gnu.org/licenses/>. 
183+  */ 
184+
185+#include QMK_KEYBOARD_H
186+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
187+    [0] = LAYOUT_ortho_2x3(
188+        KC_P1, KC_P2, MO(1),
189+        KC_P3, KC_P4, KC_P3),
190+    [1] = LAYOUT_ortho_2x3(
191+        RGB_TOG, RGB_MOD, MO(1),
192+        AU_ON,   AU_OFF,  MI_ON),
193+    [2] = LAYOUT_ortho_2x3(
194+        KC_P4, KC_P5, MO(1),
195+        KC_P1, KC_P2, KC_P3),
196+};
197diff --git a/keyboards/smallkeyboard/keymaps/via/rules.mk b/keyboards/smallkeyboard/keymaps/via/rules.mk
198new file mode 100644
199index 0000000000000000000000000000000000000000..1e5b99807cb7a90b282a3001a38bf303774544ba
200--- /dev/null
201+++ b/keyboards/smallkeyboard/keymaps/via/rules.mk
202@@ -0,0 +1 @@
203+VIA_ENABLE = yes
204diff --git a/keyboards/smallkeyboard/readme.md b/keyboards/smallkeyboard/readme.md
205new file mode 100644
206index 0000000000000000000000000000000000000000..54b4bcb53288dfa1a66183b6cbec5846c9ee213e
207--- /dev/null
208+++ b/keyboards/smallkeyboard/readme.md
209@@ -0,0 +1,18 @@
210+# SMALLKEYBOARD
211+
212+![](https://github.com/zhouqiong19840119/MacroKeyboard-little/blob/main/Small%20(1).jpg)
213+
214+* Keyboard Maintainer: [zhouqiong19840119](https://github.com/zhouqiong19840119)
215+* Hardware Availability: 
216+
217+Make example for this keyboard (after setting up your build environment):
218+
219+    make smallkeyboard:default
220+
221+Flashing example for this keyboard:
222+
223+    make smallkeyboard:default:flash
224+
225+To reset the board into bootloader mode, hold the key at the top left of the keyboard while connecting the USB cable (also erases persistent settings).
226+
227diff --git a/keyboards/smallkeyboard/rules.mk b/keyboards/smallkeyboard/rules.mk
228new file mode 100644
229index 0000000000000000000000000000000000000000..54c776b6ec44a8812630a6a2e6faf77f24f97c1e
230--- /dev/null
231+++ b/keyboards/smallkeyboard/rules.mk
232@@ -0,0 +1,26 @@
233+# MCU name
234+MCU = atmega32u4
235+
236+# Bootloader selection
237+BOOTLOADER = atmel-dfu
238+
239+# Build Options
240+#   change yes to no to disable
241+#
242+BOOTMAGIC_ENABLE = lite     # Enable Bootmagic Lite
243+MOUSEKEY_ENABLE = yes       # Mouse keys
244+EXTRAKEY_ENABLE = yes       # Audio control and System control
245+CONSOLE_ENABLE = yes        # Console for debug
246+COMMAND_ENABLE = no         # Commands for debug and configuration
247+# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
248+SLEEP_LED_ENABLE = no       # Breathing sleep LED during USB suspend
249+# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
250+NKRO_ENABLE = no            # USB Nkey Rollover
251+BACKLIGHT_ENABLE = no       # Enable keyboard backlight functionality
252+RGBLIGHT_ENABLE = no        # Enable keyboard RGB underglow
253+AUDIO_ENABLE = no           # Audio output
254+
255+RGB_MATRIX_ENABLE = yes
256+RGB_MATRIX_DRIVER = IS31FL3731
257+
258+RGB_MATRIX_SUPPORTED = yes
259diff --git a/keyboards/smallkeyboard/smallkeyboard.c b/keyboards/smallkeyboard/smallkeyboard.c
260new file mode 100644
261index 0000000000000000000000000000000000000000..4da85feff13a781897eb0142a1f050bd42ee7aba
262--- /dev/null
263+++ b/keyboards/smallkeyboard/smallkeyboard.c
264@@ -0,0 +1,49 @@
265+/* Copyright 2021 zhouqiong19840119
266+  * 
267+  * This program is free software: you can redistribute it and/or modify 
268+  * it under the terms of the GNU General Public License as published by 
269+  * the Free Software Foundation, either version 2 of the License, or 
270+  * (at your option) any later version. 
271+  * 
272+  * This program is distributed in the hope that it will be useful, 
273+  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
274+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
275+  * GNU General Public License for more details. 
276+  * 
277+  * You should have received a copy of the GNU General Public License 
278+  * along with this program.  If not, see <http://www.gnu.org/licenses/>. 
279+  */ 
280+#include "smallkeyboard.h"
281+
282+#ifdef RGB_MATRIX_ENABLE
283+
284+const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
285+/* Refer to IS31 manual for these locations
286+ *   driver
287+ *   |  R location
288+ *   |  |       G location
289+ *   |  |       |       B location
290+ *   |  |       |       | */
291+	{0, C1_3,  C2_3,  C3_3},// BL1
292+    {0, C1_4,  C2_4,  C3_4},// BL2
293+    {0, C1_5,  C2_5,  C3_5},// BL3
294+    {0, C1_11, C2_11, C3_11},// BL4
295+    {0, C1_12, C2_12, C3_12},// BL5
296+    {0, C1_13, C2_13, C3_13},// BL6
297+};
298+
299+led_config_t g_led_config = {
300+    {
301+        { 0,      1,     2},
302+        { 3,      4,     5},
303+    },
304+    {
305+        { 48, 32},{ 48, 48},{ 64, 48},
306+        { 80, 16},{ 64, 32},{ 80, 32}
307+    },
308+    {
309+        4, 4, 4, 
310+        1, 1, 4
311+    }
312+};
313+#endif
314diff --git a/keyboards/smallkeyboard/smallkeyboard.h b/keyboards/smallkeyboard/smallkeyboard.h
315new file mode 100644
316index 0000000000000000000000000000000000000000..7741772be5947af50a592e25d526debaa584e7b1
317--- /dev/null
318+++ b/keyboards/smallkeyboard/smallkeyboard.h
319@@ -0,0 +1,26 @@
320+/* Copyright 2021 zhouqiong198401189
321+  * 
322+  * This program is free software: you can redistribute it and/or modify 
323+  * it under the terms of the GNU General Public License as published by 
324+  * the Free Software Foundation, either version 2 of the License, or 
325+  * (at your option) any later version. 
326+  * 
327+  * This program is distributed in the hope that it will be useful, 
328+  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
329+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
330+  * GNU General Public License for more details. 
331+  * 
332+  * You should have received a copy of the GNU General Public License 
333+  * along with this program.  If not, see <http://www.gnu.org/licenses/>. 
334+  */ 
335+#pragma once
336+
337+#include "quantum.h"
338+
339+#define LAYOUT_ortho_2x3( \
340+    K00, K01, K02,\
341+    K10, K11, K12 \
342+) { \
343+    { K00, K01, K02 }, \
344+    { K10, K11, K12 }  \
345+}