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:
Joel Spadin
2023-10-06 22:05:49 -05:00
committed by Cem Aksoylar
parent 4a339093ce
commit 65667b863a
50 changed files with 215 additions and 221 deletions

View File

@@ -16,7 +16,7 @@ Unlike [RGB Underglow](underglow.md), backlight can only control single color LE
To enable backlight on your board or shield, add the following line to your `.conf` file of your user config directory as such:
```
```ini
CONFIG_ZMK_BACKLIGHT=y
```
@@ -46,7 +46,7 @@ values={[
First, you must enable PWM by adding the following lines to your `Kconfig.defconfig` file:
```
```kconfig
if ZMK_BACKLIGHT
config PWM
@@ -60,7 +60,7 @@ endif # ZMK_BACKLIGHT
Then you have to add the following lines to your `.dts` file:
```
```dts
&pwm0 {
status = "okay";
ch0-pin = <45>;
@@ -77,7 +77,7 @@ If your board uses a P-channel MOSFET to control backlight instead of a N-channe
Then you have to add the following lines inside the root devicetree node on the same file as before:
```
```dts
/ {
backlight: pwmleds {
compatible = "pwm-leds";
@@ -98,7 +98,7 @@ Note that every LED inside of the backlight node will be treated as a backlight
Finally you need to add backlight to the `chosen` element of the root devicetree node:
```
```dts
/ {
chosen {
zmk,backlight = &backlight;
@@ -113,7 +113,7 @@ You must first add a `boards/` directory within your shield folder. For each boa
Inside your `<board>.defconfig` file, add the following lines:
```
```kconfig
if ZMK_BACKLIGHT
config PWM
@@ -127,7 +127,7 @@ endif # ZMK_BACKLIGHT
Then add the following lines to your `.overlay` file:
```
```dts
&pwm0 {
status = "okay";
ch0-pin = <45>;
@@ -144,7 +144,7 @@ If your shield uses a P-channel MOSFET to control backlight instead of a N-chann
Then you have to add the following lines inside the root devicetree node on the same file:
```
```dts
/ {
backlight: pwmleds {
compatible = "pwm-leds";
@@ -165,7 +165,7 @@ Note that every LED inside of the backlight node will be treated as a backlight
Finally you need to add backlight to the `chosen` element of the root devicetree node:
```
```dts
/ {
chosen {
zmk,backlight = &backlight;
@@ -175,7 +175,7 @@ Finally you need to add backlight to the `chosen` element of the root devicetree
Optionally, on Pro Micro compatible shields you can add a LED GPIO node to your devicetree, this could be useful if you want your shield to be compatible with newer or untested boards. To do that you have to enable `CONFIG_LED_GPIO` in your `.conf` file and then add the following lines inside the root devicetree node of your `.dtsi` or `.dts` file:
```
```dts
/ {
backlight: gpioleds {
compatible = "gpio-leds";
@@ -199,7 +199,7 @@ It is possible to control multiple backlight LEDs at the same time. This is usef
In order to do that, first you need to enable PWM for each pin:
```
```dts
&pwm0 {
status = "okay";
ch0-pin = <45>; /* LED 0 */
@@ -213,7 +213,7 @@ This part may vary based on your MCU as different MCUs may have a different numb
Then you can simply add each of your LED to the backlight node:
```
```dts
backlight: pwmleds {
compatible = "pwm-leds";
label = "Backlight LEDs";