refactor: consolidate PWM/backlight config

This commit is contained in:
honorless 2024-11-17 15:46:22 -05:00
parent d81edeb623
commit 9da0f34455
No known key found for this signature in database
GPG Key ID: 1B48A311ABE8DA4D
3 changed files with 28 additions and 55 deletions

View File

@ -49,6 +49,13 @@
RC(4,7)
>;
};
backlight: pwmleds {
compatible = "pwm-leds";
pwm_led_0 {
pwms = <&pwm0 0 PWM_MSEC(1) PWM_POLARITY_NORMAL>;
};
};
};
&adc {
@ -125,6 +132,18 @@ zephyr_udc0: &usbd {
};
};
pwm0_default: pwm0_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 13)>;
};
};
pwm0_sleep: pwm0_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 13)>;
low-power-enable;
};
};
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 1, 12)>; // WS2812_VEXT_DATA
@ -147,6 +166,13 @@ nice_view_spi: &spi0 {
cs-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};
&spi3 {
status = "okay";
@ -170,17 +196,3 @@ nice_view_spi: &spi0 {
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
/ {
backlight: pwmleds {
compatible = "pwm-leds";
pwm_led_0 {
pwms = <&pwm0 0 PWM_MSEC(1) PWM_POLARITY_NORMAL>;
};
};
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2021 Darryl deHaan
* Copyright (c) 2024 The ZMK Contributors
* SPDX-License-Identifier: MIT
*
*/
@ -10,7 +10,6 @@
/{
chosen {
zmk,battery = &vbatt;
zmk,backlight = &backlight;
};
kscan0: kscan {
@ -53,23 +52,4 @@
b-gpios = <&gpio1 14 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
status = "okay";
};
&pinctrl {
// Other pinctrl definitions for other hardware
pwm0_default: pwm0_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 13)>;
};
};
pwm0_sleep: pwm0_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 13)>;
low-power-enable;
};
};
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};

View File

@ -1,6 +1,6 @@
/*
*
* Copyright (c) 2021 Darryl deHaan
* Copyright (c) 2024 The ZMK Contributors
* SPDX-License-Identifier: MIT
*
*/
@ -74,23 +74,4 @@
color-mapping = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};
&pinctrl {
// Other pinctrl definitions for other hardware
pwm0_default: pwm0_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 13)>;
};
};
pwm0_sleep: pwm0_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 13)>;
low-power-enable;
};
};
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};