2020-11-19 09:20:43 -08:00
|
|
|
# Copyright (c) 2020 The ZMK Contributors
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
2022-04-25 14:48:33 -07:00
|
|
|
DT_COMPAT_ZMK_KSCAN_COMPOSITE := zmk,kscan-composite
|
|
|
|
DT_COMPAT_ZMK_KSCAN_GPIO_DEMUX := zmk,kscan-gpio-demux
|
|
|
|
DT_COMPAT_ZMK_KSCAN_GPIO_DIRECT := zmk,kscan-gpio-direct
|
|
|
|
DT_COMPAT_ZMK_KSCAN_GPIO_MATRIX := zmk,kscan-gpio-matrix
|
2023-12-09 14:10:05 -08:00
|
|
|
DT_COMPAT_ZMK_KSCAN_GPIO_CHARLIEPLEX := zmk,kscan-gpio-charlieplex
|
2022-04-25 14:48:33 -07:00
|
|
|
DT_COMPAT_ZMK_KSCAN_MOCK := zmk,kscan-mock
|
|
|
|
|
2023-09-02 20:07:31 -07:00
|
|
|
if KSCAN
|
|
|
|
|
2022-04-25 14:48:33 -07:00
|
|
|
config ZMK_KSCAN_COMPOSITE_DRIVER
|
2023-04-22 21:25:56 -07:00
|
|
|
bool
|
|
|
|
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_COMPOSITE))
|
2022-04-25 14:48:33 -07:00
|
|
|
|
2023-11-09 19:51:42 -08:00
|
|
|
if ZMK_KSCAN_COMPOSITE_DRIVER
|
|
|
|
|
|
|
|
config ZMK_KSCAN_COMPOSITE_INIT_PRIORITY
|
|
|
|
int "Init Priority for the composite kscan driver"
|
|
|
|
default 95
|
|
|
|
|
|
|
|
endif
|
|
|
|
|
2020-11-19 09:20:43 -08:00
|
|
|
config ZMK_KSCAN_GPIO_DRIVER
|
2023-04-22 21:25:56 -07:00
|
|
|
bool
|
|
|
|
select GPIO
|
2023-09-11 21:56:37 -07:00
|
|
|
select ZMK_DEBOUNCE
|
2020-11-19 09:20:43 -08:00
|
|
|
|
2022-04-25 14:48:33 -07:00
|
|
|
config ZMK_KSCAN_GPIO_DEMUX
|
2023-04-22 21:25:56 -07:00
|
|
|
bool
|
|
|
|
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_GPIO_DEMUX))
|
|
|
|
select ZMK_KSCAN_GPIO_DRIVER
|
2022-04-25 14:48:33 -07:00
|
|
|
|
|
|
|
config ZMK_KSCAN_GPIO_DIRECT
|
2023-04-22 21:25:56 -07:00
|
|
|
bool
|
|
|
|
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_GPIO_DIRECT))
|
|
|
|
select ZMK_KSCAN_GPIO_DRIVER
|
2022-04-25 14:48:33 -07:00
|
|
|
|
|
|
|
config ZMK_KSCAN_GPIO_MATRIX
|
2023-04-22 21:25:56 -07:00
|
|
|
bool
|
|
|
|
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_GPIO_MATRIX))
|
|
|
|
select ZMK_KSCAN_GPIO_DRIVER
|
2022-04-25 14:48:33 -07:00
|
|
|
|
2023-12-09 14:10:05 -08:00
|
|
|
config ZMK_KSCAN_GPIO_CHARLIEPLEX
|
|
|
|
bool
|
|
|
|
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_GPIO_CHARLIEPLEX))
|
|
|
|
select ZMK_KSCAN_GPIO_DRIVER
|
|
|
|
|
2022-04-19 00:02:00 -07:00
|
|
|
if ZMK_KSCAN_GPIO_MATRIX
|
|
|
|
|
2022-09-28 10:59:25 -07:00
|
|
|
config ZMK_KSCAN_MATRIX_WAIT_BEFORE_INPUTS
|
2023-04-22 21:25:56 -07:00
|
|
|
int "Ticks to wait before reading inputs after an output set active"
|
|
|
|
default 0
|
|
|
|
help
|
|
|
|
When iterating over each output to drive it active, read inputs, then set
|
|
|
|
inactive again, some boards may take time for output to propagate to the
|
|
|
|
inputs. In that scenario, set this value to a positive value to configure
|
|
|
|
the number of ticks to wait after setting an output active before reading
|
|
|
|
the inputs for their active state.
|
2022-09-28 10:59:25 -07:00
|
|
|
|
2022-04-19 00:02:00 -07:00
|
|
|
config ZMK_KSCAN_MATRIX_WAIT_BETWEEN_OUTPUTS
|
|
|
|
int "Ticks to wait between each output when scanning"
|
2023-04-22 21:25:56 -07:00
|
|
|
default 1 if SOC_RP2040
|
|
|
|
default 0
|
|
|
|
help
|
|
|
|
When iterating over each output to drive it active, read inputs, then set
|
|
|
|
inactive again, some boards may take time for the previous output to
|
|
|
|
"settle" before reading inputs for the next active output column. In that
|
|
|
|
scenario, set this value to a positive value to configure the number of
|
|
|
|
ticks to wait after reading each column of keys.
|
2022-04-19 00:02:00 -07:00
|
|
|
|
|
|
|
endif # ZMK_KSCAN_GPIO_MATRIX
|
|
|
|
|
2023-12-09 14:10:05 -08:00
|
|
|
if ZMK_KSCAN_GPIO_CHARLIEPLEX
|
|
|
|
|
|
|
|
config ZMK_KSCAN_CHARLIEPLEX_WAIT_BEFORE_INPUTS
|
|
|
|
int "Ticks to wait before reading inputs after an output set active"
|
|
|
|
default 0
|
|
|
|
help
|
|
|
|
When iterating over each output to drive it active, read inputs, then set
|
|
|
|
inactive again, some boards may take time for output to propagate to the
|
|
|
|
inputs. In that scenario, set this value to a positive value to configure
|
|
|
|
the number of ticks to wait after setting an output active before reading
|
|
|
|
the inputs for their active state.
|
|
|
|
|
|
|
|
config ZMK_KSCAN_CHARLIEPLEX_WAIT_BETWEEN_OUTPUTS
|
|
|
|
int "Ticks to wait between each output when scanning charlieplex matrix"
|
|
|
|
default 0
|
|
|
|
help
|
|
|
|
When iterating over each output to drive it active, read inputs, then set
|
|
|
|
inactive again, some boards may take time for the previous output to
|
|
|
|
"settle" before reading inputs for the next active output column. In that
|
|
|
|
scenario, set this value to a positive value to configure the number of
|
|
|
|
usecs to wait after reading each column of keys.
|
|
|
|
|
|
|
|
endif # ZMK_KSCAN_GPIO_CHARLIEPLEX
|
|
|
|
|
2022-04-25 14:48:33 -07:00
|
|
|
config ZMK_KSCAN_MOCK_DRIVER
|
2023-04-22 21:25:56 -07:00
|
|
|
bool
|
|
|
|
default $(dt_compat_enabled,$(DT_COMPAT_ZMK_KSCAN_MOCK))
|
2022-04-25 14:48:33 -07:00
|
|
|
|
2020-11-19 09:20:43 -08:00
|
|
|
if ZMK_KSCAN_GPIO_DRIVER
|
|
|
|
|
|
|
|
config ZMK_KSCAN_MATRIX_POLLING
|
2023-04-22 21:25:56 -07:00
|
|
|
bool "Poll for key event triggers instead of using interrupts on matrix boards."
|
2020-11-19 09:20:43 -08:00
|
|
|
|
|
|
|
config ZMK_KSCAN_DIRECT_POLLING
|
2023-04-22 21:25:56 -07:00
|
|
|
bool "Poll for key event triggers instead of using interrupts on direct wired boards."
|
2020-11-19 09:20:43 -08:00
|
|
|
|
2021-07-30 23:23:33 -07:00
|
|
|
config ZMK_KSCAN_DEBOUNCE_PRESS_MS
|
2023-04-22 21:25:56 -07:00
|
|
|
int "Debounce time for key press in milliseconds."
|
|
|
|
default -1
|
|
|
|
help
|
|
|
|
Global debounce time for key press in milliseconds.
|
|
|
|
If this is -1, the debounce time is controlled by the debounce-press-ms
|
|
|
|
Devicetree property, which defaults to 5 ms. Otherwise this overrides the
|
|
|
|
debounce time for all key scan drivers to the chosen value.
|
2021-07-30 23:23:33 -07:00
|
|
|
|
|
|
|
config ZMK_KSCAN_DEBOUNCE_RELEASE_MS
|
2023-04-22 21:25:56 -07:00
|
|
|
int "Debounce time for key release in milliseconds."
|
|
|
|
default -1
|
|
|
|
help
|
|
|
|
Global debounce time for key release in milliseconds.
|
|
|
|
If this is -1, the debounce time is controlled by the debounce-release-ms
|
|
|
|
Devicetree property, which defaults to 5 ms. Otherwise this overrides the
|
|
|
|
debounce time for all key scan drivers to the chosen value.
|
2021-07-30 23:23:33 -07:00
|
|
|
|
2020-11-19 09:20:43 -08:00
|
|
|
endif
|
|
|
|
|
2023-09-02 20:07:31 -07:00
|
|
|
endif # KSCAN
|