summaryrefslogtreecommitdiffstats
path: root/keyboards/mechwild
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/mechwild')
-rw-r--r--keyboards/mechwild/sugarglider/config.h41
-rw-r--r--keyboards/mechwild/sugarglider/f401/rules.mk3
-rw-r--r--keyboards/mechwild/sugarglider/f411/rules.mk3
-rw-r--r--keyboards/mechwild/sugarglider/glcdfont.c231
-rw-r--r--keyboards/mechwild/sugarglider/halconf.h12
-rw-r--r--keyboards/mechwild/sugarglider/info.json110
-rw-r--r--keyboards/mechwild/sugarglider/keymaps/default/keymap.c70
-rw-r--r--keyboards/mechwild/sugarglider/keymaps/default/rules.mk2
-rw-r--r--keyboards/mechwild/sugarglider/keymaps/via/keymap.c61
-rw-r--r--keyboards/mechwild/sugarglider/keymaps/via/rules.mk5
-rw-r--r--keyboards/mechwild/sugarglider/matrix.c95
-rw-r--r--keyboards/mechwild/sugarglider/mcuconf.h12
-rw-r--r--keyboards/mechwild/sugarglider/post_rules.mk4
-rw-r--r--keyboards/mechwild/sugarglider/readme.md27
-rw-r--r--keyboards/mechwild/sugarglider/rules.mk23
-rw-r--r--keyboards/mechwild/sugarglider/sugarglider.c426
-rw-r--r--keyboards/mechwild/sugarglider/sugarglider.h28
-rw-r--r--keyboards/mechwild/sugarglider/wide_oled/f401/rules.mk3
-rw-r--r--keyboards/mechwild/sugarglider/wide_oled/f411/rules.mk3
-rw-r--r--keyboards/mechwild/sugarglider/wide_oled/rules.mk6
20 files changed, 1165 insertions, 0 deletions
diff --git a/keyboards/mechwild/sugarglider/config.h b/keyboards/mechwild/sugarglider/config.h
new file mode 100644
index 0000000000..dc3a85a728
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/config.h
@@ -0,0 +1,41 @@
+// Copyright 2023 Kyle McCreery
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#define DYNAMIC_KEYMAP_LAYER_COUNT 5
+
+/* Matrix COL and ROW definitions */
+#define MATRIX_ROWS 9
+#define MATRIX_COLS 6
+
+/* Cirque Touchpad Settings */
+#define POINTING_DEVICE_AUTO_MOUSE_ENABLE
+#define CIRQUE_PINNACLE_ATTENUATION EXTREG__TRACK_ADCCONFIG__ADC_ATTENUATE_2X
+
+/* Define custom font */
+#define OLED_FONT_H "keyboards/mechwild/sugarglider/glcdfont.c"
+
+/* allows the "key" button on the blackpill to toggle caps lock for user testing before soldering */
+#define DIP_SWITCH_PINS { A0 }
+
+/* TAPPING_TERM value is used for the CIRQUE_PINNACLE_TAPPING_TERM as well by default
+ * defining it this way allows us to easily modify it with DYNAMIC_TAPPING_TERM_ENABLE
+ */
+#define TAPPING_TERM 0
+#define CIRQUE_PINNACLE_TAP_ENABLE
+#define POINTING_DEVICE_GESTURES_SCROLL_ENABLE
+
+/* spi config */
+#define SPI_DRIVER SPID1
+#define SPI_SCK_PIN A5
+#define SPI_SCK_PAL_MODE 5
+#define SPI_MOSI_PIN A7
+#define SPI_MOSI_PAL_MODE 5
+#define SPI_MISO_PIN A6
+#define SPI_MISO_PAL_MODE 5
+#define CIRQUE_PINNACLE_SPI_DIVISOR 8
+#define CIRQUE_PINNACLE_SPI_CS_PIN A3
+
+/* Force NKRO */
+#define FORCE_NKRO
diff --git a/keyboards/mechwild/sugarglider/f401/rules.mk b/keyboards/mechwild/sugarglider/f401/rules.mk
new file mode 100644
index 0000000000..a92d8a85c6
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/f401/rules.mk
@@ -0,0 +1,3 @@
+# MCU name
+MCU = STM32F401
+BOARD = BLACKPILL_STM32_F401
diff --git a/keyboards/mechwild/sugarglider/f411/rules.mk b/keyboards/mechwild/sugarglider/f411/rules.mk
new file mode 100644
index 0000000000..db1d4054fd
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/f411/rules.mk
@@ -0,0 +1,3 @@
+# MCU name
+MCU = STM32F411
+BOARD = BLACKPILL_STM32_F411
diff --git a/keyboards/mechwild/sugarglider/glcdfont.c b/keyboards/mechwild/sugarglider/glcdfont.c
new file mode 100644
index 0000000000..2a0353759d
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/glcdfont.c
@@ -0,0 +1,231 @@
+// Copyright 2023 Kyle McCreery
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "progmem.h"
+
+const unsigned char font[] PROGMEM = {
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00,
+ 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00,
+ 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00,
+ 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00,
+ 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00,
+ 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00,
+ 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00,
+ 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00,
+ 0x00, 0x18, 0x24, 0x18, 0x00, 0x00,
+ 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00,
+ 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00,
+ 0x26, 0x29, 0x79, 0x29, 0x26, 0x00,
+ 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00,
+ 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00,
+ 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00,
+ 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00,
+ 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00,
+ 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00,
+ 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00,
+ 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00,
+ 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00,
+ 0x60, 0x60, 0x60, 0x60, 0x60, 0x00,
+ 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00,
+ 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00,
+ 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00,
+ 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00,
+ 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00,
+ 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00,
+ 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00,
+ 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00,
+ 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00,
+ 0x00, 0x07, 0x00, 0x07, 0x00, 0x00,
+ 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00,
+ 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00,
+ 0x23, 0x13, 0x08, 0x64, 0x62, 0x00,
+ 0x36, 0x49, 0x56, 0x20, 0x50, 0x00,
+ 0x00, 0x08, 0x07, 0x03, 0x00, 0x00,
+ 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00,
+ 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00,
+ 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00,
+ 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00,
+ 0x00, 0x80, 0x70, 0x30, 0x00, 0x00,
+ 0x08, 0x08, 0x08, 0x08, 0x08, 0x00,
+ 0x00, 0x00, 0x60, 0x60, 0x00, 0x00,
+ 0x20, 0x10, 0x08, 0x04, 0x02, 0x00,
+ 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00,
+ 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00,
+ 0x72, 0x49, 0x49, 0x49, 0x46, 0x00,
+ 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00,
+ 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00,
+ 0x27, 0x45, 0x45, 0x45, 0x39, 0x00,
+ 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00,
+ 0x41, 0x21, 0x11, 0x09, 0x07, 0x00,
+ 0x36, 0x49, 0x49, 0x49, 0x36, 0x00,
+ 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00,
+ 0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
+ 0x00, 0x40, 0x34, 0x00, 0x00, 0x00,
+ 0x00, 0x08, 0x14, 0x22, 0x41, 0x00,
+ 0x14, 0x14, 0x14, 0x14, 0x14, 0x00,
+ 0x00, 0x41, 0x22, 0x14, 0x08, 0x00,
+ 0x02, 0x01, 0x59, 0x09, 0x06, 0x00,
+ 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00,
+ 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00,
+ 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00,
+ 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00,
+ 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00,
+ 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00,
+ 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00,
+ 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00,
+ 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00,
+ 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00,
+ 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00,
+ 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00,
+ 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00,
+ 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00,
+ 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00,
+ 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00,
+ 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00,
+ 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00,
+ 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00,
+ 0x26, 0x49, 0x49, 0x49, 0x32, 0x00,
+ 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00,
+ 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00,
+ 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00,
+ 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00,
+ 0x63, 0x14, 0x08, 0x14, 0x63, 0x00,
+ 0x03, 0x04, 0x78, 0x04, 0x03, 0x00,
+ 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00,
+ 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00,
+ 0x02, 0x04, 0x08, 0x10, 0x20, 0x00,
+ 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00,
+ 0x04, 0x02, 0x01, 0x02, 0x04, 0x00,
+ 0x40, 0x40, 0x40, 0x40, 0x40, 0x00,
+ 0x00, 0x03, 0x07, 0x08, 0x00, 0x00,
+ 0x20, 0x54, 0x54, 0x78, 0x40, 0x00,
+ 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00,
+ 0x38, 0x44, 0x44, 0x44, 0x28, 0x00,
+ 0x38, 0x44, 0x44, 0x28, 0x7E, 0x00,
+ 0x38, 0x54, 0x54, 0x54, 0x18, 0x00,
+ 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00,
+ 0x18, 0x24, 0x24, 0x1C, 0x78, 0x00,
+ 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00,
+ 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00,
+ 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00,
+ 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00,
+ 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00,
+ 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00,
+ 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00,
+ 0x38, 0x44, 0x44, 0x44, 0x38, 0x00,
+ 0x7C, 0x18, 0x24, 0x24, 0x18, 0x00,
+ 0x18, 0x24, 0x24, 0x18, 0x7C, 0x00,
+ 0x7C, 0x08, 0x04, 0x04, 0x08, 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F, 0x17, 0x23, 0x41,
+ 0x40, 0x60, 0x21, 0x75, 0x3A, 0x14,
+ 0x00, 0x00, 0x00, 0xE0, 0xFE, 0xFF,
+ 0xFE, 0xF8, 0xC0, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xE0, 0xFC, 0xFF, 0xFE,
+ 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xF8, 0xFF, 0xF7, 0x07,
+ 0x07, 0x1F, 0xFF, 0xFE, 0xF0, 0xC0,
+ 0xF8, 0x3F, 0x8F, 0x0F, 0x3F, 0xFF,
+ 0xFF, 0xFE, 0x80, 0xF0, 0x0C, 0x04,
+ 0xF4, 0x1C, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x1F, 0x1F, 0x1F, 0x07, 0x06,
+ 0xF8, 0x00, 0x00, 0x73, 0x3F, 0x0F,
+ 0xC1, 0x38, 0x07, 0x0F, 0x70, 0x83,
+ 0x07, 0x7F, 0x1F, 0x03, 0xC0, 0x3F,
+ 0x01, 0x3E, 0xE0, 0x80, 0x70, 0x0E,
+ 0x01, 0x00, 0x00, 0x00, 0x00, 0x07,
+ 0x3C, 0xE0, 0x80, 0x78, 0x07, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+};
diff --git a/keyboards/mechwild/sugarglider/halconf.h b/keyboards/mechwild/sugarglider/halconf.h
new file mode 100644
index 0000000000..23a1dc04b3
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/halconf.h
@@ -0,0 +1,12 @@
+// Copyright 2023 Kyle McCreery
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#define HAL_USE_I2C TRUE
+
+#define HAL_USE_SPI TRUE
+#define SPI_USE_WAIT TRUE
+#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD
+
+#include_next <halconf.h>
diff --git a/keyboards/mechwild/sugarglider/info.json b/keyboards/mechwild/sugarglider/info.json
new file mode 100644
index 0000000000..9d9ee27eb5
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/info.json
@@ -0,0 +1,110 @@
+{
+ "manufacturer": "MechWild",
+ "keyboard_name": "Sugar Glider",
+ "maintainer": "kylemccreery",
+ "url": "https://mechwild.com/product/sugar-glider/",
+ "bootloader": "stm32-dfu",
+ "features": {
+ "bootmagic": true,
+ "command": false,
+ "console": false,
+ "extrakey": true,
+ "mousekey": true,
+ "nkro": true,
+ "encoder": true,
+ "rgblight": true,
+ "dip_switch": true,
+ "steno": true
+ },
+ "usb": {
+ "vid": "0x6D77",
+ "pid": "0x1710",
+ "device_version": "0.2.0"
+ },
+ "diode_direction": "COL2ROW",
+ "rgblight": {
+ "led_count": 10,
+ "pin": "B5",
+ "max_brightness": 255,
+ "hue_steps": 8,
+ "saturation_steps": 8,
+ "brightness_steps": 8,
+ "animations": {
+ "alternating": true,
+ "breathing": true,
+ "christmas": true,
+ "knight": true,
+ "rainbow_mood": true,
+ "rainbow_swirl": true,
+ "rgb_test": true,
+ "snake": true,
+ "static_gradient": true,
+ "twinkle": true
+ }
+ },
+ "encoder": {
+ "rotary": [
+ { "pin_a": "B0", "pin_b": "A2", "resolution": 4 },
+ { "pin_a": "B3", "pin_b": "A15", "resolution": 4 },
+ { "pin_a": "B9", "pin_b": "B8", "resolution": 4 },
+ { "pin_a": "C15", "pin_b": "C14", "resolution": 4 }
+ ]
+ },
+ "layouts": {
+ "LAYOUT": {
+ "layout": [
+ { "matrix": [0, 0], "x":0, "y":0},
+ { "matrix": [0, 1], "x":1, "y":0},
+ { "matrix": [0, 2], "x":2, "y":0},
+ { "matrix": [0, 3], "x":3, "y":0},
+ { "matrix": [0, 4], "x":4, "y":0},
+ { "matrix": [0, 5], "x":5, "y":0},
+ { "matrix": [8, 0], "x":9, "y":0},
+ { "matrix": [4, 0], "x":10.5, "y":0},
+ { "matrix": [4, 1], "x":11.5, "y":0},
+ { "matrix": [4, 2], "x":12.5, "y":0},
+ { "matrix": [4, 3], "x":13.5, "y":0},
+ { "matrix": [4, 4], "x":14.5, "y":0},
+ { "matrix": [4, 5], "x":15.5, "y":0},
+ { "matrix": [1, 0], "x":0, "y":1},
+ { "matrix": [1, 1], "x":1, "y":1},
+ { "matrix": [1, 2], "x":2, "y":1},
+ { "matrix": [1, 3], "x":3, "y":1},
+ { "matrix": [1, 4], "x":4, "y":1},
+ { "matrix": [1, 5], "x":5, "y":1},
+ { "matrix": [8, 5], "x":8, "y":1},
+ { "matrix": [8, 1], "x":9, "y":1},
+ { "matrix": [5, 0], "x":10.5, "y":1},
+ { "matrix": [5, 1], "x":11.5, "y":1},
+ { "matrix": [5, 2], "x":12.5, "y":1},
+ { "matrix": [5, 3], "x":13.5, "y":1},
+ { "matrix": [5, 4], "x":14.5, "y":1},
+ { "matrix": [5, 5], "x":15.5, "y":1},
+ { "matrix": [2, 0], "x":0, "y":2},
+ { "matrix": [2, 1], "x":1, "y":2},
+ { "matrix": [2, 2], "x":2, "y":2},
+ { "matrix": [2, 3], "x":3, "y":2},
+ { "matrix": [2, 4], "x":4, "y":2},
+ { "matrix": [2, 5], "x":5, "y":2},
+ { "matrix": [8, 2], "x":9, "y":2},
+ { "matrix": [6, 0], "x":10.5, "y":2},
+ { "matrix": [6, 1], "x":11.5, "y":2},
+ { "matrix": [6, 2], "x":12.5, "y":2},
+ { "matrix": [6, 3], "x":13.5, "y":2},
+ { "matrix": [6, 4], "x":14.5, "y":2},
+ { "matrix": [6, 5], "x":15.5, "y":2},
+ { "matrix": [3, 0], "x":2.25, "y":3.5},
+ { "matrix": [3, 1], "x":3.5, "y":3.5, "h":1.5},
+ { "matrix": [3, 2], "x":4.5, "y":3.5, "h":1.5},
+ { "matrix": [3, 3], "x":5.5, "y":3.5, "h":1.5},
+ { "matrix": [3, 4], "x":6.75, "y":3.5},
+ { "matrix": [7, 0], "x":7.75, "y":3.5},
+ { "matrix": [7, 1], "x":8.75, "y":3.5},
+ { "matrix": [7, 2], "x":10, "y":3.5, "h":1.5},
+ { "matrix": [7, 3], "x":11, "y":3.5, "h":1.5},
+ { "matrix": [7, 4], "x":12, "y":3.5, "h":1.5},
+ { "matrix": [7, 5], "x":13.25, "y":3.5}
+ ]
+ }
+ }
+}
diff --git a/keyboards/mechwild/sugarglider/keymaps/default/keymap.c b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c
new file mode 100644
index 0000000000..77541edf13
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/keymaps/default/keymap.c
@@ -0,0 +1,70 @@
+// Copyright 2023 Kyle McCreery
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include QMK_KEYBOARD_H
+#include "keymap_steno.h"
+
+// Defines names for use in layer keycodes and the keymap
+enum layer_names {
+ _QWERTY,
+ _LOWER,
+ _RAISE,
+ _ADJUST,
+ _MOUSE,
+ _STENO
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [_QWERTY] = LAYOUT(
+ QK_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, TAP_UP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
+ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_MUTE, TAP_DN, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, TG(_STENO), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
+ KC_MUTE, KC_LGUI, KC_LALT, TL_LOWR, KC_MS_BTN1, TAP_TOG, KC_MS_BTN2, TL_UPPR, KC_SPC, KC_RSFT, KC_MUTE
+ ),
+ [_LOWER] = LAYOUT(
+ KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, DPI_UP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
+ KC_TRNS, KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DPI_DN, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_SCLN, KC_SCLN,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+ [_RAISE] = LAYOUT(
+ KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS,
+ KC_TRNS, KC_UNDS, KC_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_PIPE, KC_DQUO, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+ [_ADJUST] = LAYOUT(
+ KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS,
+ KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_RMOD, RGB_TOG,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, RGB_MOD, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+ [_MOUSE] = LAYOUT(
+ 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_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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, DPI_FINE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+ [_STENO] = LAYOUT(
+ STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, KC_TRNS, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC,
+ STN_RES1, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, KC_TRNS, KC_TRNS, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR,
+ STN_RES2, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, KC_TRNS, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR,
+ KC_TRNS, STN_N1, STN_A, STN_O, KC_TRNS, KC_TRNS, KC_TRNS, STN_E, STN_U, STN_N2, KC_TRNS
+ )
+};
+
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][4][2] = {
+ [_QWERTY] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_WH_U, KC_WH_D) },
+ [_LOWER] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(DPI_UP, DPI_DN) },
+ [_RAISE] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT), ENCODER_CCW_CW(KC_HOME, KC_END) },
+ [_ADJUST] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU) },
+ [_MOUSE] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU) },
+ [_STENO] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_HOME, KC_END) }
+};
+#endif
+
+void pointing_device_init_user(void) {
+ set_auto_mouse_layer(_MOUSE);
+ set_auto_mouse_enable(true);
+}
diff --git a/keyboards/mechwild/sugarglider/keymaps/default/rules.mk b/keyboards/mechwild/sugarglider/keymaps/default/rules.mk
new file mode 100644
index 0000000000..14d46f300c
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/keymaps/default/rules.mk
@@ -0,0 +1,2 @@
+ENCODER_MAP_ENABLE = yes
+TRI_LAYER_ENABLE = yes
diff --git a/keyboards/mechwild/sugarglider/keymaps/via/keymap.c b/keyboards/mechwild/sugarglider/keymaps/via/keymap.c
new file mode 100644
index 0000000000..692af70359
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/keymaps/via/keymap.c
@@ -0,0 +1,61 @@
+// Copyright 2023 Kyle McCreery
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include QMK_KEYBOARD_H
+
+// Defines names for use in layer keycodes and the keymap
+enum layer_names {
+ _QWERTY,
+ _LOWER,
+ _RAISE,
+ _ADJUST,
+ _MOUSE
+};
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [_QWERTY] = LAYOUT(
+ QK_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, TAP_UP, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
+ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_MUTE, TAP_DN, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT,
+ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_TRNS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,
+ KC_MUTE, KC_LGUI, KC_LALT, MO(_LOWER), KC_MS_BTN1, TAP_TOG, KC_MS_BTN2, MO(_RAISE), KC_SPC, KC_RSFT, KC_MUTE
+ ),
+ [_LOWER] = LAYOUT(
+ KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, DPI_UP, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL,
+ KC_TRNS, KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DPI_DN, KC_TRNS, KC_LBRC, KC_RBRC, KC_BSLS, KC_QUOT, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+ [_RAISE] = LAYOUT(
+ KC_TRNS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TRNS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS,
+ KC_TRNS, KC_UNDS, KC_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_PIPE, KC_DQUO, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+ [_ADJUST] = LAYOUT(
+ KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS,
+ KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_RMOD, RGB_TOG,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAI, RGB_MOD, KC_TRNS,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ ),
+ [_MOUSE] = LAYOUT(
+ 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_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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
+ KC_TRNS, DPI_FINE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ )
+};
+
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][4][2] = {
+ [_QWERTY] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_VOLD, KC_VOLU), ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(KC_WH_U, KC_WH_D) },
+ [_LOWER] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(DPI_UP, DPI_DN) },
+ [_RAISE] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_HOME, KC_END), ENCODER_CCW_CW(KC_LEFT, KC_RIGHT), ENCODER_CCW_CW(KC_HOME, KC_END) },
+ [_ADJUST] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU) },
+ [_MOUSE] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_BRID, KC_BRIU) }
+};
+#endif
+
+void pointing_device_init_user(void) {
+ set_auto_mouse_layer(_MOUSE);
+ set_auto_mouse_enable(true);
+}
diff --git a/keyboards/mechwild/sugarglider/keymaps/via/rules.mk b/keyboards/mechwild/sugarglider/keymaps/via/rules.mk
new file mode 100644
index 0000000000..6591ae3653
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/keymaps/via/rules.mk
@@ -0,0 +1,5 @@
+VIA_ENABLE = yes
+ENCODER_MAP_ENABLE = yes
+
+# Steno needs to be disabled to allow endpoints for VIA
+STENO_ENABLE = no # Enable stenography endpoint
diff --git a/keyboards/mechwild/sugarglider/matrix.c b/keyboards/mechwild/sugarglider/matrix.c
new file mode 100644
index 0000000000..96a16df542
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/matrix.c
@@ -0,0 +1,95 @@
+// Copyright 2023 Kyle McCreery
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "matrix.h"
+#include "mcp23018.h"
+#include "wait.h"
+#include "debug.h"
+#include "encoder.h"
+
+#define I2C_ADDR 0x20
+#define ROW_POS { 0b01000000, 0b10000000, 0b01000000, 0b10000000, 0b00000100, 0b00010000, 0b00100000, 0b00000010, 0b00001000 }
+
+static uint8_t mcp23018_errors = 0;
+
+static void mcp23018_init_cols(void) {
+ mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTA, ALL_INPUT);
+ mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTB, ALL_INPUT);
+}
+
+static void mcp23018_scan(void) {
+ if (!mcp23018_errors) {
+ return;
+ }
+
+ static uint16_t mcp23018_reset_loop = 0;
+ if (++mcp23018_reset_loop > 0x1FFF) {
+ // tuned to about 5s given the current scan rate
+ dprintf("trying to reset mcp23018\n");
+ mcp23018_reset_loop = 0;
+ mcp23018_errors = 0;
+ mcp23018_init_cols();
+ }
+}
+
+static matrix_row_t read_cols(void) {
+ if (mcp23018_errors) {
+ return 0;
+ }
+
+ uint8_t ret = 0xFF; // sets all to 1
+ mcp23018_errors += !mcp23018_readPins(I2C_ADDR, mcp23018_PORTB, &ret); // will update with values 0 = pulled down by connection, 1 = pulled up by pullup resistors
+
+ return (~ret) & 0b00111111; // Clears out the two row bits in the B buffer.
+}
+
+static void select_row(uint8_t row) {
+ uint8_t row_pos[MATRIX_ROWS] = ROW_POS;
+ if (mcp23018_errors) {
+ // wait to mimic i2c interactions
+ //wait_us(100);
+ return;
+ }
+
+ if (row > 1) {
+ mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTB, ALL_INPUT);
+ mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTA, ~(row_pos[row]));
+ } else {
+ mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTA, ALL_INPUT);
+ mcp23018_errors += !mcp23018_set_config(I2C_ADDR, mcp23018_PORTB, ~(row_pos[row]));
+ }
+}
+
+static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) {
+ // Store last value of row prior to reading
+ matrix_row_t last_row_value = current_matrix[current_row];
+
+ // Clear data in matrix row
+ current_matrix[current_row] = 0;
+
+ // Select row and wait for row selection to stabilize
+ select_row(current_row);
+ // Skip the wait_us(30); as i2c is slow enough to debounce the io changes
+
+ current_matrix[current_row] = read_cols();
+
+ return (last_row_value != current_matrix[current_row]);
+}
+
+void matrix_init_custom(void) {
+ mcp23018_init(I2C_ADDR);
+ mcp23018_init_cols();
+}
+
+bool matrix_scan_custom(matrix_row_t current_matrix[]) {
+ mcp23018_scan();
+
+ bool changed = false;
+ for (uint8_t current_row = 0; current_row < MATRIX_ROWS; current_row++) {
+ changed |= read_cols_on_row(current_matrix, current_row);
+#ifdef ENCODER_ENABLE
+ encoder_read();
+#endif
+ }
+ return changed;
+}
diff --git a/keyboards/mechwild/sugarglider/mcuconf.h b/keyboards/mechwild/sugarglider/mcuconf.h
new file mode 100644
index 0000000000..7fe5770909
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/mcuconf.h
@@ -0,0 +1,12 @@
+// Copyright 2023 Kyle McCreery (@kylemccreery)
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include_next <mcuconf.h>
+
+#undef STM32_I2C_USE_I2C1
+#define STM32_I2C_USE_I2C1 TRUE
+
+#undef STM32_SPI_USE_SPI1
+#define STM32_SPI_USE_SPI1 TRUE
diff --git a/keyboards/mechwild/sugarglider/post_rules.mk b/keyboards/mechwild/sugarglider/post_rules.mk
new file mode 100644
index 0000000000..c94ac22fab
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/post_rules.mk
@@ -0,0 +1,4 @@
+# Checking if WIDE_OLED
+ifeq ($(strip $(WIDE_OLED_ENABLE)), yes)
+ OPT_DEFS += -DOLED_DISPLAY_128X64
+endif
diff --git a/keyboards/mechwild/sugarglider/readme.md b/keyboards/mechwild/sugarglider/readme.md
new file mode 100644
index 0000000000..df6942eed2
--- /dev/null
+++ b/keyboards/mechwild/sugarglider/readme.md
@@ -0,0 +1,27 @@
+# mechwild/sugarglider
+
+![mechwild/sugarglider](https://i.imgur.com/IYhOU3xh.jpg)
+
+The Sugar Glider is an ergonomic keyboard with columnar stagger and a central touchpad, OLED, and status LEDs.
+
+* Keyboard Maintainer: [Kyle McCreery](https://github.com/kylemccreery)
+* Hardware Supported: Sugar Glider v0.2
+* Hardware Availability: [Sugar Glider on MechWild](