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