1# Copyright (c) 2020 STMicroelectronics
2# SPDX-License-Identifier: Apache-2.0
3
4menuconfig IIS2MDC
5	bool "IIS2MDC Magnetometer"
6	default y
7	depends on DT_HAS_ST_IIS2MDC_ENABLED
8	depends on ZEPHYR_HAL_ST_MODULE
9	select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2MDC),i2c)
10	select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2MDC),spi)
11	select HAS_STMEMSC
12	select USE_STDC_IIS2MDC
13	help
14	  Enable driver for IIS2MDC I2C-based magnetometer sensor.
15
16if IIS2MDC
17
18choice IIS2MDC_TRIGGER_MODE
19	prompt "Trigger mode"
20	default IIS2MDC_TRIGGER_GLOBAL_THREAD
21	help
22	  Specify the type of triggering to be used by the driver.
23
24config IIS2MDC_TRIGGER_NONE
25	bool "No trigger"
26
27config IIS2MDC_TRIGGER_GLOBAL_THREAD
28	bool "Use global thread"
29	depends on GPIO
30	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ST_IIS2MDC),drdy-gpios)
31	select IIS2MDC_TRIGGER
32
33config IIS2MDC_TRIGGER_OWN_THREAD
34	bool "Use own thread"
35	depends on GPIO
36	depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ST_IIS2MDC),drdy-gpios)
37	select IIS2MDC_TRIGGER
38
39endchoice # IIS2MDC_TRIGGER_MODE
40
41config IIS2MDC_TRIGGER
42	bool
43
44config IIS2MDC_THREAD_PRIORITY
45	int "Thread priority"
46	depends on IIS2MDC_TRIGGER_OWN_THREAD
47	default 10
48	help
49	  Priority of thread used by the driver to handle interrupts.
50
51config IIS2MDC_THREAD_STACK_SIZE
52	int "Thread stack size"
53	depends on IIS2MDC_TRIGGER_OWN_THREAD
54	default 1024
55	help
56	  Stack size of thread used by the driver to handle interrupts.
57
58config IIS2MDC_MAG_ODR_RUNTIME
59	bool "Set magnetometer sampling frequency (ODR) at runtime (default: 10 Hz)"
60	default y
61
62endif # IIS2MDC
63