From 6c0ef5cbaedec62e0bd0e5936e0fbff8ea41ed80 Mon Sep 17 00:00:00 2001 From: Vino Rodrigues <366673+vinorodrigues@users.noreply.github.com> Date: Mon, 6 Mar 2023 17:08:28 +1100 Subject: [PATCH] Addition of the Binpad NEOKNOB KN01 rotary encoder (#390) * Added Binepad / NeoKnob KN01 * Update readme.md --- keyboards/binepad/kn01/config.h | 9 ++++ keyboards/binepad/kn01/info.json | 45 +++++++++++++++++++ .../binepad/kn01/keymaps/default/keymap.c | 28 ++++++++++++ .../binepad/kn01/keymaps/default/rules.mk | 4 ++ keyboards/binepad/kn01/keymaps/vial/config.h | 17 +++++++ keyboards/binepad/kn01/keymaps/vial/keymap.c | 28 ++++++++++++ keyboards/binepad/kn01/keymaps/vial/rules.mk | 8 ++++ keyboards/binepad/kn01/keymaps/vial/vial.json | 10 +++++ keyboards/binepad/kn01/readme.md | 27 +++++++++++ keyboards/binepad/kn01/rules.mk | 7 +++ 10 files changed, 183 insertions(+) create mode 100644 keyboards/binepad/kn01/config.h create mode 100755 keyboards/binepad/kn01/info.json create mode 100644 keyboards/binepad/kn01/keymaps/default/keymap.c create mode 100644 keyboards/binepad/kn01/keymaps/default/rules.mk create mode 100644 keyboards/binepad/kn01/keymaps/vial/config.h create mode 100644 keyboards/binepad/kn01/keymaps/vial/keymap.c create mode 100644 keyboards/binepad/kn01/keymaps/vial/rules.mk create mode 100644 keyboards/binepad/kn01/keymaps/vial/vial.json create mode 100755 keyboards/binepad/kn01/readme.md create mode 100755 keyboards/binepad/kn01/rules.mk diff --git a/keyboards/binepad/kn01/config.h b/keyboards/binepad/kn01/config.h new file mode 100644 index 0000000000..7fbf1cfab1 --- /dev/null +++ b/keyboards/binepad/kn01/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) diff --git a/keyboards/binepad/kn01/info.json b/keyboards/binepad/kn01/info.json new file mode 100755 index 0000000000..c8800932c2 --- /dev/null +++ b/keyboards/binepad/kn01/info.json @@ -0,0 +1,45 @@ +{ + "manufacturer": "Binepad", + "keyboard_name": "KN01", + "maintainer": "Binpad", + "bootloader": "stm32duino", + "processor": "STM32F103", + "diode_direction": "COL2ROW", + "debounce": 5, + "features": { + "bootmagic": true, + "command": false, + "console": false, + "extrakey": true, + "mousekey": true, + "nkro": false, + "encoder": true + }, + "url": "http://binepad.com", + "usb": { + "vid": "0x4249", + "pid": "0x4040", + "device_version": "1.0.0" + }, + "matrix_pins": { + "cols": ["A15"], + "rows": ["A8"] + }, + "encoder": { + "enabled": true, + "rotary": [ + { + "pin_a": "B3", + "pin_b": "B4" + } + ] + }, + "community_layouts": ["ortho_1x1"], + "layouts": { + "LAYOUT_ortho_1x1": { + "layout": [ + {"matrix": [0, 0], "x": 0, "y": 0, "w": 2, "h": 2} + ] + } + } +} diff --git a/keyboards/binepad/kn01/keymaps/default/keymap.c b/keyboards/binepad/kn01/keymaps/default/keymap.c new file mode 100644 index 0000000000..974005afaa --- /dev/null +++ b/keyboards/binepad/kn01/keymaps/default/keymap.c @@ -0,0 +1,28 @@ +/* Copyright 2022 Binepad (@binpad) */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include QMK_KEYBOARD_H + +enum { + _L0, + _L1 +} keyboard_layers; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_L0] = LAYOUT_ortho_1x1( + LT(_L1, KC_MUTE) + ), + + [_L1] = LAYOUT_ortho_1x1( + _______ + ) +}; + +#if defined(ENCODER_MAP_ENABLE) + +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_L0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_L1] = { ENCODER_CCW_CW(KC_MS_WH_DOWN, KC_MS_WH_UP) } +}; + +#endif diff --git a/keyboards/binepad/kn01/keymaps/default/rules.mk b/keyboards/binepad/kn01/keymaps/default/rules.mk new file mode 100644 index 0000000000..1148b627d9 --- /dev/null +++ b/keyboards/binepad/kn01/keymaps/default/rules.mk @@ -0,0 +1,4 @@ +# Copyright 2022 Binepad (@binpad) +# SPDX-License-Identifier: GPL-2.0-or-later + +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/binepad/kn01/keymaps/vial/config.h b/keyboards/binepad/kn01/keymaps/vial/config.h new file mode 100644 index 0000000000..28f40f4c7a --- /dev/null +++ b/keyboards/binepad/kn01/keymaps/vial/config.h @@ -0,0 +1,17 @@ +/* Copyright 2022 Binepad (@binpad) */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#define VIAL_KEYBOARD_UID {0xF2, 0x59, 0x70, 0xE1, 0x86, 0x78, 0x9F, 0x58} + +#define VIAL_UNLOCK_COMBO_ROWS { 0 } +#define VIAL_UNLOCK_COMBO_COLS { 0 } + + +#define TAPPING_TERM 175 + +#ifdef DYNAMIC_KEYMAP_LAYER_COUNT + #undef DYNAMIC_KEYMAP_LAYER_COUNT +#endif +#define DYNAMIC_KEYMAP_LAYER_COUNT 2 diff --git a/keyboards/binepad/kn01/keymaps/vial/keymap.c b/keyboards/binepad/kn01/keymaps/vial/keymap.c new file mode 100644 index 0000000000..974005afaa --- /dev/null +++ b/keyboards/binepad/kn01/keymaps/vial/keymap.c @@ -0,0 +1,28 @@ +/* Copyright 2022 Binepad (@binpad) */ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include QMK_KEYBOARD_H + +enum { + _L0, + _L1 +} keyboard_layers; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_L0] = LAYOUT_ortho_1x1( + LT(_L1, KC_MUTE) + ), + + [_L1] = LAYOUT_ortho_1x1( + _______ + ) +}; + +#if defined(ENCODER_MAP_ENABLE) + +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { + [_L0] = { ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_L1] = { ENCODER_CCW_CW(KC_MS_WH_DOWN, KC_MS_WH_UP) } +}; + +#endif diff --git a/keyboards/binepad/kn01/keymaps/vial/rules.mk b/keyboards/binepad/kn01/keymaps/vial/rules.mk new file mode 100644 index 0000000000..0dd2159cb7 --- /dev/null +++ b/keyboards/binepad/kn01/keymaps/vial/rules.mk @@ -0,0 +1,8 @@ +# Copyright 2022 Binepad (@binpad) +# SPDX-License-Identifier: GPL-2.0-or-later + +VIA_ENABLE = yes +VIAL_ENABLE = yes +QMK_SETTINGS = no + +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/binepad/kn01/keymaps/vial/vial.json b/keyboards/binepad/kn01/keymaps/vial/vial.json new file mode 100644 index 0000000000..a4c9aa77fd --- /dev/null +++ b/keyboards/binepad/kn01/keymaps/vial/vial.json @@ -0,0 +1,10 @@ +{ + "lighting": "none", + "matrix": { "rows": 1, "cols": 1 }, + "layouts": { + "keymap": [ + [{"x":1.25,"w":1.5,"h":1.5},"0,0"], + [{"y":-0.75},"0,0\n\n\n\n\n\n\n\n\ne",{"x":2},"0,1\n\n\n\n\n\n\n\n\ne"] + ] + } +} diff --git a/keyboards/binepad/kn01/readme.md b/keyboards/binepad/kn01/readme.md new file mode 100755 index 0000000000..ce1c7c2e23 --- /dev/null +++ b/keyboards/binepad/kn01/readme.md @@ -0,0 +1,27 @@ +# BINEPAD NEOKNOB KN01 + +The KN01 is a multifunction knob, which can be rotated, pressed, and rotated while pressed. + +* Keyboard Maintainer: [Binpad](https://github.com/binepad) +* Hardware Supported: **NEOKNOB KN01** +* Hardware Availability: [Binepad.com](https://www.binepad.com/product-page/kn01) + +Make example for this keyboard (after setting up your build environment): + + make binepad/kn01:default + +Flashing example for this keyboard: + + make binepad/kn01: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 knob while plugging in the keyboard's USB cable +* **Physical reset button**: Briefly press the button on the underside of the PCB +* **Keycode in layout**: Press the key mapped to `QK_BOOT` *(or `RESET`)* if it is available diff --git a/keyboards/binepad/kn01/rules.mk b/keyboards/binepad/kn01/rules.mk new file mode 100755 index 0000000000..a9a826d49f --- /dev/null +++ b/keyboards/binepad/kn01/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