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 c067c08 commit 2b7c7e2
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 9 deletions.
18 changes: 10 additions & 8 deletions config/boards/arm/bt75/bt75.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 = "BT75";
compatible = "polarityworks,bt75";
Expand Down Expand Up @@ -111,8 +113,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 @@ -139,7 +140,9 @@

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

&gpiote {
Expand Down Expand Up @@ -199,13 +202,12 @@
};
};

&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 = <8>;
pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";

led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
Expand Down
3 changes: 3 additions & 0 deletions config/boards/arm/bt75/bt75_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/bt75/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/bt75.keymap
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
bindings = <
&trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans &trans
&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 &reset &rgb_ug RGB_HUI
&trans &trans &kp UP &trans &trans &trans &trans &trans &kp INS &trans &kp PSCRN &kp SLCK &kp PAUSE_BREAK &sys_reset &rgb_ug RGB_HUI
&trans &kp LEFT &kp DOWN &kp RIGHT &trans &trans &trans &trans &trans &trans &kp HOME &kp PG_UP &bootloader &rgb_ug RGB_HUD
&kp C_PREV &kp C_VOL_DN &kp C_VOL_UP &kp C_MUTE &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 &bt BT_CLR &trans &trans &bl BL_DEC
Expand Down

0 comments on commit 2b7c7e2

Please sign in to comment.