Skip to content

Commit

Permalink
hana: change dongle board to pro_micro
Browse files Browse the repository at this point in the history
  • Loading branch information
numToStr committed Jun 22, 2024
1 parent 13855cc commit ce5f593
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 71 deletions.
45 changes: 1 addition & 44 deletions boards/shields/hana/hana.dtsi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <dt-bindings/zmk/matrix_transform.h>
#include "hana_matrix.dtsi"

&xiao_spi {
status = "okay";
Expand All @@ -19,49 +19,6 @@
&xiao_i2c { status = "disabled"; };

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};

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)>
, <&xiao_d 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;

// NOTE: Below are LHS columns, RHS columns are different
col-gpios
= <&shift_reg 6 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 5 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 4 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 3 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 2 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 0 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 7 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 1 (GPIO_ACTIVE_HIGH)>
;

};

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,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,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(1,7) RC(1,8) RC(2,10) RC(2,11) RC(2,12) RC(2,13) RC(2,14) RC(2,15)
RC(0,6) RC(1,6) RC(2,6) RC(2,7) RC(2,8) RC(0,9) RC(1,9) RC(2,9)
>;
};

left_encoder: left_encoder {
compatible = "alps,ec11";
a-gpios = <&xiao_d 9 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;
Expand Down
8 changes: 4 additions & 4 deletions boards/shields/hana/hana_central_dongle.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ CONFIG_ZMK_COMBO_MAX_COMBOS_PER_KEY=7
CONFIG_ZMK_SPLIT_BLE_CENTRAL_PERIPHERALS=2

# display
CONFIG_ZMK_DISPLAY=y
CONFIG_ZMK_IDLE_TIMEOUT=60000
CONFIG_BT_BAS=n
CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y
# CONFIG_ZMK_DISPLAY=y
# CONFIG_ZMK_IDLE_TIMEOUT=60000
# CONFIG_BT_BAS=n
# CONFIG_ZMK_SPLIT_BLE_CENTRAL_BATTERY_LEVEL_FETCHING=y

# Turn on logging, and set ZMK logging to debug output
# CONFIG_ZMK_USB_LOGGING=y
Expand Down
24 changes: 2 additions & 22 deletions boards/shields/hana/hana_central_dongle.overlay
Original file line number Diff line number Diff line change
@@ -1,33 +1,13 @@
#include "hana.dtsi"

&xiao_i2c {
status = "okay";

oled: ssd1306@3c {
compatible = "solomon,ssd1306fb";
reg = <0x3c>;
width = <128>;
height = <64>;
segment-offset = <0>;
page-offset = <0>;
display-offset = <0>;
multiplex-ratio = <63>;
segment-remap;
com-invdir;
inversion-on;
prechargep = <0x22>;
};
};
#include "hana_matrix.dtsi"

/delete-node/ &kscan0;

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

mock_kscan: kscan_0 {
mock_kscan: kscan1 {
compatible = "zmk,kscan-mock";
columns = <0>;
rows = <0>;
Expand Down
46 changes: 46 additions & 0 deletions boards/shields/hana/hana_matrix.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#include <dt-bindings/zmk/matrix_transform.h>

/ {
chosen {
zmk,kscan = &kscan0;
zmk,matrix_transform = &default_transform;
};

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)>
, <&xiao_d 2 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;

// NOTE: Below are LHS columns, RHS columns are different
col-gpios
= <&shift_reg 6 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 5 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 4 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 3 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 2 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 0 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 7 (GPIO_ACTIVE_HIGH)>
, <&shift_reg 1 (GPIO_ACTIVE_HIGH)>
;

};

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,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,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(1,7) RC(1,8) RC(2,10) RC(2,11) RC(2,12) RC(2,13) RC(2,14) RC(2,15)
RC(0,6) RC(1,6) RC(2,6) RC(2,7) RC(2,8) RC(0,9) RC(1,9) RC(2,9)
>;
};
};
5 changes: 4 additions & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@
board: [seeeduino_xiao_ble]
shield:
- hammer40
- hana_central_dongle
- hana_central_left
- hana_peripheral_left
- hana_peripheral_right
include:
- board: seeeduino_xiao_ble
shield: settings_reset
- board: nice_nano_v2
shield: settings_reset
- board: nice_nano_v2
shield: hana_central_dongle
# - board: seeeduino_xiao_ble
# shield: hana_left
# - board: seeeduino_xiao_ble
Expand Down

0 comments on commit ce5f593

Please sign in to comment.