diff --git a/firmware/via_support/Yampad.json b/firmware/qmk/via_support/Yampad.json similarity index 100% rename from firmware/via_support/Yampad.json rename to firmware/qmk/via_support/Yampad.json diff --git a/firmware/via_support/yampad_via.hex b/firmware/qmk/via_support/yampad_via.hex similarity index 100% rename from firmware/via_support/yampad_via.hex rename to firmware/qmk/via_support/yampad_via.hex diff --git a/firmware/yampad_default.hex b/firmware/qmk/yampad_default.hex similarity index 100% rename from firmware/yampad_default.hex rename to firmware/qmk/yampad_default.hex diff --git a/firmware/zmk/.github/workflows/build.yml b/firmware/zmk/.github/workflows/build.yml new file mode 100644 index 0000000..18f82cd --- /dev/null +++ b/firmware/zmk/.github/workflows/build.yml @@ -0,0 +1,6 @@ +name: Build ZMK firmware +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + uses: zmkfirmware/zmk/.github/workflows/build-user-config.yml@v0.3 diff --git a/firmware/zmk/boards/shields/.gitkeep b/firmware/zmk/boards/shields/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/firmware/zmk/boards/shields/yampad/Kconfig.defconfig b/firmware/zmk/boards/shields/yampad/Kconfig.defconfig new file mode 100644 index 0000000..af94476 --- /dev/null +++ b/firmware/zmk/boards/shields/yampad/Kconfig.defconfig @@ -0,0 +1,39 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +if SHIELD_YAMPAD + +config ZMK_KEYBOARD_NAME + default "YamPad" + +config ZMK_DISPLAY + default y + +if ZMK_DISPLAY + +config I2C + default y + +config SSD1306 + default y + +endif # ZMK_DISPLAY + +if LVGL + +config LV_Z_VDB_SIZE + default 64 + +config LV_DPI_DEF + default 148 + +config LV_Z_BITS_PER_PIXEL + default 1 + +choice LV_COLOR_DEPTH + default LV_COLOR_DEPTH_1 +endchoice + +endif # LVGL + +endif diff --git a/firmware/zmk/boards/shields/yampad/Kconfig.shield b/firmware/zmk/boards/shields/yampad/Kconfig.shield new file mode 100644 index 0000000..cd48044 --- /dev/null +++ b/firmware/zmk/boards/shields/yampad/Kconfig.shield @@ -0,0 +1,5 @@ +# Copyright (c) 2025 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config SHIELD_YAMPAD + def_bool $(shields_list_contains,yampad) \ No newline at end of file diff --git a/firmware/zmk/boards/shields/yampad/boards/nice_nano.overlay b/firmware/zmk/boards/shields/yampad/boards/nice_nano.overlay new file mode 100644 index 0000000..21bb17b --- /dev/null +++ b/firmware/zmk/boards/shields/yampad/boards/nice_nano.overlay @@ -0,0 +1,46 @@ +#include + +&pinctrl { + spi3_default: spi3_default { + group1 { + psels = ; + }; + }; + + spi3_sleep: spi3_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi3 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi3_default>; + pinctrl-1 = <&spi3_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <8>; /* number of SMD LED footprints on PCB */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/firmware/zmk/boards/shields/yampad/boards/nice_nano_v2.overlay b/firmware/zmk/boards/shields/yampad/boards/nice_nano_v2.overlay new file mode 100644 index 0000000..21bb17b --- /dev/null +++ b/firmware/zmk/boards/shields/yampad/boards/nice_nano_v2.overlay @@ -0,0 +1,46 @@ +#include + +&pinctrl { + spi3_default: spi3_default { + group1 { + psels = ; + }; + }; + + spi3_sleep: spi3_sleep { + group1 { + psels = ; + low-power-enable; + }; + }; +}; + +&spi3 { + compatible = "nordic,nrf-spim"; + status = "okay"; + + pinctrl-0 = <&spi3_default>; + pinctrl-1 = <&spi3_sleep>; + pinctrl-names = "default", "sleep"; + + led_strip: ws2812@0 { + compatible = "worldsemi,ws2812-spi"; + + /* SPI */ + reg = <0>; /* ignored, but necessary for SPI bindings */ + spi-max-frequency = <4000000>; + + /* WS2812 */ + chain-length = <8>; /* number of SMD LED footprints on PCB */ + spi-one-frame = <0x70>; + spi-zero-frame = <0x40>; + + color-mapping = ; + }; +}; + +/ { + chosen { + zmk,underglow = &led_strip; + }; +}; diff --git a/firmware/zmk/boards/shields/yampad/yampad.conf b/firmware/zmk/boards/shields/yampad/yampad.conf new file mode 100644 index 0000000..2acb604 --- /dev/null +++ b/firmware/zmk/boards/shields/yampad/yampad.conf @@ -0,0 +1,2 @@ +# Uncomment to disable OLED +#CONFIG_ZMK_DISPLAY=n \ No newline at end of file diff --git a/firmware/zmk/boards/shields/yampad/yampad.keymap b/firmware/zmk/boards/shields/yampad/yampad.keymap new file mode 100644 index 0000000..ec1368f --- /dev/null +++ b/firmware/zmk/boards/shields/yampad/yampad.keymap @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2025 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include +#include +#include +#include +#include + +/ { + + keymap: keymap { + compatible = "zmk,keymap"; + + default_layer { + display-name = "default"; + bindings = < + &kp KP_NUM &kp KP_DIVIDE &kp KP_MULTIPLY &kp KP_MINUS + &kp KP_N7 &kp KP_N8 &kp KP_N9 + &kp KP_N4 &kp KP_N5 &kp KP_N6 &kp KP_PLUS + &kp KP_N1 &kp KP_N2 &kp KP_N3 &kp KP_ENTER + &kp KP_N0 &kp KP_N0 &kp KP_DOT + >; + }; + }; +}; diff --git a/firmware/zmk/boards/shields/yampad/yampad.overlay b/firmware/zmk/boards/shields/yampad/yampad.overlay new file mode 100644 index 0000000..643d60a --- /dev/null +++ b/firmware/zmk/boards/shields/yampad/yampad.overlay @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2025 The ZMK Contributors + * + * SPDX-License-Identifier: MIT + */ + +#include + + +/ { + chosen { + zephyr,display = &oled; + zmk,kscan = &kscan; + zmk,matrix-transform = &default_transform; + }; + + kscan: kscan { + compatible = "zmk,kscan-gpio-matrix"; + wakeup-source; + + diode-direction = "col2row"; + row-gpios + = <&pro_micro 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 6 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 8 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + , <&pro_micro 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)> + ; + col-gpios + = <&pro_micro 15 GPIO_ACTIVE_HIGH> + , <&pro_micro 14 GPIO_ACTIVE_HIGH> + , <&pro_micro 16 GPIO_ACTIVE_HIGH> + , <&pro_micro 10 GPIO_ACTIVE_HIGH> + ; + }; + + default_transform: keymap_transform_0 { + compatible = "zmk,matrix-transform"; + columns = <4>; + rows = <5>; + map = < + RC(0,0) RC(0,1) RC(0,2) RC(0,3) + RC(1,0) RC(1,1) RC(1,2) + RC(2,0) RC(2,1) RC(2,2) RC(1,3) + RC(3,0) RC(3,1) RC(3,2) RC(4,3) + RC(4,0) RC(4,1) RC(4,2) + >; + }; + +}; + +&pro_micro_i2c { + status = "okay"; + + oled: ssd1306@3c { + compatible = "solomon,ssd1306fb"; + reg = <0x3c>; + width = <128>; + height = <32>; + segment-offset = <0>; + page-offset = <0>; + display-offset = <0>; + multiplex-ratio = <31>; + segment-remap; + com-invdir; + com-sequential; + inversion-on; + prechargep = <0x22>; + }; +}; diff --git a/firmware/zmk/boards/shields/yampad/yampad.zmk.yml b/firmware/zmk/boards/shields/yampad/yampad.zmk.yml new file mode 100644 index 0000000..98b956f --- /dev/null +++ b/firmware/zmk/boards/shields/yampad/yampad.zmk.yml @@ -0,0 +1,10 @@ +file_format: "1" +id: yampad +name: Yampad +type: shield +url: https://github.com/mattdibi/yampad +requires: [pro_micro] +exposes: [i2c_oled] +features: + - keys + - display diff --git a/firmware/zmk/build.yaml b/firmware/zmk/build.yaml new file mode 100644 index 0000000..84a4028 --- /dev/null +++ b/firmware/zmk/build.yaml @@ -0,0 +1,25 @@ +# This file generates the GitHub Actions matrix. +# For simple board + shield combinations, add them to the top level board and +# shield arrays, for more control, add individual board + shield combinations +# to the `include` property. You can also use the `cmake-args` property to +# pass flags to the build command, `snippet` to add a Zephyr snippet, and +# `artifact-name` to assign a name to distinguish build outputs from each other: +# +# board: [ "nice_nano_v2" ] +# shield: [ "corne_left", "corne_right" ] +# include: +# - board: bdn9_rev2 +# - board: nice_nano_v2 +# shield: reviung41 +# - board: nice_nano_v2 +# shield: corne_left +# snippet: studio-rpc-usb-uart +# cmake-args: -DCONFIG_ZMK_STUDIO=y +# artifact-name: corne_left_with_studio +# +--- +include: + - board: nice_nano_v2 + shield: yampad + - board: nice_nano_v2 + shield: settings_reset \ No newline at end of file diff --git a/firmware/zmk/config/west.yml b/firmware/zmk/config/west.yml new file mode 100644 index 0000000..d99f6e6 --- /dev/null +++ b/firmware/zmk/config/west.yml @@ -0,0 +1,14 @@ +manifest: + defaults: + revision: v0.3 + remotes: + - name: zmkfirmware + url-base: https://github.com/zmkfirmware + # Additional modules containing boards/shields/custom code can be listed here as well + # See https://docs.zephyrproject.org/3.2.0/develop/west/manifest.html#projects + projects: + - name: zmk + remote: zmkfirmware + import: app/west.yml + self: + path: config diff --git a/firmware/zmk/zephyr/module.yml b/firmware/zmk/zephyr/module.yml new file mode 100644 index 0000000..1cc2b35 --- /dev/null +++ b/firmware/zmk/zephyr/module.yml @@ -0,0 +1,3 @@ +build: + settings: + board_root: .