From b7729fa019833573b82d0742d9879388bfb6913c Mon Sep 17 00:00:00 2001 From: nonameCCC <79012391+nonameCCC@users.noreply.github.com> Date: Wed, 11 Sep 2024 13:43:36 +0800 Subject: [PATCH] [Keyboard] Add Support for PH-AC Rhythm Game Controller (#24368) * [Keyboard] Add PHDesign PH-AC Rhythm Game Contoller Co-authored by alt-0191 * Detail Improvement * Update keyboard.json * Update readme.md * Update readme.md * Created Encoder Matrix * Posted Images * Suggested Changes * Update keyboard.json * Update readme.md * Update keyboard.json * Update readme.md --- keyboards/phdesign/phac/keyboard.json | 46 +++++++++++++++++++ .../phdesign/phac/keymaps/default/keymap.c | 22 +++++++++ .../phdesign/phac/keymaps/default/rules.mk | 1 + keyboards/phdesign/phac/readme.md | 26 +++++++++++ 4 files changed, 95 insertions(+) create mode 100644 keyboards/phdesign/phac/keyboard.json create mode 100644 keyboards/phdesign/phac/keymaps/default/keymap.c create mode 100644 keyboards/phdesign/phac/keymaps/default/rules.mk create mode 100644 keyboards/phdesign/phac/readme.md diff --git a/keyboards/phdesign/phac/keyboard.json b/keyboards/phdesign/phac/keyboard.json new file mode 100644 index 00000000000..660cf6c2ad4 --- /dev/null +++ b/keyboards/phdesign/phac/keyboard.json @@ -0,0 +1,46 @@ +{ + "manufacturer": "PHDesign", + "keyboard_name": "phac", + "maintainer": "nonameCCC", + "bootloader": "rp2040", + "encoder": { + "rotary": [ + {"pin_a": "GP7", "pin_b": "GP8", "resolution": 1}, + {"pin_a": "GP10", "pin_b": "GP9", "resolution": 1} + ] + }, + "features": { + "bootmagic": true, + "command": false, + "console": false, + "encoder": true, + "extrakey": true, + "mousekey": true, + "nkro": true + }, + "matrix_pins": { + "direct": [ + ["GP1", "GP6", "GP5", "GP4", "GP3", "GP2", "GP0"] + ] + }, + "processor": "RP2040", + "url": "", + "usb": { + "device_version": "2.2.0", + "pid": "0x0001", + "vid": "0x5048" + }, + "layouts": { + "LAYOUT": { + "layout": [ + {"matrix": [0, 0], "x": 2.5, "y": 0}, + {"matrix": [0, 1], "x": 0, "y": 1, "w": 1.5}, + {"matrix": [0, 2], "x": 1.5, "y": 1, "w": 1.5}, + {"matrix": [0, 3], "x": 3, "y": 1, "w": 1.5}, + {"matrix": [0, 4], "x": 4.5, "y": 1, "w": 1.5}, + {"matrix": [0, 5], "x": 0.375, "y": 2, "w": 2.25}, + {"matrix": [0, 6], "x": 3.375, "y": 2, "w": 2.25} + ] + } + } +} diff --git a/keyboards/phdesign/phac/keymaps/default/keymap.c b/keyboards/phdesign/phac/keymaps/default/keymap.c new file mode 100644 index 00000000000..630cca64a78 --- /dev/null +++ b/keyboards/phdesign/phac/keymaps/default/keymap.c @@ -0,0 +1,22 @@ +// Copyright 2023 QMK +// SPDX-License-Identifier: GPL-2.0-or-later + +#include QMK_KEYBOARD_H + +enum layer_names { + _BL, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT( + KC_B, + KC_S, KC_D, KC_K, KC_L, + KC_V, KC_N + ) +}; + +#if defined(ENCODER_MAP_ENABLE) +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [_BL] = { ENCODER_CCW_CW(MS_UP, MS_DOWN), ENCODER_CCW_CW(MS_LEFT, MS_RGHT) }, +}; +#endif \ No newline at end of file diff --git a/keyboards/phdesign/phac/keymaps/default/rules.mk b/keyboards/phdesign/phac/keymaps/default/rules.mk new file mode 100644 index 00000000000..a40474b4d5c --- /dev/null +++ b/keyboards/phdesign/phac/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/phdesign/phac/readme.md b/keyboards/phdesign/phac/readme.md new file mode 100644 index 00000000000..88801888dbd --- /dev/null +++ b/keyboards/phdesign/phac/readme.md @@ -0,0 +1,26 @@ +# phac + +![phac](https://i.imgur.com/bQdYGMf.png) + +A rhythm game controller with 7 keys and 2 encoders on it. + +* Keyboard Maintainer: [Xufeng Tao](https://github.com/nonameCCC) +* Hardware Supported: RP2040 minimal system +* Hardware Availability: https://m.tb.cn/h.gLFXLaX?tk=7DpL3TuPVxx (currently not available outside of mainland China) + +Make example for this keyboard (after setting up your build environment): + + make phdesign/phac:default + +Flashing example for this keyboard: + + make phdesign/phac: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 2 ways: + +* **Bootmagic reset**: Hold down the key at (0,5) in the matrix (the START button) and plug in the controller +* **Physical reset button**: Short pin hole SW1 on the back of the PCB (not recommended as the case is not easy to open)