Skip to content
Merged
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
36 changes: 36 additions & 0 deletions boards/st/stm32u083c_dk/stm32u083c_dk.dts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <st/u0/stm32u083mctx-pinctrl.dtsi>
#include "arduino_r3_connector.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/input/stm32-tsc-defines.h>

/ {
model = "STMicroelectronics STM32U83C-DK board";
Expand Down Expand Up @@ -124,3 +125,38 @@
status = "okay";
};
};

&tsc {
status = "okay";
pinctrl-0 = <&tsc_g1_io1_pb12 &tsc_g1_io2_pb13 &tsc_g6_io1_pd10 &tsc_g6_io2_pd11>;
pinctrl-names = "default";

st,pulse-generator-prescaler = <2>;
st,charge-transfer-pulse-high = <2>;
st,charge-transfer-pulse-low = <2>;
st,spread-spectrum;
st,spread-spectrum-prescaler = <2>;
st,spread-spectrum-deviation = <100>;
st,max-count-value = <8191>;

tsc_group1: g1 {
group = <1>;
st,use-as-shield;
channel-ios = <TSC_IO2>;
sampling-io = <TSC_IO1>;
};

tsc_group6: g6 {
group = <6>;
channel-ios = <TSC_IO2>;
sampling-io = <TSC_IO1>;
ts1 {
compatible = "tsc-keys";
sampling-interval-ms = <10>;
oversampling = <10>;
noise-threshold = <50>;
sticky-key-timeout-ms = <10000>;
zephyr,code = <INPUT_KEY_0>;
};
};
};
1 change: 1 addition & 0 deletions boards/st/stm32u083c_dk/stm32u083c_dk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ supported:
- i2c
- pwm
- usart
- tsc
ram: 40
flash: 256
1 change: 1 addition & 0 deletions drivers/input/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ zephyr_library_sources_ifdef(CONFIG_INPUT_PAW32XX input_paw32xx.c)
zephyr_library_sources_ifdef(CONFIG_INPUT_PINNACLE input_pinnacle.c)
zephyr_library_sources_ifdef(CONFIG_INPUT_PMW3610 input_pmw3610.c)
zephyr_library_sources_ifdef(CONFIG_INPUT_SBUS input_sbus.c)
zephyr_library_sources_ifdef(CONFIG_INPUT_STM32_TSC_KEYS input_tsc_keys.c)
zephyr_library_sources_ifdef(CONFIG_INPUT_STMPE811 input_stmpe811.c)
zephyr_library_sources_ifdef(CONFIG_INPUT_TOUCH input_touch.c)
zephyr_library_sources_ifdef(CONFIG_INPUT_XEC_KBD input_xec_kbd.c)
Expand Down
1 change: 1 addition & 0 deletions drivers/input/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ source "drivers/input/Kconfig.sbus"
source "drivers/input/Kconfig.sdl"
source "drivers/input/Kconfig.stmpe811"
source "drivers/input/Kconfig.touch"
source "drivers/input/Kconfig.tsc_keys"
source "drivers/input/Kconfig.xec"
source "drivers/input/Kconfig.xpt2046"
# zephyr-keep-sorted-stop
Expand Down
21 changes: 21 additions & 0 deletions drivers/input/Kconfig.tsc_keys
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (c) 2024 Arif Balik <[email protected]>
# SPDX-License-Identifier: Apache-2.0

config INPUT_STM32_TSC_KEYS
bool "STM32 TSC touch library"
default y
depends on DT_HAS_ST_STM32_TSC_ENABLED
select RING_BUFFER
help
Enable support for STM32 TSC touch library.

config INPUT_STM32_TSC_KEYS_BUFFER_WORD_SIZE
int "STM32 TSC touch buffer size in words"
default 10
depends on INPUT_STM32_TSC_KEYS
help
Size of the ring buffer for the STM32 TSC touch library. The size of this
buffer together with the sampling-interval property in the tsc-keys
device tree node determines the time window of interest. A slope value is
calculated between the oldest and the newest value in the buffer to
generate a press or release input event.
Loading
Loading