diff options
author | innovaker <66737976+innovaker@users.noreply.github.com> | 2020-11-19 17:20:43 +0000 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2020-12-03 21:06:01 -0500 |
commit | 8d9ae1fdf379020d4743b4f85f465e88b148ac29 (patch) | |
tree | 07cb741277cc5a85a66c280f258d551690c120e7 /app | |
parent | 177b28f01de88ece582604c0ef0abaaaefe2f624 (diff) |
refactor: Align drivers with Zephyr file system conventions
PR: #400
Diffstat (limited to 'app')
-rw-r--r-- | app/drivers/CMakeLists.txt | 5 | ||||
-rw-r--r-- | app/drivers/Kconfig | 5 | ||||
-rw-r--r-- | app/drivers/kscan/CMakeLists.txt | 8 | ||||
-rw-r--r-- | app/drivers/kscan/Kconfig | 25 | ||||
-rw-r--r-- | app/drivers/kscan/kscan_gpio_demux.c (renamed from app/drivers/zephyr/kscan_gpio_demux.c) | 0 | ||||
-rw-r--r-- | app/drivers/kscan/kscan_gpio_direct.c (renamed from app/drivers/zephyr/kscan_gpio_direct.c) | 0 | ||||
-rw-r--r-- | app/drivers/kscan/kscan_gpio_matrix.c (renamed from app/drivers/zephyr/kscan_gpio_matrix.c) | 0 | ||||
-rw-r--r-- | app/drivers/sensor/CMakeLists.txt | 5 | ||||
-rw-r--r-- | app/drivers/sensor/Kconfig | 5 | ||||
-rw-r--r-- | app/drivers/sensor/battery_voltage_divider/CMakeLists.txt | 6 | ||||
-rw-r--r-- | app/drivers/sensor/battery_voltage_divider/Kconfig | 8 | ||||
-rw-r--r-- | app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c (renamed from app/drivers/zephyr/battery_voltage_divider.c) | 0 | ||||
-rw-r--r-- | app/drivers/sensor/ec11/CMakeLists.txt | 9 | ||||
-rw-r--r-- | app/drivers/sensor/ec11/Kconfig (renamed from app/drivers/zephyr/Kconfig) | 31 | ||||
-rw-r--r-- | app/drivers/sensor/ec11/ec11.c (renamed from app/drivers/zephyr/ec11.c) | 0 | ||||
-rw-r--r-- | app/drivers/sensor/ec11/ec11.h (renamed from app/drivers/zephyr/ec11.h) | 0 | ||||
-rw-r--r-- | app/drivers/sensor/ec11/ec11_trigger.c (renamed from app/drivers/zephyr/ec11_trigger.c) | 0 | ||||
-rw-r--r-- | app/drivers/zephyr/CMakeLists.txt | 14 | ||||
-rw-r--r-- | app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-demux.yaml (renamed from app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-demux.yaml) | 0 | ||||
-rw-r--r-- | app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-direct.yaml (renamed from app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-direct.yaml) | 0 | ||||
-rw-r--r-- | app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-matrix.yaml (renamed from app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-matrix.yaml) | 0 | ||||
-rw-r--r-- | app/drivers/zephyr/dts/bindings/sensor/alps,ec11.yaml (renamed from app/drivers/zephyr/dts/bindings/alps,ec11.yaml) | 0 | ||||
-rw-r--r-- | app/drivers/zephyr/dts/bindings/sensor/zmk,battery-voltage-divider.yaml (renamed from app/drivers/zephyr/dts/bindings/zmk,battery-voltage-divider.yaml) | 0 | ||||
-rw-r--r-- | app/drivers/zephyr/module.yml | 4 |
24 files changed, 79 insertions, 46 deletions
diff --git a/app/drivers/CMakeLists.txt b/app/drivers/CMakeLists.txt new file mode 100644 index 0000000..13f04f8 --- /dev/null +++ b/app/drivers/CMakeLists.txt @@ -0,0 +1,5 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +add_subdirectory_ifdef(CONFIG_KSCAN kscan) +add_subdirectory_ifdef(CONFIG_SENSOR sensor)
\ No newline at end of file diff --git a/app/drivers/Kconfig b/app/drivers/Kconfig new file mode 100644 index 0000000..7ad7699 --- /dev/null +++ b/app/drivers/Kconfig @@ -0,0 +1,5 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +rsource "kscan/Kconfig" +rsource "sensor/Kconfig"
\ No newline at end of file diff --git a/app/drivers/kscan/CMakeLists.txt b/app/drivers/kscan/CMakeLists.txt new file mode 100644 index 0000000..19933aa --- /dev/null +++ b/app/drivers/kscan/CMakeLists.txt @@ -0,0 +1,8 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +zephyr_library() + +zephyr_library_sources_ifdef(CONFIG_ZMK_KSCAN_GPIO_DRIVER kscan_gpio_matrix.c) +zephyr_library_sources_ifdef(CONFIG_ZMK_KSCAN_GPIO_DRIVER kscan_gpio_direct.c) +zephyr_library_sources_ifdef(CONFIG_ZMK_KSCAN_GPIO_DRIVER kscan_gpio_demux.c)
\ No newline at end of file diff --git a/app/drivers/kscan/Kconfig b/app/drivers/kscan/Kconfig new file mode 100644 index 0000000..5b913f3 --- /dev/null +++ b/app/drivers/kscan/Kconfig @@ -0,0 +1,25 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config ZMK_KSCAN_GPIO_DRIVER + bool "Enable GPIO kscan driver to simulate key presses" + default y + select GPIO + +if ZMK_KSCAN_GPIO_DRIVER + +config ZMK_KSCAN_MATRIX_POLLING + bool "Poll for key event triggers instead of using interrupts on matrix boards." + default n + +config ZMK_KSCAN_DIRECT_POLLING + bool "Poll for key event triggers instead of using interrupts on direct wired boards." + default n + +endif + +config ZMK_KSCAN_INIT_PRIORITY + int "Keyboard scan driver init priority" + default 40 + help + Keyboard scan device driver initialization priority.
\ No newline at end of file diff --git a/app/drivers/zephyr/kscan_gpio_demux.c b/app/drivers/kscan/kscan_gpio_demux.c index 6113d7c..6113d7c 100644 --- a/app/drivers/zephyr/kscan_gpio_demux.c +++ b/app/drivers/kscan/kscan_gpio_demux.c diff --git a/app/drivers/zephyr/kscan_gpio_direct.c b/app/drivers/kscan/kscan_gpio_direct.c index 8327161..8327161 100644 --- a/app/drivers/zephyr/kscan_gpio_direct.c +++ b/app/drivers/kscan/kscan_gpio_direct.c diff --git a/app/drivers/zephyr/kscan_gpio_matrix.c b/app/drivers/kscan/kscan_gpio_matrix.c index ec4fb39..ec4fb39 100644 --- a/app/drivers/zephyr/kscan_gpio_matrix.c +++ b/app/drivers/kscan/kscan_gpio_matrix.c diff --git a/app/drivers/sensor/CMakeLists.txt b/app/drivers/sensor/CMakeLists.txt new file mode 100644 index 0000000..a4c2ba8 --- /dev/null +++ b/app/drivers/sensor/CMakeLists.txt @@ -0,0 +1,5 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +add_subdirectory_ifdef(CONFIG_ZMK_BATTERY_VOLTAGE_DIVIDER battery_voltage_divider) +add_subdirectory_ifdef(CONFIG_EC11 ec11)
\ No newline at end of file diff --git a/app/drivers/sensor/Kconfig b/app/drivers/sensor/Kconfig new file mode 100644 index 0000000..7b6a0d0 --- /dev/null +++ b/app/drivers/sensor/Kconfig @@ -0,0 +1,5 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +rsource "battery_voltage_divider/Kconfig" +rsource "ec11/Kconfig"
\ No newline at end of file diff --git a/app/drivers/sensor/battery_voltage_divider/CMakeLists.txt b/app/drivers/sensor/battery_voltage_divider/CMakeLists.txt new file mode 100644 index 0000000..4b7f042 --- /dev/null +++ b/app/drivers/sensor/battery_voltage_divider/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +zephyr_library() + +zephyr_library_sources(battery_voltage_divider.c)
\ No newline at end of file diff --git a/app/drivers/sensor/battery_voltage_divider/Kconfig b/app/drivers/sensor/battery_voltage_divider/Kconfig new file mode 100644 index 0000000..18c4ea3 --- /dev/null +++ b/app/drivers/sensor/battery_voltage_divider/Kconfig @@ -0,0 +1,8 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +config ZMK_BATTERY_VOLTAGE_DIVIDER + bool "ZMK battery voltage divider" + select ADC + help + Enable ZMK battery voltage divider driver for battery monitoring.
\ No newline at end of file diff --git a/app/drivers/zephyr/battery_voltage_divider.c b/app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c index d634dfd..d634dfd 100644 --- a/app/drivers/zephyr/battery_voltage_divider.c +++ b/app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c diff --git a/app/drivers/sensor/ec11/CMakeLists.txt b/app/drivers/sensor/ec11/CMakeLists.txt new file mode 100644 index 0000000..de291fe --- /dev/null +++ b/app/drivers/sensor/ec11/CMakeLists.txt @@ -0,0 +1,9 @@ +# Copyright (c) 2020 The ZMK Contributors +# SPDX-License-Identifier: MIT + +zephyr_include_directories(.) + +zephyr_library() + +zephyr_library_sources(ec11.c) +zephyr_library_sources_ifdef(CONFIG_EC11_TRIGGER ec11_trigger.c)
\ No newline at end of file diff --git a/app/drivers/zephyr/Kconfig b/app/drivers/sensor/ec11/Kconfig index b8b2b1b..6854e53 100644 --- a/app/drivers/zephyr/Kconfig +++ b/app/drivers/sensor/ec11/Kconfig @@ -1,35 +1,6 @@ # Copyright (c) 2020 The ZMK Contributors # SPDX-License-Identifier: MIT -config ZMK_KSCAN_GPIO_DRIVER - bool "Enable GPIO kscan driver to simulate key presses" - default y - select GPIO - -if ZMK_KSCAN_GPIO_DRIVER - -config ZMK_KSCAN_MATRIX_POLLING - bool "Poll for key event triggers instead of using interrupts on matrix boards." - default n - -config ZMK_KSCAN_DIRECT_POLLING - bool "Poll for key event triggers instead of using interrupts on direct wired boards." - default n - -endif - -config ZMK_KSCAN_INIT_PRIORITY - int "Keyboard scan driver init priority" - default 40 - help - Keyboard scan device driver initialization priority. - -config ZMK_BATTERY_VOLTAGE_DIVIDER - bool "ZMK battery voltage divider" - select ADC - help - Enable ZMK battery voltage divider driver for battery monitoring. - menuconfig EC11 bool "EC11 Incremental Encoder Sensor" depends on GPIO @@ -76,4 +47,4 @@ config EC11_THREAD_STACK_SIZE help Stack size of thread used by the driver to handle interrupts. -endif # EC11 +endif # EC11
\ No newline at end of file diff --git a/app/drivers/zephyr/ec11.c b/app/drivers/sensor/ec11/ec11.c index 00d0090..00d0090 100644 --- a/app/drivers/zephyr/ec11.c +++ b/app/drivers/sensor/ec11/ec11.c diff --git a/app/drivers/zephyr/ec11.h b/app/drivers/sensor/ec11/ec11.h index e62e733..e62e733 100644 --- a/app/drivers/zephyr/ec11.h +++ b/app/drivers/sensor/ec11/ec11.h diff --git a/app/drivers/zephyr/ec11_trigger.c b/app/drivers/sensor/ec11/ec11_trigger.c index 248ac32..248ac32 100644 --- a/app/drivers/zephyr/ec11_trigger.c +++ b/app/drivers/sensor/ec11/ec11_trigger.c diff --git a/app/drivers/zephyr/CMakeLists.txt b/app/drivers/zephyr/CMakeLists.txt deleted file mode 100644 index e3a192d..0000000 --- a/app/drivers/zephyr/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -if(CONFIG_ZMK_KSCAN_GPIO_DRIVER) - zephyr_include_directories(.) - - zephyr_library() - zephyr_library_sources( - kscan_gpio_matrix.c - kscan_gpio_direct.c - kscan_gpio_demux.c - ) - - zephyr_library_sources_ifdef(CONFIG_EC11 ec11.c) - zephyr_library_sources_ifdef(CONFIG_EC11_TRIGGER ec11_trigger.c) - zephyr_library_sources_ifdef(CONFIG_ZMK_BATTERY_VOLTAGE_DIVIDER battery_voltage_divider.c) -endif() diff --git a/app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-demux.yaml b/app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-demux.yaml index a2d8d24..a2d8d24 100644 --- a/app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-demux.yaml +++ b/app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-demux.yaml diff --git a/app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-direct.yaml b/app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-direct.yaml index 09a9b6c..09a9b6c 100644 --- a/app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-direct.yaml +++ b/app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-direct.yaml diff --git a/app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-matrix.yaml b/app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-matrix.yaml index 5ebcbdd..5ebcbdd 100644 --- a/app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-matrix.yaml +++ b/app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-matrix.yaml diff --git a/app/drivers/zephyr/dts/bindings/alps,ec11.yaml b/app/drivers/zephyr/dts/bindings/sensor/alps,ec11.yaml index 5cbe77a..5cbe77a 100644 --- a/app/drivers/zephyr/dts/bindings/alps,ec11.yaml +++ b/app/drivers/zephyr/dts/bindings/sensor/alps,ec11.yaml diff --git a/app/drivers/zephyr/dts/bindings/zmk,battery-voltage-divider.yaml b/app/drivers/zephyr/dts/bindings/sensor/zmk,battery-voltage-divider.yaml index 3f391d7..3f391d7 100644 --- a/app/drivers/zephyr/dts/bindings/zmk,battery-voltage-divider.yaml +++ b/app/drivers/zephyr/dts/bindings/sensor/zmk,battery-voltage-divider.yaml diff --git a/app/drivers/zephyr/module.yml b/app/drivers/zephyr/module.yml index cbff6a1..0b66059 100644 --- a/app/drivers/zephyr/module.yml +++ b/app/drivers/zephyr/module.yml @@ -1,3 +1,3 @@ build: - cmake: zephyr - kconfig: zephyr/Kconfig + cmake: . + kconfig: Kconfig |