diff --git a/app/boards/rpi_pico.conf b/app/boards/rpi_pico.conf index f0db8ed14..286ec25ab 100644 --- a/app/boards/rpi_pico.conf +++ b/app/boards/rpi_pico.conf @@ -3,3 +3,10 @@ CONFIG_SERIAL=n CONFIG_UART_CONSOLE=n CONFIG_UART_INTERRUPT_DRIVEN=n CONFIG_ZMK_USB=y + +CONFIG_MPU_ALLOW_FLASH_WRITE=y +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 diff --git a/app/boards/rpi_pico.overlay b/app/boards/rpi_pico.overlay new file mode 100644 index 000000000..5368ab290 --- /dev/null +++ b/app/boards/rpi_pico.overlay @@ -0,0 +1,15 @@ + +&uart0 { status = "disabled"; }; + +&code_partition { + reg = <0x100 (DT_SIZE_M(2) - 0x100 - DT_SIZE_K(512))>; +}; + +&flash0 { + partitions { + storage_partition: partition@180000 { + reg = <0x180000 DT_SIZE_K(512)>; + read-only; + }; + }; +}; diff --git a/app/boards/shields/tester_rpi_pico/Kconfig.defconfig b/app/boards/shields/tester_rpi_pico/Kconfig.defconfig new file mode 100644 index 000000000..740c6b676 --- /dev/null +++ b/app/boards/shields/tester_rpi_pico/Kconfig.defconfig @@ -0,0 +1,12 @@ +if SHIELD_TESTER_RPI_PICO + +config ZMK_KEYBOARD_NAME + default "ZMK Tester" + +config ZMK_BLE + def_bool n + +config SETTINGS + def_bool n + +endif \ No newline at end of file diff --git a/app/boards/shields/tester_rpi_pico/Kconfig.shield b/app/boards/shields/tester_rpi_pico/Kconfig.shield new file mode 100644 index 000000000..19246d180 --- /dev/null +++ b/app/boards/shields/tester_rpi_pico/Kconfig.shield @@ -0,0 +1,2 @@ +config SHIELD_TESTER_RPI_PICO + def_bool $(shields_list_contains,tester_rpi_pico) \ No newline at end of file diff --git a/app/boards/shields/tester_rpi_pico/tester_rpi_pico-layouts.dtsi b/app/boards/shields/tester_rpi_pico/tester_rpi_pico-layouts.dtsi new file mode 100644 index 000000000..77eda01ee --- /dev/null +++ b/app/boards/shields/tester_rpi_pico/tester_rpi_pico-layouts.dtsi @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2025 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include + +/ { + tester_position_map { + compatible = "zmk,physical-layout-position-map"; + complete; + + pinout_map: pinout_positions { + physical-layout = <&physical_layout0>; + positions = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25>; + }; + inline_map: single_row_positions { + physical-layout = <&physical_layout1>; + positions = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25>; + }; + }; + + physical_layout0: physical_layout_0 { + compatible = "zmk,physical-layout"; + display-name = "Rpi Pico Pinout"; + + kscan = <&kscan0>; + transform = <&matrix_transform0>; + + keys // w h x y rot rx ry + = <&key_physical_attrs 100 100 0 0 0 0 0> + , <&key_physical_attrs 100 100 0 100 0 0 0> + , <&key_physical_attrs 100 100 0 300 0 0 0> + , <&key_physical_attrs 100 100 0 400 0 0 0> + , <&key_physical_attrs 100 100 0 500 0 0 0> + , <&key_physical_attrs 100 100 0 600 0 0 0> + , <&key_physical_attrs 100 100 0 800 0 0 0> + , <&key_physical_attrs 100 100 0 900 0 0 0> + , <&key_physical_attrs 100 100 0 1000 0 0 0> + , <&key_physical_attrs 100 100 0 1100 0 0 0> + , <&key_physical_attrs 100 100 0 1300 0 0 0> + , <&key_physical_attrs 100 100 0 1400 0 0 0> + , <&key_physical_attrs 100 100 0 1500 0 0 0> + , <&key_physical_attrs 100 100 0 1600 0 0 0> + , <&key_physical_attrs 100 100 0 1800 0 0 0> + , <&key_physical_attrs 100 100 0 1900 0 0 0> + , <&key_physical_attrs 100 100 600 1900 0 0 0> + , <&key_physical_attrs 100 100 600 1800 0 0 0> + , <&key_physical_attrs 100 100 600 1600 0 0 0> + , <&key_physical_attrs 100 100 600 1500 0 0 0> + , <&key_physical_attrs 100 100 600 1400 0 0 0> + , <&key_physical_attrs 100 100 600 1300 0 0 0> + , <&key_physical_attrs 100 100 600 1100 0 0 0> + , <&key_physical_attrs 100 100 600 900 0 0 0> + , <&key_physical_attrs 100 100 600 800 0 0 0> + , <&key_physical_attrs 100 100 600 600 0 0 0> + ; + }; + + physical_layout1: physical_layout_1 { + compatible = "zmk,physical-layout"; + display-name = "Single Row"; + + // Single row of eighteen "keys", in ascending "Arduino" order. + keys // w h x y rot rx ry + = <&key_physical_attrs 100 100 0 0 0 0 0> + , <&key_physical_attrs 100 100 100 0 0 0 0> + , <&key_physical_attrs 100 100 200 0 0 0 0> + , <&key_physical_attrs 100 100 300 0 0 0 0> + , <&key_physical_attrs 100 100 400 0 0 0 0> + , <&key_physical_attrs 100 100 500 0 0 0 0> + , <&key_physical_attrs 100 100 600 0 0 0 0> + , <&key_physical_attrs 100 100 700 0 0 0 0> + , <&key_physical_attrs 100 100 800 0 0 0 0> + , <&key_physical_attrs 100 100 900 0 0 0 0> + , <&key_physical_attrs 100 100 1000 0 0 0 0> + , <&key_physical_attrs 100 100 1100 0 0 0 0> + , <&key_physical_attrs 100 100 1200 0 0 0 0> + , <&key_physical_attrs 100 100 1300 0 0 0 0> + , <&key_physical_attrs 100 100 1400 0 0 0 0> + , <&key_physical_attrs 100 100 1500 0 0 0 0> + , <&key_physical_attrs 100 100 1600 0 0 0 0> + , <&key_physical_attrs 100 100 1700 0 0 0 0> + , <&key_physical_attrs 100 100 1800 0 0 0 0> + , <&key_physical_attrs 100 100 1900 0 0 0 0> + , <&key_physical_attrs 100 100 2000 0 0 0 0> + , <&key_physical_attrs 100 100 2100 0 0 0 0> + , <&key_physical_attrs 100 100 2200 0 0 0 0> + , <&key_physical_attrs 100 100 2300 0 0 0 0> + , <&key_physical_attrs 100 100 2400 0 0 0 0> + , <&key_physical_attrs 100 100 2500 0 0 0 0> + ; + }; +}; diff --git a/app/boards/shields/tester_rpi_pico/tester_rpi_pico.keymap b/app/boards/shields/tester_rpi_pico/tester_rpi_pico.keymap new file mode 100644 index 000000000..f938b5ea4 --- /dev/null +++ b/app/boards/shields/tester_rpi_pico/tester_rpi_pico.keymap @@ -0,0 +1,77 @@ +#include +#include + +#define PIN_MACRO(name, pin) \ +/ { \ + macros { \ + name: name { \ + compatible = "zmk,behavior-macro"; \ + wait-ms = <5>; \ + tap-ms = <5>; \ + #binding-cells = <0>; \ + bindings = <&kp P &kp I &kp N &kp SPACE>, pin, <&kp ENTER>; \ + }; \ + }; \ +}; + +PIN_MACRO(pin0, <&kp N0>) +PIN_MACRO(pin1, <&kp N1>) +PIN_MACRO(pin2, <&kp N2>) +PIN_MACRO(pin3, <&kp N3>) +PIN_MACRO(pin4, <&kp N4>) +PIN_MACRO(pin5, <&kp N5>) +PIN_MACRO(pin6, <&kp N6>) +PIN_MACRO(pin7, <&kp N7>) +PIN_MACRO(pin8, <&kp N8>) +PIN_MACRO(pin9, <&kp N9>) +PIN_MACRO(pin10, <&kp N1 &kp N0>) +PIN_MACRO(pin11, <&kp N1 &kp N1>) +PIN_MACRO(pin12, <&kp N1 &kp N2>) +PIN_MACRO(pin13, <&kp N1 &kp N3>) +PIN_MACRO(pin14, <&kp N1 &kp N4>) +PIN_MACRO(pin15, <&kp N1 &kp N5>) +PIN_MACRO(pin16, <&kp N1 &kp N6>) +PIN_MACRO(pin17, <&kp N1 &kp N7>) +PIN_MACRO(pin18, <&kp N1 &kp N8>) +PIN_MACRO(pin19, <&kp N1 &kp N9>) +PIN_MACRO(pin20, <&kp N2 &kp N0>) +PIN_MACRO(pin21, <&kp N2 &kp N1>) +PIN_MACRO(pin22, <&kp N2 &kp N2>) +PIN_MACRO(pin26, <&kp N2 &kp N6>) +PIN_MACRO(pin27, <&kp N2 &kp N7>) +PIN_MACRO(pin28, <&kp N2 &kp N8>) + +/ { + keymap { + compatible = "zmk,keymap"; + + default_layer { + bindings = <&pin0 + &pin1 + &pin2 + &pin3 + &pin4 + &pin5 + &pin6 + &pin7 + &pin8 + &pin9 + &pin10 + &pin11 + &pin12 + &pin13 + &pin14 + &pin15 + &pin16 + &pin17 + &pin18 + &pin19 + &pin20 + &pin21 + &pin22 + &pin26 + &pin27 + &pin28>; + }; + }; +}; \ No newline at end of file diff --git a/app/boards/shields/tester_rpi_pico/tester_rpi_pico.overlay b/app/boards/shields/tester_rpi_pico/tester_rpi_pico.overlay new file mode 100644 index 000000000..6fcacd708 --- /dev/null +++ b/app/boards/shields/tester_rpi_pico/tester_rpi_pico.overlay @@ -0,0 +1,63 @@ +#include +#include "tester_rpi_pico-layouts.dtsi" + +&physical_layout0 { + transform = <&transform0>; +}; + +&physical_layout1 { + transform = <&transform0>; +}; + +/ { + chosen { + zmk,kscan = &kscan0; + zmk,physical-layout = &physical_layout0; + }; + + kscan0: kscan { + compatible = "zmk,kscan-gpio-direct"; + wakeup-source; + debounce-press-ms = <10>; + debounce-release-ms = <10>; + input-gpios + = <&pico_header 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 2 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 18 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 20 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 21 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 22 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 26 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 27 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + , <&pico_header 28 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)> + ; + }; + + transform0: keymap_transform { + compatible = "zmk,matrix-transform"; + columns = <26>; + rows = <1>; + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,7) RC(0,8) RC(0,9) + RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(0,14) RC(0,15) RC(0,16) RC(0,17) RC(0,18) RC(0,19) + RC(0,20) RC(0,21) RC(0,22) RC(0,23) RC(0,24) RC(0,25) + >; + }; +}; diff --git a/app/boards/shields/tester_rpi_pico/tester_rpi_pico.zmk.yml b/app/boards/shields/tester_rpi_pico/tester_rpi_pico.zmk.yml new file mode 100644 index 000000000..560eca586 --- /dev/null +++ b/app/boards/shields/tester_rpi_pico/tester_rpi_pico.zmk.yml @@ -0,0 +1,6 @@ +file_format: "1" +id: tester_rpi_pico +name: TesterRpiPico +type: shield +url: https://zmk.dev/docs/troubleshooting/hardware-issues +requires: [rpi_pico]