b7729fa019833573b82d0742d9879388bfb6913c

Author
nonameCCC <79012391+nonameCCC@users.noreply.github.com>
Committer
GitHub <noreply@github.com>
Date

Message

[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

Diff

This diff is truncated to protect this page.

  1diff --git a/keyboards/phdesign/phac/keyboard.json b/keyboards/phdesign/phac/keyboard.json
  2new file mode 100644
  3index 0000000000000000000000000000000000000000..660cf6c2ad4d4fa76dcb23bea04d1e3bf4fabd92
  4--- /dev/null
  5+++ b/keyboards/phdesign/phac/keyboard.json
  6@@ -0,0 +1,46 @@
  7+{
  8+    "manufacturer": "PHDesign",
  9+    "keyboard_name": "phac",
 10+    "maintainer": "nonameCCC",
 11+    "bootloader": "rp2040",
 12+    "encoder": {
 13+        "rotary": [
 14+            {"pin_a": "GP7", "pin_b": "GP8", "resolution": 1},
 15+            {"pin_a": "GP10", "pin_b": "GP9", "resolution": 1}
 16+        ]
 17+    },
 18+    "features": {
 19+        "bootmagic": true,
 20+        "command": false,
 21+        "console": false,
 22+        "encoder": true,
 23+        "extrakey": true,
 24+        "mousekey": true,
 25+        "nkro": true
 26+    },
 27+    "matrix_pins": {
 28+        "direct": [
 29+            ["GP1", "GP6", "GP5", "GP4", "GP3", "GP2", "GP0"]
 30+        ]
 31+    },
 32+    "processor": "RP2040",
 33+    "url": "",
 34+    "usb": {
 35+        "device_version": "2.2.0",
 36+        "pid": "0x0001",
 37+        "vid": "0x5048"
 38+    },
 39+    "layouts": {
 40+        "LAYOUT": {
 41+            "layout": [
 42+                {"matrix": [0, 0], "x": 2.5, "y": 0},
 43+                {"matrix": [0, 1], "x": 0, "y": 1, "w": 1.5},
 44+                {"matrix": [0, 2], "x": 1.5, "y": 1, "w": 1.5},
 45+                {"matrix": [0, 3], "x": 3, "y": 1, "w": 1.5},
 46+                {"matrix": [0, 4], "x": 4.5, "y": 1, "w": 1.5},
 47+                {"matrix": [0, 5], "x": 0.375, "y": 2, "w": 2.25},
 48+                {"matrix": [0, 6], "x": 3.375, "y": 2, "w": 2.25}
 49+            ]
 50+        }
 51+    }
 52+}
 53diff --git a/keyboards/phdesign/phac/keymaps/default/keymap.c b/keyboards/phdesign/phac/keymaps/default/keymap.c
 54new file mode 100644
 55index 0000000000000000000000000000000000000000..630cca64a787b0363e9d53e9570efb83eb16aa26
 56--- /dev/null
 57+++ b/keyboards/phdesign/phac/keymaps/default/keymap.c
 58@@ -0,0 +1,22 @@
 59+// Copyright 2023 QMK
 60+// SPDX-License-Identifier: GPL-2.0-or-later
 61+
 62+#include QMK_KEYBOARD_H
 63+
 64+enum layer_names {
 65+    _BL,
 66+};
 67+
 68+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 69+    [_BL] = LAYOUT(
 70+                    KC_B,
 71+        KC_S,   KC_D,   KC_K,   KC_L,
 72+            KC_V,           KC_N
 73+    )
 74+};
 75+
 76+#if defined(ENCODER_MAP_ENABLE)
 77+const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
 78+    [_BL] = { ENCODER_CCW_CW(MS_UP, MS_DOWN),  ENCODER_CCW_CW(MS_LEFT, MS_RGHT)  },
 79+};
 80+#endif
 81diff --git a/keyboards/phdesign/phac/keymaps/default/rules.mk b/keyboards/phdesign/phac/keymaps/default/rules.mk
 82new file mode 100644
 83index 0000000000000000000000000000000000000000..a40474b4d5c71c0cb5b821bec0ab63c175cdc43d
 84--- /dev/null
 85+++ b/keyboards/phdesign/phac/keymaps/default/rules.mk
 86@@ -0,0 +1 @@
 87+ENCODER_MAP_ENABLE = yes
 88diff --git a/keyboards/phdesign/phac/readme.md b/keyboards/phdesign/phac/readme.md
 89new file mode 100644
 90index 0000000000000000000000000000000000000000..88801888dbdce8b040866bbff80e84d72f69b696
 91--- /dev/null
 92+++ b/keyboards/phdesign/phac/readme.md
 93@@ -0,0 +1,26 @@
 94+# phac
 95+
 96+![phac](https://i.imgur.com/bQdYGMf.png)
 97+
 98+A rhythm game controller with 7 keys and 2 encoders on it.
 99+
100+* Keyboard Maintainer: [Xufeng Tao](https://github.com/nonameCCC)
101+* Hardware Supported: RP2040 minimal system
102+* Hardware Availability: https://m.tb.cn/h.gLFXLaX?tk=7DpL3TuPVxx (currently not available outside of mainland China)
103+
104+Make example for this keyboard (after setting up your build environment):
105+
106+    make phdesign/phac:default
107+
108+Flashing example for this keyboard:
109+
110+    make phdesign/phac:default:flash
111+