diff --git a/app/boards/makerdiary/nrf52840_m2/nrf52840_m2-pinctrl.dtsi b/app/boards/makerdiary/nrf52840_m2/nrf52840_m2-pinctrl.dtsi new file mode 100644 index 000000000..0a12efdf8 --- /dev/null +++ b/app/boards/makerdiary/nrf52840_m2/nrf52840_m2-pinctrl.dtsi @@ -0,0 +1,18 @@ +&pinctrl { + /* configuration for pwm device, default state */ + pwm0_default: pwm0_default { + group1 { + psels = , // LED 0 (red) + , // LED 1 (green) + ; // LED 2 (blue) + }; + }; + pwm0_sleep: pwm0_sleep { + group1 { + psels = , // LED 0 + , // LED 1 + ; // LED 2 + low-power-enable; + }; + }; +}; diff --git a/app/boards/makerdiary/nrf52840_m2/nrf52840_m2.dts b/app/boards/makerdiary/nrf52840_m2/nrf52840_m2.dts index f9ffee623..80b922c08 100644 --- a/app/boards/makerdiary/nrf52840_m2/nrf52840_m2.dts +++ b/app/boards/makerdiary/nrf52840_m2/nrf52840_m2.dts @@ -7,6 +7,7 @@ /dts-v1/; #include #include +#include "nrf52840_m2-pinctrl.dtsi" / { model = "Makerdiary nRF52840 M.2 module"; @@ -21,14 +22,17 @@ leds { compatible = "gpio-leds"; - red_led: led_0 { + led1_red: led_1 { gpios = <&gpio0 30 GPIO_ACTIVE_HIGH>; + label = "Red LED 1"; }; - green_led: led_1 { + led1_green: led_2 { gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>; + label = "Green LED 1"; }; - blue_led: led_2 { + led1_blue: led_3 { gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>; + label = "Blue LED 1"; }; }; @@ -38,7 +42,6 @@ output-ohms = <1000000>; full-ohms = <(1000000 + 1000000)>; }; - }; &adc { @@ -57,12 +60,18 @@ status = "okay"; }; +&pwm0 { + status = "okay"; + pinctrl-0 = <&pwm0_default>; + pinctrl-1 = <&pwm0_sleep>; + pinctrl-names = "default", "sleep"; +}; + zephyr_udc0: &usbd { compatible = "nordic,nrf-usbd"; status = "okay"; }; - &flash0 { /* * For more information, see: diff --git a/app/boards/makerdiary/nrf52840_m2/nrf52840_m2_defconfig b/app/boards/makerdiary/nrf52840_m2/nrf52840_m2_defconfig index d0b01539e..95e6d3132 100644 --- a/app/boards/makerdiary/nrf52840_m2/nrf52840_m2_defconfig +++ b/app/boards/makerdiary/nrf52840_m2/nrf52840_m2_defconfig @@ -18,4 +18,5 @@ CONFIG_FLASH_PAGE_LAYOUT=y CONFIG_FLASH_MAP=y CONFIG_ZMK_USB=y -CONFIG_ZMK_BLE=y \ No newline at end of file +CONFIG_ZMK_BLE=y +CONFIG_PINCTRL=y diff --git a/app/boards/shields/m60/Kconfig.defconfig b/app/boards/shields/m60/Kconfig.defconfig index a46969540..d162e623b 100644 --- a/app/boards/shields/m60/Kconfig.defconfig +++ b/app/boards/shields/m60/Kconfig.defconfig @@ -6,4 +6,10 @@ if SHIELD_M60 config ZMK_KEYBOARD_NAME default "m60" +config PWM + default y + +config LED_PWM + default y + endif diff --git a/app/boards/shields/m60/boards/nrf52840_m2.overlay b/app/boards/shields/m60/boards/nrf52840_m2.overlay new file mode 100644 index 000000000..80b4777a0 --- /dev/null +++ b/app/boards/shields/m60/boards/nrf52840_m2.overlay @@ -0,0 +1,31 @@ +&pinctrl { + /* configuration for i2c0 device, default state */ + i2c0_default: i2c0_default { + group1 { + psels = , + ; + }; + }; + + i2c0_sleep: i2c0_sleep { + group1 { + psels = , + ; + low-power-enable; + }; + }; +}; + +&i2c0 { + compatible = "nordic,nrf-twim"; + status = "okay"; + pinctrl-0 = <&i2c0_default>; + pinctrl-1 = <&i2c0_sleep>; + pinctrl-names = "default", "sleep"; + clock-frequency = ; + is31fl3733: is31fl3733@50 { + compatible = "issi,is31fl3733"; + reg = <0x50>; + sdb-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; + }; +}; diff --git a/app/boards/shields/m60/m60.keymap b/app/boards/shields/m60/m60.keymap index 7fa07bbb7..254dbadf3 100644 --- a/app/boards/shields/m60/m60.keymap +++ b/app/boards/shields/m60/m60.keymap @@ -14,13 +14,18 @@ default_layer { display-name = "Default Layer"; -// ------------------------------------------------------------------------------------------ -// | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BSPC | -// | TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | -// | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | -// | SHIFT | Z | X | C | V | B | N | M | , | . | / | SHIFT | -// | CTL | WIN | ALT | SPACE | ALT | MO(1) | WIN | CTRL | -// ------------------------------------------------------------------------------------------ + + // ╭─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────────╮ + // | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ⌫ | + // |─────┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───────| + // | ─>| | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + // |───────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴───────| + // | CAPS | A | S | D | F | G | H | J | K | L | ; | ' | ↵ | + // |────────┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴────────────| + // | ⇧ | Z | X | C | V | B | N | M | , | . | / | ⇧ | + // |──────┬───┴──┬──┴──┬──┴─────┴─────┴─────┴─────┴─────┴───┬─┴─────┼─────┴┬──────┬────────| + // | Ctrl | Win | Alt | | Alt | MO(1)| WIN | Ctrl | + // ╰──────┴──────┴─────┴────────────────────────────────────┴───────┴──────┴──────┴────────╯ bindings = < &kp ESC &kp N1 &kp N2 &kp N3 &kp N4 &kp N5 &kp N6 &kp N7 &kp N8 &kp N9 &kp N0 &kp MINUS &kp EQUAL &kp BSPC &kp TAB &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp LBKT &kp RBKT &kp BSLH @@ -32,9 +37,21 @@ fn_layer { display-name = "Fn Layer"; + + // ╭─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────────╮ + // | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | BOOT | + // |─────┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───────| + // | ─>| | BTc | BLt | BLc | | | | | | | | | | reset | + // |───────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴┬────┴───────| + // | CAPS | BT0 | BT1 | BT2 | BT3 | BT4 | ← | ↓ | ↑ | → | | | ↵ | + // |────────┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴────────────| + // | ⇧ | | | | | | | | | | | ⇧ | + // |──────┬───┴──┬──┴──┬──┴─────┴─────┴─────┴─────┴─────┴───┬─┴─────┼─────┴┬──────┬────────| + // | Ctrl | Win | alt | | alt | MO(1)| WIN | Ctrl | + // ╰──────┴──────┴─────┴────────────────────────────────────┴───────┴──────┴──────┴────────╯ bindings = < &kp GRAVE &kp F1 &kp F2 &kp F3 &kp F4 &kp F5 &kp F6 &kp F7 &kp F8 &kp F9 &kp F10 &kp F11 &kp F12 &bootloader -&trans &bt BT_CLR &none &none &none &none &none &none &none &none &none &none &none &sys_reset +&trans &bt BT_CLR &bl BL_TOG &bl BL_CYCLE &none &none &none &none &none &none &none &none &none &sys_reset &trans &bt BT_SEL 0 &bt BT_SEL 1 &bt BT_SEL 2 &bt BT_SEL 3 &bt BT_SEL 4 &kp LEFT &kp DOWN &kp UP &kp RIGHT &none &none &trans &trans &none &none &none &none &none &none &none &none &none &none &trans &trans &trans &trans &trans &trans &trans &trans &trans diff --git a/app/boards/shields/m60/m60.overlay b/app/boards/shields/m60/m60.overlay index 15690f524..5861e281a 100644 --- a/app/boards/shields/m60/m60.overlay +++ b/app/boards/shields/m60/m60.overlay @@ -58,6 +58,19 @@ RC(6,4) RC(6,3) RC(6,2) RC(6,1) RC(6,0) RC(5,7) RC(5,6) RC(5,5) RC(5,4) RC RC(6,5) RC(6,6) RC(6,7) RC(7,0) RC(7,1) RC(7,2) RC(7,3) RC(7,4) >; }; + + pwmleds: pwmleds { + compatible = "pwm-leds"; + red_pwm_led: pwm_led_0 { + pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + green_pwm_led: pwm_led_1 { + pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + blue_pwm_led: pwm_led_2 { + pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_NORMAL>; + }; + }; }; &layout_60_ansi {