|
| 1 | +# Porting a Keyboard for Halcyon Module Support |
| 2 | + |
| 3 | +Ensure the setup in the main README is completed before proceeding. |
| 4 | + |
| 5 | +This guide applies to: |
| 6 | + |
| 7 | +* Keyboards with a **Halcyon + VIK connector** |
| 8 | +* Keyboards using the **Halcyon → Pro Micro adapter** |
| 9 | + |
| 10 | +## 1. Enable Halcyon Modules in Your Keymap |
| 11 | + |
| 12 | +Copy or create your keymap in this repository. |
| 13 | + |
| 14 | +In your keymap directory, update or create `rules.mk`: |
| 15 | + |
| 16 | +```make |
| 17 | +USER_NAME := halcyon_modules |
| 18 | +``` |
| 19 | + |
| 20 | +If using the Halcyon → Pro Micro adapter, also add: |
| 21 | + |
| 22 | +```make |
| 23 | +CONVERT_TO = halcyon |
| 24 | +``` |
| 25 | + |
| 26 | +## 2. Configure Encoder Support |
| 27 | + |
| 28 | +Edit: |
| 29 | + |
| 30 | +``` |
| 31 | +users/halcyon_modules/splitkb/config.h |
| 32 | +``` |
| 33 | + |
| 34 | +Add a keyboard-specific override. Pin values must match those defined in `keyboard.json`. |
| 35 | + |
| 36 | +Replace `/` with `_` in the keyboard identifier: |
| 37 | + |
| 38 | +```c |
| 39 | +#ifdef KEYBOARD_splitkb_halcyon_elora_rev2_hlc |
| 40 | + #define ENCODER_A_PINS { GP22, HLC_ENCODER_A } |
| 41 | + #define ENCODER_B_PINS { GP18, HLC_ENCODER_B } |
| 42 | +#endif |
| 43 | +``` |
| 44 | + |
| 45 | +If the keyboard defines a split encoder, also override right-half pins: |
| 46 | + |
| 47 | +```c |
| 48 | +#ifdef KEYBOARD_splitkb_aurora_corne_rev1_hlc |
| 49 | + #undef ENCODER_A_PINS |
| 50 | + #undef ENCODER_B_PINS |
| 51 | + #define ENCODER_A_PINS { D4, HLC_ENCODER_A } |
| 52 | + #define ENCODER_B_PINS { C6, HLC_ENCODER_B } |
| 53 | + |
| 54 | + #undef ENCODER_A_PINS_RIGHT |
| 55 | + #undef ENCODER_B_PINS_RIGHT |
| 56 | + #define ENCODER_A_PINS_RIGHT { F6, HLC_ENCODER_A } |
| 57 | + #define ENCODER_B_PINS_RIGHT { F7, HLC_ENCODER_B } |
| 58 | +#endif |
| 59 | +``` |
| 60 | + |
| 61 | +## 3. Expand the Matrix |
| 62 | + |
| 63 | +In your keymap's `config.h`, override the column count when Halcyon is enabled. Create the file if needed. |
| 64 | + |
| 65 | +Determine the current column count from `keyboard.json`, then add 5: |
| 66 | + |
| 67 | +```c |
| 68 | +#ifdef HALCYON_ENABLE |
| 69 | + #undef MATRIX_COLS |
| 70 | + #define MATRIX_COLS 11 // original + 5 |
| 71 | +#endif |
| 72 | +``` |
| 73 | + |
| 74 | +## 4. Define Halcyon Button Mappings |
| 75 | + |
| 76 | +Update `keymap.c`, or create a new file if you're using the `keymap.json` (e.g. `halcyon_keys.c`). |
| 77 | + |
| 78 | +If creating a new file: |
| 79 | + |
| 80 | +* Add `#include QMK_KEYBOARD_H` |
| 81 | +* Register it in `rules.mk`: |
| 82 | + |
| 83 | + ```make |
| 84 | + SRC += halcyon_keys.c |
| 85 | + ``` |
| 86 | + |
| 87 | +Add: |
| 88 | + |
| 89 | +```c |
| 90 | +#if defined(HALCYON_ENABLE) |
| 91 | + |
| 92 | +const uint16_t left_halcyon_buttons[10][5] = { |
| 93 | + [0] = { KC_MUTE, _______, _______, _______, _______ }, |
| 94 | + [1] = { _______, _______, _______, _______, _______ }, |
| 95 | + [2] = { _______, _______, _______, _______, _______ }, |
| 96 | +}; |
| 97 | + |
| 98 | +const uint16_t right_halcyon_buttons[10][5] = { |
| 99 | + [0] = { KC_MUTE, _______, _______, _______, _______ }, |
| 100 | + [1] = { _______, _______, _______, _______, _______ }, |
| 101 | + [2] = { _______, _______, _______, _______, _______ }, |
| 102 | +}; |
| 103 | + |
| 104 | +#endif |
| 105 | +``` |
| 106 | + |
| 107 | +(Extend layers as needed; unused entries can remain `_______`.) |
| 108 | + |
| 109 | +## 5. Compile |
| 110 | + |
| 111 | +Build using the standard userspace workflow described in the main README. |
0 commit comments