Skip to content

Commit

Permalink
feat: firmware
Browse files Browse the repository at this point in the history
  • Loading branch information
plushugh committed May 26, 2024
1 parent eff6a94 commit e35d940
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 0 deletions.
6 changes: 6 additions & 0 deletions boards/shields/uh9/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if SHIELD_UH9

config ZMK_KEYBOARD_NAME
default "uh9"

endif # SHIELD_KNOB_GOBLIN
2 changes: 2 additions & 0 deletions boards/shields/uh9/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config SHIELD_UH9
def_bool $(shields_list_contains,uh9)
2 changes: 2 additions & 0 deletions boards/shields/uh9/uh9.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONFIG_EC11=y
CONFIG_EC11_TRIGGER_GLOBAL_THREAD=y
19 changes: 19 additions & 0 deletions boards/shields/uh9/uh9.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>

/ {
keymap {
compatible = "zmk,keymap";

default_layer {

bindings = <
&kp KP_NUMBER_1 &kp KP_NUMBER_2 &kp KP_NUMBER_3
&kp KP_NUMBER_4 &kp KP_NUMBER_5 &kp KP_NUMBER_6
&kp KP_NUMBER_7 &kp KP_NUMBER_8 &kp KP_NUMBER_9
>;

sensor-bindings = <&inc_dec_kp C_VOL_UP C_VOL_DN>;
};
};
};
42 changes: 42 additions & 0 deletions boards/shields/uh9/uh9.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zephyr,display = &oled;
zmk,kscan = &kscan0;
};

kscan0: kscan {
compatible = "zmk,kscan-gpio-matrix";
diode-direction = "col2row";
wakeup-source;

col-gpios
= <&gpio1 9 GPIO_ACTIVE_HIGH>
, <&gpio0 28 GPIO_ACTIVE_HIGH>
, <&gpio0 3 GPIO_ACTIVE_HIGH>
;

row-gpios
= <&gpio1 11 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio1 13 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&gpio0 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;

};

encoder: encoder {
compatible = "alps,ec11";
a-gpios = <&gpio0 29 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
b-gpios = <&gpio0 31 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
steps = <80>;
status = "okay";
};

sensors: sensors {
compatible = "zmk,keymap-sensors";
sensors = <&top_encoder>;
triggers-per-rotation = <20>;
};

};
10 changes: 10 additions & 0 deletions boards/shields/uh9/uh9.zmk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
file_format: "1"
id: uh9
name: uh9
type: shield
url: https://example.com
requires: []
exposes: []
features:
- keys
- encoder
2 changes: 2 additions & 0 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@
# artifact-name: corne_left_with_logging
#
---
board: ["nice_nano_v2"]
shield: ["uh9"]

0 comments on commit e35d940

Please sign in to comment.