summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2023-12-11 23:06:18 +0000
committerGitHub <noreply@github.com>2023-12-11 23:06:18 +0000
commit4682226e20d17437c0a6f67f5d6160432074d948 (patch)
tree94a85cb8b8ae55c8f3db7ab09d8af13d66bf0bfa /docs
parentd85f954d3065da06e0c7eb14068d61f18b23bd25 (diff)
Keymap introspection for Dip Switches (#22543)
Diffstat (limited to 'docs')
-rw-r--r--docs/feature_dip_switch.md21
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`: