diff options
author | Joel Challis <[email protected]> | 2023-12-11 23:06:18 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2023-12-11 23:06:18 +0000 |
commit | 4682226e20d17437c0a6f67f5d6160432074d948 (patch) | |
tree | 94a85cb8b8ae55c8f3db7ab09d8af13d66bf0bfa /docs | |
parent | d85f954d3065da06e0c7eb14068d61f18b23bd25 (diff) | |
download | qmk_firmware-4682226e20d17437c0a6f67f5d6160432074d948.tar.gz qmk_firmware-4682226e20d17437c0a6f67f5d6160432074d948.zip |
Keymap introspection for Dip Switches (#22543)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/feature_dip_switch.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/feature_dip_switch.md b/docs/feature_dip_switch.md index 6fbe91657d..0e31f5acae 100644 --- a/docs/feature_dip_switch.md +++ b/docs/feature_dip_switch.md @@ -20,6 +20,27 @@ or #define DIP_SWITCH_MATRIX_GRID { {0,6}, {1,6}, {2,6} } // List of row and col pairs ``` +## DIP Switch map :id=dip-switch-map + +DIP Switch mapping may be added to your `keymap.c`, which replicates the normal keyswitch functionality, but with dip switches. Add this to your keymap's `rules.mk`: + +```make +DIP_SWITCH_MAP_ENABLE = yes +``` + +Your `keymap.c` will then need a dip switch mapping defined (for two dip switches): + +```c +#if defined(DIP_SWITCH_MAP_ENABLE) +const uint16_t PROGMEM dip_switch_map[NUM_DIP_SWITCHES][NUM_DIP_STATES] = { + DIP_SWITCH_OFF_ON(DF(0), DF(1)), + DIP_SWITCH_OFF_ON(EC_NORM, EC_SWAP) +}; +#endif +``` + +?> This should only be enabled at the keymap level. + ## Callbacks The callback functions can be inserted into your `<keyboard>.c`: |