From bfb1056c20b3843a9bc5561768703c73b3dcf900 Mon Sep 17 00:00:00 2001 From: ReFil <31960031+ReFil@users.noreply.github.com> Date: Sat, 2 Sep 2023 15:46:48 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Cem Aksoylar --- docs/docs/features/backlight.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/docs/features/backlight.md b/docs/docs/features/backlight.md index 3de68bca16a..deced26ee40 100644 --- a/docs/docs/features/backlight.md +++ b/docs/docs/features/backlight.md @@ -58,7 +58,7 @@ config LED_PWM endif # ZMK_BACKLIGHT ``` -Since the Zephyr 3.2 update the PWM driver has been revised, permitting the use of the pinctrl API to select the pins. For now the old method of pin select is also functional +Since the Zephyr 3.2 update the PWM driver has been revised, permitting the use of the pinctrl API to select the pins. For now the old method of pin select is also functional, as long as you don't enable pinctrl for the board at all. If you do not want to use pinctrl add the following lines to your `.dts` file: @@ -126,9 +126,9 @@ config LED_PWM endif # ZMK_BACKLIGHT ``` -When using the pinctrl API you should create a pinctrl.dtsi file if it's not created already, and include it at the beginning of the `board.dts` file. You also need to add `CONFIG_PINCTRL=y` to board_defconfig if it's not already enabled +When using the pinctrl API you should create a pinctrl.dtsi file if it's not created already, and include it at the beginning of the `board.dts` file. You also need to add `CONFIG_PINCTRL=y` to board_defconfig if it's not already enabled. -A pinctrl file has an `&pinctrl` node that encompasses all pinctrl settings including for I2C or SPI peripherals (e.g. WS2812 LEDs, Battery fuel gauges) +A pinctrl file has an `&pinctrl` node that encompasses all pinctrl settings including for I2C or SPI peripherals (e.g. WS2812 LEDs, Battery fuel gauges): ``` &pinctrl { @@ -151,7 +151,7 @@ The pin number is handled differently depending on the MCU in question, on nRF b For example, _P1.13_ would give you `(PWM_OUT0, 1, 13)` and _P0.15_ would give you `(PWM_OUT0, 0, 15)`. -Then you add the PWM device inside the `board.dts` file and assign the pinctrl definitions to it +Then you add the PWM device inside the `board.dts` file and assign the pinctrl definitions to it: ``` &pwm0 { @@ -192,7 +192,7 @@ Finally you need to add backlight to the `chosen` element of the root devicetree -Since the Zephyr 3.2 update the PWM driver has been revised, permitting the use of the pinctrl API to select the pins. For now the old method of pin select is also functional +Since the Zephyr 3.2 update the PWM driver has been revised, permitting the use of the pinctrl API to select the pins. For now the old method of pin select is also functional, but note that if you are modifying a shield and the board already has pinctrl enabled then you have to use the pinctrl API as well. You must first add a `boards/` directory within your shield folder. For each board that supports the shield you must create a `.defconfig` file and a `.overlay` file inside the `boards/` folder. @@ -318,7 +318,7 @@ The pin number is handled differently depending on the MCU in question, on nRF b For example, _P1.13_ would give you `(PWM_OUT0, 1, 13)` and _P0.15_ would give you `(PWM_OUT0, 0, 15)`. -Then you add the PWM device inside the `.overlay` file and assign the pinctrl definitions to it +Then you add the PWM device inside the `.overlay` file and assign the pinctrl definitions to it: ``` &pwm0 {