Browse Source

[Keyboard] Add Binepad BNR1 v2 rotary encoder (#19770)

Vino Rodrigues 3 years ago
parent
commit
989f2476b6

+ 1 - 3
keyboards/binepad/bnr1/info.json

@@ -14,9 +14,7 @@
     },
     "url": "http://binepad.com",
     "usb": {
-        "vid": "0x4249",
-        "pid": "0x4231",
-        "device_version": "1.0.0"
+        "vid": "0x4249"
     },
     "community_layouts": ["ortho_1x1"],
     "layouts": {

+ 0 - 2
keyboards/binepad/bnr1/keymaps/default/rules.mk

@@ -1,6 +1,4 @@
 # Copyright 2022 Binepad (@binpad)
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-LTO_ENABLE = yes
-
 ENCODER_MAP_ENABLE = yes

+ 0 - 1
keyboards/binepad/bnr1/keymaps/via/rules.mk

@@ -1,7 +1,6 @@
 # Copyright 2022 Binepad (@binpad)
 # SPDX-License-Identifier: GPL-2.0-or-later
 
-LTO_ENABLE = yes
 VIA_ENABLE = yes
 
 ENCODER_MAP_ENABLE = yes

+ 7 - 1
keyboards/binepad/bnr1/readme.md

@@ -3,13 +3,19 @@
 The BNR1 is a multifunction knob, which can be rotated, pressed, and rotated while pressed.
 
 * Keyboard Maintainer: [Binpad](https://github.com/binepad)
-* Hardware Supported: **BNR1** & **BNR1 R2** *("V1" ft. ATMega32u4 MCU)*
+* Hardware Supported:
+    * **BNR1** & **BNR1 R2** *("V1" ft. ATMega32u4 MCU)*
+    * **BNR1 V2** *("V2" ft. STM32F103 MCU)*
 * Hardware Availability: [Binepad.com](https://www.binepad.com/bnr1)
 
 Make example for this keyboard (after setting up your build environment):
 
     make binepad/bnr1/v1:default
 
+  ..or..
+
+    make binepad/bnr1/v2:default
+
 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).
 

+ 2 - 2
keyboards/binepad/bnr1/rules.mk

@@ -1,3 +1,3 @@
-# This file intentionally left blank
+# This file is mostly left blank
 
-DEFAULT_FOLDER = binepad/bnr1/v1
+DEFAULT_FOLDER = binepad/bnr1/v2

+ 9 - 1
keyboards/binepad/bnr1/v1/info.json

@@ -2,13 +2,21 @@
     "bootloader": "atmel-dfu",
     "processor": "atmega32u4",
     "diode_direction": "COL2ROW",
+    "usb": {
+        "pid": "0x4231",
+        "device_version": "1.0.0"
+    },
     "matrix_pins": {
         "cols": ["B0"],
         "rows": ["E6"]
     },
     "encoder": {
+        "enabled": true,
         "rotary": [
-            { "pin_a": "D6", "pin_b": "D7" }
+            { 
+                "pin_a": "D6",
+                "pin_b": "D7"
+            }
         ]
     }
 }

+ 3 - 1
keyboards/binepad/bnr1/v1/rules.mk

@@ -1 +1,3 @@
-# This file intentionally left blank
+# This file is mostly left blank
+
+LTO_ENABLE = yes

+ 9 - 0
keyboards/binepad/bnr1/v2/config.h

@@ -0,0 +1,9 @@
+// Copyright 2022 BINEPAD (@binepad)
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#pragma once
+
+#include "config_common.h"
+
+#define WEAR_LEVELING_LOGICAL_SIZE 1024
+#define WEAR_LEVELING_BACKING_SIZE (WEAR_LEVELING_LOGICAL_SIZE * 2)

+ 22 - 0
keyboards/binepad/bnr1/v2/info.json

@@ -0,0 +1,22 @@
+{
+    "bootloader": "stm32duino",
+    "processor": "STM32F103",
+    "diode_direction": "COL2ROW",
+    "usb": {
+        "pid": "0x4241",
+        "device_version": "2.0.0"
+    },
+    "matrix_pins": {
+        "cols": ["A15"],
+        "rows": ["A8"]
+    },
+    "encoder": {
+        "enabled": true,
+        "rotary": [
+            { 
+                "pin_a": "B3", 
+                "pin_b": "B4"
+            }
+        ]
+    }
+}

+ 7 - 0
keyboards/binepad/bnr1/v2/rules.mk

@@ -0,0 +1,7 @@
+# This file only contains EFL/WL settings and enables F103 low-power mode
+
+EEPROM_DRIVER = wear_leveling
+WEAR_LEVELING_DRIVER = embedded_flash
+
+# Enter lower-power sleep mode when on the ChibiOS idle thread
+OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE