diff options
author | Pete Johanson <peter@peterjohanson.com> | 2020-10-15 11:18:42 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-15 11:18:42 -0400 |
commit | 548fa2a6eb9580a7b5c8354a47bad193afc1fe49 (patch) | |
tree | 4ff61c73e1bd67fcb8cafbfcdfb8eed9b76625b4 | |
parent | 3186a553a5d18f24fc6fbac2987cf8054afadcbb (diff) | |
parent | cc21167d57665a9bf0b413a4a85984f771d7812f (diff) |
Merge pull request #277 from megamind4089/docs/ext-power
Added docs for external power output
-rw-r--r-- | docs/docs/behavior/power.md | 64 | ||||
-rw-r--r-- | docs/sidebars.js | 1 |
2 files changed, 65 insertions, 0 deletions
diff --git a/docs/docs/behavior/power.md b/docs/docs/behavior/power.md new file mode 100644 index 0000000..6b8237b --- /dev/null +++ b/docs/docs/behavior/power.md @@ -0,0 +1,64 @@ +--- +title: Power Management Behaviors +sidebar_label: Power Management +--- + +## Summary + +These page contains some of the power management behaviors currently supported by ZMK. + +## External Power Control + +The External power control behavior allows enabling or disabling the VCC power output +to save power. Some of the LEDs will consume power even in OFF state. To preserve +battery life in this scenario, some controller boards have support to disable the +external power completely. + +The following boards currently support this feature: +- nRFMicro +- nice!nano + +## External Power Control Command Defines + +External power control command defines are provided through the [`dt-bindings/zmk/ext_power.h`](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/ext_power.h) header, +which is added at the top of the keymap file: + +``` +#include <dt-bindings/zmk/ext_power.h> +``` + +This will allow you to reference the actions defined in this header such as `EXT_POWER_OFF_CMD`. + +Here is a table describing the command for each define: + +| Define | Action | Alias | +| ------------ | -------------------------------------- | -------- | +| `EXT_POWER_OFF_CMD` | Disable the external power. | `EP_OFF` | +| `EXT_POWER_ON_CMD` | Enable the external power. | `EP_ON` | +| `EXT_POWER_TOGGLE_CMD` | Toggle the external power. | `EP_TOG` | + +### Behavior Binding + +- Reference: `&ext_power` +- Parameter#1: Command, e.g `EP_ON` + +### Example: + +1. Behavior binding to enable the external power + + ``` + &ext_power EP_ON + ``` + +1. Behavior binding to disable the external power + + ``` + &ext_power EP_OFF + ``` + +1. Behavior binding to toggle the external power + + ``` + &ext_power EP_TOG + ``` + diff --git a/docs/sidebars.js b/docs/sidebars.js index 93ce226..12b4a6e 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -23,6 +23,7 @@ module.exports = { "behavior/reset", "behavior/bluetooth", "behavior/lighting", + "behavior/power", ], Development: [ "dev-clean-room", |