summaryrefslogtreecommitdiff
path: root/app/drivers
diff options
context:
space:
mode:
authorPete Johanson <peter@peterjohanson.com>2020-06-24 10:06:35 -0400
committerPete Johanson <peter@peterjohanson.com>2020-06-24 10:14:27 -0400
commitd35a95c7afc9e5ef6f087034dbf4cbb03048f9cd (patch)
treecc5b179646d8a293f4656947c463fd58e41499e2 /app/drivers
parent23931aa4fede2d81437a01e5d69329157219c2a5 (diff)
Initial working Clueboard California Macropad w/ proton-c fixes
* Basic Clueboard Californai Macropad shield definition. * New "direct" KSCAN driver that supports non-matrix direct wiring for switches, needed for macropad that doesn't have a matrix at all. * Some renames for existing KSCAN GPIO driver to make the implied "matrix" part explicit.
Diffstat (limited to 'app/drivers')
-rw-r--r--app/drivers/zephyr/CMakeLists.txt3
-rw-r--r--app/drivers/zephyr/Kconfig8
-rw-r--r--app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-matrix.yaml (renamed from app/drivers/zephyr/dts/bindings/gpio-kscan.yaml)2
-rw-r--r--app/drivers/zephyr/kscan_gpio_matrix.c (renamed from app/drivers/zephyr/kscan_gpio.c)6
4 files changed, 16 insertions, 3 deletions
diff --git a/app/drivers/zephyr/CMakeLists.txt b/app/drivers/zephyr/CMakeLists.txt
index 03a97c6..b40498f 100644
--- a/app/drivers/zephyr/CMakeLists.txt
+++ b/app/drivers/zephyr/CMakeLists.txt
@@ -4,6 +4,7 @@ if(CONFIG_ZMK_KSCAN_GPIO_DRIVER)
zephyr_library()
zephyr_library_sources(
- kscan_gpio.c
+ kscan_gpio_matrix.c
+ kscan_gpio_direct.c
)
endif()
diff --git a/app/drivers/zephyr/Kconfig b/app/drivers/zephyr/Kconfig
index 2dcb3a8..cd526e8 100644
--- a/app/drivers/zephyr/Kconfig
+++ b/app/drivers/zephyr/Kconfig
@@ -3,6 +3,14 @@ config ZMK_KSCAN_GPIO_DRIVER
default y
select GPIO
+if ZMK_KSCAN_GPIO_DRIVER
+
+config ZMK_KSCAN_GPIO_POLLING
+ bool "Poll for key event triggers instead of using interrupts"
+ default n
+
+endif
+
config ZMK_KSCAN_INIT_PRIORITY
int "Keyboard scan driver init priority"
default 40
diff --git a/app/drivers/zephyr/dts/bindings/gpio-kscan.yaml b/app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-matrix.yaml
index 748d3fa..5ebcbdd 100644
--- a/app/drivers/zephyr/dts/bindings/gpio-kscan.yaml
+++ b/app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-matrix.yaml
@@ -3,7 +3,7 @@
description: GPIO keyboard matrix controller
-compatible: "gpio-kscan"
+compatible: "zmk,kscan-gpio-matrix"
include: kscan.yaml
diff --git a/app/drivers/zephyr/kscan_gpio.c b/app/drivers/zephyr/kscan_gpio_matrix.c
index 76606d8..22217ef 100644
--- a/app/drivers/zephyr/kscan_gpio.c
+++ b/app/drivers/zephyr/kscan_gpio_matrix.c
@@ -4,7 +4,7 @@
* SPDX-License-Identifier: MIT
*/
-#define DT_DRV_COMPAT gpio_kscan
+#define DT_DRV_COMPAT zmk_kscan_gpio_matrix
#include <device.h>
#include <drivers/kscan.h>
@@ -13,6 +13,8 @@
LOG_MODULE_DECLARE(zmk, CONFIG_ZMK_LOG_LEVEL);
+#if DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT)
+
struct kscan_gpio_item_config
{
char *label;
@@ -254,3 +256,5 @@ static int kscan_gpio_config_interrupts(struct device **devices,
&gpio_driver_api_##n);
DT_INST_FOREACH_STATUS_OKAY(GPIO_INST_INIT)
+
+#endif /* DT_HAS_COMPAT_STATUS_OKAY(DT_DRV_COMPAT) */