Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PS/2 GPIO Bit-banging driver #15

Open
wants to merge 2 commits into
base: v3.2.0+zmk-fixes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/ps2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ zephyr_library_sources_ifdef(CONFIG_PS2_XEC ps2_mchp_xec.c)
zephyr_library_sources_ifdef(CONFIG_USERSPACE ps2_handlers.c)
zephyr_library_sources_ifdef(CONFIG_PS2_NPCX ps2_npcx_channel.c)
zephyr_library_sources_ifdef(CONFIG_PS2_NPCX ps2_npcx_controller.c)
zephyr_library_sources_ifdef(CONFIG_PS2_GPIO ps2_gpio.c)
1 change: 1 addition & 0 deletions drivers/ps2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if PS2

source "drivers/ps2/Kconfig.xec"
source "drivers/ps2/Kconfig.npcx"
source "drivers/ps2/Kconfig.gpio"

module = PS2
module-str = ps2
Expand Down
41 changes: 41 additions & 0 deletions drivers/ps2/Kconfig.gpio
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright (c) 2017 Linaro Ltd.
# SPDX-License-Identifier: Apache-2.0

DT_COMPAT_PS2_GPIO := gpio-ps2

config PS2_GPIO
bool "GPIO bit banging PS/2 support"
default $(dt_compat_enabled,$(DT_COMPAT_PS2_GPIO))
help
Enable software driven (bit banging) PS/2 support using GPIO pins

if PS2_GPIO

# PS/2 events must be processed within 30-50us. Therefore we shift the
# BT_CTLR_LLL_PRIO from 0 to 1 and BT_CTLR_ULL_* priorities from 1 to 2.
# We then set the gpio priority to 0.
#
# On top of this, the following has to be added to the device tree:
# &gpiote {
# interrupts = < 0x6 0 >;
# };
#
# This allows the PS/2 interrupts to be triggered in time.

config BT_CTLR_ADVANCED_FEATURES
default y

config BT_CTLR_LLL_PRIO
default 1

config BT_CTLR_ULL_HIGH_PRIO
default 2

config BT_CTLR_ULL_LOW_PRIO
default 2

config PS2_GPIO_INTERRUPT_LOG_ENABLED
bool "Enable extensive interrupt logging."
default n

endif # PS2_GPIO
Loading
Loading