Skip to content

Commit

Permalink
init hana
Browse files Browse the repository at this point in the history
  • Loading branch information
numToStr committed May 12, 2024
1 parent cb75b0c commit 4aa4a34
Show file tree
Hide file tree
Showing 12 changed files with 160 additions and 3 deletions.
2 changes: 1 addition & 1 deletion boards/shields/hammer40/hammer40.conf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ CONFIG_BT_CTLR_TX_PWR_PLUS_8=y
# Enable deep sleep
CONFIG_ZMK_SLEEP=y

# Set NFC Pins on Xaio as GPIO - Do this only once then comment out
# Set NFC Pins on Xiao as GPIO
CONFIG_NFCT_PINS_AS_GPIOS=y

# Turn on logging, and set ZMK logging to debug output
Expand Down
23 changes: 23 additions & 0 deletions boards/shields/hana/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
if SHIELD_HANA_LEFT

config ZMK_KEYBOARD_NAME
default "hana"

config ZMK_SPLIT_ROLE_CENTRAL
default y

endif

if SHIELD_HANA_RIGHT

config ZMK_KEYBOARD_NAME
default "hana.right"

endif

if SHIELD_HANA_LEFT || SHIELD_HANA_RIGHT

config ZMK_SPLIT
default y

endif
5 changes: 5 additions & 0 deletions boards/shields/hana/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
config SHIELD_HANA_LEFT
def_bool $(shields_list_contains,hana_left)

config SHIELD_HANA_RIGHT
def_bool $(shields_list_contains,hana_right)
2 changes: 2 additions & 0 deletions boards/shields/hana/hana.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Set NFC Pins on Xiao as GPIO
CONFIG_NFCT_PINS_AS_GPIOS=y
66 changes: 66 additions & 0 deletions boards/shields/hana/hana.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#include <dt-bindings/zmk/matrix_transform.h>

// &pinctrl {
// /* configuration for uart0 device, default state */
// uart0_default: uart0_default {
// /* group 1 ('group1' name is arbitrary) */
// group1 {
// psels = <NRF_PSEL(UART_TX, 0, 6)>;
// };
// /* group 2 */
// group2 {
// /* configure P0.3 as UART_RX */
// psels = <NRF_PSEL(UART_RX, 0, 8)>;
// // bias-pull-up;
// };
// };
// };

// &uart0 {
// status = "okay";
// current-speed = <115200>;
// pinctrl-0 = <&uart0_default>;
// pinctrl-names = "default", "sleep";
// // pinctrl-names = "default";
// };

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &test_transform;
// zmk,split-uart = &uart0;
};

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

diode-direction = "col2row";

row-gpios
= <&xiao_d 0 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
, <&xiao_d 1 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};

default_transform: default_transform {
compatible = "zmk,matrix-transform";
columns = <16>;
rows = <3>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5) RC(0,6) RC(0,9) RC(0,10) RC(0,11) RC(0,12) RC(0,13) RC(0,14) RC(0,15)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7) RC(1,8) RC(1,9) RC(1,10) RC(1,11) RC(1,12) RC(1,13) RC(1,14) RC(1,15)
RC(2,0) RC(2,1) RC(2,2) RC(2,3) RC(2,4) RC(2,5) RC(2,6) RC(2,7) RC(2,8) RC(2,9) RC(2,10) RC(2,11) RC(2,12) RC(2,13) RC(2,14) RC(2,15)
>;
};

test_transform: test_transform {
compatible = "zmk,matrix-transform";
columns = <6>;
rows = <2>;
map = <
RC(0,0) RC(0,1) RC(0,2) RC(0,3) RC(0,4) RC(0,5)
RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5)
>;
};
};
17 changes: 17 additions & 0 deletions boards/shields/hana/hana.keymap
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>

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

default_layer {
display-name = "base";
bindings = <
&kp TAB &kp Q &kp W &kp E &kp H &kp J
&kp LCTRL &kp A &kp S &kp D &kp K &kp L
>;
};
};
};
15 changes: 15 additions & 0 deletions boards/shields/hana/hana.zmk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
file_format: "1"
id: hana
name: hana
type: shield
url: https://github.com/keeb-it/hana
requires: [seeeduino_xiao_ble, seeeduino_xiao_rp2040]
exposes: [i2c_oled, spi_oled]
siblings:
- hana_left
- hana_right
features:
- keys
- encoder
- display
- pointer
Empty file.
9 changes: 9 additions & 0 deletions boards/shields/hana/hana_left.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#include "hana.dtsi"

&kscan0 {
col-gpios
= <&xiao_d 10 GPIO_ACTIVE_HIGH>
, <&xiao_d 9 GPIO_ACTIVE_HIGH>
, <&xiao_d 8 GPIO_ACTIVE_HIGH>
;
};
Empty file.
13 changes: 13 additions & 0 deletions boards/shields/hana/hana_right.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#include "hana.dtsi"

&default_transform {
col-offset = <3>;
};

&kscan0 {
col-gpios
= <&xiao_d 10 GPIO_ACTIVE_HIGH>
, <&xiao_d 9 GPIO_ACTIVE_HIGH>
, <&xiao_d 8 GPIO_ACTIVE_HIGH>
;
};
11 changes: 9 additions & 2 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,12 @@
#
---
# board: [seeeduino_xiao, seeeduino_xiao_ble, seeeduino_xiao_rp2040]
board: [seeeduino_xiao_ble, seeeduino_xiao_rp2040]
shield: [hammer40]
board: [seeeduino_xiao_ble]
shield: [hammer40, hana_left, hana_right]
include:
- board: seeeduino_xiao_ble
shield: settings_reset
# - board: seeeduino_xiao_ble
# shield: hana_left
# - board: seeeduino_xiao_ble
# shield: hana_right

0 comments on commit 4aa4a34

Please sign in to comment.