Rewrote the direct GPIO kscan driver to match the improvements made to
the matrix driver in 82cb762698 and
f946dc6893. It now uses the same
debouncing system as the matrix driver.
Switched the GPIO matrix driver to debouncing using a simple integrator
algorithm. Whenever a key is pressed, we now scan at a rate controlled
by debounce-scan-period-ms (default 1 ms) until all keys are released,
then return to either waiting for an interrupt or polling more slowly.
The timers for key press and release can now be controlled separately,
so debounce-period is deprecated in favor of debounce-press-ms and
debounce-release-ms. Global Kconfig options
ZMK_KSCAN_DEBOUNCE_PRESS_MS and ZMK_KSCAN_DEBOUNCE_RELEASE_MS are also
added to make these easier to set.
Added documentation for debouncing options.
Refactored the GPIO matrix kscan driver so that only the data and config
structures are defined in the foreach macro. Functionality is unchanged
except for the addition of DT properties to adjust polling speed.
This should make it easier to add other enhancements later, like
improved and customizable debounce behavior.
Updated function calls with missing reference. GPIO missing.
To my understanding:
DT_INST_GPIO_PIN() should be called instead if DT_INST_PIN()
DT_INST_GPIO_FLAGS() should be called instead if DT_INST_GPIO_FLAGS()
Current implementation does not compile when using control pin.
+ zmk,kscan_gpio_demux is now a compatible kscan option
+ kscan_gpio_demux is based heavily off of the implementation of
kscan_gpio_matrix, modified to address cols using an n-to-1
demultiplexer chip instead of discrete IO
+ Added zmk,kscan_gpio_demux.yaml file
* modified CMakeLists to include new source files
* New ZMK_SLEEP Kconfig symbol to enable the functionality.
* Switch to PORT events that allows wake from deep sleep.
* Initial basic power management policy, with idle ms,
and ignoring deep sleep if we detect a USB connection.
Fixed initializing interrupts for direct GPIO when
CONFIG_ZMK_KSCAN_DIRECT_POLLING is not enabled. IS_ENABLED() is needed to map
the possibly-undefined value to 0 or 1 so COND_CODE_0() and COND_CODE_1() work.
- Add ZMK_KSCAN_MATRIX_POLLING config flag to Kconfig
- Update matrix driver code to use the above flag to conditionally add the handling code for polling operations.
* Especially for splits, we need the ability to
unpair all paired devices as sledgehammer
if we need to "reset things", and doing so via
keymaps isn't suitable.
* Allows shields to define a collection of key
positions that if all held 2 seconds after
startup, will unpair all existing pairs for the
device.