diff --git a/app/boards/arm/bluemicro840/bluemicro840_v1-pinctrl.dtsi b/app/boards/arm/bluemicro840/bluemicro840_v1-pinctrl.dtsi new file mode 100644 index 00000000..18b90f21 --- /dev/null +++ b/app/boards/arm/bluemicro840/bluemicro840_v1-pinctrl.dtsi @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * SPDX-License-Identifier: MIT + */ + +&pinctrl { + uart0_default: uart0_default { + group1 { + psels = ; + bias-pull-up; + }; + group2 { + psels = ; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c0_default: i2c0_default { + group1 { + psels = , + ; + }; + }; + + i2c0_sleep: i2c0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; diff --git a/app/boards/arm/bluemicro840/bluemicro840_v1.dts b/app/boards/arm/bluemicro840/bluemicro840_v1.dts index 29bf0f8d..c636ca31 100644 --- a/app/boards/arm/bluemicro840/bluemicro840_v1.dts +++ b/app/boards/arm/bluemicro840/bluemicro840_v1.dts @@ -7,6 +7,7 @@ /dts-v1/; #include #include "arduino_pro_micro_pins.dtsi" +#include "bluemicro840_v1-pinctrl.dtsi" / { model = "BlueMicro840_V1"; @@ -62,15 +63,17 @@ }; &i2c0 { - compatible = "nordic,nrf-twi"; - sda-pin = <15>; - scl-pin = <17>; + compatible = "nordic,nrf-twim"; + pinctrl-0 = <&i2c0_default>; + pinctrl-1 = <&i2c0_sleep>; + pinctrl-names = "default", "sleep"; }; &uart0 { compatible = "nordic,nrf-uarte"; - tx-pin = <6>; - rx-pin = <8>; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; }; &usbd { diff --git a/app/boards/arm/bluemicro840/bluemicro840_v1_defconfig b/app/boards/arm/bluemicro840/bluemicro840_v1_defconfig index b8e4e805..99d51a94 100644 --- a/app/boards/arm/bluemicro840/bluemicro840_v1_defconfig +++ b/app/boards/arm/bluemicro840/bluemicro840_v1_defconfig @@ -7,6 +7,8 @@ CONFIG_BOARD_BLUEMICRO840_V1=y # Enable MPU CONFIG_ARM_MPU=y +CONFIG_PINCTRL=y + # enable GPIO CONFIG_GPIO=y @@ -18,4 +20,4 @@ CONFIG_NVS=y CONFIG_SETTINGS_NVS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y -CONFIG_FLASH_MAP=y \ No newline at end of file +CONFIG_FLASH_MAP=y diff --git a/app/boards/arm/corneish_zen/corneish_zen_v2_left.dts b/app/boards/arm/corneish_zen/corneish_zen_v2_left.dts index 2d8f0a81..4dbdaef5 100644 --- a/app/boards/arm/corneish_zen/corneish_zen_v2_left.dts +++ b/app/boards/arm/corneish_zen/corneish_zen_v2_left.dts @@ -53,12 +53,31 @@ }; +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; + + spi0_sleep: spi0_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + &spi0 { status = "okay"; compatible = "nordic,nrf-spim"; - sck-pin = <27>; - mosi-pin = <8>; - miso-pin = <22>; + pinctrl-0 = <&spi0_default>; + pinctrl-1 = <&spi0_sleep>; + pinctrl-names = "default", "sleep"; cs-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>; epd: il0323@0 { @@ -75,4 +94,4 @@ cdi = <0xd2>; tcon = <0x22>; }; -}; \ No newline at end of file +}; diff --git a/app/boards/arm/corneish_zen/corneish_zen_v2_left_defconfig b/app/boards/arm/corneish_zen/corneish_zen_v2_left_defconfig index 42e27037..305ce72e 100644 --- a/app/boards/arm/corneish_zen/corneish_zen_v2_left_defconfig +++ b/app/boards/arm/corneish_zen/corneish_zen_v2_left_defconfig @@ -13,6 +13,9 @@ CONFIG_ZMK_DISPLAY=y # Enable MPU CONFIG_ARM_MPU=y +# enable pinctrl +CONFIG_PINCTRL=y + # enable GPIO CONFIG_GPIO=y diff --git a/app/boards/arm/corneish_zen/corneish_zen_v2_right.dts b/app/boards/arm/corneish_zen/corneish_zen_v2_right.dts index 097872f5..52439e4f 100644 --- a/app/boards/arm/corneish_zen/corneish_zen_v2_right.dts +++ b/app/boards/arm/corneish_zen/corneish_zen_v2_right.dts @@ -60,12 +60,31 @@ col-offset = <6>; }; +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; + + spi0_sleep: spi0_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; + &spi0 { status = "okay"; compatible = "nordic,nrf-spim"; - sck-pin = <20>; - mosi-pin = <24>; - miso-pin = <27>; + pinctrl-0 = <&spi0_default>; + pinctrl-1 = <&spi0_sleep>; + pinctrl-names = "default", "sleep"; cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>; epd: il0323@0 { diff --git a/app/boards/arm/corneish_zen/corneish_zen_v2_right_defconfig b/app/boards/arm/corneish_zen/corneish_zen_v2_right_defconfig index e9b36f2e..0fd0fd6c 100644 --- a/app/boards/arm/corneish_zen/corneish_zen_v2_right_defconfig +++ b/app/boards/arm/corneish_zen/corneish_zen_v2_right_defconfig @@ -13,6 +13,9 @@ CONFIG_ZMK_DISPLAY=y # Enable MPU CONFIG_ARM_MPU=y +# enable pinctrl +CONFIG_PINCTRL=y + # enable GPIO CONFIG_GPIO=y diff --git a/app/boards/arm/mikoto/mikoto_520-pinctrl.dtsi b/app/boards/arm/mikoto/mikoto_520-pinctrl.dtsi new file mode 100644 index 00000000..4a8ff82c --- /dev/null +++ b/app/boards/arm/mikoto/mikoto_520-pinctrl.dtsi @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * SPDX-License-Identifier: MIT + */ + +&pinctrl { + uart0_default: uart0_default { + group1 { + psels = ; + bias-pull-up; + }; + group2 { + psels = ; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c0_default: i2c0_default { + group1 { + psels = , + ; + }; + }; + + i2c0_sleep: i2c0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; diff --git a/app/boards/arm/mikoto/mikoto_520.dts b/app/boards/arm/mikoto/mikoto_520.dts index 49d9d6be..3fff0835 100644 --- a/app/boards/arm/mikoto/mikoto_520.dts +++ b/app/boards/arm/mikoto/mikoto_520.dts @@ -7,6 +7,7 @@ /dts-v1/; #include #include "arduino_pro_micro_pins.dtsi" +#include "mikoto_520-pinctrl.dtsi" / { model = "mikoto"; @@ -62,14 +63,17 @@ &i2c0 { compatible = "nordic,nrf-twi"; - sda-pin = <17>; - scl-pin = <20>; + pinctrl-0 = <&i2c0_default>; + pinctrl-1 = <&i2c0_sleep>; + pinctrl-names = "default", "sleep"; }; &uart0 { compatible = "nordic,nrf-uarte"; - tx-pin = <8>; - rx-pin = <4>; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; }; &usbd { diff --git a/app/boards/arm/mikoto/mikoto_520_defconfig b/app/boards/arm/mikoto/mikoto_520_defconfig index d5fd8958..c755633e 100644 --- a/app/boards/arm/mikoto/mikoto_520_defconfig +++ b/app/boards/arm/mikoto/mikoto_520_defconfig @@ -7,6 +7,8 @@ CONFIG_BOARD_MIKOTO_520=y # Enable MPU CONFIG_ARM_MPU=y +CONFIG_PINCTRL=y + # enable GPIO CONFIG_GPIO=y diff --git a/app/boards/arm/nice60/nice60-pinctrl.dtsi b/app/boards/arm/nice60/nice60-pinctrl.dtsi new file mode 100644 index 00000000..aced76b4 --- /dev/null +++ b/app/boards/arm/nice60/nice60-pinctrl.dtsi @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * SPDX-License-Identifier: MIT + */ + +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = ; + }; + }; +}; diff --git a/app/boards/arm/nice60/nice60.dts b/app/boards/arm/nice60/nice60.dts index bb058da8..c982f88e 100644 --- a/app/boards/arm/nice60/nice60.dts +++ b/app/boards/arm/nice60/nice60.dts @@ -10,6 +10,8 @@ #include #include +#include "nice60-pinctrl.dtsi" + / { model = "nice!60"; compatible = "nice,60"; @@ -110,10 +112,9 @@ RC(4,0) RC(4,1) RC(4,2) RC(4,5) R &spi0 { compatible = "nordic,nrf-spim"; /* Cannot be used together with i2c0. */ + pinctrl-0 = <&spi0_default>; + pinctrl-names = "default"; status = "okay"; - sck-pin = <12>; - mosi-pin = <27>; - miso-pin = <13>; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; diff --git a/app/boards/arm/nice60/nice60_defconfig b/app/boards/arm/nice60/nice60_defconfig index 9fac3a30..48936a04 100644 --- a/app/boards/arm/nice60/nice60_defconfig +++ b/app/boards/arm/nice60/nice60_defconfig @@ -8,6 +8,8 @@ CONFIG_BOARD_NICE60=y # Enable MPU CONFIG_ARM_MPU=y +CONFIG_PINCTRL=y + # enable GPIO CONFIG_GPIO=y diff --git a/app/boards/arm/nice_nano/nice_nano-pinctrl.dtsi b/app/boards/arm/nice_nano/nice_nano-pinctrl.dtsi new file mode 100644 index 00000000..18b90f21 --- /dev/null +++ b/app/boards/arm/nice_nano/nice_nano-pinctrl.dtsi @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * SPDX-License-Identifier: MIT + */ + +&pinctrl { + uart0_default: uart0_default { + group1 { + psels = ; + bias-pull-up; + }; + group2 { + psels = ; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c0_default: i2c0_default { + group1 { + psels = , + ; + }; + }; + + i2c0_sleep: i2c0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; diff --git a/app/boards/arm/nice_nano/nice_nano.dtsi b/app/boards/arm/nice_nano/nice_nano.dtsi index 6c9d081c..ad5ef278 100644 --- a/app/boards/arm/nice_nano/nice_nano.dtsi +++ b/app/boards/arm/nice_nano/nice_nano.dtsi @@ -5,6 +5,7 @@ */ #include +#include "nice_nano-pinctrl.dtsi" #include "arduino_pro_micro_pins.dtsi" / { @@ -45,14 +46,17 @@ &i2c0 { compatible = "nordic,nrf-twi"; - sda-pin = <17>; - scl-pin = <20>; + pinctrl-0 = <&i2c0_default>; + pinctrl-1 = <&i2c0_sleep>; + pinctrl-names = "default", "sleep"; }; &uart0 { compatible = "nordic,nrf-uarte"; - tx-pin = <6>; - rx-pin = <8>; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; }; &usbd { diff --git a/app/boards/arm/nice_nano/nice_nano_defconfig b/app/boards/arm/nice_nano/nice_nano_defconfig index 1ff025ec..a837b7d2 100644 --- a/app/boards/arm/nice_nano/nice_nano_defconfig +++ b/app/boards/arm/nice_nano/nice_nano_defconfig @@ -10,6 +10,9 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y +# Use pinctrl +CONFIG_PINCTRL=y + CONFIG_USE_DT_CODE_PARTITION=y CONFIG_BUILD_OUTPUT_UF2=y @@ -18,4 +21,4 @@ CONFIG_NVS=y CONFIG_SETTINGS_NVS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y -CONFIG_FLASH_MAP=y \ No newline at end of file +CONFIG_FLASH_MAP=y diff --git a/app/boards/arm/nice_nano/nice_nano_v2_defconfig b/app/boards/arm/nice_nano/nice_nano_v2_defconfig index 206e51c2..667cf71a 100644 --- a/app/boards/arm/nice_nano/nice_nano_v2_defconfig +++ b/app/boards/arm/nice_nano/nice_nano_v2_defconfig @@ -7,6 +7,9 @@ CONFIG_BOARD_NICE_NANO_V2=y # Enable MPU CONFIG_ARM_MPU=y +# Use pinctrl +CONFIG_PINCTRL=y + # enable GPIO CONFIG_GPIO=y @@ -18,4 +21,4 @@ CONFIG_NVS=y CONFIG_SETTINGS_NVS=y CONFIG_FLASH=y CONFIG_FLASH_PAGE_LAYOUT=y -CONFIG_FLASH_MAP=y \ No newline at end of file +CONFIG_FLASH_MAP=y diff --git a/app/boards/arm/nrfmicro/nrfmicro-flipped-pinctrl.dtsi b/app/boards/arm/nrfmicro/nrfmicro-flipped-pinctrl.dtsi new file mode 100644 index 00000000..a54c2598 --- /dev/null +++ b/app/boards/arm/nrfmicro/nrfmicro-flipped-pinctrl.dtsi @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * SPDX-License-Identifier: MIT + */ + +&pinctrl { + uart0_default: uart0_default { + group1 { + psels = ; + bias-pull-up; + }; + group2 { + psels = ; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c0_default: i2c0_default { + group1 { + psels = , + ; + }; + }; + + i2c0_sleep: i2c0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; diff --git a/app/boards/arm/nrfmicro/nrfmicro-pinctrl.dtsi b/app/boards/arm/nrfmicro/nrfmicro-pinctrl.dtsi new file mode 100644 index 00000000..a5385690 --- /dev/null +++ b/app/boards/arm/nrfmicro/nrfmicro-pinctrl.dtsi @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * SPDX-License-Identifier: MIT + */ + +&pinctrl { + uart0_default: uart0_default { + group1 { + psels = ; + bias-pull-up; + }; + group2 { + psels = ; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c0_default: i2c0_default { + group1 { + psels = , + ; + }; + }; + + i2c0_sleep: i2c0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; diff --git a/app/boards/arm/nrfmicro/nrfmicro_11.dts b/app/boards/arm/nrfmicro/nrfmicro_11.dts index 82951b5f..48186ac9 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_11.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_11.dts @@ -7,6 +7,7 @@ /dts-v1/; #include #include "arduino_pro_micro_pins.dtsi" +#include "nrfmicro-pinctrl.dtsi" / { model = "nrfmicro"; @@ -47,15 +48,17 @@ }; &i2c0 { - compatible = "nordic,nrf-twi"; - sda-pin = <15>; - scl-pin = <17>; + compatible = "nordic,nrf-twim"; + pinctrl-0 = <&i2c0_default>; + pinctrl-1 = <&i2c0_sleep>; + pinctrl-names = "default", "sleep"; }; &uart0 { compatible = "nordic,nrf-uarte"; - tx-pin = <6>; - rx-pin = <8>; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; }; &usbd { diff --git a/app/boards/arm/nrfmicro/nrfmicro_11_defconfig b/app/boards/arm/nrfmicro/nrfmicro_11_defconfig index 3f6a447d..b51929b0 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_11_defconfig +++ b/app/boards/arm/nrfmicro/nrfmicro_11_defconfig @@ -7,6 +7,8 @@ CONFIG_BOARD_NRFMICRO_11=y # Enable MPU CONFIG_ARM_MPU=y +CONFIG_PINCTRL=y + # enable GPIO CONFIG_GPIO=y diff --git a/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts b/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts index fdfba507..656873a0 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_11_flipped.dts @@ -7,6 +7,7 @@ /dts-v1/; #include #include "arduino_pro_micro_pins_flipped.dtsi" +#include "nrfmicro-flipped-pinctrl.dtsi" / { model = "nrfmicro"; @@ -47,15 +48,17 @@ }; &i2c0 { - compatible = "nordic,nrf-twi"; - sda-pin = <30>; - scl-pin = <31>; + compatible = "nordic,nrf-twim"; + pinctrl-0 = <&i2c0_default>; + pinctrl-1 = <&i2c0_sleep>; + pinctrl-names = "default", "sleep"; }; &uart0 { compatible = "nordic,nrf-uarte"; - tx-pin = <6>; - rx-pin = <8>; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; }; &usbd { @@ -105,4 +108,4 @@ reg = <0x000f4000 0x0000c000>; }; }; -}; \ No newline at end of file +}; diff --git a/app/boards/arm/nrfmicro/nrfmicro_11_flipped_defconfig b/app/boards/arm/nrfmicro/nrfmicro_11_flipped_defconfig index efe924f2..335a2d75 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_11_flipped_defconfig +++ b/app/boards/arm/nrfmicro/nrfmicro_11_flipped_defconfig @@ -7,6 +7,8 @@ CONFIG_BOARD_NRFMICRO_11_FLIPPED=y # Enable MPU CONFIG_ARM_MPU=y +CONFIG_PINCTRL=y + # enable GPIO CONFIG_GPIO=y diff --git a/app/boards/arm/nrfmicro/nrfmicro_13.dts b/app/boards/arm/nrfmicro/nrfmicro_13.dts index a0f74170..9fb68562 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_13.dts @@ -7,6 +7,7 @@ /dts-v1/; #include #include "arduino_pro_micro_pins.dtsi" +#include "nrfmicro-pinctrl.dtsi" / { model = "nrfmicro"; @@ -60,15 +61,17 @@ }; &i2c0 { - compatible = "nordic,nrf-twi"; - sda-pin = <15>; - scl-pin = <17>; + compatible = "nordic,nrf-twim"; + pinctrl-0 = <&i2c0_default>; + pinctrl-1 = <&i2c0_sleep>; + pinctrl-names = "default", "sleep"; }; &uart0 { compatible = "nordic,nrf-uarte"; - tx-pin = <6>; - rx-pin = <8>; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; }; &usbd { diff --git a/app/boards/arm/nrfmicro/nrfmicro_13_52833.dts b/app/boards/arm/nrfmicro/nrfmicro_13_52833.dts index 7f833ff5..9ade364d 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13_52833.dts +++ b/app/boards/arm/nrfmicro/nrfmicro_13_52833.dts @@ -7,6 +7,7 @@ /dts-v1/; #include #include "arduino_pro_micro_pins_52833.dtsi" +#include "nrfmicro-pinctrl.dtsi" / { model = "nrfmicro"; @@ -60,15 +61,17 @@ }; &i2c0 { - compatible = "nordic,nrf-twi"; - sda-pin = <15>; - scl-pin = <17>; + compatible = "nordic,nrf-twim"; + pinctrl-0 = <&i2c0_default>; + pinctrl-1 = <&i2c0_sleep>; + pinctrl-names = "default", "sleep"; }; &uart0 { compatible = "nordic,nrf-uarte"; - tx-pin = <6>; - rx-pin = <8>; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; }; &usbd { diff --git a/app/boards/arm/nrfmicro/nrfmicro_13_52833_defconfig b/app/boards/arm/nrfmicro/nrfmicro_13_52833_defconfig index 112e0344..4af1ff86 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13_52833_defconfig +++ b/app/boards/arm/nrfmicro/nrfmicro_13_52833_defconfig @@ -7,6 +7,8 @@ CONFIG_BOARD_NRFMICRO_13_52833=y # Enable MPU CONFIG_ARM_MPU=y +CONFIG_PINCTRL=y + # enable GPIO CONFIG_GPIO=y diff --git a/app/boards/arm/nrfmicro/nrfmicro_13_defconfig b/app/boards/arm/nrfmicro/nrfmicro_13_defconfig index 06758784..43ba40e2 100644 --- a/app/boards/arm/nrfmicro/nrfmicro_13_defconfig +++ b/app/boards/arm/nrfmicro/nrfmicro_13_defconfig @@ -7,6 +7,8 @@ CONFIG_BOARD_NRFMICRO_13=y # Enable MPU CONFIG_ARM_MPU=y +CONFIG_PINCTRL=y + # enable GPIO CONFIG_GPIO=y diff --git a/app/boards/arm/pillbug/pillbug-pinctrl.dtsi b/app/boards/arm/pillbug/pillbug-pinctrl.dtsi new file mode 100644 index 00000000..8751bc4b --- /dev/null +++ b/app/boards/arm/pillbug/pillbug-pinctrl.dtsi @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * SPDX-License-Identifier: MIT + */ + +&pinctrl { + uart0_default: uart0_default { + group1 { + psels = ; + bias-pull-up; + }; + group2 { + psels = ; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c0_default: i2c0_default { + group1 { + psels = , + ; + }; + }; + + i2c0_sleep: i2c0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + spi1_default: spi1_default { + group1 { + psels = , + , + ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = , + , + ; + low-power-enable; + }; + }; +}; diff --git a/app/boards/arm/pillbug/pillbug.dts b/app/boards/arm/pillbug/pillbug.dts index 85c5cccd..c1330319 100644 --- a/app/boards/arm/pillbug/pillbug.dts +++ b/app/boards/arm/pillbug/pillbug.dts @@ -7,6 +7,7 @@ /dts-v1/; #include +#include "pillbug-pinctrl.dtsi" #include "blackpill_pins.dtsi" / { @@ -63,22 +64,25 @@ &i2c0 { compatible = "nordic,nrf-twi"; - sda-pin = <15>; - scl-pin = <13>; + pinctrl-0 = <&i2c0_default>; + pinctrl-1 = <&i2c0_sleep>; + pinctrl-names = "default", "sleep"; }; -&spi1{ +&spi1 { status = "disabled"; compatible = "nordic,nrf-spim"; - sck-pin = <40>; - mosi-pin = <11>; - miso-pin = <26>; + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; }; &uart0 { compatible = "nordic,nrf-uarte"; - tx-pin = <6>; - rx-pin = <8>; + current-speed = <115200>; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; }; &usbd { diff --git a/app/boards/arm/puchi_ble/puchi_ble_v1-pinctrl.dtsi b/app/boards/arm/puchi_ble/puchi_ble_v1-pinctrl.dtsi new file mode 100644 index 00000000..a5385690 --- /dev/null +++ b/app/boards/arm/puchi_ble/puchi_ble_v1-pinctrl.dtsi @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2022 The ZMK Contributors + * SPDX-License-Identifier: MIT + */ + +&pinctrl { + uart0_default: uart0_default { + group1 { + psels = ; + bias-pull-up; + }; + group2 { + psels = ; + }; + }; + + uart0_sleep: uart0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; + + i2c0_default: i2c0_default { + group1 { + psels = , + ; + }; + }; + + i2c0_sleep: i2c0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; diff --git a/app/boards/arm/puchi_ble/puchi_ble_v1.dts b/app/boards/arm/puchi_ble/puchi_ble_v1.dts index e324cccc..a8f25c37 100644 --- a/app/boards/arm/puchi_ble/puchi_ble_v1.dts +++ b/app/boards/arm/puchi_ble/puchi_ble_v1.dts @@ -7,6 +7,7 @@ /dts-v1/; #include #include "arduino_pro_micro_pins.dtsi" +#include "puchi_ble_v1-pinctrl.dtsi" / { model = "puchi_ble"; @@ -61,14 +62,16 @@ &i2c0 { compatible = "nordic,nrf-twi"; - sda-pin = <15>; - scl-pin = <17>; + pinctrl-0 = <&i2c0_default>; + pinctrl-1 = <&i2c0_sleep>; + pinctrl-names = "default", "sleep"; }; &uart0 { compatible = "nordic,nrf-uarte"; - tx-pin = <6>; - rx-pin = <8>; + pinctrl-0 = <&uart0_default>; + pinctrl-1 = <&uart0_sleep>; + pinctrl-names = "default", "sleep"; }; &usbd { diff --git a/app/boards/arm/puchi_ble/puchi_ble_v1_defconfig b/app/boards/arm/puchi_ble/puchi_ble_v1_defconfig index e32886d0..1adb9217 100644 --- a/app/boards/arm/puchi_ble/puchi_ble_v1_defconfig +++ b/app/boards/arm/puchi_ble/puchi_ble_v1_defconfig @@ -11,6 +11,9 @@ CONFIG_ARM_MPU=y # enable GPIO CONFIG_GPIO=y +# Use pinctrl +CONFIG_PINCTRL=y + CONFIG_USE_DT_CODE_PARTITION=y CONFIG_BUILD_OUTPUT_UF2=y diff --git a/app/boards/shields/chalice/boards/nice_nano.overlay b/app/boards/shields/chalice/boards/nice_nano.overlay index 5a74582a..172859ae 100644 --- a/app/boards/shields/chalice/boards/nice_nano.overlay +++ b/app/boards/shields/chalice/boards/nice_nano.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,7 +32,7 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <14>; /* arbitrary; change at will */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; diff --git a/app/boards/shields/chalice/boards/nice_nano_v2.overlay b/app/boards/shields/chalice/boards/nice_nano_v2.overlay index 5a74582a..172859ae 100644 --- a/app/boards/shields/chalice/boards/nice_nano_v2.overlay +++ b/app/boards/shields/chalice/boards/nice_nano_v2.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,7 +32,7 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <14>; /* arbitrary; change at will */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; diff --git a/app/boards/shields/corne/boards/nice_nano.overlay b/app/boards/shields/corne/boards/nice_nano.overlay index e5f84063..172859ae 100644 --- a/app/boards/shields/corne/boards/nice_nano.overlay +++ b/app/boards/shields/corne/boards/nice_nano.overlay @@ -1,24 +1,38 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; - /* Cannot be used together with i2c0. */ status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; - label = "SK6812mini"; + label = "WS2812"; /* SPI */ reg = <0>; /* ignored, but necessary for SPI bindings */ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <6>; /* There are per-key RGB, but the first 6 are underglow */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; diff --git a/app/boards/shields/corne/boards/nice_nano_v2.overlay b/app/boards/shields/corne/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..172859ae --- /dev/null +++ b/app/boards/shields/corne/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/elephant42/boards/nice_nano.overlay b/app/boards/shields/elephant42/boards/nice_nano.overlay new file mode 100644 index 00000000..172859ae --- /dev/null +++ b/app/boards/shields/elephant42/boards/nice_nano.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/elephant42/boards/nice_nano_v2.overlay b/app/boards/shields/elephant42/boards/nice_nano_v2.overlay index 87c8da21..172859ae 100644 --- a/app/boards/shields/elephant42/boards/nice_nano_v2.overlay +++ b/app/boards/shields/elephant42/boards/nice_nano_v2.overlay @@ -1,23 +1,38 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; - /* Cannot be used together with i2c0. */ status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; label = "WS2812"; + /* SPI */ reg = <0>; /* ignored, but necessary for SPI bindings */ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <27>; /* There are per-key RGB and the LAST 6 are underglow */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; @@ -29,4 +44,4 @@ chosen { zmk,underglow = &led_strip; }; -}; \ No newline at end of file +}; diff --git a/app/boards/shields/eternal_keypad/boards/nice_nano.overlay b/app/boards/shields/eternal_keypad/boards/nice_nano.overlay new file mode 100644 index 00000000..172859ae --- /dev/null +++ b/app/boards/shields/eternal_keypad/boards/nice_nano.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/eternal_keypad/boards/nice_nano_v2.overlay b/app/boards/shields/eternal_keypad/boards/nice_nano_v2.overlay index 61950d18..172859ae 100644 --- a/app/boards/shields/eternal_keypad/boards/nice_nano_v2.overlay +++ b/app/boards/shields/eternal_keypad/boards/nice_nano_v2.overlay @@ -1,32 +1,41 @@ -/* - * Copyright (c) 2022 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; - /* Cannot be used together with i2c0. */ status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; - label = "SK6812mini"; + label = "WS2812"; /* SPI */ reg = <0>; /* ignored, but necessary for SPI bindings */ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <8>; + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/helix/boards/nice_nano.overlay b/app/boards/shields/helix/boards/nice_nano.overlay index da7deed1..172859ae 100644 --- a/app/boards/shields/helix/boards/nice_nano.overlay +++ b/app/boards/shields/helix/boards/nice_nano.overlay @@ -1,38 +1,47 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { - compatible = "nordic,nrf-spim"; - status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + compatible = "nordic,nrf-spim"; + status = "okay"; - led_strip: ws2812@0 { - compatible = "worldsemi,ws2812-spi"; - label = "WS2812"; + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; - /* SPI */ - reg = <0>; /* ignored, but necessary for SPI bindings */ - spi-max-frequency = <4000000>; + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; - /* WS2812 */ - chain-length = <32>; /* number of LEDs */ - spi-one-frame = <0x70>; - spi-zero-frame = <0x40>; - - color-mapping = ; - }; + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; }; / { - chosen { - zmk,underglow = &led_strip; - }; + chosen { + zmk,underglow = &led_strip; + }; }; diff --git a/app/boards/shields/helix/boards/nice_nano_v2.overlay b/app/boards/shields/helix/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..172859ae --- /dev/null +++ b/app/boards/shields/helix/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/jorne/boards/nice_nano.overlay b/app/boards/shields/jorne/boards/nice_nano.overlay index 2864fd60..172859ae 100644 --- a/app/boards/shields/jorne/boards/nice_nano.overlay +++ b/app/boards/shields/jorne/boards/nice_nano.overlay @@ -1,13 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; - /* Cannot be used together with i2c0. */ status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -18,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <6>; /* There are per-key RGB, but the first 6 are underglow */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/jorne/boards/nice_nano_v2.overlay b/app/boards/shields/jorne/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..172859ae --- /dev/null +++ b/app/boards/shields/jorne/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/kyria/boards/nice_nano.overlay b/app/boards/shields/kyria/boards/nice_nano.overlay index b774b4ba..172859ae 100644 --- a/app/boards/shields/kyria/boards/nice_nano.overlay +++ b/app/boards/shields/kyria/boards/nice_nano.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -20,6 +35,7 @@ chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/kyria/boards/nice_nano_v2.overlay b/app/boards/shields/kyria/boards/nice_nano_v2.overlay index b1e7fbb5..172859ae 100644 --- a/app/boards/shields/kyria/boards/nice_nano_v2.overlay +++ b/app/boards/shields/kyria/boards/nice_nano_v2.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; diff --git a/app/boards/shields/kyria/boards/nrfmicro_11.overlay b/app/boards/shields/kyria/boards/nrfmicro_11.overlay index 1cff5f77..172859ae 100644 --- a/app/boards/shields/kyria/boards/nrfmicro_11.overlay +++ b/app/boards/shields/kyria/boards/nrfmicro_11.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <12>; // 0.12 is not broken out on the nRFMicro - miso-pin = <22>; // 0.22 is not broken out on the nRFMicro + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -20,6 +35,7 @@ chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; @@ -29,4 +45,3 @@ zmk,underglow = &led_strip; }; }; - diff --git a/app/boards/shields/kyria/boards/nrfmicro_11_flipped.overlay b/app/boards/shields/kyria/boards/nrfmicro_11_flipped.overlay index 80d0c898..172859ae 100644 --- a/app/boards/shields/kyria/boards/nrfmicro_11_flipped.overlay +++ b/app/boards/shields/kyria/boards/nrfmicro_11_flipped.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <12>; // 0.12 is not broken out on the nRFMicro - miso-pin = <22>; // 0.22 is not broken out on the nRFMicro + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -20,6 +35,7 @@ chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/kyria/boards/nrfmicro_13.overlay b/app/boards/shields/kyria/boards/nrfmicro_13.overlay index 80d0c898..172859ae 100644 --- a/app/boards/shields/kyria/boards/nrfmicro_13.overlay +++ b/app/boards/shields/kyria/boards/nrfmicro_13.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <12>; // 0.12 is not broken out on the nRFMicro - miso-pin = <22>; // 0.22 is not broken out on the nRFMicro + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -20,6 +35,7 @@ chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/lily58/boards/nice_nano.overlay b/app/boards/shields/lily58/boards/nice_nano.overlay index 69bfffa0..172859ae 100644 --- a/app/boards/shields/lily58/boards/nice_nano.overlay +++ b/app/boards/shields/lily58/boards/nice_nano.overlay @@ -1,18 +1,27 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -23,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <5>; /* number of LEDs */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/lily58/boards/nice_nano_v2.overlay b/app/boards/shields/lily58/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..172859ae --- /dev/null +++ b/app/boards/shields/lily58/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/microdox/boards/nice_nano.overlay b/app/boards/shields/microdox/boards/nice_nano.overlay index 360e7098..172859ae 100644 --- a/app/boards/shields/microdox/boards/nice_nano.overlay +++ b/app/boards/shields/microdox/boards/nice_nano.overlay @@ -1,32 +1,41 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; - /* Cannot be used together with i2c0. */ status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; - label = "SK6812mini"; + label = "WS2812"; /* SPI */ reg = <0>; /* ignored, but necessary for SPI bindings */ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <6>; /* There are per-key RGB, but the first 6 are underglow */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/microdox/boards/nice_nano_v2.overlay b/app/boards/shields/microdox/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..172859ae --- /dev/null +++ b/app/boards/shields/microdox/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/murphpad/boards/nice_nano.overlay b/app/boards/shields/murphpad/boards/nice_nano.overlay index d7cdcff7..89ba4f9d 100644 --- a/app/boards/shields/murphpad/boards/nice_nano.overlay +++ b/app/boards/shields/murphpad/boards/nice_nano.overlay @@ -1,18 +1,27 @@ -/* - * Copyright (c) 2021 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ +#include - #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <31>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -23,7 +32,7 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <8>; /* number of LEDs */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; @@ -35,4 +44,4 @@ chosen { zmk,underglow = &led_strip; }; -}; \ No newline at end of file +}; diff --git a/app/boards/shields/murphpad/boards/nice_nano_v2.overlay b/app/boards/shields/murphpad/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..89ba4f9d --- /dev/null +++ b/app/boards/shields/murphpad/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/nibble/boards/nice_nano.overlay b/app/boards/shields/nibble/boards/nice_nano.overlay index 0a08c770..ece699e2 100644 --- a/app/boards/shields/nibble/boards/nice_nano.overlay +++ b/app/boards/shields/nibble/boards/nice_nano.overlay @@ -1,18 +1,27 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <11>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -23,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <10>; /* number of LEDs */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/nibble/boards/nice_nano_v2.overlay b/app/boards/shields/nibble/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..ece699e2 --- /dev/null +++ b/app/boards/shields/nibble/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/nice_view_adapter/boards/bluemicro840_v1.overlay b/app/boards/shields/nice_view_adapter/boards/bluemicro840_v1.overlay index 9d9ab734..27d76b07 100644 --- a/app/boards/shields/nice_view_adapter/boards/bluemicro840_v1.overlay +++ b/app/boards/shields/nice_view_adapter/boards/bluemicro840_v1.overlay @@ -4,11 +4,21 @@ * SPDX-License-Identifier: MIT */ +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; +}; + + nice_view_spi: &spi0 { compatible = "nordic,nrf-spim"; - sck-pin = <17>; - mosi-pin = <15>; - miso-pin = <25>; + pinctrl-0 = &spi0_default; + pinctrl-names = "default"; cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; }; diff --git a/app/boards/shields/nice_view_adapter/boards/mikoto_520.overlay b/app/boards/shields/nice_view_adapter/boards/mikoto_520.overlay index 9f6fad1c..fc2667f3 100644 --- a/app/boards/shields/nice_view_adapter/boards/mikoto_520.overlay +++ b/app/boards/shields/nice_view_adapter/boards/mikoto_520.overlay @@ -4,11 +4,20 @@ * SPDX-License-Identifier: MIT */ +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; +}; + nice_view_spi: &spi0 { compatible = "nordic,nrf-spim"; - sck-pin = <20>; - mosi-pin = <17>; - miso-pin = <5>; + pinctrl-0 = &spi0_default; + pinctrl-names = "default"; cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; }; diff --git a/app/boards/shields/nice_view_adapter/boards/nice_nano.overlay b/app/boards/shields/nice_view_adapter/boards/nice_nano.overlay index 3a0ad462..c9a0e788 100644 --- a/app/boards/shields/nice_view_adapter/boards/nice_nano.overlay +++ b/app/boards/shields/nice_view_adapter/boards/nice_nano.overlay @@ -4,11 +4,20 @@ * SPDX-License-Identifier: MIT */ +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; +}; + nice_view_spi: &spi0 { compatible = "nordic,nrf-spim"; - sck-pin = <20>; - mosi-pin = <17>; - miso-pin = <25>; + pinctrl-0 = &spi0_default; + pinctrl-names = "default"; cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; }; diff --git a/app/boards/shields/nice_view_adapter/boards/nice_nano_v2.overlay b/app/boards/shields/nice_view_adapter/boards/nice_nano_v2.overlay index 3a0ad462..0068b5b2 100644 --- a/app/boards/shields/nice_view_adapter/boards/nice_nano_v2.overlay +++ b/app/boards/shields/nice_view_adapter/boards/nice_nano_v2.overlay @@ -4,11 +4,20 @@ * SPDX-License-Identifier: MIT */ +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; +}; + nice_view_spi: &spi0 { compatible = "nordic,nrf-spim"; - sck-pin = <20>; - mosi-pin = <17>; - miso-pin = <25>; + pinctrl-0 = <&spi0_default>; + pinctrl-names = "default"; cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; }; diff --git a/app/boards/shields/nice_view_adapter/boards/nrfmicro_11.overlay b/app/boards/shields/nice_view_adapter/boards/nrfmicro_11.overlay index 9d9ab734..27d76b07 100644 --- a/app/boards/shields/nice_view_adapter/boards/nrfmicro_11.overlay +++ b/app/boards/shields/nice_view_adapter/boards/nrfmicro_11.overlay @@ -4,11 +4,21 @@ * SPDX-License-Identifier: MIT */ +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; +}; + + nice_view_spi: &spi0 { compatible = "nordic,nrf-spim"; - sck-pin = <17>; - mosi-pin = <15>; - miso-pin = <25>; + pinctrl-0 = &spi0_default; + pinctrl-names = "default"; cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; }; diff --git a/app/boards/shields/nice_view_adapter/boards/nrfmicro_11_flipped.overlay b/app/boards/shields/nice_view_adapter/boards/nrfmicro_11_flipped.overlay index 7b12c252..5074d0f9 100644 --- a/app/boards/shields/nice_view_adapter/boards/nrfmicro_11_flipped.overlay +++ b/app/boards/shields/nice_view_adapter/boards/nrfmicro_11_flipped.overlay @@ -4,11 +4,20 @@ * SPDX-License-Identifier: MIT */ +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; +}; + nice_view_spi: &spi0 { compatible = "nordic,nrf-spim"; - sck-pin = <31>; - mosi-pin = <30>; - miso-pin = <25>; + pinctrl-0 = &spi0_default; + pinctrl-names = "default"; cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; }; diff --git a/app/boards/shields/nice_view_adapter/boards/nrfmicro_13.overlay b/app/boards/shields/nice_view_adapter/boards/nrfmicro_13.overlay index 9d9ab734..9a4f3170 100644 --- a/app/boards/shields/nice_view_adapter/boards/nrfmicro_13.overlay +++ b/app/boards/shields/nice_view_adapter/boards/nrfmicro_13.overlay @@ -4,11 +4,20 @@ * SPDX-License-Identifier: MIT */ +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; +}; + nice_view_spi: &spi0 { compatible = "nordic,nrf-spim"; - sck-pin = <17>; - mosi-pin = <15>; - miso-pin = <25>; + pinctrl-0 = &spi0_default; + pinctrl-names = "default"; cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; }; diff --git a/app/boards/shields/nice_view_adapter/boards/puchi_ble_v1.overlay b/app/boards/shields/nice_view_adapter/boards/puchi_ble_v1.overlay index 9d9ab734..9a4f3170 100644 --- a/app/boards/shields/nice_view_adapter/boards/puchi_ble_v1.overlay +++ b/app/boards/shields/nice_view_adapter/boards/puchi_ble_v1.overlay @@ -4,11 +4,20 @@ * SPDX-License-Identifier: MIT */ +&pinctrl { + spi0_default: spi0_default { + group1 { + psels = , + , + ; + }; + }; +}; + nice_view_spi: &spi0 { compatible = "nordic,nrf-spim"; - sck-pin = <17>; - mosi-pin = <15>; - miso-pin = <25>; + pinctrl-0 = &spi0_default; + pinctrl-names = "default"; cs-gpios = <&pro_micro 1 GPIO_ACTIVE_HIGH>; }; diff --git a/app/boards/shields/redox/boards/nice_nano.overlay b/app/boards/shields/redox/boards/nice_nano.overlay index d67e46f9..172859ae 100644 --- a/app/boards/shields/redox/boards/nice_nano.overlay +++ b/app/boards/shields/redox/boards/nice_nano.overlay @@ -1,18 +1,27 @@ -/* - * Copyright (c) 2021 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ +#include - #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -23,7 +32,7 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <5>; /* number of LEDs */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; diff --git a/app/boards/shields/redox/boards/nice_nano_v2.overlay b/app/boards/shields/redox/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..172859ae --- /dev/null +++ b/app/boards/shields/redox/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/reviung41/boards/nice_nano.overlay b/app/boards/shields/reviung41/boards/nice_nano.overlay index b52faac6..172859ae 100644 --- a/app/boards/shields/reviung41/boards/nice_nano.overlay +++ b/app/boards/shields/reviung41/boards/nice_nano.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <11>; /* arbitrary; change at will */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/reviung41/boards/nice_nano_v2.overlay b/app/boards/shields/reviung41/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..172859ae --- /dev/null +++ b/app/boards/shields/reviung41/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/romac_plus/boards/nice_nano.overlay b/app/boards/shields/romac_plus/boards/nice_nano.overlay index dc686af8..172859ae 100644 --- a/app/boards/shields/romac_plus/boards/nice_nano.overlay +++ b/app/boards/shields/romac_plus/boards/nice_nano.overlay @@ -1,31 +1,47 @@ -#include - -&spi1 { - compatible = "nordic,nrf-spim"; - status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; - - led_strip: ws2812@0 { - compatible = "worldsemi,ws2812-spi"; - label = "WS2812"; - - /* SPI */ - reg = <0>; /* ignored, but necessary for SPI bindings */ - spi-max-frequency = <4000000>; - - /* WS2812 */ - chain-length = <10>; /* arbitrary; change at will */ - spi-one-frame = <0x70>; - spi-zero-frame = <0x40>; - color-mapping = ; - }; -}; - -/ { - chosen { - zmk,underglow = &led_strip; - }; -}; \ No newline at end of file +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/romac_plus/boards/nice_nano_v2.overlay b/app/boards/shields/romac_plus/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..172859ae --- /dev/null +++ b/app/boards/shields/romac_plus/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/snap/boards/nice_nano.overlay b/app/boards/shields/snap/boards/nice_nano.overlay index f869db5d..15c5801e 100644 --- a/app/boards/shields/snap/boards/nice_nano.overlay +++ b/app/boards/shields/snap/boards/nice_nano.overlay @@ -1,18 +1,27 @@ -/* - * Copyright (c) 2022 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <10>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -23,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <5>; /* arbitrary; change at will */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/snap/boards/nice_nano_v2.overlay b/app/boards/shields/snap/boards/nice_nano_v2.overlay index f869db5d..15c5801e 100644 --- a/app/boards/shields/snap/boards/nice_nano_v2.overlay +++ b/app/boards/shields/snap/boards/nice_nano_v2.overlay @@ -1,18 +1,27 @@ -/* - * Copyright (c) 2022 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <10>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -23,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <5>; /* arbitrary; change at will */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/splitkb_aurora_corne/boards/nice_nano.overlay b/app/boards/shields/splitkb_aurora_corne/boards/nice_nano.overlay index 0087208c..172859ae 100644 --- a/app/boards/shields/splitkb_aurora_corne/boards/nice_nano.overlay +++ b/app/boards/shields/splitkb_aurora_corne/boards/nice_nano.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <6>; /* arbitrary; change at will */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/splitkb_aurora_corne/boards/nice_nano_v2.overlay b/app/boards/shields/splitkb_aurora_corne/boards/nice_nano_v2.overlay index 0087208c..172859ae 100644 --- a/app/boards/shields/splitkb_aurora_corne/boards/nice_nano_v2.overlay +++ b/app/boards/shields/splitkb_aurora_corne/boards/nice_nano_v2.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <6>; /* arbitrary; change at will */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/splitkb_aurora_lily58/boards/nice_nano.overlay b/app/boards/shields/splitkb_aurora_lily58/boards/nice_nano.overlay index eb838b24..4a6b717d 100644 --- a/app/boards/shields/splitkb_aurora_lily58/boards/nice_nano.overlay +++ b/app/boards/shields/splitkb_aurora_lily58/boards/nice_nano.overlay @@ -1,12 +1,28 @@ #include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; diff --git a/app/boards/shields/splitkb_aurora_lily58/boards/nice_nano_v2.overlay b/app/boards/shields/splitkb_aurora_lily58/boards/nice_nano_v2.overlay index eb838b24..ed03ed0d 100644 --- a/app/boards/shields/splitkb_aurora_lily58/boards/nice_nano_v2.overlay +++ b/app/boards/shields/splitkb_aurora_lily58/boards/nice_nano_v2.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; diff --git a/app/boards/shields/splitkb_aurora_sweep/boards/nice_nano.overlay b/app/boards/shields/splitkb_aurora_sweep/boards/nice_nano.overlay index 0087208c..172859ae 100644 --- a/app/boards/shields/splitkb_aurora_sweep/boards/nice_nano.overlay +++ b/app/boards/shields/splitkb_aurora_sweep/boards/nice_nano.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <6>; /* arbitrary; change at will */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/splitkb_aurora_sweep/boards/nice_nano_v2.overlay b/app/boards/shields/splitkb_aurora_sweep/boards/nice_nano_v2.overlay index 0087208c..172859ae 100644 --- a/app/boards/shields/splitkb_aurora_sweep/boards/nice_nano_v2.overlay +++ b/app/boards/shields/splitkb_aurora_sweep/boards/nice_nano_v2.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <6>; /* arbitrary; change at will */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/tg4x/boards/nice_nano.overlay b/app/boards/shields/tg4x/boards/nice_nano.overlay index fe7fbf18..62f20140 100644 --- a/app/boards/shields/tg4x/boards/nice_nano.overlay +++ b/app/boards/shields/tg4x/boards/nice_nano.overlay @@ -1,18 +1,27 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <8>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -23,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <7>; /* number of LEDs */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/tg4x/boards/nice_nano_v2.overlay b/app/boards/shields/tg4x/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..62f20140 --- /dev/null +++ b/app/boards/shields/tg4x/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/tidbit/boards/nice_nano.overlay b/app/boards/shields/tidbit/boards/nice_nano.overlay index d8a647e9..08379e30 100644 --- a/app/boards/shields/tidbit/boards/nice_nano.overlay +++ b/app/boards/shields/tidbit/boards/nice_nano.overlay @@ -1,18 +1,27 @@ -/* - * Copyright (c) 2020 The ZMK Contributors - * - * SPDX-License-Identifier: MIT - */ - #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <9>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -23,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <8>; /* number of LEDs */ + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/tidbit/boards/nice_nano_v2.overlay b/app/boards/shields/tidbit/boards/nice_nano_v2.overlay new file mode 100644 index 00000000..08379e30 --- /dev/null +++ b/app/boards/shields/tidbit/boards/nice_nano_v2.overlay @@ -0,0 +1,47 @@ +#include + +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi1 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + label = "WS2812"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <10>; /* arbitrary; change at will */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/app/boards/shields/two_percent_milk/boards/nice_nano.overlay b/app/boards/shields/two_percent_milk/boards/nice_nano.overlay index dd7e34c4..08379e30 100644 --- a/app/boards/shields/two_percent_milk/boards/nice_nano.overlay +++ b/app/boards/shields/two_percent_milk/boards/nice_nano.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <9>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <2>; + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/two_percent_milk/boards/nice_nano_v2.overlay b/app/boards/shields/two_percent_milk/boards/nice_nano_v2.overlay index dd7e34c4..08379e30 100644 --- a/app/boards/shields/two_percent_milk/boards/nice_nano_v2.overlay +++ b/app/boards/shields/two_percent_milk/boards/nice_nano_v2.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <9>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <2>; + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/two_percent_milk/boards/nrfmicro_11.overlay b/app/boards/shields/two_percent_milk/boards/nrfmicro_11.overlay index c2dab5a6..64d16572 100644 --- a/app/boards/shields/two_percent_milk/boards/nrfmicro_11.overlay +++ b/app/boards/shields/two_percent_milk/boards/nrfmicro_11.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <43>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <12>; // 0.12 is not broken out on the nRFMicro - miso-pin = <22>; // 0.22 is not broken out on the nRFMicro + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <2>; + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; @@ -29,4 +45,3 @@ zmk,underglow = &led_strip; }; }; - diff --git a/app/boards/shields/two_percent_milk/boards/nrfmicro_11_flipped.overlay b/app/boards/shields/two_percent_milk/boards/nrfmicro_11_flipped.overlay index e53b149a..b84beb93 100644 --- a/app/boards/shields/two_percent_milk/boards/nrfmicro_11_flipped.overlay +++ b/app/boards/shields/two_percent_milk/boards/nrfmicro_11_flipped.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <38>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <12>; // 0.12 is not broken out on the nRFMicro - miso-pin = <22>; // 0.22 is not broken out on the nRFMicro + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <2>; + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/app/boards/shields/two_percent_milk/boards/nrfmicro_13.overlay b/app/boards/shields/two_percent_milk/boards/nrfmicro_13.overlay index 252329b4..64d16572 100644 --- a/app/boards/shields/two_percent_milk/boards/nrfmicro_13.overlay +++ b/app/boards/shields/two_percent_milk/boards/nrfmicro_13.overlay @@ -1,12 +1,27 @@ #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <43>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <12>; // 0.12 is not broken out on the nRFMicro - miso-pin = <22>; // 0.22 is not broken out on the nRFMicro + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi"; @@ -17,9 +32,10 @@ spi-max-frequency = <4000000>; /* WS2812 */ - chain-length = <2>; + chain-length = <10>; /* arbitrary; change at will */ spi-one-frame = <0x70>; spi-zero-frame = <0x40>; + color-mapping = ; }; }; diff --git a/docs/docs/features/underglow.md b/docs/docs/features/underglow.md index 020701fd..c70ffffb 100644 --- a/docs/docs/features/underglow.md +++ b/docs/docs/features/underglow.md @@ -54,23 +54,33 @@ For example, the Kyria shield has a `boards/nice_nano.overlay` file that defines With nRF52 boards, you can just use `&spi1` and define the pins you want to use. -To identify which pin number you need to put in the config you need do to a bit of math. You need the hardware port and run it through a function. -**32 \* X + Y** = `` where X is first part of the hardware port "PX.01" and Y is the second part of the hardware port "P1.Y". - -(_P1.13_ would give you _32 \* 1 + 13_ = `<45>` and P0.15 would give you _32 \* 0 + 15_ = `<15>`) - Here's an example on a definition that uses P0.06: ``` #include +&pinctrl { + spi1_default: spi1_default { + group1 { + psels = ; + }; + }; + + spi1_sleep: spi1_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + &spi1 { compatible = "nordic,nrf-spim"; status = "okay"; - mosi-pin = <6>; - // Unused pins, needed for SPI definition, but not used by the ws2812 driver itself. - sck-pin = <5>; - miso-pin = <7>; + + pinctrl-0 = <&spi1_default>; + pinctrl-1 = <&spi1_sleep>; + pinctrl-names = "default", "sleep"; led_strip: ws2812@0 { compatible = "worldsemi,ws2812-spi";