diff --git a/boards/shields/hana/hana.dtsi b/boards/shields/hana/hana.dtsi index b91d838..31a5f66 100644 --- a/boards/shields/hana/hana.dtsi +++ b/boards/shields/hana/hana.dtsi @@ -1,4 +1,4 @@ -#include +#include "hana_matrix.dtsi" &xiao_spi { status = "okay"; @@ -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)>; diff --git a/boards/shields/hana/hana_central_dongle.conf b/boards/shields/hana/hana_central_dongle.conf index c197753..78b6eb5 100644 --- a/boards/shields/hana/hana_central_dongle.conf +++ b/boards/shields/hana/hana_central_dongle.conf @@ -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 diff --git a/boards/shields/hana/hana_central_dongle.overlay b/boards/shields/hana/hana_central_dongle.overlay index ef7622b..2fb3b2a 100644 --- a/boards/shields/hana/hana_central_dongle.overlay +++ b/boards/shields/hana/hana_central_dongle.overlay @@ -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>; diff --git a/boards/shields/hana/hana_matrix.dtsi b/boards/shields/hana/hana_matrix.dtsi new file mode 100644 index 0000000..aa58125 --- /dev/null +++ b/boards/shields/hana/hana_matrix.dtsi @@ -0,0 +1,46 @@ +#include + +/ { + 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) + >; + }; +}; \ No newline at end of file diff --git a/build.yaml b/build.yaml index e874b9b..e32ad6e 100644 --- a/build.yaml +++ b/build.yaml @@ -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