input: gpio_kbd_matrix: add 16 bit rows support
Add a Kconfig option to extend the row type to 16 bits, allowing the library to handle a 16 row matrix. Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
This commit is contained in:
parent
adcb2f580c
commit
f9ed74e0d5
|
@ -14,4 +14,10 @@ config INPUT_KBD_MATRIX_THREAD_STACK_SIZE
|
|||
help
|
||||
Size of the stack used for the keyboard matrix thread.
|
||||
|
||||
config INPUT_KBD_MATRIX_16_BIT_ROW
|
||||
bool "16 bit row size support"
|
||||
help
|
||||
Use a 16 bit type for the internal structure, allow using a matrix
|
||||
with up to 16 rows if the driver supports it.
|
||||
|
||||
endif # INPUT_KBD_MATRIX
|
||||
|
|
|
@ -30,7 +30,11 @@
|
|||
#define INPUT_KBD_MATRIX_SCAN_OCURRENCES 30U
|
||||
|
||||
/** Row entry data type */
|
||||
#if CONFIG_INPUT_KBD_MATRIX_16_BIT_ROW
|
||||
typedef uint16_t kbd_row_t;
|
||||
#else
|
||||
typedef uint8_t kbd_row_t;
|
||||
#endif
|
||||
|
||||
/** Maximum number of rows */
|
||||
#define INPUT_KBD_MATRIX_ROW_BITS NUM_BITS(kbd_row_t)
|
||||
|
|
Loading…
Reference in New Issue