From 55987542e1165aedf826012bf940a235b6afe610 Mon Sep 17 00:00:00 2001
From: rhmokey <57172003+rhmokey@users.noreply.github.com>
Date: Tue, 13 Jun 2023 23:17:55 +0800
Subject: [PATCH] [Keyboard] Add mokey12x2 (#20702)

Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Joel Challis <git@zvecr.com>
---
 keyboards/mokey/mokey12x2/info.json           | 47 +++++++++++++++++++
 .../mokey/mokey12x2/keymaps/default/keymap.c  | 26 ++++++++++
 .../mokey/mokey12x2/keymaps/via/keymap.c      | 26 ++++++++++
 .../mokey/mokey12x2/keymaps/via/rules.mk      |  1 +
 keyboards/mokey/mokey12x2/readme.md           | 23 +++++++++
 keyboards/mokey/mokey12x2/rules.mk            |  1 +
 6 files changed, 124 insertions(+)
 create mode 100644 keyboards/mokey/mokey12x2/info.json
 create mode 100644 keyboards/mokey/mokey12x2/keymaps/default/keymap.c
 create mode 100644 keyboards/mokey/mokey12x2/keymaps/via/keymap.c
 create mode 100644 keyboards/mokey/mokey12x2/keymaps/via/rules.mk
 create mode 100644 keyboards/mokey/mokey12x2/readme.md
 create mode 100644 keyboards/mokey/mokey12x2/rules.mk

diff --git a/keyboards/mokey/mokey12x2/info.json b/keyboards/mokey/mokey12x2/info.json
new file mode 100644
index 0000000000..6f22429e72
--- /dev/null
+++ b/keyboards/mokey/mokey12x2/info.json
@@ -0,0 +1,47 @@
+{
+    "keyboard_name": "Mokey12x2",
+    "manufacturer": "Mokey",
+    "url": "",
+    "maintainer": "Mokey",
+    "development_board": "bluepill",
+    "diode_direction": "COL2ROW",
+    "matrix_pins": {
+        "cols": ["A6", "A5", "A4", "A3", "B9"],
+        "rows": ["A2", "A1", "A0", "A7"]
+    },
+    "usb": {
+        "device_version": "0.0.1",
+        "vid": "0x6653",
+        "pid": "0x012A"
+    },
+    "features": {
+        "bootmagic": true,
+        "extrakey": true,
+        "mousekey": true,
+        "nkro": true
+    },
+    "layouts": {
+        "LAYOUT": {
+            "layout": [
+                {"matrix": [0,0], "x":0.25, "y":2.75},
+                {"matrix": [0,1], "x":1.25, "y":2.75},
+                {"matrix": [0,2], "x":2.25, "y":2.75},
+                {"matrix": [0,3], "x":3.25, "y":2.75},
+                {"matrix": [0,4], "x":0.25, "y":0, "w":1.5, "h":1.5},
+                {"matrix": [1,0], "x":0.25, "y":3.75},
+                {"matrix": [1,1], "x":1.25, "y":3.75},
+                {"matrix": [1,2], "x":2.25, "y":3.75},
+                {"matrix": [1,3], "x":3.25, "y":3.75},
+                {"matrix": [1,4], "x":2.75, "y":0, "w":1.5, "h":1.5},
+                {"matrix": [2,0], "x":0.25, "y":4.75},
+                {"matrix": [2,1], "x":1.25, "y":4.75},
+                {"matrix": [2,2], "x":2.25, "y":4.75},
+                {"matrix": [2,3], "x":3.25, "y":4.75},
+                {"matrix": [3,0], "x":0, "y":1.5},
+                {"matrix": [3,1], "x":1, "y":1.5},
+                {"matrix": [3,2], "x":2.5, "y":1.5},
+                {"matrix": [3,3], "x":3.5, "y":1.5}
+            ]
+        }
+    }
+}
diff --git a/keyboards/mokey/mokey12x2/keymaps/default/keymap.c b/keyboards/mokey/mokey12x2/keymaps/default/keymap.c
new file mode 100644
index 0000000000..74fbf1e947
--- /dev/null
+++ b/keyboards/mokey/mokey12x2/keymaps/default/keymap.c
@@ -0,0 +1,26 @@
+/* 
+ * Copyright 2023 Mokey12×2
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    [0] = LAYOUT(
+           KC_A,    KC_B,    KC_C,    KC_D,   KC_1,
+           KC_E,    KC_F,    KC_G,    KC_H,   KC_2,
+           KC_I,    KC_J,    KC_K,    KC_L,
+           KC_I,    KC_J,    KC_K,    KC_L)
+};
diff --git a/keyboards/mokey/mokey12x2/keymaps/via/keymap.c b/keyboards/mokey/mokey12x2/keymaps/via/keymap.c
new file mode 100644
index 0000000000..74fbf1e947
--- /dev/null
+++ b/keyboards/mokey/mokey12x2/keymaps/via/keymap.c
@@ -0,0 +1,26 @@
+/* 
+ * Copyright 2023 Mokey12×2
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+    [0] = LAYOUT(
+           KC_A,    KC_B,    KC_C,    KC_D,   KC_1,
+           KC_E,    KC_F,    KC_G,    KC_H,   KC_2,
+           KC_I,    KC_J,    KC_K,    KC_L,
+           KC_I,    KC_J,    KC_K,    KC_L)
+};
diff --git a/keyboards/mokey/mokey12x2/keymaps/via/rules.mk b/keyboards/mokey/mokey12x2/keymaps/via/rules.mk
new file mode 100644
index 0000000000..1e5b99807c
--- /dev/null
+++ b/keyboards/mokey/mokey12x2/keymaps/via/rules.mk
@@ -0,0 +1 @@
+VIA_ENABLE = yes
diff --git a/keyboards/mokey/mokey12x2/readme.md b/keyboards/mokey/mokey12x2/readme.md
new file mode 100644
index 0000000000..75a87062c9
--- /dev/null
+++ b/keyboards/mokey/mokey12x2/readme.md
@@ -0,0 +1,23 @@
+# mokey12x2
+
+A Blue Pill STM32F103C8T6-based keyboard.
+
+* Keyboard Maintainer: [rhmokey](https://github.com/rhmokey)
+* Hardware Supported: [rhmokey](https://github.com/rhmokey)
+
+Make example for this keyboard (after setting up your build environment):
+
+    make mokey/mokey12x2:default
+
+Flashing example for this keyboard:
+
+    make mokey/mokey12x2: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 2 ways:
+
+* **Physical reset button**: Briefly press the button: [boot] first, then press button: [reset]  on the back of the PCB
+* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available
\ No newline at end of file
diff --git a/keyboards/mokey/mokey12x2/rules.mk b/keyboards/mokey/mokey12x2/rules.mk
new file mode 100644
index 0000000000..6e7633bfe0
--- /dev/null
+++ b/keyboards/mokey/mokey12x2/rules.mk
@@ -0,0 +1 @@
+# This file intentionally left blank