Skip to content

Commit

Permalink
Add Pinctrl functions, change reset to sys_reset
Browse files Browse the repository at this point in the history
  • Loading branch information
ReFil committed Apr 9, 2023
1 parent e1a30ce commit 0a88737
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 22 deletions.
32 changes: 11 additions & 21 deletions config/boards/arm/bt65/bt65.dts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#include <dt-bindings/led/led.h>
#include <dt-bindings/zmk/matrix_transform.h>

#include "pinctrl.dtsi"

/ {
model = "BT65";
compatible = "polarityworks,bt65";
Expand Down Expand Up @@ -110,8 +112,7 @@
compatible = "pwm-leds";
label = "Backlight LEDs";
pwm_led_0 {
pwms = <&pwm0 17>;
label = "Backlight LED 0";
pwms = <&pwm0 0 10000 PWM_POLARITY_NORMAL>;
};
};

Expand All @@ -138,7 +139,9 @@

&pwm0 {
status = "okay";
ch0-pin = <17>;
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};

&gpiote {
Expand All @@ -153,18 +156,6 @@
status = "okay";
};

&i2c0 {
compatible = "nordic,nrf-twi";
sda-pin = <17>;
scl-pin = <20>;
};

&uart0 {
compatible = "nordic,nrf-uarte";
tx-pin = <6>;
rx-pin = <8>;
};

&usbd {
status = "okay";
};
Expand Down Expand Up @@ -210,20 +201,19 @@
};
};

&spi1 {
&spi3 {
compatible = "nordic,nrf-spim";
status = "okay";
mosi-pin = <20>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <27>;
miso-pin = <11>;
pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";

led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "WS2812";

/* SPI */
reg = <0>;
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;

/* WS2812 */
Expand Down
3 changes: 3 additions & 0 deletions config/boards/arm/bt65/bt65_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ CONFIG_ARM_MPU=y
# enable GPIO
CONFIG_GPIO=y

CONFIG_PINCTRL=y

# encoder
CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
Expand All @@ -23,6 +25,7 @@ CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_FLASH_MAP=y

CONFIG_SPI=y
CONFIG_ZMK_RGB_UNDERGLOW=y
CONFIG_ZMK_RGB_UNDERGLOW_EXT_POWER=y
CONFIG_ZMK_RGB_UNDERGLOW_ON_START=y
Expand Down
30 changes: 30 additions & 0 deletions config/boards/arm/bt65/pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2022 The ZMK Contributors
* SPDX-License-Identifier: MIT
*/

&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 20)>;
};
};

spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 20)>;
low-power-enable;
};
};
pwm0_default: pwm0_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 17)>;
};
};
pwm0_sleep: pwm0_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 17)>;
low-power-enable;
};
};
};
2 changes: 1 addition & 1 deletion config/bt65.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
bindings = <
&kp ESC &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &bl BL_TOG &rgb_ug RGB_TOG
&trans &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &rgb_ug RGB_HUI
&trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &reset &bootloader &rgb_ug RGB_HUD
&trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &sys_reset &bootloader &rgb_ug RGB_HUD
&kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &trans &trans &trans &trans &trans &trans &kp END &kp PG_DN &kp C_NEXT &trans &bl BL_INC
&bt BT_PRV &bt BT_NXT &trans &trans &trans &trans &trans &bt BT_CLR &trans &bl BL_DEC
>;
Expand Down

0 comments on commit 0a88737

Please sign in to comment.