From 9a09eb14af7be29078d668ea492f2b2c78022d19 Mon Sep 17 00:00:00 2001 From: Pete Johanson Date: Wed, 27 May 2020 00:48:03 -0400 Subject: Initial composite kscan driver. * For now, to be used for FrankenKyria, where both matrix halves will be attached to the same MCU, but should be a stepping stone to proper split support once we have a kscan driver over a split transport. * Implement multiple instances for mock kscan driver. --- .../petejohanson_handwire/Kconfig.defconfig | 2 ++ .../petejohanson_handwire.overlay | 37 +++++++++++++++++++--- 2 files changed, 34 insertions(+), 5 deletions(-) (limited to 'boards/shields') diff --git a/boards/shields/petejohanson_handwire/Kconfig.defconfig b/boards/shields/petejohanson_handwire/Kconfig.defconfig index e69de29..c7408ce 100644 --- a/boards/shields/petejohanson_handwire/Kconfig.defconfig +++ b/boards/shields/petejohanson_handwire/Kconfig.defconfig @@ -0,0 +1,2 @@ + +CONFIG_ZMK_KSCAN_COMPOSITE_DRIVER=y \ No newline at end of file diff --git a/boards/shields/petejohanson_handwire/petejohanson_handwire.overlay b/boards/shields/petejohanson_handwire/petejohanson_handwire.overlay index 72e24a0..d65b3b1 100644 --- a/boards/shields/petejohanson_handwire/petejohanson_handwire.overlay +++ b/boards/shields/petejohanson_handwire/petejohanson_handwire.overlay @@ -4,14 +4,41 @@ zmk,kscan = &kscan0; }; - kscan0: kscan { + kscan0: kscan_0 { + compatible = "zmk,kscan-composite"; + label = "KSCAN_COMP"; + rows = <2>; + columns = <4>; + + left { + kscan = <&left_hand>; + }; + + right { + kscan = <&right_hand>; + column-offset = <2>; + }; + }; + + left_hand: kscan_1 { compatible = "gpio-kscan"; - label = "KSCAN"; + label = "KSCAN_LEFT"; diode-direction = "row2col"; row-gpios = <&arduino_header 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, - <&arduino_header 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; - col-gpios = <&arduino_header 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, - <&arduino_header 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + <&arduino_header 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + col-gpios = <&arduino_header 10 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, + <&arduino_header 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + }; + + right_hand: kscan_2 { + compatible = "gpio-kscan"; + label = "KSCAN_RIGHT"; + + diode-direction = "row2col"; + row-gpios = <&arduino_header 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, + <&arduino_header 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; + col-gpios = <&arduino_header 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>, + <&arduino_header 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; }; }; -- cgit v1.2.3