# 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 config PS2_GPIO_ENABLE_PS2_RESEND_CALLBACK bool "Notify the PS2 device driver (mouse driver) when the received data is invalid and a resend is requested from the peripheral. This can help the higher level PS2 device driver handle transmission errors with less side-effects, but it requires a forked zephyr. With the ps2-uart driver this option is not really necessary, but is very useful for the ps2-gpio driver." default n select ZMK_INPUT_MOUSE_PS2_ENABLE_PS2_RESEND_CALLBACK # 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. # # The following also has to be added to the device tree to set GPIOTE to the # highest priority: # &gpiote { # interrupts = < 0x6 0 >; # }; # # On top of that all other interrupts have to be set to priority 3 to prevent # them from delaying the BT interrupts. # # Overrides can be generated using the following script in infused-kim's zmk # fork: # app/scripts/gen_interrupt_priority_overrides.py # # Make sure to do it on a zephyr.dts where the interrupts have not been # adjusted yet (i.e. a config that doesn't have the the following options # enabled). # # If you are building using a toolchain you can find the zephyr.dts in the # build directory, which by default is: `app/build/zephyr/zephyr.dts` # # If you are building using the github actions, copy the output of the build # step `xxxx_right - nice_nano_v2 Devicetree file` into a file and run the # script on it. # # This will increase the probability that the PS/2 interrupts are 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