Browse Source

refactor: Align drivers with Zephyr file system conventions

PR: #400
xmkb
innovaker 4 years ago committed by Pete Johanson
parent
commit
8d9ae1fdf3
  1. 5
      app/drivers/CMakeLists.txt
  2. 5
      app/drivers/Kconfig
  3. 8
      app/drivers/kscan/CMakeLists.txt
  4. 25
      app/drivers/kscan/Kconfig
  5. 0
      app/drivers/kscan/kscan_gpio_demux.c
  6. 0
      app/drivers/kscan/kscan_gpio_direct.c
  7. 0
      app/drivers/kscan/kscan_gpio_matrix.c
  8. 5
      app/drivers/sensor/CMakeLists.txt
  9. 5
      app/drivers/sensor/Kconfig
  10. 6
      app/drivers/sensor/battery_voltage_divider/CMakeLists.txt
  11. 8
      app/drivers/sensor/battery_voltage_divider/Kconfig
  12. 0
      app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c
  13. 9
      app/drivers/sensor/ec11/CMakeLists.txt
  14. 31
      app/drivers/sensor/ec11/Kconfig
  15. 0
      app/drivers/sensor/ec11/ec11.c
  16. 0
      app/drivers/sensor/ec11/ec11.h
  17. 0
      app/drivers/sensor/ec11/ec11_trigger.c
  18. 14
      app/drivers/zephyr/CMakeLists.txt
  19. 0
      app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-demux.yaml
  20. 0
      app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-direct.yaml
  21. 0
      app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-matrix.yaml
  22. 0
      app/drivers/zephyr/dts/bindings/sensor/alps,ec11.yaml
  23. 0
      app/drivers/zephyr/dts/bindings/sensor/zmk,battery-voltage-divider.yaml
  24. 4
      app/drivers/zephyr/module.yml

5
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)

5
app/drivers/Kconfig

@ -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

@ -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

@ -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.

0
app/drivers/zephyr/kscan_gpio_demux.c → app/drivers/kscan/kscan_gpio_demux.c

0
app/drivers/zephyr/kscan_gpio_direct.c → app/drivers/kscan/kscan_gpio_direct.c

0
app/drivers/zephyr/kscan_gpio_matrix.c → app/drivers/kscan/kscan_gpio_matrix.c

5
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)

5
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"

6
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)

8
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.

0
app/drivers/zephyr/battery_voltage_divider.c → app/drivers/sensor/battery_voltage_divider/battery_voltage_divider.c

9
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)

31
app/drivers/zephyr/Kconfig → app/drivers/sensor/ec11/Kconfig

@ -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
@ -76,4 +47,4 @@ config EC11_THREAD_STACK_SIZE
help help
Stack size of thread used by the driver to handle interrupts. Stack size of thread used by the driver to handle interrupts.
endif # EC11 endif # EC11

0
app/drivers/zephyr/ec11.c → app/drivers/sensor/ec11/ec11.c

0
app/drivers/zephyr/ec11.h → app/drivers/sensor/ec11/ec11.h

0
app/drivers/zephyr/ec11_trigger.c → app/drivers/sensor/ec11/ec11_trigger.c

14
app/drivers/zephyr/CMakeLists.txt

@ -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()

0
app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-demux.yaml → app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-demux.yaml

0
app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-direct.yaml → app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-direct.yaml

0
app/drivers/zephyr/dts/bindings/zmk,kscan-gpio-matrix.yaml → app/drivers/zephyr/dts/bindings/kscan/zmk,kscan-gpio-matrix.yaml

0
app/drivers/zephyr/dts/bindings/alps,ec11.yaml → app/drivers/zephyr/dts/bindings/sensor/alps,ec11.yaml

0
app/drivers/zephyr/dts/bindings/zmk,battery-voltage-divider.yaml → app/drivers/zephyr/dts/bindings/sensor/zmk,battery-voltage-divider.yaml

4
app/drivers/zephyr/module.yml

@ -1,3 +1,3 @@
build: build:
cmake: zephyr cmake: .
kconfig: zephyr/Kconfig kconfig: Kconfig

Loading…
Cancel
Save