summaryrefslogtreecommitdiff
path: root/docs/reference_info_json.md
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2022-06-21 04:15:06 +0100
committerGitHub <noreply@github.com>2022-06-20 20:15:06 -0700
commit1a400d8644a1f0763c68626863b897cb83c6c939 (patch)
tree4eb78ed9ca511844edd9881eb88a68320e8bc8c0 /docs/reference_info_json.md
parent4c39bad2e631e019d6f90d528e28961c54eb7fe1 (diff)
Allow encoder config from info.json (#17295)
Diffstat (limited to 'docs/reference_info_json.md')
-rw-r--r--docs/reference_info_json.md36
1 files changed, 36 insertions, 0 deletions
diff --git a/docs/reference_info_json.md b/docs/reference_info_json.md
index 90b28689d0..d2e9346ee3 100644
--- a/docs/reference_info_json.md
+++ b/docs/reference_info_json.md
@@ -187,3 +187,39 @@ Example:
```
The device version is a BCD (binary coded decimal) value, in the format `MMmr`, so the below value would look like `0x0100` in the generated code. This also means the maximum valid values for each part are `99.9.9`, despite it being a hexadecimal value under the hood.
+
+### Encoders
+
+This section controls the basic [rotary encoder](feature_encoders.md) support.
+
+The following items can be set. Not every value is required.
+
+* `pin_a`
+ * __Required__. A pad definition
+* `pin_b`
+ * __Required__. B pad definition
+* `resolution`
+ * How many pulses the encoder registers between each detent
+
+Examples:
+
+```json
+{
+ "encoder": {
+ "rotary": [
+ { "pin_a": "B5", "pin_b": "A2" }
+ ]
+ }
+}
+```
+
+```json
+{
+ "encoder": {
+ "rotary": [
+ { "pin_a": "B5", "pin_b": "A2", "resolution": 4 }
+ { "pin_a": "B6", "pin_b": "A3", "resolution": 2 }
+ ]
+ }
+}
+```