1# ST Microelectronics LPS2xDF pressure and temperature sensor
2
3# Copyright (c) 2023 STMicroelectronics
4# Copyright (c) 2023 PHYTEC Messtechnik GmbH
5# SPDX-License-Identifier: Apache-2.0
6
7menuconfig LPS2XDF
8	bool "LPS2xDF pressure and temperature"
9	default y
10	depends on DT_HAS_ST_LPS22DF_ENABLED || DT_HAS_ST_LPS28DFW_ENABLED ||\
11		   DT_HAS_ST_ILPS22QS_ENABLED
12	depends on ZEPHYR_HAL_ST_MODULE
13	select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LPS22DF),i2c) ||\
14		      $(dt_compat_on_bus,$(DT_COMPAT_ST_ILPS22QS),i2c) ||\
15		      $(dt_compat_on_bus,$(DT_COMPAT_ST_LPS28DFW),i2c)
16	select I3C if $(dt_compat_on_bus,$(DT_COMPAT_ST_LPS22DF),i3c) ||\
17		      $(dt_compat_on_bus,$(DT_COMPAT_ST_ILPS22QS),i3c) ||\
18		      $(dt_compat_on_bus,$(DT_COMPAT_ST_LPS28DFW),i3c)
19	select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_LPS22DF),spi) ||\
20		      $(dt_compat_on_bus,$(DT_COMPAT_ST_ILPS22QS),spi)
21	select HAS_STMEMSC
22	select USE_STDC_ILPS22QS if DT_HAS_ST_ILPS22QS_ENABLED
23	select USE_STDC_LPS22DF if DT_HAS_ST_LPS22DF_ENABLED
24	select USE_STDC_LPS28DFW if DT_HAS_ST_LPS28DFW_ENABLED
25	help
26	  Enable driver for LPS2xDF I2C-based pressure and temperature
27	  sensor.
28
29if LPS2XDF
30
31choice LPS2XDF_TRIGGER_MODE
32	prompt "Trigger mode"
33	default LPS2XDF_TRIGGER_GLOBAL_THREAD
34	help
35	  Specify the type of triggering to be used by the driver.
36
37config LPS2XDF_TRIGGER_NONE
38	bool "No trigger"
39
40config LPS2XDF_TRIGGER_GLOBAL_THREAD
41	bool "Use global thread"
42	depends on GPIO
43	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ST_LPS22DF),drdy-gpios) ||\
44		   $(dt_compat_any_has_prop,$(DT_COMPAT_ST_LPS28DFW),drdy-gpios)
45	select LPS2XDF_TRIGGER
46
47config LPS2XDF_TRIGGER_OWN_THREAD
48	bool "Use own thread"
49	depends on GPIO
50	select LPS2XDF_TRIGGER
51
52endchoice # LPS2XDF_TRIGGER_MODE
53
54config LPS2XDF_TRIGGER
55	bool
56
57config LPS2XDF_THREAD_PRIORITY
58	int "Thread priority"
59	depends on LPS2XDF_TRIGGER_OWN_THREAD
60	default 10
61	help
62	  Priority of thread used by the driver to handle interrupts.
63
64config LPS2XDF_THREAD_STACK_SIZE
65	int "Thread stack size"
66	depends on LPS2XDF_TRIGGER_OWN_THREAD
67	default 1024
68	help
69	  Stack size of thread used by the driver to handle interrupts.
70
71endif # LPS2XDF
72