mirror of
https://github.com/zmkfirmware/zmk.git
synced 2026-03-31 10:25:19 -05:00
docs: Add syntax highlighting to more code blocks
Added language tags to more code blocks in the documentation to enable syntax highlighting.
This commit is contained in:
committed by
Cem Aksoylar
parent
4a339093ce
commit
65667b863a
@@ -71,7 +71,7 @@ Kconfig is used to configure global settings such as the keyboard name and enabl
|
||||
|
||||
Kconfig files look like this:
|
||||
|
||||
```
|
||||
```ini
|
||||
CONFIG_ZMK_SLEEP=y
|
||||
CONFIG_EC11=y
|
||||
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
|
||||
@@ -114,7 +114,7 @@ Devicetree files use various file extensions. These indicate the purpose of the
|
||||
|
||||
Devicetree files look like this:
|
||||
|
||||
```devicetree
|
||||
```dts
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
@@ -138,7 +138,7 @@ search through the `.dts` file for your board, `.overlay` file for your shield,
|
||||
|
||||
A Devicetree node looks like this:
|
||||
|
||||
```devicetree
|
||||
```dts
|
||||
kscan0: kscan {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
// more properties and/or nodes...
|
||||
@@ -157,7 +157,7 @@ followed by the node's label, an opening curly brace (`{`), one or more new prop
|
||||
|
||||
For example, to adjust the debouncing of the `zmk,kscan-gpio-matrix` node shown above, you could add this to your keymap:
|
||||
|
||||
```devicetree
|
||||
```dts
|
||||
&kscan0 {
|
||||
debounce-press-ms = <0>;
|
||||
};
|
||||
@@ -165,7 +165,7 @@ For example, to adjust the debouncing of the `zmk,kscan-gpio-matrix` node shown
|
||||
|
||||
If the node you want to edit doesn't have a label, you can also write a new tree and it will be merged with the existing tree, overriding any properties. Adding this to your keymap would be equivalent to the previous example.
|
||||
|
||||
```devicetree
|
||||
```dts
|
||||
/ {
|
||||
kscan {
|
||||
debounce-press-ms = <0>;
|
||||
@@ -185,7 +185,7 @@ 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
|
||||
```dts
|
||||
/delete-property/ the-property-name;
|
||||
```
|
||||
|
||||
@@ -240,7 +240,7 @@ Each item in the array should be a label for a GPIO node (the names of which dif
|
||||
|
||||
Example:
|
||||
|
||||
```devicetree
|
||||
```dts
|
||||
some-gpios =
|
||||
<&gpio0 0 GPIO_ACTIVE_HIGH>,
|
||||
<&gpio0 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>
|
||||
@@ -253,7 +253,7 @@ A path to a node, either as a node reference or as a string.
|
||||
|
||||
Examples:
|
||||
|
||||
```
|
||||
```dts
|
||||
property = &label;
|
||||
property = "/path/to/some/node";
|
||||
```
|
||||
|
||||
@@ -88,7 +88,7 @@ By default, a switch will drain current through the internal pull up/down resist
|
||||
|
||||
Assuming the switches connect each GPIO pin to the ground, the [GPIO flags](https://docs.zephyrproject.org/3.2.0/hardware/peripherals/gpio.html#api-reference) for the elements in `input-gpios` should be `(GPIO_ACTIVE_LOW | GPIO_PULL_UP)`:
|
||||
|
||||
```devicetree
|
||||
```dts
|
||||
kscan0: kscan {
|
||||
compatible = "zmk,kscan-gpio-direct";
|
||||
input-gpios
|
||||
@@ -137,7 +137,7 @@ The `diode-direction` property must be one of:
|
||||
Given the `diode-direction`, the [GPIO flags](https://docs.zephyrproject.org/3.2.0/hardware/peripherals/gpio.html#api-reference) for the elements in `row-` and `col-gpios` should be set appropriately.
|
||||
The output pins (e.g. columns for `col2row`) should have the flag `GPIO_ACTIVE_HIGH`, and input pins (e.g. rows for `col2row`) should have the flags `(GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)`:
|
||||
|
||||
```devicetree
|
||||
```dts
|
||||
kscan0: kscan {
|
||||
compatible = "zmk,kscan-gpio-matrix";
|
||||
diode-direction = "col2row";
|
||||
@@ -229,7 +229,7 @@ One possible way to do this is a 3x4 matrix where the direct GPIO keys are shift
|
||||
|
||||
...which can be configured with the following Devicetree code:
|
||||
|
||||
```devicetree
|
||||
```dts
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
@@ -316,7 +316,7 @@ The `map` array should be defined using the `RC()` macro from [dt-bindings/zmk/m
|
||||
|
||||
Any keyboard which is not a grid of 1 unit keys will likely have some unused positions in the matrix. A matrix transform can be used to skip the unused positions so users don't have to set them to `&none` in keymaps.
|
||||
|
||||
```devicetree
|
||||
```dts
|
||||
// numpad.overlay
|
||||
/ {
|
||||
chosen {
|
||||
@@ -355,7 +355,7 @@ Any keyboard which is not a grid of 1 unit keys will likely have some unused pos
|
||||
};
|
||||
```
|
||||
|
||||
```devicetree
|
||||
```dts
|
||||
// numpad.keymap
|
||||
/ {
|
||||
keymap {
|
||||
@@ -377,7 +377,7 @@ Any keyboard which is not a grid of 1 unit keys will likely have some unused pos
|
||||
|
||||
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
|
||||
```dts
|
||||
/ {
|
||||
chosen {
|
||||
zmk,kscan = &kscan0;
|
||||
|
||||
Reference in New Issue
Block a user