mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-23 22:45:17 -05:00
fix(docs): Updated encoder config docs.
* Update new shield guide for new sensor/encoder settings. * Add DTS section to encoder config docs. Co-authored-by: Cem Aksoylar <caksoylar@users.noreply.github.com>
This commit is contained in:
committed by
Pete Johanson
parent
9e8ee86842
commit
8d09809ef0
@@ -29,13 +29,55 @@ If `CONFIG_EC11` is enabled, exactly one of the following options must be set to
|
||||
|
||||
### Devicetree
|
||||
|
||||
#### Keymap Sensor Config
|
||||
|
||||
For shields/boards that export a `sensors` node configuration label, both global and per-sensor settings can be set by overriding the properties there.
|
||||
|
||||
To override the general settings, update them on the exported `sensors` node, e.g.:
|
||||
|
||||
```
|
||||
&sensors {
|
||||
triggers-per-rotation = <18>;
|
||||
};
|
||||
```
|
||||
|
||||
Per sensor overrides can be added with ordered nested nodes with the correct overrides, e.g.:
|
||||
|
||||
```
|
||||
&sensors {
|
||||
left_config {
|
||||
triggers-per-rotation = <18>;
|
||||
};
|
||||
|
||||
right_config {
|
||||
triggers-per-rotation = <24>;
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
:::note
|
||||
|
||||
The names of the child nodes are not important, and are applied in order to the sensors listed in the `sensors` property of the sensors node.
|
||||
|
||||
:::
|
||||
|
||||
Applies to the node and child nodes of: `compatible = "zmk,keymap-sensors"`
|
||||
|
||||
Definition file: [zmk/app/drivers/zephyr/dts/bindings/zmk,keymap-sensors.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/zephyr/dts/bindings/zmk%2Ckeymap-sensors.yaml)
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| ----------------------- | ---- | --------------------------------------------------------------- | ------- |
|
||||
| `triggers-per-rotation` | int | Number of times to trigger the bound behavior per full rotation | |
|
||||
|
||||
#### EC11 Nodes
|
||||
|
||||
Applies to: `compatible = "alps,ec11"`
|
||||
|
||||
Definition file: [zmk/app/module/dts/bindings/sensor/alps,ec11.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/module/dts/bindings/sensor/alps%2Cec11.yaml)
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| ------------ | ---------- | ------------------------------------- | ------- |
|
||||
| `label` | string | Unique label for the node | |
|
||||
| `a-gpios` | GPIO array | GPIO connected to the encoder's A pin | |
|
||||
| `b-gpios` | GPIO array | GPIO connected to the encoder's B pin | |
|
||||
| `resolution` | int | Number of encoder pulses per tick | 1 |
|
||||
| Property | Type | Description | Default |
|
||||
| --------- | ---------- | ---------------------------------------------- | ------- |
|
||||
| `label` | string | Unique label for the node | |
|
||||
| `a-gpios` | GPIO array | GPIO connected to the encoder's A pin | |
|
||||
| `b-gpios` | GPIO array | GPIO connected to the encoder's B pin | |
|
||||
| `steps` | int | Number of encoder pulses per complete rotation | |
|
||||
|
||||
Reference in New Issue
Block a user