Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
File renamed without changes.
6 changes: 6 additions & 0 deletions firmware/zmk/.github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
Empty file.
39 changes: 39 additions & 0 deletions firmware/zmk/boards/shields/yampad/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions firmware/zmk/boards/shields/yampad/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2025 The ZMK Contributors
# SPDX-License-Identifier: MIT

config SHIELD_YAMPAD
def_bool $(shields_list_contains,yampad)
46 changes: 46 additions & 0 deletions firmware/zmk/boards/shields/yampad/boards/nice_nano.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include <dt-bindings/led/led.h>

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

spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 31)>;
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 = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};

/ {
chosen {
zmk,underglow = &led_strip;
};
};
46 changes: 46 additions & 0 deletions firmware/zmk/boards/shields/yampad/boards/nice_nano_v2.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include <dt-bindings/led/led.h>

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

spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 31)>;
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 = <LED_COLOR_ID_GREEN LED_COLOR_ID_RED LED_COLOR_ID_BLUE>;
};
};

/ {
chosen {
zmk,underglow = &led_strip;
};
};
2 changes: 2 additions & 0 deletions firmware/zmk/boards/shields/yampad/yampad.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Uncomment to disable OLED
#CONFIG_ZMK_DISPLAY=n
29 changes: 29 additions & 0 deletions firmware/zmk/boards/shields/yampad/yampad.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright (c) 2025 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
#include <dt-bindings/zmk/outputs.h>
#include <dt-bindings/zmk/rgb.h>

/ {

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
>;
};
};
};
70 changes: 70 additions & 0 deletions firmware/zmk/boards/shields/yampad/yampad.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright (c) 2025 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/

#include <dt-bindings/zmk/matrix_transform.h>


/ {
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>;
};
};
10 changes: 10 additions & 0 deletions firmware/zmk/boards/shields/yampad/yampad.zmk.yml
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions firmware/zmk/build.yaml
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions firmware/zmk/config/west.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions firmware/zmk/zephyr/module.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build:
settings:
board_root: .