parent
177b28f01d
commit
8d9ae1fdf3
24 changed files with 79 additions and 46 deletions
5
app/drivers/CMakeLists.txt
Normal file
5
app/drivers/CMakeLists.txt
Normal file
|
@ -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)
|
5
app/drivers/Kconfig
Normal file
5
app/drivers/Kconfig
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Copyright (c) 2020 The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
rsource "kscan/Kconfig"
|
||||||
|
rsource "sensor/Kconfig"
|
8
app/drivers/kscan/CMakeLists.txt
Normal file
8
app/drivers/kscan/CMakeLists.txt
Normal file
|
@ -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)
|
25
app/drivers/kscan/Kconfig
Normal file
25
app/drivers/kscan/Kconfig
Normal file
|
@ -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.
|
5
app/drivers/sensor/CMakeLists.txt
Normal file
5
app/drivers/sensor/CMakeLists.txt
Normal file
|
@ -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)
|
5
app/drivers/sensor/Kconfig
Normal file
5
app/drivers/sensor/Kconfig
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Copyright (c) 2020 The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
rsource "battery_voltage_divider/Kconfig"
|
||||||
|
rsource "ec11/Kconfig"
|
|
@ -0,0 +1,6 @@
|
||||||
|
# Copyright (c) 2020 The ZMK Contributors
|
||||||
|
# SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
zephyr_library()
|
||||||
|
|
||||||
|
zephyr_library_sources(battery_voltage_divider.c)
|
8
app/drivers/sensor/battery_voltage_divider/Kconfig
Normal file
8
app/drivers/sensor/battery_voltage_divider/Kconfig
Normal file
|
@ -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.
|
9
app/drivers/sensor/ec11/CMakeLists.txt
Normal file
9
app/drivers/sensor/ec11/CMakeLists.txt
Normal file
|
@ -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)
|
|
@ -1,35 +1,6 @@
|
||||||
# Copyright (c) 2020 The ZMK Contributors
|
# Copyright (c) 2020 The ZMK Contributors
|
||||||
# SPDX-License-Identifier: MIT
|
# 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
|
menuconfig EC11
|
||||||
bool "EC11 Incremental Encoder Sensor"
|
bool "EC11 Incremental Encoder Sensor"
|
||||||
depends on GPIO
|
depends on GPIO
|
|
@ -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()
|
|
|
@ -1,3 +1,3 @@
|
||||||
build:
|
build:
|
||||||
cmake: zephyr
|
cmake: .
|
||||||
kconfig: zephyr/Kconfig
|
kconfig: Kconfig
|
||||||
|
|
Loading…
Reference in a new issue