docs: Add documentation for config options
This commit is contained in:
parent
6180643581
commit
11861a4d30
14 changed files with 1014 additions and 26 deletions
91
docs/docs/config/behaviors.md
Normal file
91
docs/docs/config/behaviors.md
Normal file
|
@ -0,0 +1,91 @@
|
|||
---
|
||||
title: Behavior Configuration
|
||||
sidebar_label: Behaviors
|
||||
---
|
||||
|
||||
Some behaviors have properties to adjust how they behave. These can also be used as templates to create custom behaviors when none of the built-in behaviors do what you want.
|
||||
|
||||
See [Configuration Overview](/docs/config/index) for instructions on how to change these settings.
|
||||
|
||||
See the [zmk/app/dts/behaviors/](https://github.com/zmkfirmware/zmk/tree/main/app/dts/behaviors) folder for all default behaviors.
|
||||
|
||||
## Hold-Tap
|
||||
|
||||
Creates a custom behavior that triggers one behavior when a key is held or a different one when the key is tapped.
|
||||
|
||||
See the [hold-tap behavior documentation](/docs/behaviors/hold-tap) for more details and examples.
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,behavior-hold-tap"`
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| ----------------- | ------------- | ------------------------------------------------------------------------------ | ------------------ |
|
||||
| `label` | string | Unique label for the node | |
|
||||
| `#binding-cells` | int | Must be `<2>` | |
|
||||
| `bindings` | phandle array | A list of two behaviors: one for hold and one for tap | |
|
||||
| `tapping-term-ms` | int | How long in milliseconds the key must be held to trigger a hold | |
|
||||
| `quick-tap-ms` | int | Tap twice within this period in milliseconds to trigger a tap, even when held | -1 |
|
||||
| `flavor` | string | Adjusts how the behavior chooses between hold and tap | `"hold-preferred"` |
|
||||
| `retro-tap` | bool | Triggers the tap behavior on release if no other key was pressed during a hold | false |
|
||||
|
||||
The `flavor` property may be one of:
|
||||
|
||||
- `"hold-preferred"`
|
||||
- `"balanced"`
|
||||
- `"tap-preferred"`
|
||||
|
||||
See the [hold-tap behavior documentation](/docs/behaviors/hold-tap) for an explanation of each flavor.
|
||||
|
||||
| Node | Behavior |
|
||||
| ----- | --------------------------------------------- |
|
||||
| `<` | [Layer-tap](/docs/behaviors/layers#layer-tap) |
|
||||
| `&mt` | [Mod-tap](/docs/behaviors/mod-tap) |
|
||||
|
||||
## Mod-Morph
|
||||
|
||||
Creates a custom behavior that triggers one behavior when a key is pressed without certain modifiers held or a different one if certain modifiers are held.
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,behavior-mod-morph"`
|
||||
|
||||
| Property | Type | Description |
|
||||
| ---------------- | ------------- | ----------------------------------------------------------------------------------- |
|
||||
| `label` | string | Unique label for the node |
|
||||
| `#binding-cells` | int | Must be `<0>` |
|
||||
| `bindings` | phandle array | A list of two behaviors: one for normal press and one for mod morphed press |
|
||||
| `mods` | int | A bit field of modifiers which will switch to the morph behavior if any are pressed |
|
||||
|
||||
See [dt-bindings/zmk/modifiers.h](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/modifiers.h) for a list of modifiers.
|
||||
|
||||
You can use the following nodes to tweak the default behaviors:
|
||||
|
||||
| Node | Behavior |
|
||||
| -------- | ------------ |
|
||||
| `&gresc` | Grave escape |
|
||||
|
||||
## Sticky Key
|
||||
|
||||
Creates a custom behavior that triggers a behavior and keeps it pressed it until another key is pressed and released.
|
||||
|
||||
See the [sticky key behavior](/docs/behaviors/sticky-key) and [sticky layer behavior](/docs/behaviors/sticky-layer) documentation for more details and examples.
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,behavior-sticky-key"`
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| ------------------ | ------------- | ------------------------------------------------------------------------ | ------- |
|
||||
| `label` | string | Unique label for the node | |
|
||||
| `#binding-cells` | int | Must match the number of parameters the `bindings` behavior uses | |
|
||||
| `bindings` | phandle array | A behavior (without parameters) to trigger | |
|
||||
| `release-after-ms` | int | Releases the key after this many milliseconds if no other key is pressed | 1000 |
|
||||
| `quick-release` | bool | Release the sticky key on the next key press instead of release | false |
|
||||
|
||||
You can use the following nodes to tweak the default behaviors:
|
||||
|
||||
| Node | Behavior |
|
||||
| ----- | -------------------------------------------- |
|
||||
| `&sk` | [Sticky key](/docs/behaviors/sticky-key) |
|
||||
| `&sl` | [Sticky layer](/docs/behaviors/sticky-layer) |
|
42
docs/docs/config/combos.md
Normal file
42
docs/docs/config/combos.md
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
title: Combo Configuration
|
||||
sidebar_label: Combos
|
||||
---
|
||||
|
||||
See the [Combos feature page](/docs/features/combos) for more details and examples.
|
||||
|
||||
See [Configuration Overview](/docs/config/index) for instructions on how to change these settings.
|
||||
|
||||
## Kconfig
|
||||
|
||||
Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ------------------------------------- | ---- | -------------------------------------------------------------- | ------- |
|
||||
| `CONFIG_ZMK_COMBO_MAX_PRESSED_COMBOS` | int | Maximum number of combos that can be active at the same time | 4 |
|
||||
| `CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY` | int | Maximum number of active combos that use the same key position | 5 |
|
||||
| `CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO` | int | Maximum number of keys to press to activate a combo | 4 |
|
||||
|
||||
If `CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY` is 5, you can have 5 separate combos that use position `0`, 5 combos that use position `1`, and so on.
|
||||
|
||||
If you want a combo that triggers when pressing 5 keys, you must set `CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO` to 5.
|
||||
|
||||
## Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,combo"`
|
||||
|
||||
Definition file: [zmk/app/dts/bindings/zmk,combos.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/zmk%2Ccombos.yaml)
|
||||
|
||||
The `zmk,combos` node itself has no properties. It should have one child node per combo.
|
||||
|
||||
Each child node can have the following properties:
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| --------------- | ------------- | ---------------------------------------------------------------------------------- | ------- |
|
||||
| `bindings` | phandle-array | A [behavior](/docs/features/keymaps#behaviors) to run when the combo is triggered | |
|
||||
| `key-positions` | array | A list of key position indices for the keys which should trigger the combo | |
|
||||
| `timeout-ms` | int | All the keys must be pressed within this time in milliseconds to trigger the combo | 50 |
|
||||
| `slow-release` | bool | Releases the combo when all keys are released instead of when any key is released | false |
|
||||
| `layers` | array | A list of layers on which the combo may be triggered. `-1` allows all layers. | `<-1>` |
|
||||
|
||||
The `key-positions` array must not be longer than the `CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO` setting, which defaults to 4. If you want a combo that triggers when pressing 5 keys, then you must change the setting to 5.
|
43
docs/docs/config/displays.md
Normal file
43
docs/docs/config/displays.md
Normal file
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
title: Display Configuration
|
||||
sidebar_label: Displays
|
||||
---
|
||||
|
||||
See the [displays feature page](/docs/features/displays) for more details.
|
||||
|
||||
See [Configuration Overview](/docs/config/index) for instructions on how to change these settings.
|
||||
|
||||
## Kconfig
|
||||
|
||||
Definition files:
|
||||
|
||||
- [zmk/app/src/display/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/src/display/Kconfig)
|
||||
- [zmk/app/src/display/widgets/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/src/display/widgets/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ---------------------------------- | ---- | ---------------------------------------------------- | ------- |
|
||||
| `CONFIG_ZMK_DISPLAY` | bool | Enable support for displays | n |
|
||||
| `CONFIG_ZMK_WIDGET_LAYER_STATUS` | bool | Enable a widget to show the highest, active layer | y |
|
||||
| `CONFIG_ZMK_WIDGET_BATTERY_STATUS` | bool | Enable a widget to show battery charge information | y |
|
||||
| `CONFIG_ZMK_WIDGET_OUTPUT_STATUS` | bool | Enable a widget to show the current output (USB/BLE) | y |
|
||||
| `CONFIG_ZMK_WIDGET_WPM_STATUS` | bool | Enable a widget to show words per minute | n |
|
||||
|
||||
If `CONFIG_ZMK_DISPLAY` is enabled, exactly one of the following options must be set to `y`:
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ------------------------------------------- | ---- | ------------------------------ | ------- |
|
||||
| `CONFIG_ZMK_DISPLAY_STATUS_SCREEN_BUILT_IN` | bool | Use the built-in status screen | y |
|
||||
| `CONFIG_ZMK_DISPLAY_STATUS_SCREEN_CUSTOM` | bool | Use a custom status screen | n |
|
||||
|
||||
You must also configure the Zephyr driver for your display. Here are the Kconfig options for common displays.
|
||||
|
||||
- [SSD1306](https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_SSD1306.html)
|
||||
|
||||
## Devicetree
|
||||
|
||||
See the Zephyr Devicetree bindings for your display. Here are the bindings for common displays:
|
||||
|
||||
- [SSD1306 (i2c)](https://docs.zephyrproject.org/latest/reference/devicetree/bindings/solomon,ssd1306fb-i2c.html)
|
||||
- [SSD1306 (spi)](https://docs.zephyrproject.org/latest/reference/devicetree/bindings/solomon,ssd1306fb-spi.html)
|
||||
|
||||
A full list of supported drivers can be found in [Zephyr's Devicetree bindings index](https://docs.zephyrproject.org/latest/reference/devicetree/bindings.html).
|
41
docs/docs/config/encoders.md
Normal file
41
docs/docs/config/encoders.md
Normal file
|
@ -0,0 +1,41 @@
|
|||
---
|
||||
title: Encoder Configuration
|
||||
sidebar_label: Encoders
|
||||
---
|
||||
|
||||
See the [Encoders feature page](/docs/features/encoders) for more details, including instructions for adding encoder support to a board.
|
||||
|
||||
See [Configuration Overview](/docs/config/index) for instructions on how to change these settings.
|
||||
|
||||
## EC11 Encoders
|
||||
|
||||
### Kconfig
|
||||
|
||||
Definition file: [zmk/app/drivers/sensor/ec11/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/sensor/ec11/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ------------------------------- | ---- | -------------------------------- | ------- |
|
||||
| `CONFIG_EC11` | bool | Enable EC11 encoders | n |
|
||||
| `CONFIG_EC11_THREAD_PRIORITY` | int | Priority of the encoder thread | 10 |
|
||||
| `CONFIG_EC11_THREAD_STACK_SIZE` | int | Stack size of the encoder thread | 1024 |
|
||||
|
||||
If `CONFIG_EC11` is enabled, exactly one of the following options must be set to `y`:
|
||||
|
||||
| Config | Type | Description |
|
||||
| ----------------------------------- | ---- | ----------------------------------------------- |
|
||||
| `CONFIG_EC11_TRIGGER_NONE` | bool | No trigger (encoders are disabled) |
|
||||
| `CONFIG_EC11_TRIGGER_GLOBAL_THREAD` | bool | Process encoder interrupts on the global thread |
|
||||
| `CONFIG_EC11_TRIGGER_OWN_THREAD` | bool | Process encoder interrupts on their own thread |
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "alps,ec11"`
|
||||
|
||||
Definition file: [zmk/app/drivers/zephyr/dts/bindings/sensor/alps,ec11.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/zephyr/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 |
|
237
docs/docs/config/index.md
Normal file
237
docs/docs/config/index.md
Normal file
|
@ -0,0 +1,237 @@
|
|||
---
|
||||
title: Configuration Overview
|
||||
sidebar_label: Overview
|
||||
---
|
||||
|
||||
ZMK has several configuration settings that can be changed to change the behavior of your keyboard. They are set in either Kconfig or Devicetree files.
|
||||
|
||||
This page describes the Kconfig and Devicetree file formats and how to change settings in them. See the other pages in the configuration section for a list of settings you can change.
|
||||
|
||||
:::note
|
||||
All configuration is currently set at compile time. After changing any settings, you must build new firmware and flash it for the changes to apply.
|
||||
:::
|
||||
|
||||
## Config File Locations
|
||||
|
||||
ZMK will search multiple folders for the config files described below. There are three primary locations it will search:
|
||||
|
||||
### User Config Folder
|
||||
|
||||
When building with a `zmk-config` folder, ZMK will search the `zmk-config/config` folder for the following config files, where `<name>` is the name of the shield if using a shield, or the name of the board otherwise:
|
||||
|
||||
- `<name>.conf` (Kconfig)
|
||||
- `<name>.keymap` (Devicetree)
|
||||
|
||||
These files hold your personal settings for the keyboard. They override any configuration set in the board or shield folders.
|
||||
|
||||
When using a split keyboard, you can use a single file without the `_left` or `_right` suffix to configure both sides. For example, `corne.conf` and `corne.keymap` will apply to both `corne_left` and `corne_right`.
|
||||
|
||||
### Board Folder
|
||||
|
||||
ZMK will search for config files in either of:
|
||||
|
||||
- [`zmk/app/boards/arm/<board>`](https://github.com/zmkfirmware/zmk/tree/main/app/boards/arm)
|
||||
- `zmk-config/config/boards/arm/<board>`
|
||||
|
||||
...where `<board>` is the name of the board. These files describe the hardware of the board.
|
||||
|
||||
ZMK will search the board folder for the following config files:
|
||||
|
||||
- `<board>_defconfig` (Kconfig)
|
||||
- `<board>.dts` (Devicetree)
|
||||
- `<board>.keymap` (Devictree, standalone boards only)
|
||||
|
||||
For more documentation on creating and configuring a new board, see [Zephyr's board porting guide](https://docs.zephyrproject.org/latest/guides/porting/board_porting.html#write-kconfig-files).
|
||||
|
||||
### Shield Folder
|
||||
|
||||
When building with a shield, ZMK will search for config files in either of:
|
||||
|
||||
- [`zmk/app/boards/shields/<shield>`](https://github.com/zmkfirmware/zmk/tree/main/app/boards/shields)
|
||||
- `zmk-config/config/boards/shields/<shield>`
|
||||
|
||||
...where `<shield>` is the name of the shield. These files describe the hardware of the shield that the board is plugged into.
|
||||
|
||||
ZMK will search the shield folder for the following config files:
|
||||
|
||||
- `<shield>.conf` (Kconfig)
|
||||
- `<shield>.overlay` (Devicetree)
|
||||
- `<shield>.keymap` (Devicetree)
|
||||
|
||||
For more documentation on creating and configuring a new shield, see [Zephyr's shield documentation](https://docs.zephyrproject.org/latest/guides/porting/shields.html) and [ZMK's new keyboard shield](/docs/development/new-shield) guide.
|
||||
|
||||
## Kconfig Files
|
||||
|
||||
Kconfig is used to configure global settings such as the keyboard name and enabling certain hardware devices. These typically have a `.conf` file extension and are text files containing `CONFIG_XYZ=value` assignments, with one setting per line.
|
||||
|
||||
Kconfig files look like this:
|
||||
|
||||
```
|
||||
CONFIG_ZMK_SLEEP=y
|
||||
CONFIG_EC11=y
|
||||
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
|
||||
```
|
||||
|
||||
The list of available settings is determined by various files in ZMK whose names start with `Kconfig`.
|
||||
|
||||
See [Zephyr's Kconfig documentation](https://docs.zephyrproject.org/latest/guides/kconfig/index.html) for more details on Kconfig files.
|
||||
|
||||
### KConfig Value Types
|
||||
|
||||
#### bool
|
||||
|
||||
Either `y` for yes or `n` for no.
|
||||
|
||||
Example: `CONFIG_FOO=y`
|
||||
|
||||
#### int
|
||||
|
||||
An integer.
|
||||
|
||||
Example: `CONFIG_FOO=42`
|
||||
|
||||
#### string
|
||||
|
||||
Text surrounded by double quotes.
|
||||
|
||||
Example: `CONFIG_FOO="foo"`
|
||||
|
||||
## Devicetree Files
|
||||
|
||||
Various Devicetree files are combined to build a tree that describes the hardware for a keyboard. They are also used to define keymaps. Common file extensions for Devicetree files are `.dts`, `.dtsi`, `.overlay`, and `.keymap`.
|
||||
|
||||
Devicetree files look like this:
|
||||
|
||||
```devicetree
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
};
|
||||
|
||||
kscan0: kscan {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
label = "KSCAN";
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
Devicetree properties apply to specific nodes in the tree instead of globally. The properties that can be set for each node are determined by `.yaml` files in ZMK in the various `dts/bindings` folders.
|
||||
|
||||
See [Zephyr's Devicetree guide](https://docs.zephyrproject.org/latest/guides/dts/index.html) for more details on Devicetree files.
|
||||
|
||||
### Changing Devicetree Properties
|
||||
|
||||
Since Devicetree properties are set for specific nodes in the tree, you will first need to find the node you want to configure. You will typically need to
|
||||
search through the `.dts` file for you board, `.overlay` file for your shield, or a `.dtsi` file included in by of those files using an `#include` statement.
|
||||
|
||||
A Devicetree node looks like this:
|
||||
|
||||
```devicetree
|
||||
kscan0: kscan {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
// more properties and/or nodes...
|
||||
};
|
||||
```
|
||||
|
||||
The part before the colon, `kscan0`, is a label. This is optional, and it provides a shortcut to allow changing the properties of the node. The part after the colon, `kscan`, is the node's name. The values inside the curly braces are the node's properties.
|
||||
|
||||
The `compatible` property indicates what type of node it is. Search this documentation for the text inside the quotes to see which properties the node
|
||||
supports. You can also search ZMK for a file whose name is the value of the `compatible` property with a `.yaml` file extension.
|
||||
|
||||
To set a property, see below for examples for common property types, or see [Zephyr's Devicetree documentation](https://docs.zephyrproject.org/latest/guides/dts/intro.html#writing-property-values) for more details on the syntax for properties.
|
||||
|
||||
To change a property for an existing node, first find the node you want to change and find its label. Next, outside of any other node, write an ampersand (`&`)
|
||||
followed by the node's label, an opening curly brace (`{`), one or more new property values, a closing curly brace (`}`), and a semicolon (`;`).
|
||||
|
||||
For example, to adjust the debouncing of the `zmk,kscan-gpio-matrix` node shown above, you could add this to your keymap:
|
||||
|
||||
```devicetree
|
||||
&kscan0 {
|
||||
debounce-period = <7>;
|
||||
};
|
||||
```
|
||||
|
||||
### Devicetree Property Types
|
||||
|
||||
These are some of the property types you will see most often when working with ZMK. [Zephyr's Devicetree bindings documentation](https://docs.zephyrproject.org/latest/guides/dts/bindings.html) provides more detailed information and a full list of types.
|
||||
|
||||
#### bool
|
||||
|
||||
True or false. To set the property to true, list it with no value. To set it to false, do not list it.
|
||||
|
||||
Example: `property;`
|
||||
|
||||
If a property has already been set to true and you need to override it to false, use the following command to delete the existing property:
|
||||
|
||||
```devicetree
|
||||
/delete-property/ the-property-name;
|
||||
```
|
||||
|
||||
#### int
|
||||
|
||||
A single integer surrounded by angle brackets. Also supports mathematical expressions.
|
||||
|
||||
Example: `property = <42>;`
|
||||
|
||||
#### string
|
||||
|
||||
Text surrounded by double quotes.
|
||||
|
||||
Example: `property = "foo";`
|
||||
|
||||
#### array
|
||||
|
||||
A list of integers surrounded by angle brackets and separated with spaces. Mathematical expressions can be used but must be surrounded by parenthesis.
|
||||
|
||||
Example: `property = <1 2 3 4>;`
|
||||
|
||||
Values can also be split into multiple blocks, e.g. `property = <1 2>, <3 4>;`
|
||||
|
||||
#### phandle
|
||||
|
||||
A single node reference surrounded by angle brackets.
|
||||
|
||||
Example: `property = <&label>`
|
||||
|
||||
#### phandles
|
||||
|
||||
A list of node references surrounded by angle brackets.
|
||||
|
||||
Example: `property = <&label1 &label2 &label3>`
|
||||
|
||||
#### phandle array
|
||||
|
||||
A list of node references and possibly numbers to associate with the node. Mathematical expressions can be used but must be surrounded by parenthesis.
|
||||
|
||||
Example: `property = <&none &mo 1>;`
|
||||
|
||||
Values can also be split into multiple blocks, e.g. `property = <&none>, <&mo 1>;`
|
||||
|
||||
See the documentation for "phandle-array" in [Zephyr's Devicetree bindings documentation](https://docs.zephyrproject.org/latest/guides/dts/bindings.html)
|
||||
for more details on how parameters are associated with nodes.
|
||||
|
||||
#### GPIO array
|
||||
|
||||
This is just a phandle array. The documentation lists this as a different type to make it clear which properties expect an array of GPIOs.
|
||||
|
||||
Each item in the array should be a label for a GPIO node (the names of which differ between hardware platforms) followed by an index and configuration flags. See [Zephyr's GPIO documentation](https://docs.zephyrproject.org/latest/reference/peripherals/gpio.html) for a full list of flags.
|
||||
|
||||
Example:
|
||||
|
||||
```devicetree
|
||||
some-gpios =
|
||||
<&gpio0 0 GPIO_ACTIVE_HIGH>,
|
||||
<&gpio0 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
;
|
||||
```
|
||||
|
||||
#### path
|
||||
|
||||
A path to a node, either as a node reference or as a string.
|
||||
|
||||
Examples:
|
||||
|
||||
```
|
||||
property = &label;
|
||||
property = "/path/to/some/node";
|
||||
```
|
42
docs/docs/config/keymap.md
Normal file
42
docs/docs/config/keymap.md
Normal file
|
@ -0,0 +1,42 @@
|
|||
---
|
||||
title: Keymap Configuration
|
||||
sidebar_label: Keymap
|
||||
---
|
||||
|
||||
See [Configuration Overview](/docs/config/index) for instructions on how to change these settings.
|
||||
|
||||
## Keymap
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,keymap"`
|
||||
|
||||
Definition file: [zmk/app/dts/bindings/zmk,keymap.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/zmk%2Ckeymap.yaml)
|
||||
|
||||
The `zmk,keymap` node itself has no properties. It should have one child node per layer of the keymap, starting with the default layer (layer 0).
|
||||
|
||||
Each child node can have the following properties:
|
||||
|
||||
| Property | Type | Description |
|
||||
| ----------------- | ------------- | ---------------------------------------------------------------------- |
|
||||
| `label` | string | Unique label for the node |
|
||||
| `bindings` | phandle-array | List of [key behaviors](/docs/features/keymaps#behaviors), one per key |
|
||||
| `sensor-bindings` | phandle-array | List of sensor behaviors, one per sensor |
|
||||
|
||||
Items for `bindings` must be listed in the order the keys are defined in the [keyboard scan configuration](/docs/config/kscan).
|
||||
|
||||
Items for `sensor-bindings` must be listed in the order the [sensors](#keymap-sensors) are defined.
|
||||
|
||||
## Keymap Sensors
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,keymap-sensors"`
|
||||
|
||||
| Property | Type | Description |
|
||||
| --------- | -------- | -------------------- |
|
||||
| `sensors` | phandles | List of sensor nodes |
|
||||
|
||||
The following types of nodes can be used as a sensor:
|
||||
|
||||
- [`alps,ec11`](/docs/config/encoders#ec11-encoders)
|
319
docs/docs/config/kscan.md
Normal file
319
docs/docs/config/kscan.md
Normal file
|
@ -0,0 +1,319 @@
|
|||
---
|
||||
title: Keyboard Scan Configuration
|
||||
sidebar_label: Keyboard Scan
|
||||
---
|
||||
|
||||
See [Configuration Overview](/docs/config/index) for instructions on how to change these settings.
|
||||
|
||||
## Common
|
||||
|
||||
### Kconfig
|
||||
|
||||
Definition files:
|
||||
|
||||
- [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig)
|
||||
- [zmk/app/drivers/kscan/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/kscan/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ----------------------------------- | ---- | ------------------------------------------------------ | ------- |
|
||||
| `CONFIG_ZMK_KSCAN_GPIO_DRIVER` | bool | Enable GPIO keyboard scan driver to detect key presses | y |
|
||||
| `CONFIG_ZMK_KSCAN_EVENT_QUEUE_SIZE` | int | Size of the event queue for kscan events | 4 |
|
||||
| `CONFIG_ZMK_KSCAN_INIT_PRIORITY` | int | Keyboard scan device driver initialization priority | 40 |
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: [`/chosen` node](https://docs.zephyrproject.org/latest/guides/dts/intro.html#aliases-and-chosen-nodes)
|
||||
|
||||
| Property | Type | Description |
|
||||
| ---------------------- | ---- | ------------------------------------------------------------- |
|
||||
| `zmk,kscan` | path | The node for the keyboard scan driver to use |
|
||||
| `zmk,matrix_transform` | path | The node for the [matrix transform](#matrix-transform) to use |
|
||||
|
||||
## Demux Driver
|
||||
|
||||
Keyboard scan driver which works like a regular matrix but uses a demultiplexer to drive the rows or columns. This allows N GPIOs to drive N<sup>2</sup> rows or columns instead of just N like with a regular matrix.
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,kscan-gpio-demux"`
|
||||
|
||||
Definition file: [zmk/app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-demux.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/zephyr/dts/bindings/kscan/zmk%2Ckscan-gpio-demux.yaml)
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| ----------------------- | ---------- | -------------------------------- | ------- |
|
||||
| `label` | string | Unique label for the node | |
|
||||
| `input-gpios` | GPIO array | Input GPIOs | |
|
||||
| `output-gpios` | GPIO array | Demultiplexer address GPIOs | |
|
||||
| `debounce-period` | int | Debounce period in milliseconds | 5 |
|
||||
| `polling-interval-msec` | int | Polling interval in milliseconds | 25 |
|
||||
|
||||
## Direct GPIO Driver
|
||||
|
||||
Keyboard scan driver where each key has a dedicated GPIO.
|
||||
|
||||
### Kconfig
|
||||
|
||||
Definition file: [zmk/app/drivers/kscan/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/kscan/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| --------------------------------- | ---- | ------------------------------------------------ | ------- |
|
||||
| `CONFIG_ZMK_KSCAN_DIRECT_POLLING` | bool | Poll for key presses instead of using interrupts | n |
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,kscan-gpio-direct"`
|
||||
|
||||
Definition file: [zmk/app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-direct.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/zephyr/dts/bindings/kscan/zmk%2Ckscan-gpio-direct.yaml)
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| ----------------- | ---------- | ------------------------------- | ------- |
|
||||
| `label` | string | Unique label for the node | |
|
||||
| `input-gpios` | GPIO array | Input GPIOs (one per key) | |
|
||||
| `debounce-period` | int | Debounce period in milliseconds | 5 |
|
||||
|
||||
## Matrix Driver
|
||||
|
||||
Keyboard scan driver where keys are arranged on a matrix with one GPIO per row and column.
|
||||
|
||||
Definition file: [zmk/app/drivers/kscan/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/kscan/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| --------------------------------- | ---- | ------------------------------------------------ | ------- |
|
||||
| `CONFIG_ZMK_KSCAN_MATRIX_POLLING` | bool | Poll for key presses instead of using interrupts | n |
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,kscan-gpio-matrix"`
|
||||
|
||||
Definition file: [zmk/app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-matrix.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/zephyr/dts/bindings/kscan/zmk%2Ckscan-gpio-matrix.yaml)
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| ----------------- | ---------- | ------------------------------------------------------------ | ----------- |
|
||||
| `label` | string | Unique label for the node | |
|
||||
| `row-gpios` | GPIO array | Matrix row GPIOs in order, starting from the top row | |
|
||||
| `col-gpios` | GPIO array | Matrix column GPIOs in order, starting from the leftmost row | |
|
||||
| `debounce-period` | int | Debounce period in milliseconds | 5 |
|
||||
| `diode-direction` | string | The direction of the matrix diodes | `"row2col"` |
|
||||
|
||||
The `diode-direction` property must be one of:
|
||||
|
||||
| Value | Description |
|
||||
| ----------- | --------------------------------------------------------------------- |
|
||||
| `"row2col"` | Diodes point from rows to columns (cathodes are connected to columns) |
|
||||
| `"col2row"` | Diodes point from columns to rows (cathodes are connected to rows) |
|
||||
|
||||
## Composite Driver
|
||||
|
||||
Keyboard scan driver which combines multiple other keyboard scan drivers.
|
||||
|
||||
### Kconfig
|
||||
|
||||
Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ----------------------------------- | ---- | ----------------------------- | ------- |
|
||||
| `CONFIG_ZMK_KSCAN_COMPOSITE_DRIVER` | bool | Enable composite kscan driver | n |
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to : `compatible = "zmk,kscan-composite"`
|
||||
|
||||
Definition file: [zmk/app/dts/bindings/zmk,kscan-composite.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/zmk,kscan-composite.yaml)
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| -------- | ------ | --------------------------------------------- | ------- |
|
||||
| `label` | string | Unique label for the node | |
|
||||
| `rows` | int | The number rows of in the composite matrix | |
|
||||
| `cols` | int | The number columns of in the composite matrix | |
|
||||
|
||||
The `zmk,kscan-composite` node should have one child node per keyboard scan driver that should be composited. Each child node can have the following properties:
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| --------------- | ------- | ------------------------------------------------------------------------------ | ------- |
|
||||
| `label` | string | Unique label for the node | |
|
||||
| `kscan` | phandle | Label of the kscan driver to include | |
|
||||
| `row-offset` | int | Shifts row 0 of the included driver to a new row in the composite matrix | 0 |
|
||||
| `column-offset` | int | Shifts column 0 of the included driver to a new column in the composite matrix | 0 |
|
||||
|
||||
### Example Configuration
|
||||
|
||||
For example, consider a macropad with a 3x3 matrix and two direct GPIO keys:
|
||||
|
||||
<div style={{columns: 2, marginBottom: '1em'}}>
|
||||
<div style={{breakInside: 'avoid'}}>
|
||||
Matrix:
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th></th><th>Col 0</th><th>Col 1</th><th>Col 2</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><th>Row 0</th><td>A0</td><td>A1</td><td>A2</td></tr>
|
||||
<tr><th>Row 1</th><td>A3</td><td>A4</td><td>A5</td></tr>
|
||||
<tr><th>Row 2</th><td>A6</td><td>A7</td><td>A8</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div style={{breakInside: 'avoid'}}>
|
||||
Direct GPIO:
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th></th><th>Col 0</th><th>Col 1</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><th>Row 0</th><td>B0</td><td>B1</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
To combine them, we need to create a composite matrix with enough rows and columns to fit both sets of keys without overlapping, then set row and/or columns offsets to shift them so they do not overlap.
|
||||
|
||||
One possible way to do this is a 3x4 matrix where the direct GPIO keys are shifted to below the matrix keys...
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th></th><th>Col 0</th><th>Col 1</th><th>Col 2</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr><th>Row 0</th><td>A0</td><td>A1</td><td>A2</td></tr>
|
||||
<tr><th>Row 1</th><td>A3</td><td>A4</td><td>A5</td></tr>
|
||||
<tr><th>Row 2</th><td>A6</td><td>A7</td><td>A8</td></tr>
|
||||
<tr><th>Row 3</th><td>B0</td><td>B1</td><td>(none)</td></tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
...which can be configured with the following Devicetree code:
|
||||
|
||||
```devicetree
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
};
|
||||
|
||||
kscan0: kscan_composite {
|
||||
compatible = "zmk,kscan-composite";
|
||||
label = "KSCAN0";
|
||||
rows = <3>;
|
||||
columns = <4>;
|
||||
|
||||
// Include the matrix driver
|
||||
matrix {
|
||||
kscan = <&kscan1>;
|
||||
};
|
||||
|
||||
// Include the direct GPIO driver...
|
||||
direct {
|
||||
kscan = <&kscan2>;
|
||||
row-offset = <3>; // ..and shift it to not overlap
|
||||
};
|
||||
};
|
||||
|
||||
kscan1: kscan_matrix {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
// define 3x3 matrix here...
|
||||
};
|
||||
|
||||
kscan2: kscan_direct {
|
||||
compatible = "zmk,kscan-gpio-direct";
|
||||
// define 2 direct GPIOs here...
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Mock Driver
|
||||
|
||||
Mock keyboard scan driver that simulates key events.
|
||||
|
||||
### Kconfig
|
||||
|
||||
Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ------------------------------ | ---- | ------------------------ | ------- |
|
||||
| `CONFIG_ZMK_KSCAN_MOCK_DRIVER` | bool | Enable mock kscan driver | n |
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,kscan-mock"`
|
||||
|
||||
Definition file: [zmk/app/dts/bindings/zmk,kscan-mock.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/zmk%2Ckscan-mock.yaml)
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| -------------- | ------ | --------------------------------------------- | ------- |
|
||||
| `label` | string | Unique label for the node | |
|
||||
| `event-period` | int | Milliseconds between each generated event | |
|
||||
| `events` | array | List of key events to simulate | |
|
||||
| `rows` | int | The number rows of in the composite matrix | |
|
||||
| `cols` | int | The number columns of in the composite matrix | |
|
||||
| `exit-after` | bool | Exit the program after running all events | false |
|
||||
|
||||
The `events` array should be defined using the macros from [dt-bindings/zmk/kscan_mock.h](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/kscan_mock.h).
|
||||
|
||||
## Matrix Transform
|
||||
|
||||
Defines a mapping from keymap logical positions to physical matrix positions.
|
||||
|
||||
Transforms should be used any time the physical layout of a keyboard's keys does not match the layout of its electrical matrix and/or when not all positions in the matrix are used. This applies to most non-ortholinear boards.
|
||||
|
||||
Transforms can also be used for keyboards with multiple layouts. You can define multiple matrix transform nodes, one for each layout, and users can select which one they want from the `/chosen` node in their keymaps.
|
||||
|
||||
See the [new shield guide](/docs/development/new-shield/#optional-matrix-transform) for more documentation on how to define a matrix transform.
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,matrix-transform"`
|
||||
|
||||
Definition file: [zmk/app/dts/bindings/zmk,matrix-transform.yaml](https://github.com/zmkfirmware/zmk/blob/main/app/dts/bindings/zmk%2Cmatrix-transform.yaml)
|
||||
|
||||
| Property | Type | Description | Default |
|
||||
| ------------ | ----- | --------------------------------------------------------------------- | ------- |
|
||||
| `rows` | int | Number of rows in the transformed matrix | |
|
||||
| `columns` | int | Number of columns in the transformed matrix | |
|
||||
| `row-offset` | int | Adds an offset to all rows before looking them up in the transform | 0 |
|
||||
| `col-offset` | int | Adds an offset to all columns before looking them up in the transform | 0 |
|
||||
| `map` | array | A list of position transforms | |
|
||||
|
||||
The `map` array should be defined using the `RC()` macro from [dt-bindings/zmk/matrix_transform.h](https://github.com/zmkfirmware/zmk/blob/main/app/include/dt-bindings/zmk/matrix_transform.h). It should have one item per logical position in the keymap. Each item should list the physical row and column that should trigger the key in that position.
|
||||
|
||||
### Example Configuration
|
||||
|
||||
Consider a keyboard with a [duplex matrix](https://wiki.ai03.com/books/pcb-design/page/matrices-and-duplex-matrix), where the matrix has twice as many rows and half as many columns as the keyboard has keys. A matrix transform can be used to correct for this so that keymaps can match the layout of the keys, not the layout of the matrix.
|
||||
|
||||
```devicetree
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
zmk,matrix_transform = &default_transform;
|
||||
};
|
||||
|
||||
kscan0: kscan {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
rows = <12>;
|
||||
columns = <8>;
|
||||
// define the matrix...
|
||||
};
|
||||
|
||||
default_transform: matrix_transform {
|
||||
compatible = "zmk,matrix-transform";
|
||||
rows = <6>;
|
||||
columns = <16>;
|
||||
// ESC F1 F2 F3 ...
|
||||
// ` 1 2 3 ...
|
||||
// Tab Q W E ...
|
||||
// Caps A S D ...
|
||||
// Shift Z X C ...
|
||||
// Ctrl Alt ...
|
||||
map = <
|
||||
RC(0,0) RC(1,0) RC(0,1) RC(1,1) // ...
|
||||
RC(2,0) RC(3,0) RC(2,1) RC(3,1) // ...
|
||||
RC(4,0) RC(5,0) RC(4,1) RC(5,1) // ...
|
||||
RC(6,0) RC(7,0) RC(6,1) RC(7,1) // ...
|
||||
RC(8,0) RC(8,1) RC(9,1) // ...
|
||||
RC(10,0) RC(11,0) // ...
|
||||
>;
|
||||
};
|
||||
};
|
||||
```
|
65
docs/docs/config/power.md
Normal file
65
docs/docs/config/power.md
Normal file
|
@ -0,0 +1,65 @@
|
|||
---
|
||||
title: Power Management Configuration
|
||||
sidebar_label: Power Management
|
||||
---
|
||||
|
||||
See [Configuration Overview](/docs/config/index) for instructions on how to
|
||||
change these settings.
|
||||
|
||||
## Idle/Sleep
|
||||
|
||||
Configuration for entering low power modes when the keyboard is idle.
|
||||
|
||||
In the idle state, peripherals such as displays and lighting are disabled, but the keyboard remains connected to Bluetooth so it can immediately respond when you press a key.
|
||||
|
||||
In the deep sleep state, the keyboard additionally disconnects from Bluetooth. This state uses very little power, but it may take a few seconds to reconnect after waking.
|
||||
|
||||
### Kconfig
|
||||
|
||||
Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ------------------------------- | ---- | ----------------------------------------------------- | ------- |
|
||||
| `CONFIG_ZMK_IDLE_TIMEOUT` | int | Milliseconds of inactivity before entering idle state | 30000 |
|
||||
| `CONFIG_ZMK_SLEEP` | bool | Enable deep sleep support | n |
|
||||
| `CONFIG_ZMK_IDLE_SLEEP_TIMEOUT` | int | Milliseconds of inactivity before entering deep sleep | 900000 |
|
||||
|
||||
## External Power Control
|
||||
|
||||
Driver for enabling or disabling power to peripherals such as displays and lighting. This driver must be configured to use [power management behaviors](/docs/behaviors/power).
|
||||
|
||||
### Kconfig
|
||||
|
||||
Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ---------------------- | ---- | ----------------------------------------------- | ------- |
|
||||
| `CONFIG_ZMK_EXT_POWER` | bool | Enable support to control external power output | y |
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,ext-power-generic"`
|
||||
|
||||
| Property | Type | Description |
|
||||
| --------------- | ---------- | ------------------------------------------------------------- |
|
||||
| `label` | string | Unique label for the node |
|
||||
| `control-gpios` | GPIO array | List of GPIOs which should be active to enable external power |
|
||||
| `init-delay-ms` | int | number of milliseconds to delay after initializing the driver |
|
||||
|
||||
## Battery Voltage Divider
|
||||
|
||||
Driver for reading the voltage of a battery using an ADC connected to a voltage divider.
|
||||
|
||||
### Kconfig
|
||||
|
||||
Definition file: [zmk/app/drivers/sensor/battery_voltage_divider/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/drivers/sensor/battery_voltage_divider/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ------------------------------------ | ---- | ------------------------------------------------------------ | ------- |
|
||||
| `CONFIG_ZMK_BATTERY_VOLTAGE_DIVIDER` | bool | Enable battery voltage divider driver for battery monitoring | n |
|
||||
|
||||
### Devicetree
|
||||
|
||||
Applies to: `compatible = "zmk,battery-voltage-divider"`
|
||||
|
||||
See [Zephyr's voltage divider documentation](https://docs.zephyrproject.org/latest/reference/devicetree/bindings/voltage-divider.html).
|
66
docs/docs/config/system.md
Normal file
66
docs/docs/config/system.md
Normal file
|
@ -0,0 +1,66 @@
|
|||
---
|
||||
title: System Configuration
|
||||
sidebar_label: System
|
||||
---
|
||||
|
||||
These are general settings that control how the keyboard behaves and which features it supports. Several of these settings come from Zephyr and are not specific to ZMK, but they are listed here because they are relevant to how a keyboard functions.
|
||||
|
||||
See [Configuration Overview](/docs/config/index) for instructions on how to change these settings.
|
||||
|
||||
## Kconfig
|
||||
|
||||
Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig)
|
||||
|
||||
### General
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ----------------------------------- | ------ | ----------------------------------------------------------------------------- | ------- |
|
||||
| `CONFIG_ZMK_KEYBOARD_NAME` | string | The name of the keyboard | |
|
||||
| `CONFIG_ZMK_SETTINGS_SAVE_DEBOUNCE` | int | Milliseconds to wait after a setting change before writing it to flash memory | 60000 |
|
||||
| `CONFIG_ZMK_WPM` | bool | Enable calculating words per minute | n |
|
||||
| `CONFIG_HEAP_MEM_POOL_SIZE` | int | Size of the heap memory pool | 8192 |
|
||||
|
||||
### USB
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| --------------------------------- | ------ | --------------------------------------- | --------------- |
|
||||
| `CONFIG_USB` | bool | Enable USB drivers | |
|
||||
| `CONFIG_USB_DEVICE_VID` | int | The vendor ID advertised to USB | `0x1D50` |
|
||||
| `CONFIG_USB_DEVICE_PID` | int | The product ID advertised to USB | `0x615E` |
|
||||
| `CONFIG_USB_DEVICE_MANUFACTURER` | string | The manufacturer name advertised to USB | `"ZMK Project"` |
|
||||
| `CONFIG_USB_HID_POLL_INTERVAL_MS` | int | USB polling interval in milliseconds | 9 |
|
||||
| `CONFIG_ZMK_USB` | bool | Enable ZMK as a USB keyboard | |
|
||||
| `CONFIG_ZMK_USB_INIT_PRIORITY` | int | USB init priority | 50 |
|
||||
|
||||
### Bluetooth
|
||||
|
||||
See [Zephyr's Bluetooth stack architecture documentation](https://docs.zephyrproject.org/latest/guides/bluetooth/bluetooth-arch.html)
|
||||
for more information on configuring Bluetooth.
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ----------------------------------------------------- | ---- | ---------------------------------------------------------------------- | ------- |
|
||||
| `CONFIG_BT` | bool | Enable Bluetooth support | |
|
||||
| `CONFIG_BT_MAX_CONN` | int | Maximum number of simultaneous Bluetooth connections | 5 |
|
||||
| `CONFIG_BT_MAX_PAIRED` | int | Maximum number of paired Bluetooth devices | 5 |
|
||||
| `CONFIG_ZMK_BLE` | bool | Enable ZMK as a Bluetooth keyboard | |
|
||||
| `CONFIG_ZMK_BLE_INIT_PRIORITY` | int | BLE init priority | 50 |
|
||||
| `CONFIG_ZMK_BLE_THREAD_STACK_SIZE` | int | Stack size of the BLE notify thread | 512 |
|
||||
| `CONFIG_ZMK_BLE_THREAD_PRIORITY` | int | Priority of the BLE notify thread | 5 |
|
||||
| `CONFIG_ZMK_BLE_KEYBOARD_REPORT_QUEUE_SIZE` | int | Max number of keyboard HID reports to queue for sending over BLE | 20 |
|
||||
| `CONFIG_ZMK_BLE_CONSUMER__REPORT_QUEUE_SIZE` | int | Max number of consumer HID reports to queue for sending over BLE | 5 |
|
||||
| `CONFIG_ZMK_BLE_CLEAR_BONDS_ON_START` | bool | Clears all bond information from the keyboard on startup | n |
|
||||
| `CONFIG_ZMK_BLE_PASSKEY_ENTRY` | bool | Experimental: require typing passkey from host to pair BLE connection | n |
|
||||
| `CONFIG_ZMK_SPLIT` | bool | Enable split keyboard support | n |
|
||||
| `CONFIG_ZMK_SPLIT_BLE` | bool | Use BLE to communicate between split keyboard halves | y |
|
||||
| `CONFIG_ZMK_SPLIT_BLE_ROLE_CENTRAL` | bool | `y` for central device, `n` for peripheral | |
|
||||
| `CONFIG_ZMK_SPLIT_BLE_CENTRAL_POSITION_QUEUE_SIZE` | int | Max number of key state events to queue when received from peripherals | 5 |
|
||||
| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_STACK_SIZE` | int | Stack size of the split peripheral BLE notify thread | 512 |
|
||||
| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_PRIORITY` | int | Priority of the split peripheral BLE notify thread | 5 |
|
||||
| `CONFIG_ZMK_SPLIT_BLE_PERIPHERAL_POSITION_QUEUE_SIZE` | int | Max number of key state events to queue to send to the central | 10 |
|
||||
|
||||
### Logging
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ------------------------ | ---- | ---------------------------------------- | ------- |
|
||||
| `CONFIG_ZMK_USB_LOGGING` | bool | Enable USB CDC ACM logging for debugging | n |
|
||||
| `CONFIG_ZMK_LOG_LEVEL` | int | Log level for ZMK debug messages | 4 |
|
43
docs/docs/config/underglow.md
Normal file
43
docs/docs/config/underglow.md
Normal file
|
@ -0,0 +1,43 @@
|
|||
---
|
||||
title: RGB Underglow Configuration
|
||||
sidebar_label: RGB Underglow
|
||||
---
|
||||
|
||||
See the [RGB Underglow feature page](/docs/features/underglow) for more details, including instructions for adding underglow support to a board.
|
||||
|
||||
See [Configuration Overview](/docs/config/index) for instructions on how to change these settings.
|
||||
|
||||
## Kconfig
|
||||
|
||||
RGB underglow depends on [Zephyr's LED strip driver](https://github.com/zephyrproject-rtos/zephyr/tree/master/drivers/led_strip), which provides additional Kconfig options.
|
||||
|
||||
Definition file: [zmk/app/Kconfig](https://github.com/zmkfirmware/zmk/blob/main/app/Kconfig)
|
||||
|
||||
| Config | Type | Description | Default |
|
||||
| ------------------------------------ | ---- | ----------------------------------------------------- | ------- |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW` | bool | Enable RGB underglow | n |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER` | bool | Underglow toggling also controls external power | y |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_HUE_STEP` | int | Hue step in degrees (0-359) used by RGB actions | 10 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_SAT_STEP` | int | Saturation step in percent used by RGB actions | 10 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_BRT_STEP` | int | Brightness step in percent used by RGB actions | 10 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_HUE_START` | int | Default hue in degrees (0-359) | 0 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_SAT_START` | int | Default saturation percent (0-100) | 100 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_BRT_START` | int | Default brightness in percent (0-100) | 100 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_SPD_START` | int | Default effect speed (1-5) | 3 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_EFF_START` | int | Default effect index from the effect list (see below) | 0 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_ON_START` | bool | Default on state | y |
|
||||
|
||||
Values for `CONFIG_ZMK_RGB_UNDERGLOW_EFF_START`:
|
||||
|
||||
| Value | Effect |
|
||||
| ----- | ----------- |
|
||||
| 0 | Solid color |
|
||||
| 1 | Breathe |
|
||||
| 2 | Spectrum |
|
||||
| 3 | Swirl |
|
||||
|
||||
## Devicetree
|
||||
|
||||
ZMK does not have any Devicetree properties of its own. See the Devicetree bindings for [Zephyr's LED strip driver](https://github.com/zephyrproject-rtos/zephyr/tree/master/dts/bindings/led_strip).
|
||||
|
||||
See the [RGB underglow feature page](/docs/features/underglow) for examples of the properties that must be set to enable underglow.
|
|
@ -9,10 +9,10 @@ with the main `zmk` firmware repository to build your desired firmware. The main
|
|||
working components of ZMK are kept separate from your personal keyboard settings, reducing the amount of file manipulation in the configuration process.
|
||||
This makes flashing ZMK to your keyboard much easier, especially because you don't need to keep an up-to-date copy of zmk on your computer at all times.
|
||||
|
||||
On default `zmk-config` folder should contain two files:
|
||||
By default, the `zmk-config` folder should contain two files:
|
||||
|
||||
- `<shield>.conf`
|
||||
- `<shield>`.keymap
|
||||
- `<shield>.keymap`
|
||||
|
||||
However, your config folder can also be modified to include a `boards/` directory for keymaps and configurations for multiple boards/shields
|
||||
outside of the default keyboard setting definitions.
|
||||
|
@ -23,6 +23,8 @@ The setup script creates a `config/<shield>.conf` file that allows you to add ad
|
|||
control what features and options are built into your firmware. Opening that file with your text editor will allow you to see the
|
||||
various config settings that can be commented/uncommented to modify how your firmware is built.
|
||||
|
||||
Refer to the [Configuration](/docs/config/index) documentation for more details on this file.
|
||||
|
||||
## Keymap
|
||||
|
||||
Once you have the basic user config completed, you can find the keymap file in `config/<shield>.keymap` and customize from there.
|
||||
|
|
|
@ -25,7 +25,7 @@ Combos configured in your `.keymap` file, but are separate from the `keymap` nod
|
|||
|
||||
- The name of the combo doesn't really matter, but convention is to start the node name with `combo_`.
|
||||
- The `compatible` property should always be `"zmk,combos"` for combos.
|
||||
- `timeout-ms` is the length of the window (in milliseconds) in which all keys of the combo must be pressed in order to successfully trigger the combo.
|
||||
- All the keys must be pressed within `timeout-ms` milliseconds to trigger the combo.
|
||||
- `key-positions` is an array of key positions. See the info section below about how to figure out the positions on your board.
|
||||
- `layers = <0 1...>` will allow limiting a combo to specific layers. This is an _optional_ parameter, when omitted it defaults to global scope.
|
||||
- `bindings` is the behavior that is activated when the behavior is pressed.
|
||||
|
@ -47,10 +47,4 @@ Key positions are numbered like the keys in your keymap, starting at 0. So, if t
|
|||
Invoking a source-specific behavior such as one of the [reset behaviors](behaviors/reset.md) using a combo will always trigger it on the central side of the keyboard, regardless of the side that the keys corresponding to `key-positions` are on.
|
||||
:::
|
||||
|
||||
### Advanced configuration
|
||||
|
||||
There are three global combo parameters which are set through KConfig. You can set them in the `<boardname>.conf` file in the same directory as your keymap file.
|
||||
|
||||
- `CONFIG_ZMK_COMBO_MAX_PRESSED_COMBOS` is the number of combos that can be active at the same time. Default 4.
|
||||
- `CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY` is the maximum number of combos that can be active on a key position. Defaults to 5. (So you can have 5 separate combos that use position `3` for example)
|
||||
- `CONFIG_ZMK_COMBO_MAX_KEYS_PER_COMBO` is the maximum number of keys that need to be pressed to activate a combo. Default 4. If you want a combo that triggers when pressing 5 keys, you'd set this to 5 for example.
|
||||
See [combo configuration](/docs/config/combos) for advanced configuration options.
|
||||
|
|
|
@ -25,7 +25,8 @@ Here you can see the RGB underglow feature in action using WS2812 LEDs.
|
|||
|
||||
## Enabling RGB Underglow
|
||||
|
||||
To enable RGB underglow on your board or shield, simply enable the `CONFIG_ZMK_RGB_UNDERGLOW` and `X_STRIP` configuration values in the `.conf` file of your user config directory as such:
|
||||
To enable RGB underglow on your board or shield, simply enable the `CONFIG_ZMK_RGB_UNDERGLOW` and `CONFIG_*_STRIP` configuration values in the `.conf` file for your board or shield.
|
||||
For example:
|
||||
|
||||
```
|
||||
CONFIG_ZMK_RGB_UNDERGLOW=y
|
||||
|
@ -33,24 +34,14 @@ CONFIG_ZMK_RGB_UNDERGLOW=y
|
|||
CONFIG_WS2812_STRIP=y
|
||||
```
|
||||
|
||||
See [Configuration Overview](/docs/config/index) for more instructions on how to
|
||||
use Kconfig.
|
||||
|
||||
If your board or shield does not have RGB underglow configured, refer to [Adding RGB Underglow to a Board](#adding-rgb-underglow-to-a-board).
|
||||
|
||||
## Configuring RGB Underglow
|
||||
|
||||
There are various Kconfig options used to configure the RGB underglow feature. These can all be set in the `.conf` file.
|
||||
|
||||
| Option | Description | Default |
|
||||
| ------------------------------------ | ----------------------------------------------- | ------- |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER` | Underglow toggling also controls external power | y |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_HUE_STEP` | Hue step in degrees of 360 used by RGB actions | 10 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_SAT_STEP` | Saturation step in percent used by RGB actions | 10 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_BRT_STEP` | Brightness step in percent used by RGB actions | 10 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_HUE_START` | Default hue 0-359 in degrees | 0 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_SAT_START` | Default saturation 0-100 in percent | 100 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_BRT_START` | Default brightness 0-100 in percent | 100 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_SPD_START` | Default effect speed 1-5 | 3 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_EFF_START` | Default effect integer from the effect enum | 0 |
|
||||
| `CONFIG_ZMK_RGB_UNDERGLOW_ON_START` | Default on state | y |
|
||||
See [RGB underglow configuration](/docs/config/underglow).
|
||||
|
||||
## Adding RGB Underglow to a Board
|
||||
|
||||
|
@ -154,7 +145,7 @@ Once you have your `led_strip` properly defined you need to add it to the root d
|
|||
};
|
||||
```
|
||||
|
||||
Finally you need to enable the `CONFIG_ZMK_RGB_UNDERGLOW` and `X_STRIP` configuration values in the `.conf` file of your board (or set a default in the `Kconfig.defconfig`):
|
||||
Finally you need to enable the `CONFIG_ZMK_RGB_UNDERGLOW` and `CONFIG*_STRIP` configuration values in the `.conf` file of your board (or set a default in the `Kconfig.defconfig`):
|
||||
|
||||
```
|
||||
CONFIG_ZMK_RGB_UNDERGLOW=y
|
||||
|
|
|
@ -52,6 +52,18 @@ module.exports = {
|
|||
"codes/power",
|
||||
"codes/keymap-upgrader",
|
||||
],
|
||||
Configuration: [
|
||||
"config/index",
|
||||
"config/behaviors",
|
||||
"config/combos",
|
||||
"config/displays",
|
||||
"config/encoders",
|
||||
"config/keymap",
|
||||
"config/kscan",
|
||||
"config/power",
|
||||
"config/system",
|
||||
"config/underglow",
|
||||
],
|
||||
Development: [
|
||||
"development/clean-room",
|
||||
"development/documentation",
|
||||
|
|
Loading…
Reference in a new issue