From 4c9c42fda5e880ae3796515f8c4cd56b3b855349 Mon Sep 17 00:00:00 2001
From: Vino Rodrigues <366673+vinorodrigues@users.noreply.github.com>
Date: Thu, 2 Mar 2023 23:50:16 +1100
Subject: [PATCH 1/3] Add Binepad BN009 v2
---
keyboards/binepad/bn009v2/config.h | 22 ++++++++++
keyboards/binepad/bn009v2/info.json | 41 +++++++++++++++++++
.../binepad/bn009v2/keymaps/vial/config.h | 9 ++++
.../binepad/bn009v2/keymaps/vial/keymap.c | 39 ++++++++++++++++++
.../binepad/bn009v2/keymaps/vial/rules.mk | 2 +
.../binepad/bn009v2/keymaps/vial/vial.json | 11 +++++
keyboards/binepad/bn009v2/readme.md | 27 ++++++++++++
keyboards/binepad/bn009v2/rules.mk | 1 +
8 files changed, 152 insertions(+)
create mode 100644 keyboards/binepad/bn009v2/config.h
create mode 100644 keyboards/binepad/bn009v2/info.json
create mode 100644 keyboards/binepad/bn009v2/keymaps/vial/config.h
create mode 100644 keyboards/binepad/bn009v2/keymaps/vial/keymap.c
create mode 100644 keyboards/binepad/bn009v2/keymaps/vial/rules.mk
create mode 100644 keyboards/binepad/bn009v2/keymaps/vial/vial.json
create mode 100644 keyboards/binepad/bn009v2/readme.md
create mode 100644 keyboards/binepad/bn009v2/rules.mk
diff --git a/keyboards/binepad/bn009v2/config.h b/keyboards/binepad/bn009v2/config.h
new file mode 100644
index 00000000000..7e40d6c1b56
--- /dev/null
+++ b/keyboards/binepad/bn009v2/config.h
@@ -0,0 +1,22 @@
+// Copyright 2023 binepad (@binepad)
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#define HOLD_ON_OTHER_KEY_PRESS
+
+/*
+ * Feature disable options
+ * These options are also useful to firmware size reduction.
+ */
+
+/* disable debug print */
+//#define NO_DEBUG
+
+/* disable print */
+//#define NO_PRINT
+
+/* disable action features */
+//#define NO_ACTION_LAYER
+//#define NO_ACTION_TAPPING
+//#define NO_ACTION_ONESHOT
diff --git a/keyboards/binepad/bn009v2/info.json b/keyboards/binepad/bn009v2/info.json
new file mode 100644
index 00000000000..756a035535c
--- /dev/null
+++ b/keyboards/binepad/bn009v2/info.json
@@ -0,0 +1,41 @@
+{
+ "manufacturer": "Binepad",
+ "keyboard_name": "BN009",
+ "maintainer": "binepad",
+ "bootloader": "stm32duino",
+ "diode_direction": "COL2ROW",
+ "features": {
+ "bootmagic": true,
+ "command": false,
+ "console": false,
+ "extrakey": true,
+ "mousekey": true,
+ "nkro": false
+ },
+ "matrix_pins": {
+ "cols": ["A1", "A2", "A6"],
+ "rows": ["B6", "B7", "B2"]
+ },
+ "processor": "STM32F103",
+ "url": "http://binepad.com",
+ "usb": {
+ "vid": "0x4249",
+ "pid": "0x4295",
+ "device_version": "2.0.0"
+ },
+ "layouts": {
+ "LAYOUT_ortho_3x3": {
+ "layout": [
+ { "matrix": [0, 0], "x": 0, "y": 0 },
+ { "matrix": [0, 1], "x": 1, "y": 0 },
+ { "matrix": [0, 2], "x": 2, "y": 0 },
+ { "matrix": [1, 0], "x": 0, "y": 1 },
+ { "matrix": [1, 1], "x": 1, "y": 1 },
+ { "matrix": [1, 2], "x": 2, "y": 1 },
+ { "matrix": [2, 0], "x": 0, "y": 2 },
+ { "matrix": [2, 1], "x": 1, "y": 2 },
+ { "matrix": [2, 2], "x": 2, "y": 2 }
+ ]
+ }
+ }
+}
\ No newline at end of file
diff --git a/keyboards/binepad/bn009v2/keymaps/vial/config.h b/keyboards/binepad/bn009v2/keymaps/vial/config.h
new file mode 100644
index 00000000000..c6137aef2ff
--- /dev/null
+++ b/keyboards/binepad/bn009v2/keymaps/vial/config.h
@@ -0,0 +1,9 @@
+// Copyright 2023 Binepad
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#define VIAL_KEYBOARD_UID {0x48, 0x7D, 0x01, 0xAC, 0xB2, 0x33, 0x46, 0x84}
+
+#define VIAL_UNLOCK_COMBO_ROWS { 0, 2 }
+#define VIAL_UNLOCK_COMBO_COLS { 0, 2 }
diff --git a/keyboards/binepad/bn009v2/keymaps/vial/keymap.c b/keyboards/binepad/bn009v2/keymaps/vial/keymap.c
new file mode 100644
index 00000000000..ed8a00f4f82
--- /dev/null
+++ b/keyboards/binepad/bn009v2/keymaps/vial/keymap.c
@@ -0,0 +1,39 @@
+// Copyright 2023 Binepad
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include QMK_KEYBOARD_H
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+ /*
+ * ┌───┬───┬───┐
+ * │ A │ B │ C │
+ * ├───┼───┼───┤
+ * │ D │ E │ F │
+ * ├───┼───┼───┤
+ * │ G │ H │ I │
+ * └───┴───┴───┘
+ */
+ [0] = LAYOUT_ortho_3x3(
+ KC_7, KC_8, KC_9,
+ KC_4, KC_5, KC_6,
+ KC_1, KC_2, KC_3
+ ),
+
+ [1] = LAYOUT_ortho_3x3(
+ KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO
+ ),
+
+ [2] = LAYOUT_ortho_3x3(
+ KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO
+ ),
+
+ [3] = LAYOUT_ortho_3x3(
+ KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO,
+ KC_NO, KC_NO, KC_NO
+ )
+};
diff --git a/keyboards/binepad/bn009v2/keymaps/vial/rules.mk b/keyboards/binepad/bn009v2/keymaps/vial/rules.mk
new file mode 100644
index 00000000000..4f7618e9b21
--- /dev/null
+++ b/keyboards/binepad/bn009v2/keymaps/vial/rules.mk
@@ -0,0 +1,2 @@
+VIA_ENABLE = yes
+VIAL_ENABLE = yes
diff --git a/keyboards/binepad/bn009v2/keymaps/vial/vial.json b/keyboards/binepad/bn009v2/keymaps/vial/vial.json
new file mode 100644
index 00000000000..4fb02a3ed7b
--- /dev/null
+++ b/keyboards/binepad/bn009v2/keymaps/vial/vial.json
@@ -0,0 +1,11 @@
+{
+ "lighting": "none",
+ "matrix": {"rows": 3, "cols": 3},
+ "layouts": {
+ "keymap": [
+ ["0,0", "0,1", "0,2"],
+ ["1,0", "1,1", "1,2"],
+ ["2,0", "2,1", "2,2"]
+ ]
+ }
+}
diff --git a/keyboards/binepad/bn009v2/readme.md b/keyboards/binepad/bn009v2/readme.md
new file mode 100644
index 00000000000..00f7fd58547
--- /dev/null
+++ b/keyboards/binepad/bn009v2/readme.md
@@ -0,0 +1,27 @@
+# BINEPAD BN009 v2
+
+![BINEPAD BN009](https://imgur.com/fu0iXD0h.jpg)
+
+*A 9% macropad*
+
+* Keyboard Maintainer: [binepad](https://github.com/binepad)
+* Hardware Supported: BN009 *(ft. STM32F103)*
+* Hardware Availability: [binepad.com](https://www.binepad.com/bn009)
+
+Make example for this keyboard (after setting up your build environment):
+
+ make binepad/bn009v2:default
+
+Flashing example for this keyboard:
+
+ make binepad/bn009v2: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) and plug in the keyboard
+* **Physical reset button**: Briefly press the button under the small hole on the back of the macropad
+* **Keycode in layout**: Press the key mapped to `QK_BOOT` or `RESET` if it is available
diff --git a/keyboards/binepad/bn009v2/rules.mk b/keyboards/binepad/bn009v2/rules.mk
new file mode 100644
index 00000000000..6e7633bfe01
--- /dev/null
+++ b/keyboards/binepad/bn009v2/rules.mk
@@ -0,0 +1 @@
+# This file intentionally left blank
From c392ed24686e3893142dd2ba2e3aade523e382ae Mon Sep 17 00:00:00 2001
From: Vino Rodrigues <366673+vinorodrigues@users.noreply.github.com>
Date: Fri, 3 Mar 2023 03:46:34 +1100
Subject: [PATCH 2/3] Align code to qmk upstream
---
keyboards/binepad/bn009r2/config.h | 11 ++++++++++
.../binepad/{bn009v2 => bn009r2}/info.json | 2 +-
.../bn009r2/keymaps/default/keymap.json | 15 +++++++++++++
.../keymaps/vial/config.h | 0
.../keymaps/vial/keymap.c | 0
.../binepad/bn009r2/keymaps/vial/rules.mk | 5 +++++
.../keymaps/vial/vial.json | 0
.../binepad/{bn009v2 => bn009r2}/readme.md | 6 ++---
keyboards/binepad/bn009r2/rules.mk | 5 +++++
keyboards/binepad/bn009v2/config.h | 22 -------------------
.../binepad/bn009v2/keymaps/vial/rules.mk | 2 --
keyboards/binepad/bn009v2/rules.mk | 1 -
12 files changed, 40 insertions(+), 29 deletions(-)
create mode 100644 keyboards/binepad/bn009r2/config.h
rename keyboards/binepad/{bn009v2 => bn009r2}/info.json (97%)
create mode 100644 keyboards/binepad/bn009r2/keymaps/default/keymap.json
rename keyboards/binepad/{bn009v2 => bn009r2}/keymaps/vial/config.h (100%)
rename keyboards/binepad/{bn009v2 => bn009r2}/keymaps/vial/keymap.c (100%)
create mode 100644 keyboards/binepad/bn009r2/keymaps/vial/rules.mk
rename keyboards/binepad/{bn009v2 => bn009r2}/keymaps/vial/vial.json (100%)
rename keyboards/binepad/{bn009v2 => bn009r2}/readme.md (91%)
create mode 100644 keyboards/binepad/bn009r2/rules.mk
delete mode 100644 keyboards/binepad/bn009v2/config.h
delete mode 100644 keyboards/binepad/bn009v2/keymaps/vial/rules.mk
delete mode 100644 keyboards/binepad/bn009v2/rules.mk
diff --git a/keyboards/binepad/bn009r2/config.h b/keyboards/binepad/bn009r2/config.h
new file mode 100644
index 00000000000..d9051ee99ec
--- /dev/null
+++ b/keyboards/binepad/bn009r2/config.h
@@ -0,0 +1,11 @@
+// Copyright 2023 Binepad (@binepad)
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+/*
+ * Wear Leveling EEPROM Emulation
+ */
+
+#define WEAR_LEVELING_LOGICAL_SIZE 2048 // Number of bytes "exposed" to the rest of QMK and denotes the size of the usable EEPROM.
+#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2) // Number of bytes used by the wear-leveling algorithm for its underlying storage, and needs to be a multiple of the logical size.
diff --git a/keyboards/binepad/bn009v2/info.json b/keyboards/binepad/bn009r2/info.json
similarity index 97%
rename from keyboards/binepad/bn009v2/info.json
rename to keyboards/binepad/bn009r2/info.json
index 756a035535c..537e76def2e 100644
--- a/keyboards/binepad/bn009v2/info.json
+++ b/keyboards/binepad/bn009r2/info.json
@@ -1,6 +1,6 @@
{
"manufacturer": "Binepad",
- "keyboard_name": "BN009",
+ "keyboard_name": "BN009 R2",
"maintainer": "binepad",
"bootloader": "stm32duino",
"diode_direction": "COL2ROW",
diff --git a/keyboards/binepad/bn009r2/keymaps/default/keymap.json b/keyboards/binepad/bn009r2/keymaps/default/keymap.json
new file mode 100644
index 00000000000..505318245d5
--- /dev/null
+++ b/keyboards/binepad/bn009r2/keymaps/default/keymap.json
@@ -0,0 +1,15 @@
+{
+ "keyboard": "binepad/bn009r2",
+ "version": 1,
+ "author": "binepad",
+ "notes": "This file is a keymap.json file for binepad/bn009r2",
+ "keymap": "default_json",
+ "layout": "LAYOUT_ortho_3x3",
+ "layers": [
+ [
+ "KC_7", "KC_8", "KC_9",
+ "KC_4", "KC_5", "KC_6",
+ "KC_1", "KC_2", "KC_3"
+ ]
+ ]
+}
diff --git a/keyboards/binepad/bn009v2/keymaps/vial/config.h b/keyboards/binepad/bn009r2/keymaps/vial/config.h
similarity index 100%
rename from keyboards/binepad/bn009v2/keymaps/vial/config.h
rename to keyboards/binepad/bn009r2/keymaps/vial/config.h
diff --git a/keyboards/binepad/bn009v2/keymaps/vial/keymap.c b/keyboards/binepad/bn009r2/keymaps/vial/keymap.c
similarity index 100%
rename from keyboards/binepad/bn009v2/keymaps/vial/keymap.c
rename to keyboards/binepad/bn009r2/keymaps/vial/keymap.c
diff --git a/keyboards/binepad/bn009r2/keymaps/vial/rules.mk b/keyboards/binepad/bn009r2/keymaps/vial/rules.mk
new file mode 100644
index 00000000000..4ce60898638
--- /dev/null
+++ b/keyboards/binepad/bn009r2/keymaps/vial/rules.mk
@@ -0,0 +1,5 @@
+# Copyright 2022 Binepad (@binpad)
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+VIA_ENABLE = yes
+VIAL_ENABLE = yes
diff --git a/keyboards/binepad/bn009v2/keymaps/vial/vial.json b/keyboards/binepad/bn009r2/keymaps/vial/vial.json
similarity index 100%
rename from keyboards/binepad/bn009v2/keymaps/vial/vial.json
rename to keyboards/binepad/bn009r2/keymaps/vial/vial.json
diff --git a/keyboards/binepad/bn009v2/readme.md b/keyboards/binepad/bn009r2/readme.md
similarity index 91%
rename from keyboards/binepad/bn009v2/readme.md
rename to keyboards/binepad/bn009r2/readme.md
index 00f7fd58547..5444a088431 100644
--- a/keyboards/binepad/bn009v2/readme.md
+++ b/keyboards/binepad/bn009r2/readme.md
@@ -1,4 +1,4 @@
-# BINEPAD BN009 v2
+# BINEPAD BN009 R2
![BINEPAD BN009](https://imgur.com/fu0iXD0h.jpg)
@@ -10,11 +10,11 @@
Make example for this keyboard (after setting up your build environment):
- make binepad/bn009v2:default
+ make binepad/bn009r2:default
Flashing example for this keyboard:
- make binepad/bn009v2:default:flash
+ make binepad/bn009r2: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).
diff --git a/keyboards/binepad/bn009r2/rules.mk b/keyboards/binepad/bn009r2/rules.mk
new file mode 100644
index 00000000000..58561c984b4
--- /dev/null
+++ b/keyboards/binepad/bn009r2/rules.mk
@@ -0,0 +1,5 @@
+# Copyright 2022 Binepad (@binpad)
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+EPROM_DRIVER = wear_leveling
+WEAR_LEVELING_DRIVER = embedded_flash
diff --git a/keyboards/binepad/bn009v2/config.h b/keyboards/binepad/bn009v2/config.h
deleted file mode 100644
index 7e40d6c1b56..00000000000
--- a/keyboards/binepad/bn009v2/config.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2023 binepad (@binepad)
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-#pragma once
-
-#define HOLD_ON_OTHER_KEY_PRESS
-
-/*
- * Feature disable options
- * These options are also useful to firmware size reduction.
- */
-
-/* disable debug print */
-//#define NO_DEBUG
-
-/* disable print */
-//#define NO_PRINT
-
-/* disable action features */
-//#define NO_ACTION_LAYER
-//#define NO_ACTION_TAPPING
-//#define NO_ACTION_ONESHOT
diff --git a/keyboards/binepad/bn009v2/keymaps/vial/rules.mk b/keyboards/binepad/bn009v2/keymaps/vial/rules.mk
deleted file mode 100644
index 4f7618e9b21..00000000000
--- a/keyboards/binepad/bn009v2/keymaps/vial/rules.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-VIA_ENABLE = yes
-VIAL_ENABLE = yes
diff --git a/keyboards/binepad/bn009v2/rules.mk b/keyboards/binepad/bn009v2/rules.mk
deleted file mode 100644
index 6e7633bfe01..00000000000
--- a/keyboards/binepad/bn009v2/rules.mk
+++ /dev/null
@@ -1 +0,0 @@
-# This file intentionally left blank
From 5093e58c51e187e1b6ae3b97be78402e8878b7f1 Mon Sep 17 00:00:00 2001
From: Vino Rodrigues <366673+vinorodrigues@users.noreply.github.com>
Date: Fri, 3 Mar 2023 15:42:52 +1100
Subject: [PATCH 3/3] Merge R1 and R2 sources into one common source base
---
keyboards/binepad/bn009/bn009.c | 16 -----
keyboards/binepad/bn009/bn009.h | 28 --------
keyboards/binepad/bn009/config.h | 70 -------------------
keyboards/binepad/bn009/info.json | 43 ++++++++----
.../binepad/bn009/keymaps/default/keymap.c | 42 -----------
.../keymaps/default/keymap.json | 6 +-
.../binepad/bn009/keymaps/default/readme.md | 1 -
keyboards/binepad/bn009/keymaps/via/keymap.c | 44 ------------
keyboards/binepad/bn009/keymaps/via/rules.mk | 1 -
keyboards/binepad/bn009/keymaps/vial/config.h | 13 ++++
.../{bn009r2 => bn009}/keymaps/vial/keymap.c | 0
.../{bn009r2 => bn009}/keymaps/vial/rules.mk | 0
.../{bn009r2 => bn009}/keymaps/vial/vial.json | 0
keyboards/binepad/bn009/r1/config.h | 11 +++
keyboards/binepad/bn009/r1/info.json | 13 ++++
keyboards/binepad/bn009/r1/readme.md | 3 +
keyboards/binepad/bn009/r1/rules.mk | 4 ++
.../binepad/{bn009r2 => bn009/r2}/config.h | 0
keyboards/binepad/bn009/r2/info.json | 13 ++++
keyboards/binepad/bn009/r2/readme.md | 3 +
.../binepad/{bn009r2 => bn009/r2}/rules.mk | 0
keyboards/binepad/bn009/readme.md | 37 +++++++---
keyboards/binepad/bn009/rules.mk | 19 +----
keyboards/binepad/bn009r2/info.json | 41 -----------
.../binepad/bn009r2/keymaps/vial/config.h | 9 ---
keyboards/binepad/bn009r2/readme.md | 27 -------
26 files changed, 124 insertions(+), 320 deletions(-)
delete mode 100644 keyboards/binepad/bn009/bn009.c
delete mode 100644 keyboards/binepad/bn009/bn009.h
delete mode 100644 keyboards/binepad/bn009/config.h
delete mode 100644 keyboards/binepad/bn009/keymaps/default/keymap.c
rename keyboards/binepad/{bn009r2 => bn009}/keymaps/default/keymap.json (63%)
delete mode 100644 keyboards/binepad/bn009/keymaps/default/readme.md
delete mode 100644 keyboards/binepad/bn009/keymaps/via/keymap.c
delete mode 100644 keyboards/binepad/bn009/keymaps/via/rules.mk
create mode 100644 keyboards/binepad/bn009/keymaps/vial/config.h
rename keyboards/binepad/{bn009r2 => bn009}/keymaps/vial/keymap.c (100%)
rename keyboards/binepad/{bn009r2 => bn009}/keymaps/vial/rules.mk (100%)
rename keyboards/binepad/{bn009r2 => bn009}/keymaps/vial/vial.json (100%)
create mode 100644 keyboards/binepad/bn009/r1/config.h
create mode 100644 keyboards/binepad/bn009/r1/info.json
create mode 100644 keyboards/binepad/bn009/r1/readme.md
create mode 100644 keyboards/binepad/bn009/r1/rules.mk
rename keyboards/binepad/{bn009r2 => bn009/r2}/config.h (100%)
create mode 100644 keyboards/binepad/bn009/r2/info.json
create mode 100644 keyboards/binepad/bn009/r2/readme.md
rename keyboards/binepad/{bn009r2 => bn009/r2}/rules.mk (100%)
delete mode 100644 keyboards/binepad/bn009r2/info.json
delete mode 100644 keyboards/binepad/bn009r2/keymaps/vial/config.h
delete mode 100644 keyboards/binepad/bn009r2/readme.md
diff --git a/keyboards/binepad/bn009/bn009.c b/keyboards/binepad/bn009/bn009.c
deleted file mode 100644
index 48bfb44dae5..00000000000
--- a/keyboards/binepad/bn009/bn009.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Copyright 2020 BINEPAD
- *
- * 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 "bn009.h"
diff --git a/keyboards/binepad/bn009/bn009.h b/keyboards/binepad/bn009/bn009.h
deleted file mode 100644
index 9a3a23fbcb4..00000000000
--- a/keyboards/binepad/bn009/bn009.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Copyright 2020 BINEPAD
- *
- * 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 "quantum.h"
-
-#define LAYOUT( \
- k00, k01, k02, \
- k10, k11, k12, \
- k20, k21, k22 \
-) \
-{ \
- { k00, k01, k02 }, \
- { k10, k11, k12 }, \
- { k20, k21, k22 } \
-}
-
diff --git a/keyboards/binepad/bn009/config.h b/keyboards/binepad/bn009/config.h
deleted file mode 100644
index 48c2fd984c5..00000000000
--- a/keyboards/binepad/bn009/config.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Copyright 2020 BINEPAD
- *
- * 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
-
-#include "config_common.h"
-
-/* Key matrix size */
-#define MATRIX_ROWS 3
-#define MATRIX_COLS 3
-
-#define MATRIX_ROW_PINS { D2, D1, D0 }
-#define MATRIX_COL_PINS { B6, B5, B4 }
-
-/* COL2ROW, ROW2COL*/
-#define DIODE_DIRECTION COL2ROW
-
-
-/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
-#define DEBOUNCE 5
-
-/* define if matrix has ghost (lacks anti-ghosting diodes) */
-//#define MATRIX_HAS_GHOST
-
-
-/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
-#define LOCKING_SUPPORT_ENABLE
-/* Locking resynchronize hack */
-#define LOCKING_RESYNC_ENABLE
-
-/* If defined, GRAVE_ESC will always act as ESC when CTRL is held.
- * This is userful for the Windows task manager shortcut (ctrl+shift+esc).
- */
-// #define GRAVE_ESC_CTRL_OVERRIDE
-
-/*
- * Force NKRO
- *
- * Force NKRO (nKey Rollover) to be enabled by default, regardless of the saved
- * state in the bootmagic EEPROM settings. (Note that NKRO must be enabled in the
- * makefile for this to work.)
- *
- * If forced on, NKRO can be disabled via magic key (default = LShift+RShift+N)
- * until the next keyboard reset.
- *
- * NKRO may prevent your keystrokes from being detected in the BIOS, but it is
- * fully operational during normal computer usage.
- *
- * For a less heavy-handed approach, enable NKRO via magic key (LShift+RShift+N)
- * or via bootmagic (hold SPACE+N while plugging in the keyboard). Once set by
- * bootmagic, NKRO mode will always be enabled until it is toggled again during a
- * power-up.
- *
-
- */
-//#define FORCE_NKRO
-
diff --git a/keyboards/binepad/bn009/info.json b/keyboards/binepad/bn009/info.json
index 528cf570169..f707db9ef4a 100644
--- a/keyboards/binepad/bn009/info.json
+++ b/keyboards/binepad/bn009/info.json
@@ -1,16 +1,33 @@
{
- "keyboard_name": "BN009",
- "manufacturer": "Binepad",
- "url": "https://binepad.com",
- "maintainer": "binepad",
- "usb": {
- "vid": "0x4249",
- "pid": "0x4295",
- "device_version": "0.0.1"
- },
- "layouts": {
- "LAYOUT": {
- "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k10", "x":0, "y":1}, {"label":"k11", "x":1, "y":1}, {"label":"k12", "x":2, "y":1}, {"label":"k20", "x":0, "y":2}, {"label":"k21", "x":1, "y":2}, {"label":"k22", "x":2, "y":2}]
+ "manufacturer": "Binepad",
+ "keyboard_name": "BN009",
+ "maintainer": "binepad",
+ "features": {
+ "bootmagic": true,
+ "command": false,
+ "console": false,
+ "extrakey": true,
+ "mousekey": true,
+ "nkro": false
+ },
+ "url": "http://binepad.com",
+ "usb": {
+ "vid": "0x4249",
+ "pid": "0x4295"
+ },
+ "layouts": {
+ "LAYOUT_ortho_3x3": {
+ "layout": [
+ { "matrix": [0, 0], "x": 0, "y": 0, "label": "k00" },
+ { "matrix": [0, 1], "x": 1, "y": 0, "label": "k01" },
+ { "matrix": [0, 2], "x": 2, "y": 0, "label": "k02" },
+ { "matrix": [1, 0], "x": 0, "y": 1, "label": "k10" },
+ { "matrix": [1, 1], "x": 1, "y": 1, "label": "k11" },
+ { "matrix": [1, 2], "x": 2, "y": 1, "label": "k12" },
+ { "matrix": [2, 0], "x": 0, "y": 2, "label": "k20" },
+ { "matrix": [2, 1], "x": 1, "y": 2, "label": "k21" },
+ { "matrix": [2, 2], "x": 2, "y": 2, "label": "k22" }
+ ]
+ }
}
- }
}
\ No newline at end of file
diff --git a/keyboards/binepad/bn009/keymaps/default/keymap.c b/keyboards/binepad/bn009/keymaps/default/keymap.c
deleted file mode 100644
index 573a25d01dc..00000000000
--- a/keyboards/binepad/bn009/keymaps/default/keymap.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright 2021 BINEPAD
- *
- * 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
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
-
-
-[0] = LAYOUT(
- KC_7, KC_8, KC_9,
- KC_4, KC_5, KC_6,
- KC_1, KC_2, KC_3
-),
-
-
-[1] = LAYOUT(
- KC_NO, KC_NO, KC_NO,
- KC_NO, KC_NO, KC_NO,
- KC_NO, KC_NO, KC_NO
-),
-
-
-[2] = LAYOUT(
- KC_NO, KC_NO, KC_NO,
- KC_NO, KC_NO, KC_NO,
- KC_NO, KC_NO, KC_NO
-)
-
-};
diff --git a/keyboards/binepad/bn009r2/keymaps/default/keymap.json b/keyboards/binepad/bn009/keymaps/default/keymap.json
similarity index 63%
rename from keyboards/binepad/bn009r2/keymaps/default/keymap.json
rename to keyboards/binepad/bn009/keymaps/default/keymap.json
index 505318245d5..adb7e3e8865 100644
--- a/keyboards/binepad/bn009r2/keymaps/default/keymap.json
+++ b/keyboards/binepad/bn009/keymaps/default/keymap.json
@@ -1,9 +1,9 @@
{
- "keyboard": "binepad/bn009r2",
+ "keyboard": "binepad/bn009",
"version": 1,
"author": "binepad",
- "notes": "This file is a keymap.json file for binepad/bn009r2",
- "keymap": "default_json",
+ "notes": "This file is a keymap.json file for binepad/bn009",
+ "keymap": "default",
"layout": "LAYOUT_ortho_3x3",
"layers": [
[
diff --git a/keyboards/binepad/bn009/keymaps/default/readme.md b/keyboards/binepad/bn009/keymaps/default/readme.md
deleted file mode 100644
index b3c7ba28dc5..00000000000
--- a/keyboards/binepad/bn009/keymaps/default/readme.md
+++ /dev/null
@@ -1 +0,0 @@
-# bn009 - Default layout
diff --git a/keyboards/binepad/bn009/keymaps/via/keymap.c b/keyboards/binepad/bn009/keymaps/via/keymap.c
deleted file mode 100644
index 4ce3d1ae786..00000000000
--- a/keyboards/binepad/bn009/keymaps/via/keymap.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* Copyright 2021 BINEPAD
- *
- * 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
-
-const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
- [0] =
- LAYOUT(
- KC_7 , KC_8 , KC_9,
- KC_4 , KC_5 , KC_6,
- KC_1 , KC_2 , KC_3
- ),
- [1] =
- LAYOUT(
- KC_NO , KC_NO, KC_NO,
- KC_NO , KC_NO, KC_NO,
- KC_NO , KC_NO, KC_NO
- ),
- [2] =
- LAYOUT(
- KC_NO , KC_NO, KC_NO,
- KC_NO , KC_NO, KC_NO,
- KC_NO , KC_NO, KC_NO
- ),
- [3] =
- LAYOUT(
- KC_NO , KC_NO, KC_NO,
- KC_NO , KC_NO, KC_NO,
- KC_NO , KC_NO, KC_NO
- ),
-};
diff --git a/keyboards/binepad/bn009/keymaps/via/rules.mk b/keyboards/binepad/bn009/keymaps/via/rules.mk
deleted file mode 100644
index 1e5b99807cb..00000000000
--- a/keyboards/binepad/bn009/keymaps/via/rules.mk
+++ /dev/null
@@ -1 +0,0 @@
-VIA_ENABLE = yes
diff --git a/keyboards/binepad/bn009/keymaps/vial/config.h b/keyboards/binepad/bn009/keymaps/vial/config.h
new file mode 100644
index 00000000000..61da02e30c3
--- /dev/null
+++ b/keyboards/binepad/bn009/keymaps/vial/config.h
@@ -0,0 +1,13 @@
+// Copyright 2023 Binepad
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#if defined(KEYBOARD_binepad_bn009_r1)
+ #define VIAL_KEYBOARD_UID {0x48, 0x7D, 0x01, 0xAC, 0xB2, 0x33, 0x46, 0x83}
+#else // KEYBOARD_binepad_bn009_r2
+ #define VIAL_KEYBOARD_UID {0x48, 0x7D, 0x01, 0xAC, 0xB2, 0x33, 0x46, 0x84}
+#endif
+
+#define VIAL_UNLOCK_COMBO_ROWS { 0, 2 }
+#define VIAL_UNLOCK_COMBO_COLS { 0, 2 }
diff --git a/keyboards/binepad/bn009r2/keymaps/vial/keymap.c b/keyboards/binepad/bn009/keymaps/vial/keymap.c
similarity index 100%
rename from keyboards/binepad/bn009r2/keymaps/vial/keymap.c
rename to keyboards/binepad/bn009/keymaps/vial/keymap.c
diff --git a/keyboards/binepad/bn009r2/keymaps/vial/rules.mk b/keyboards/binepad/bn009/keymaps/vial/rules.mk
similarity index 100%
rename from keyboards/binepad/bn009r2/keymaps/vial/rules.mk
rename to keyboards/binepad/bn009/keymaps/vial/rules.mk
diff --git a/keyboards/binepad/bn009r2/keymaps/vial/vial.json b/keyboards/binepad/bn009/keymaps/vial/vial.json
similarity index 100%
rename from keyboards/binepad/bn009r2/keymaps/vial/vial.json
rename to keyboards/binepad/bn009/keymaps/vial/vial.json
diff --git a/keyboards/binepad/bn009/r1/config.h b/keyboards/binepad/bn009/r1/config.h
new file mode 100644
index 00000000000..6779c0f11e8
--- /dev/null
+++ b/keyboards/binepad/bn009/r1/config.h
@@ -0,0 +1,11 @@
+// Copyright 2020 Binepad (@binepad)
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include "config_common.h"
+
+/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
+#define LOCKING_SUPPORT_ENABLE
+/* Locking resynchronize hack */
+#define LOCKING_RESYNC_ENABLE
diff --git a/keyboards/binepad/bn009/r1/info.json b/keyboards/binepad/bn009/r1/info.json
new file mode 100644
index 00000000000..de0f07b7cd8
--- /dev/null
+++ b/keyboards/binepad/bn009/r1/info.json
@@ -0,0 +1,13 @@
+{
+ "keyboard_name": "BN009 R1",
+ "bootloader": "atmel-dfu",
+ "diode_direction": "COL2ROW",
+ "matrix_pins": {
+ "cols": ["D2", "D1", "D0"],
+ "rows": ["B6", "B5", "B4"]
+ },
+ "processor": "atmega32u4",
+ "usb": {
+ "device_version": "0.0.1"
+ }
+}
diff --git a/keyboards/binepad/bn009/r1/readme.md b/keyboards/binepad/bn009/r1/readme.md
new file mode 100644
index 00000000000..125441c6a2d
--- /dev/null
+++ b/keyboards/binepad/bn009/r1/readme.md
@@ -0,0 +1,3 @@
+# BINEPAD BN009 R1
+
+* Hardware Supported: BN009 R1 *(ft. ATmega32U4)*
diff --git a/keyboards/binepad/bn009/r1/rules.mk b/keyboards/binepad/bn009/r1/rules.mk
new file mode 100644
index 00000000000..10468472aa9
--- /dev/null
+++ b/keyboards/binepad/bn009/r1/rules.mk
@@ -0,0 +1,4 @@
+# Copyright 2020 Binepad (@binpad)
+# SPDX-License-Identifier: GPL-2.0-or-later
+
+LTO_ENABLE = yes
diff --git a/keyboards/binepad/bn009r2/config.h b/keyboards/binepad/bn009/r2/config.h
similarity index 100%
rename from keyboards/binepad/bn009r2/config.h
rename to keyboards/binepad/bn009/r2/config.h
diff --git a/keyboards/binepad/bn009/r2/info.json b/keyboards/binepad/bn009/r2/info.json
new file mode 100644
index 00000000000..c011fe0e32d
--- /dev/null
+++ b/keyboards/binepad/bn009/r2/info.json
@@ -0,0 +1,13 @@
+{
+ "keyboard_name": "BN009 R2",
+ "bootloader": "stm32duino",
+ "diode_direction": "COL2ROW",
+ "matrix_pins": {
+ "cols": ["A1", "A2", "A6"],
+ "rows": ["B6", "B7", "B2"]
+ },
+ "processor": "STM32F103",
+ "usb": {
+ "device_version": "2.0.0"
+ }
+}
diff --git a/keyboards/binepad/bn009/r2/readme.md b/keyboards/binepad/bn009/r2/readme.md
new file mode 100644
index 00000000000..c30cc23d118
--- /dev/null
+++ b/keyboards/binepad/bn009/r2/readme.md
@@ -0,0 +1,3 @@
+# BINEPAD BN009 R2
+
+* Hardware Supported: BN009 R2 *(ft. STM32F103)*
diff --git a/keyboards/binepad/bn009r2/rules.mk b/keyboards/binepad/bn009/r2/rules.mk
similarity index 100%
rename from keyboards/binepad/bn009r2/rules.mk
rename to keyboards/binepad/bn009/r2/rules.mk
diff --git a/keyboards/binepad/bn009/readme.md b/keyboards/binepad/bn009/readme.md
index dc0442fa826..fcfe2029389 100644
--- a/keyboards/binepad/bn009/readme.md
+++ b/keyboards/binepad/bn009/readme.md
@@ -2,16 +2,37 @@
![BINEPAD BN009](https://imgur.com/fu0iXD0h.jpg)
-A 9% macropad.
+*A 9% macropad.*
-* Keyboard Maintainer: [BINEPAD]
-* Hardware Supported: BN009 PCB (ATmega32U4)
-* Hardware Availability: [Interest Check](https://www.binepad.com/bn009)
-
-**Physical reset button**: There's a small hole at the bottom of macropad. Use the reset pin provided in box and push it hard through the hole, so that it press the reset button on pcb.
+* Keyboard Maintainer: [binepad](https://github.com/binepad)
+* Hardware Supported:
+ * BN009 R1 *(ft. ATmega32U4)*
+ * BN009 R2 *(ft. STM32F103)*
+* Hardware Availability: [binepad.com](https://www.binepad.com/bn009)
Make example for this keyboard (after setting up your build environment):
- make binepad/bn009:default
+ make binepad/bn009/r1:default
+
+..or..
+
+ make binepad/bn009/r2:default
+
+Flashing example for this keyboard:
+
+ make binepad/bn009/r1:default:flash
+
+..or..
+
+ make binepad/bn009/r2: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:
-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).
+* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (usually the top left key) and plug in the keyboard
+* **Physical reset button**: Briefly press the button under the small hole on the back of the macropad
+* **Keycode in layout**: Press the key mapped to `QK_BOOT` or `RESET` if it is available
diff --git a/keyboards/binepad/bn009/rules.mk b/keyboards/binepad/bn009/rules.mk
index 73ac281e0b4..74214d60ed0 100644
--- a/keyboards/binepad/bn009/rules.mk
+++ b/keyboards/binepad/bn009/rules.mk
@@ -1,18 +1,3 @@
-# MCU name
-MCU = atmega32u4
+# This file is mostly left blank
-# Bootloader selection
-BOOTLOADER = atmel-dfu
-
-# Build Options
-# change yes to no to disable
-#
-BOOTMAGIC_ENABLE = yes # Enable Bootmagic Lite
-MOUSEKEY_ENABLE = yes # Mouse keys
-EXTRAKEY_ENABLE = yes # Audio control and System control
-CONSOLE_ENABLE = yes # Console for debug
-COMMAND_ENABLE = yes # Commands for debug and configuration
-NKRO_ENABLE = yes # Enable N-Key Rollover
-BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
-RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow
-AUDIO_ENABLE = no # Audio output
+DEFAULT_FOLDER = binepad/bn009/r2
diff --git a/keyboards/binepad/bn009r2/info.json b/keyboards/binepad/bn009r2/info.json
deleted file mode 100644
index 537e76def2e..00000000000
--- a/keyboards/binepad/bn009r2/info.json
+++ /dev/null
@@ -1,41 +0,0 @@
-{
- "manufacturer": "Binepad",
- "keyboard_name": "BN009 R2",
- "maintainer": "binepad",
- "bootloader": "stm32duino",
- "diode_direction": "COL2ROW",
- "features": {
- "bootmagic": true,
- "command": false,
- "console": false,
- "extrakey": true,
- "mousekey": true,
- "nkro": false
- },
- "matrix_pins": {
- "cols": ["A1", "A2", "A6"],
- "rows": ["B6", "B7", "B2"]
- },
- "processor": "STM32F103",
- "url": "http://binepad.com",
- "usb": {
- "vid": "0x4249",
- "pid": "0x4295",
- "device_version": "2.0.0"
- },
- "layouts": {
- "LAYOUT_ortho_3x3": {
- "layout": [
- { "matrix": [0, 0], "x": 0, "y": 0 },
- { "matrix": [0, 1], "x": 1, "y": 0 },
- { "matrix": [0, 2], "x": 2, "y": 0 },
- { "matrix": [1, 0], "x": 0, "y": 1 },
- { "matrix": [1, 1], "x": 1, "y": 1 },
- { "matrix": [1, 2], "x": 2, "y": 1 },
- { "matrix": [2, 0], "x": 0, "y": 2 },
- { "matrix": [2, 1], "x": 1, "y": 2 },
- { "matrix": [2, 2], "x": 2, "y": 2 }
- ]
- }
- }
-}
\ No newline at end of file
diff --git a/keyboards/binepad/bn009r2/keymaps/vial/config.h b/keyboards/binepad/bn009r2/keymaps/vial/config.h
deleted file mode 100644
index c6137aef2ff..00000000000
--- a/keyboards/binepad/bn009r2/keymaps/vial/config.h
+++ /dev/null
@@ -1,9 +0,0 @@
-// Copyright 2023 Binepad
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-#pragma once
-
-#define VIAL_KEYBOARD_UID {0x48, 0x7D, 0x01, 0xAC, 0xB2, 0x33, 0x46, 0x84}
-
-#define VIAL_UNLOCK_COMBO_ROWS { 0, 2 }
-#define VIAL_UNLOCK_COMBO_COLS { 0, 2 }
diff --git a/keyboards/binepad/bn009r2/readme.md b/keyboards/binepad/bn009r2/readme.md
deleted file mode 100644
index 5444a088431..00000000000
--- a/keyboards/binepad/bn009r2/readme.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# BINEPAD BN009 R2
-
-![BINEPAD BN009](https://imgur.com/fu0iXD0h.jpg)
-
-*A 9% macropad*
-
-* Keyboard Maintainer: [binepad](https://github.com/binepad)
-* Hardware Supported: BN009 *(ft. STM32F103)*
-* Hardware Availability: [binepad.com](https://www.binepad.com/bn009)
-
-Make example for this keyboard (after setting up your build environment):
-
- make binepad/bn009r2:default
-
-Flashing example for this keyboard:
-
- make binepad/bn009r2: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) and plug in the keyboard
-* **Physical reset button**: Briefly press the button under the small hole on the back of the macropad
-* **Keycode in layout**: Press the key mapped to `QK_BOOT` or `RESET` if it is available