From fbf1c160eb286a2d84afcdf72b48338567e16bdb Mon Sep 17 00:00:00 2001
From: NCKiser <37519411+NCKiser@users.noreply.github.com>
Date: Sat, 2 Sep 2023 23:37:25 -0500
Subject: [PATCH] Added Madeline (#531)
* add default and vial keymaps
* fix readme
* Move entirely to data driven, matching QMK PR
Update to match https://github.com/qmk/qmk_firmware/pull/21857
* Update keyboards/kiserdesigns/madeline/keymaps/vial/vial.json
Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com>
* Update keyboards/kiserdesigns/madeline/keymaps/vial/rules.mk
Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com>
* Update keyboards/kiserdesigns/madeline/keymaps/vial/keymap.c
Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com>
* Update keyboards/kiserdesigns/madeline/keymaps/vial/keymap.c
Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com>
* Match number of layers b/t keymap and encodermap
This reverts commit db72bf0baf69044d8ca9447170b051fb0daab2cb.
* format info.json
---------
Co-authored-by: Less/Rikki <86894501+lesshonor@users.noreply.github.com>
---
keyboards/kiserdesigns/madeline/config.h | 25 +++
keyboards/kiserdesigns/madeline/info.json | 77 ++++++++
.../madeline/keymaps/default/keymap.c | 53 +++++
.../madeline/keymaps/default/rules.mk | 1 +
.../madeline/keymaps/vial/config.h | 27 +++
.../madeline/keymaps/vial/keymap.c | 46 +++++
.../madeline/keymaps/vial/rules.mk | 3 +
.../madeline/keymaps/vial/vial.json | 186 ++++++++++++++++++
keyboards/kiserdesigns/madeline/readme.md | 23 +++
keyboards/kiserdesigns/madeline/rules.mk | 1 +
10 files changed, 442 insertions(+)
create mode 100644 keyboards/kiserdesigns/madeline/config.h
create mode 100644 keyboards/kiserdesigns/madeline/info.json
create mode 100644 keyboards/kiserdesigns/madeline/keymaps/default/keymap.c
create mode 100644 keyboards/kiserdesigns/madeline/keymaps/default/rules.mk
create mode 100644 keyboards/kiserdesigns/madeline/keymaps/vial/config.h
create mode 100644 keyboards/kiserdesigns/madeline/keymaps/vial/keymap.c
create mode 100644 keyboards/kiserdesigns/madeline/keymaps/vial/rules.mk
create mode 100644 keyboards/kiserdesigns/madeline/keymaps/vial/vial.json
create mode 100644 keyboards/kiserdesigns/madeline/readme.md
create mode 100644 keyboards/kiserdesigns/madeline/rules.mk
diff --git a/keyboards/kiserdesigns/madeline/config.h b/keyboards/kiserdesigns/madeline/config.h
new file mode 100644
index 0000000000..8522d7cd43
--- /dev/null
+++ b/keyboards/kiserdesigns/madeline/config.h
@@ -0,0 +1,25 @@
+/* Copyright 2021 Noah Kiser (NCKiser)
+ *
+ * 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 .
+ */
+#pragma once
+
+#define LOCKING_SUPPORT_ENABLE
+#define LOCKING_RESYNC_ENABLE
+
+#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET
+#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_LED GP17
+#define RP2040_BOOTLOADER_DOUBLE_TAP_RESET_TIMEOUT 1000U
+
+#define RP2040_FLASH_GENERIC_03H
diff --git a/keyboards/kiserdesigns/madeline/info.json b/keyboards/kiserdesigns/madeline/info.json
new file mode 100644
index 0000000000..73d3f5ccff
--- /dev/null
+++ b/keyboards/kiserdesigns/madeline/info.json
@@ -0,0 +1,77 @@
+{
+ "manufacturer": "rubybuilds",
+ "keyboard_name": "Madeline",
+ "maintainer": "NCKiser",
+ "bootloader": "rp2040",
+ "diode_direction": "COL2ROW",
+ "encoder": {
+ "enabled": true,
+ "rotary": [
+ {"pin_a": "GP13", "pin_b": "GP15"}
+ ]
+ },
+ "features": {
+ "bootmagic": true,
+ "command": false,
+ "console": false,
+ "extrakey": true,
+ "mousekey": true,
+ "nkro": true
+ },
+ "matrix_pins": {
+ "cols": ["GP25", "GP26", "GP27", "GP28", "GP29", "GP9", "GP0", "GP1", "GP2", "GP3"],
+ "rows": ["GP5", "GP4", "GP12", "GP7"]
+ },
+ "processor": "RP2040",
+ "qmk": {
+ "tap_keycode_delay": 10
+ },
+ "url": "https://qmk.fm/keyboards",
+ "usb": {
+ "device_version": "0.0.1",
+ "pid": "0x6D64",
+ "vid": "0x5242"
+ },
+ "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": 6.5, "y": 0},
+ {"matrix": [0, 6], "x": 7.5, "y": 0},
+ {"matrix": [0, 7], "x": 8.5, "y": 0},
+ {"matrix": [0, 8], "x": 9.5, "y": 0},
+ {"matrix": [0, 9], "x": 10.5, "y": 0, "w": 1.25},
+ {"matrix": [1, 0], "x": 0, "y": 1, "w": 1.25},
+ {"matrix": [1, 1], "x": 1.25, "y": 1},
+ {"matrix": [1, 2], "x": 2.25, "y": 1},
+ {"matrix": [1, 3], "x": 3.25, "y": 1},
+ {"matrix": [1, 4], "x": 4.25, "y": 1},
+ {"matrix": [1, 5], "x": 6.75, "y": 1},
+ {"matrix": [1, 6], "x": 7.75, "y": 1},
+ {"matrix": [1, 7], "x": 8.75, "y": 1},
+ {"matrix": [1, 8], "x": 9.75, "y": 1},
+ {"matrix": [1, 9], "x": 10.75, "y": 1},
+ {"matrix": [2, 0], "x": 0, "y": 2, "w": 1.75},
+ {"matrix": [2, 1], "x": 1.75, "y": 2},
+ {"matrix": [2, 2], "x": 2.75, "y": 2},
+ {"matrix": [2, 3], "x": 3.75, "y": 2},
+ {"matrix": [2, 4], "x": 4.75, "y": 2},
+ {"matrix": [2, 5], "x": 6.25, "y": 2},
+ {"matrix": [2, 6], "x": 7.25, "y": 2},
+ {"matrix": [2, 7], "x": 8.25, "y": 2},
+ {"matrix": [2, 8], "x": 9.25, "y": 2},
+ {"matrix": [2, 9], "x": 10.25, "y": 2, "w": 1.5},
+ {"matrix": [3, 0], "x": 0, "y": 3},
+ {"matrix": [3, 1], "x": 2.5, "y": 3},
+ {"matrix": [3, 3], "x": 3.5, "y": 3, "w": 2.25},
+ {"matrix": [3, 6], "x": 6.25, "y": 3, "w": 2},
+ {"matrix": [3, 7], "x": 8.25, "y": 3},
+ {"matrix": [3, 9], "x": 10.75, "y": 3}
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/keyboards/kiserdesigns/madeline/keymaps/default/keymap.c b/keyboards/kiserdesigns/madeline/keymaps/default/keymap.c
new file mode 100644
index 0000000000..c1af9a9f32
--- /dev/null
+++ b/keyboards/kiserdesigns/madeline/keymaps/default/keymap.c
@@ -0,0 +1,53 @@
+/* Copyright 2021 Noah Kiser (NCKiser)
+ *
+ * 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 .
+ */
+#include QMK_KEYBOARD_H
+
+enum layers {
+ _BASE,
+ _NUM_SYM
+};
+
+#define KC_NUM_SPC LT(_NUM_SYM, KC_SPC)
+#define KC_GA LGUI_T(KC_A)
+#define KC_AS LALT_T(KC_S)
+#define KC_CD LCTL_T(KC_D)
+#define KC_SF LSFT_T(KC_F)
+#define KC_SJ RSFT_T(KC_J)
+#define KC_CK RCTL_T(KC_K)
+#define KC_AL RALT_T(KC_L)
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [_BASE] = LAYOUT(
+ KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
+ KC_GA, KC_AS, KC_CD, KC_SF, KC_G, KC_H, KC_SJ, KC_CK, KC_AL, KC_ENT,
+ KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,
+ KC_LCTL, KC_LALT, KC_BSPC, KC_NUM_SPC, KC_RGUI, KC_RCTL
+ ),
+
+ [_NUM_SYM] = LAYOUT(
+ KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
+ KC_ESC, KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_BSPC,
+ KC_LCBR, KC_LBRC, KC_LPRN, KC_UNDS, KC_NO, KC_RPRN, KC_RBRC, KC_RCBR, KC_SCLN, KC_QUOTE,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ )
+};
+
+#if defined(ENCODER_MAP_ENABLE)
+ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
+ [0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
+ [1] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) }
+ };
+#endif
diff --git a/keyboards/kiserdesigns/madeline/keymaps/default/rules.mk b/keyboards/kiserdesigns/madeline/keymaps/default/rules.mk
new file mode 100644
index 0000000000..ee32568148
--- /dev/null
+++ b/keyboards/kiserdesigns/madeline/keymaps/default/rules.mk
@@ -0,0 +1 @@
+ENCODER_MAP_ENABLE = yes
diff --git a/keyboards/kiserdesigns/madeline/keymaps/vial/config.h b/keyboards/kiserdesigns/madeline/keymaps/vial/config.h
new file mode 100644
index 0000000000..4fe3120698
--- /dev/null
+++ b/keyboards/kiserdesigns/madeline/keymaps/vial/config.h
@@ -0,0 +1,27 @@
+ /* 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 .
+ */
+#pragma once
+
+#define VIAL_KEYBOARD_UID {0x19, 0x2F, 0x03, 0x95, 0xE3, 0xAA, 0x1B, 0x85}
+
+#define VIAL_TAP_DANCE_ENTRIES 32
+
+#define VIAL_COMBO_ENTRIES 32
+
+#define DYNAMIC_KEYMAP_LAYER_COUNT 8
+
+#define VIAL_UNLOCK_COMBO_ROWS { 0, 1 }
+#define VIAL_UNLOCK_COMBO_COLS { 0, 9 }
+
+
diff --git a/keyboards/kiserdesigns/madeline/keymaps/vial/keymap.c b/keyboards/kiserdesigns/madeline/keymaps/vial/keymap.c
new file mode 100644
index 0000000000..62c265c502
--- /dev/null
+++ b/keyboards/kiserdesigns/madeline/keymaps/vial/keymap.c
@@ -0,0 +1,46 @@
+ /* 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 .
+ */
+#include QMK_KEYBOARD_H
+
+#define KC_NUM_SPC LT(1, KC_SPC)
+#define KC_GA LGUI_T(KC_A)
+#define KC_AS LALT_T(KC_S)
+#define KC_CD LCTL_T(KC_D)
+#define KC_SF LSFT_T(KC_F)
+#define KC_SJ RSFT_T(KC_J)
+#define KC_CK RCTL_T(KC_K)
+#define KC_AL RALT_T(KC_L)
+#define KC_GSCLN RGUI_T(KC_SCLN)
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ [0] = LAYOUT(
+ KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
+ KC_GA, KC_AS, KC_CD, KC_SF, KC_G, KC_H, KC_SJ, KC_CK, KC_AL, KC_ENT,
+ KC_Z, KC_X, KC_C, KC_V, KC_B, KC_B, KC_N, KC_M, KC_COMM, KC_DOT,
+ KC_LCTL, KC_LALT, KC_BSPC, KC_NUM_SPC, KC_RGUI, KC_RCTL
+ ),
+ [1] = LAYOUT(
+ KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
+ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_EQUAL, KC_MINS,
+ KC_LCBR, KC_LBRC, KC_LPRN, KC_UNDS, KC_NO, KC_RPRN, KC_RBRC, KC_RCBR, KC_SCLN, KC_QUOTE,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
+ )
+};
+
+#if defined(ENCODER_MAP_ENABLE)
+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
+ [0] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN) },
+ [1] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }
+};
+#endif
diff --git a/keyboards/kiserdesigns/madeline/keymaps/vial/rules.mk b/keyboards/kiserdesigns/madeline/keymaps/vial/rules.mk
new file mode 100644
index 0000000000..c6bf6798de
--- /dev/null
+++ b/keyboards/kiserdesigns/madeline/keymaps/vial/rules.mk
@@ -0,0 +1,3 @@
+VIA_ENABLE = yes
+VIAL_ENABLE = yes
+ENCODER_MAP_ENABLE = yes
\ No newline at end of file
diff --git a/keyboards/kiserdesigns/madeline/keymaps/vial/vial.json b/keyboards/kiserdesigns/madeline/keymaps/vial/vial.json
new file mode 100644
index 0000000000..73d0b5f56c
--- /dev/null
+++ b/keyboards/kiserdesigns/madeline/keymaps/vial/vial.json
@@ -0,0 +1,186 @@
+{
+ "matrix": {
+ "rows": 4,
+ "cols": 10
+ },
+ "layouts": {
+ "keymap": [
+ [
+ {
+ "y": 0.24,
+ "x": 0.3
+ },
+ "0,0"
+ ],
+ [
+ {
+ "x": 0.16,
+ "w": 1.25
+ },
+ "1,0"
+ ],
+ [
+ {
+ "y": -0.58,
+ "x": 6.25
+ },
+ "0,0\n\n\n\n\n\n\n\n\ne"
+ ],
+ [
+ {
+ "y": -0.42,
+ "x": 0.01,
+ "w": 1.75
+ },
+ "2,0"
+ ],
+ [
+ {
+ "y": -0.58,
+ "x": 6.25
+ },
+ "0,1\n\n\n\n\n\n\n\n\ne"
+ ],
+ [
+ {
+ "y": -0.42,
+ "x": 0.1
+ },
+ "3,0"
+ ],
+ [
+ {
+ "rx": 1.5,
+ "y": 0.24,
+ "x": 10.2,
+ "w": 1.25
+ },
+ "0,9"
+ ],
+ [
+ {
+ "x": 10.59
+ },
+ "1,9"
+ ],
+ [
+ {
+ "x": 10.23,
+ "w": 1.5
+ },
+ "2,9"
+ ],
+ [
+ {
+ "x": 10.63
+ },
+ "3,9"
+ ],
+ [
+ {
+ "r": 8,
+ "rx": 0,
+ "y": 0,
+ "x": 3.44
+ },
+ "0,3"
+ ],
+ [
+ {
+ "y": -1,
+ "x": 1.44
+ },
+ "0,1",
+ "0,2",
+ {
+ "x": 1
+ },
+ "0,4"
+ ],
+ [
+ {
+ "x": 1.69
+ },
+ "1,1",
+ "1,2",
+ "1,3",
+ {
+ "x": 0
+ },
+ "1,4"
+ ],
+ [
+ {
+ "x": 2.19
+ },
+ "2,1",
+ "2,2",
+ {
+ "x": 0
+ },
+ "2,3",
+ "2,4"
+ ],
+ [
+ {
+ "x": 2.94
+ },
+ "3,1",
+ {
+ "w": 2.25
+ },
+ "3,3"
+ ],
+ [
+ {
+ "r": -8,
+ "rx": 1.5,
+ "y": 1.66,
+ "x": 5.94
+ },
+ "0,5",
+ {
+ "x": 0
+ },
+ "0,6",
+ "0,7",
+ "0,8"
+ ],
+ [
+ {
+ "x": 6.19
+ },
+ "1,5",
+ {
+ "x": 0
+ },
+ "1,6",
+ "1,7",
+ "1,8"
+ ],
+ [
+ {
+ "x": 5.69
+ },
+ "2,5",
+ {
+ "x": 0
+ },
+ "2,6",
+ "2,7",
+ "2,8"
+ ],
+ [
+ {
+ "x": 5.69,
+ "w": 2
+ },
+ "3,6",
+ {
+ "x": 0
+ },
+ "3,7"
+ ]
+ ]
+ }
+ }
\ No newline at end of file
diff --git a/keyboards/kiserdesigns/madeline/readme.md b/keyboards/kiserdesigns/madeline/readme.md
new file mode 100644
index 0000000000..138368282a
--- /dev/null
+++ b/keyboards/kiserdesigns/madeline/readme.md
@@ -0,0 +1,23 @@
+# Madeline
+
+![Madeline](https://i.imgur.com/MBT5kg2h.jpg)
+
+*A cool QAZ-Alice hybrid designed based on the Adalyn by [Marv](https://github.com/MarvFPV/Adalyn) with a PCB by [Rossman360](https://github.com/Rossman360)*
+* Keyboard Maintainer: [NCKiser](https://github.com/NCKiser)
+* Hardware Supported: Madeline PCB, rp2040
+* Hardware Availability: kb.rubybuilds.com
+
+Make example for this keyboard (after setting up your build environment):
+
+ make kiserdesigns/madeline:default
+
+Flashing example for this keyboard:
+
+ make kiserdesigns/madeline:default:flash
+
+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).
+## Bootloader
+Enter the bootloader in 3 ways:
+* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key or Escape) and plug in the keyboard
+* **Physical reset button**: Briefly double-tap the button on the back of the PCB - some may have pads you must short instead
+* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
diff --git a/keyboards/kiserdesigns/madeline/rules.mk b/keyboards/kiserdesigns/madeline/rules.mk
new file mode 100644
index 0000000000..6e7633bfe0
--- /dev/null
+++ b/keyboards/kiserdesigns/madeline/rules.mk
@@ -0,0 +1 @@
+# This file intentionally left blank