Skip to content

Commit 0d85074

Browse files
franciscomunozandrewboie
authored andcommitted
drivers: kscan: Add driver for Microchip XEC family
Add the Keyboard Scan matrix driver for XEC Signed-off-by: Francisco Munoz <[email protected]>
1 parent edf2499 commit 0d85074

File tree

3 files changed

+461
-0
lines changed

3 files changed

+461
-0
lines changed

drivers/kscan/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
# SPDX-License-Identifier: Apache-2.0
22

33
zephyr_library()
4+
5+
zephyr_library_sources_ifdef(CONFIG_KSCAN_XEC kscan_mchp_xec.c)
6+
7+
zephyr_library_sources_ifdef(CONFIG_USERSPACE kscan_handlers.c)

drivers/kscan/Kconfig.xec

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Kconfig.xec - Microchip XEC Keyboard Scan Matrix configuration options
2+
#
3+
# Copyright (c) 2019 Intel Corporation
4+
#
5+
# SPDX-License-Identifier: Apache-2.0
6+
#
7+
8+
menuconfig KSCAN_XEC
9+
bool "XEC Microchip KSCAN driver"
10+
depends on SOC_FAMILY_MEC
11+
select MULTITHREADING
12+
help
13+
Enable the Microchip XEC Kscan IO driver.
14+
15+
if KSCAN_XEC
16+
17+
config KSCAN_XEC_COLUMN_SIZE
18+
int "KSCAN_XEC_COLUMN_SIZE"
19+
default 16
20+
help
21+
Adjust the value to your keyboard columns. The maximum
22+
colum size for the Microchip XEC family is 18 (from 0 to 17).
23+
24+
config KSCAN_XEC_ROW_SIZE
25+
int "KSCAN_XEC_ROW_SIZE"
26+
default 8
27+
help
28+
Adjust the value to your keyboard rows. The maximum
29+
colum size for the Microchip XEC family is 8 (from 0 to 7).
30+
31+
config KSCAN_XEC_DEBOUNCE_DOWN
32+
int "KSCAN_XEC_DEBOUNCE_DOWN"
33+
default 10
34+
help
35+
Determines the time in msecs for debouncing a key press.
36+
37+
config KSCAN_XEC_DEBOUNCE_UP
38+
int "KSCAN_XEC_DEBOUNCE_UP"
39+
default 20
40+
help
41+
Determines the time in msecs for debouncing a key release.
42+
43+
config KSCAN_XEC_POLL_PERIOD
44+
int "KSCAN_XEC_POLL_PERIOD"
45+
default 5
46+
help
47+
Defines the poll period in msecs between between matrix scans.
48+
49+
endif #KSCAN_XEC

0 commit comments

Comments
 (0)