From 252b041b97c03374e8f10570a54992f7f91f5f26 Mon Sep 17 00:00:00 2001 From: Patryk <61631089+patrykf03@users.noreply.github.com> Date: Wed, 1 Feb 2023 14:13:18 +0000 Subject: [PATCH] add Mecx Labs mp1 macropad (#19064) * add mecxlabs mp1 macropad Co-authored-by: Joel Challis --- keyboards/mecxlabs/mp1/info.json | 46 +++++++++++++++++++ .../mecxlabs/mp1/keymaps/default/keymap.c | 22 +++++++++ keyboards/mecxlabs/mp1/readme.md | 23 ++++++++++ keyboards/mecxlabs/mp1/rules.mk | 4 ++ 4 files changed, 95 insertions(+) create mode 100644 keyboards/mecxlabs/mp1/info.json create mode 100644 keyboards/mecxlabs/mp1/keymaps/default/keymap.c create mode 100644 keyboards/mecxlabs/mp1/readme.md create mode 100644 keyboards/mecxlabs/mp1/rules.mk diff --git a/keyboards/mecxlabs/mp1/info.json b/keyboards/mecxlabs/mp1/info.json new file mode 100644 index 000000000000..db989e5517f9 --- /dev/null +++ b/keyboards/mecxlabs/mp1/info.json @@ -0,0 +1,46 @@ +{ + "keyboard_name": "mp1", + "manufacturer": "Mecx Labs", + "maintainer": "patrykf03", + "usb": { + "vid": "0xC6C6", + "pid": "0x6C6C", + "device_version": "0.0.1" + }, + "processor": "STM32F072", + "bootloader": "stm32-dfu", + "features": { + "bootmagic": true, + "extrakey": true, + "mousekey": true, + "nkro": true, + "encoder": true + }, + "encoder": { + "rotary": [ + { "pin_a": "A10", "pin_b": "A9", "resolution": 2 } + ] + }, + "matrix_pins": { + "direct": [ + ["B14", "A14", "A15"], + ["B13", "B12", "A2"], + ["A5", "A4", "A3"] + ] + }, + "layouts": { + "LAYOUT_ortho_3x3": { + "layout": [ + { "matrix": [0, 0], "x": 0.0, "y": 0.0 }, + { "matrix": [0, 1], "x": 1.0, "y": 0.0 }, + { "matrix": [0, 2], "x": 2.0, "y": 0.0 }, + { "matrix": [1, 0], "x": 0.0, "y": 1.0 }, + { "matrix": [1, 1], "x": 1.0, "y": 1.0 }, + { "matrix": [1, 2], "x": 2.0, "y": 1.0 }, + { "matrix": [2, 0], "x": 0.0, "y": 2.0 }, + { "matrix": [2, 1], "x": 1.0, "y": 2.0 }, + { "matrix": [2, 2], "x": 2.0, "y": 2.0 } + ] + } + } +} diff --git a/keyboards/mecxlabs/mp1/keymaps/default/keymap.c b/keyboards/mecxlabs/mp1/keymaps/default/keymap.c new file mode 100644 index 000000000000..a58fefbd2d73 --- /dev/null +++ b/keyboards/mecxlabs/mp1/keymaps/default/keymap.c @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_ortho_3x3( + KC_1, KC_2, KC_3, + KC_4, KC_5, KC_6, + KC_7, KC_8, KC_9 + ) + +}; + +bool encoder_update_user(uint8_t index, bool clockwise) { + if (clockwise) { + tap_code(KC_VOLU); + } else { + tap_code(KC_VOLD); + } + return true; +} diff --git a/keyboards/mecxlabs/mp1/readme.md b/keyboards/mecxlabs/mp1/readme.md new file mode 100644 index 000000000000..de0c6e6255ce --- /dev/null +++ b/keyboards/mecxlabs/mp1/readme.md @@ -0,0 +1,23 @@ +# mecxlabs mp1 + +* Keyboard Maintainer: [Patrykf03](https://github.com/Patrykf03) +* Hardware Supported: Mecx Labs mp1 macropad (STM32/APM32F072) +* Hardware Availability: [mecxlabs.com](https://mecxlabs.com/products/mp1-framework) + +Make example for this keyboard (after setting up your build environment): + + make mecxlabs/mp1:default + +Flashing example for this keyboard: + + make mecxlabs/mp1: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 (encoder in top left) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB +* **Keycode in layout**: Press the key mapped to `RESET` if it is available diff --git a/keyboards/mecxlabs/mp1/rules.mk b/keyboards/mecxlabs/mp1/rules.mk new file mode 100644 index 000000000000..ee2a7c0d6a92 --- /dev/null +++ b/keyboards/mecxlabs/mp1/rules.mk @@ -0,0 +1,4 @@ +# Wildcard to allow APM32 MCU +DFU_SUFFIX_ARGS = -v FFFF -p FFFF +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE