From 70055221767ff6b004006d3f349fcfdfcc864180 Mon Sep 17 00:00:00 2001 From: Guido Bartolucci Date: Mon, 28 Oct 2024 01:50:42 -0400 Subject: [PATCH] Add madjax_macropad keyboard (#24524) Co-authored-by: Ryan --- keyboards/madjax_macropad/keyboard.json | 55 +++++++++++++++++++ .../madjax_macropad/keymaps/default/keymap.c | 49 +++++++++++++++++ .../madjax_macropad/keymaps/default/rules.mk | 1 + keyboards/madjax_macropad/readme.md | 24 ++++++++ 4 files changed, 129 insertions(+) create mode 100644 keyboards/madjax_macropad/keyboard.json create mode 100644 keyboards/madjax_macropad/keymaps/default/keymap.c create mode 100644 keyboards/madjax_macropad/keymaps/default/rules.mk create mode 100644 keyboards/madjax_macropad/readme.md diff --git a/keyboards/madjax_macropad/keyboard.json b/keyboards/madjax_macropad/keyboard.json new file mode 100644 index 0000000000..ac2802faef --- /dev/null +++ b/keyboards/madjax_macropad/keyboard.json @@ -0,0 +1,55 @@ +{ + "manufacturer": "MadJax", + "keyboard_name": "madjax_macropad", + "maintainer": "guidoism", + "bootloader": "rp2040", + "diode_direction": "COL2ROW", + "features": { + "bootmagic": true, + "command": false, + "console": false, + "encoder": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "cols": ["GP26", "GP27", "GP28", "GP29"], + "rows": ["GP6", "GP7", "GP0", "GP4", "GP3"] + }, + "encoder": { + "rotary": [ + {"pin_a": "GP1", "pin_b": "GP2"} + ] + }, + "processor": "RP2040", + "url": "https://github.com/guidoism/madjax_macropad", + "usb": { + "device_version": "1.0.0", + "pid": "0x0000", + "vid": "0xFEED" + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [0, 3], "x": 3, "y": 0}, + {"matrix": [1, 0], "x": 0, "y": 1}, + {"matrix": [1, 1], "x": 1, "y": 1}, + {"matrix": [1, 2], "x": 2, "y": 1}, + {"matrix": [1, 3], "x": 3, "y": 1}, + {"matrix": [2, 0], "x": 0, "y": 2}, + {"matrix": [2, 1], "x": 1, "y": 2}, + {"matrix": [2, 2], "x": 2, "y": 2}, + {"matrix": [2, 3], "x": 3, "y": 2}, + {"matrix": [3, 0], "x": 0, "y": 3}, + {"matrix": [3, 1], "x": 1, "y": 3}, + {"matrix": [3, 2], "x": 2, "y": 3}, + {"matrix": [3, 3], "x": 3, "y": 3}, + {"matrix": [4, 0], "x": 0, "y": 4}, + {"matrix": [4, 1], "x": 1, "y": 4}, + {"matrix": [4, 2], "x": 2, "y": 4}, + {"matrix": [4, 3], "x": 3, "y": 4} + ] + } + } +} diff --git a/keyboards/madjax_macropad/keymaps/default/keymap.c b/keyboards/madjax_macropad/keymaps/default/keymap.c new file mode 100644 index 0000000000..693438c1f3 --- /dev/null +++ b/keyboards/madjax_macropad/keymaps/default/keymap.c @@ -0,0 +1,49 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +enum custom_keycodes { + KC_P00 = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ┌───┐ + * │ - │ + * ┌───┬───┬───┼───┤ + * │ 7 │ 8 │ 9 │ + │ + * ├───┼───┼───┼───┤ + * │ 4 │ 5 │ 6 │ % │ + * ├───┼───┼───┼───┤ + * │ 1 │ 2 │ 3 │ = │ + * ├───┼───┼───┼───┤ + * │ 0 │00 │ . │Ent│ + * └───┴───┴───┴───┘ + */ + [0] = LAYOUT( + KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_PERC, + KC_P1, KC_P2, KC_P3, KC_EQL, + KC_P0, KC_P00, KC_PDOT, KC_PENT + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case KC_P00: + tap_code(KC_P0); + tap_code(KC_P0); + return false; + } + } + return true; +} + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN) } +}; +#endif diff --git a/keyboards/madjax_macropad/keymaps/default/rules.mk b/keyboards/madjax_macropad/keymaps/default/rules.mk new file mode 100644 index 0000000000..ee32568148 --- /dev/null +++ b/keyboards/madjax_macropad/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/madjax_macropad/readme.md b/keyboards/madjax_macropad/readme.md new file mode 100644 index 0000000000..1abe17ecca --- /dev/null +++ b/keyboards/madjax_macropad/readme.md @@ -0,0 +1,24 @@ +# MadJax Macropad + +* Keyboard Maintainer: [Guido Bartolucci](https://github.com/guidoism) +* Hardware Supported: Seeed Studio XIAO RP2040 +* Hardware Availability: https://github.com/guidoism/madjax_macropad + +Make example for this keyboard (after setting up your build environment): + + make madjax_macropad:default + +Flashing example for this keyboard: + + make madjax_macropad: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 or Escape) and plug in the keyboard +* **Physical reset button**: Briefly press the button on the back of the PCB - some may have pads you must short instead +* **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available +