-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(feat): Adding some additional clarity around low power states, w…
…ith guide portion moved to hardware integration
- Loading branch information
1 parent
249ecbc
commit 3e847ee
Showing
15 changed files
with
523 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
docs/docs/development/hardware-integration/includes/_gpio-key-direct.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Here is an example for a keyboard with a dedicated on/off push button that is a direct wire between the GPIO pin and ground: | ||
|
||
```dts | ||
/ { | ||
keys { | ||
compatible = "gpio-keys"; | ||
soft_off_gpio_key: soft_off_gpio_key { | ||
gpios = <&gpio0 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; | ||
}; | ||
}; | ||
}; | ||
``` | ||
|
||
In the above example the soft on/off would be triggered by pulling the specified pin low, typically by pressing a switch that has the other leg connected to ground. |
14 changes: 14 additions & 0 deletions
14
docs/docs/development/hardware-integration/includes/_gpio-key-matrix.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Here is an example for a keyboard with a GPIO pin that reads from the matrix: | ||
|
||
```dts | ||
/ { | ||
keys { | ||
compatible = "gpio-keys"; | ||
soft_off_gpio_key: soft_off_gpio_key { | ||
gpios = <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; | ||
}; | ||
}; | ||
}; | ||
``` | ||
|
||
Matrix inputs are triggered by pulling the specified pin high, typically by pressing some combination of switches which connects the matrix input to a matrix output. |
14 changes: 14 additions & 0 deletions
14
docs/docs/development/hardware-integration/includes/_gpio-key-wakeup.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Here is an example for a keyboard with a GPIO pin reused from a matrix kscan: | ||
|
||
```dts | ||
/ { | ||
keys { | ||
compatible = "gpio-keys"; | ||
soft_off_gpio_key: soft_off_gpio_key { | ||
gpios = <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; | ||
}; | ||
}; | ||
}; | ||
``` | ||
|
||
The GPIO settings should match those in the kscan, so the above would be set to `(GPIO_ACTIVE_LOW | GPIO_PULL_UP)` for a direct kscan. |
37 changes: 37 additions & 0 deletions
37
docs/docs/development/hardware-integration/includes/_sideband-direct.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
### KScan sideband behavior | ||
|
||
The kscan sideband behavior driver will be used to trigger the [soft off behavior](../../../keymaps/behaviors/soft-off.md) "out of band" from the normal keymap processing. To do so, it will decorate/wrap an underlying kscan driver. | ||
|
||
With a simple direct pin setup, the [direct kscan](../../../config/kscan.md) driver can be used with a [GPIO key](#gpio-key), to make a small "side matrix": | ||
|
||
```dts | ||
/ { | ||
wakeup_scan: wakeup_scan { | ||
compatible = "zmk,kscan-gpio-direct"; | ||
input-keys = <&soft_off_gpio_key>; | ||
wakeup-source; | ||
}; | ||
}; | ||
``` | ||
|
||
With that in place, the kscan sideband behavior will wrap the new driver: | ||
|
||
```dts | ||
/ { | ||
side_band_behavior_triggers: side_band_behavior_triggers { | ||
compatible = "zmk,kscan-sideband-behaviors"; | ||
kscan = <&wakeup_scan>; | ||
auto-enable; | ||
wakeup-source; | ||
soft_off { | ||
column = <0>; | ||
row = <0>; | ||
bindings = <&hw_soft_off>; | ||
}; | ||
}; | ||
}; | ||
``` | ||
|
||
As the kscan used only has a single key, both column and row are set to 0. The properties of the `kscan-sideband-behaviors` node can be found in the [appropriate configuration section](../../../config/kscan.md#kscan-sideband-behavior-driver). |
Oops, something went wrong.