1# ST Microelectronics IIS2DH 3-axis accelerometer driver 2 3# Copyright (c) 2020 STMicroelectronics 4# SPDX-License-Identifier: Apache-2.0 5 6menuconfig IIS2DH 7 bool "IIS2DH I2C/SPI accelerometer sensor driver" 8 default y 9 depends on DT_HAS_ST_IIS2DH_ENABLED 10 depends on ZEPHYR_HAL_ST_MODULE 11 select I2C if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2DH),i2c) 12 select SPI if $(dt_compat_on_bus,$(DT_COMPAT_ST_IIS2DH),spi) 13 select HAS_STMEMSC 14 select USE_STDC_IIS2DH 15 help 16 Enable driver for IIS2DH accelerometer sensor driver 17 18if IIS2DH 19 20choice IIS2DH_TRIGGER_MODE 21 prompt "Trigger mode" 22 help 23 Specify the type of triggering to be used by the driver. 24 25config IIS2DH_TRIGGER_NONE 26 bool "No trigger" 27 28config IIS2DH_TRIGGER_GLOBAL_THREAD 29 bool "Use global thread" 30 depends on GPIO 31 depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ST_IIS2DH),drdy-gpios) 32 select IIS2DH_TRIGGER 33 34config IIS2DH_TRIGGER_OWN_THREAD 35 bool "Use own thread" 36 depends on GPIO 37 depends on $(dt_compat_any_has_prop,$(DT_COMPAT_ST_IIS2DH),drdy-gpios) 38 select IIS2DH_TRIGGER 39 40endchoice 41 42config IIS2DH_TRIGGER 43 bool 44 45if IIS2DH_TRIGGER 46 47config IIS2DH_THREAD_PRIORITY 48 int "Thread priority" 49 depends on IIS2DH_TRIGGER_OWN_THREAD 50 default 10 51 help 52 Priority of thread used by the driver to handle interrupts. 53 54config IIS2DH_THREAD_STACK_SIZE 55 int "Thread stack size" 56 depends on IIS2DH_TRIGGER_OWN_THREAD 57 default 1024 58 help 59 Stack size of thread used by the driver to handle interrupts. 60 61endif # IIS2DH_TRIGGER 62 63config IIS2DH_RANGE 64 int "Accelerometer Full-scale range setting" 65 default 0 66 help 67 Specify the default accelerometer full-scale range. 68 Valid values are: 69 0: Full Scale selected at runtime 70 2: +/- 2g 71 4: +/- 4g 72 8: +/- 8g 73 16: +/- 16g 74 75config IIS2DH_ODR 76 int "Accelerometer sampling frequency (ODR)" 77 range 0 9 78 default 0 79 help 80 Specify the default accelerometer output data rate expressed in 81 samples per second (Hz). 82 0: ODR selected at runtime 83 1: 1 Hz 84 2: 10 Hz 85 3: 25 Hz 86 4: 50 Hz 87 5: 100 Hz 88 6: 200 Hz 89 7: 400 Hz 90 8: 1620 Hz (only LP) 91 9: Depends by mode. LP: 5376 Hz - NORM or HR: 1344 Hz 92 93config IIS2DH_POWER_MODE 94 int "Sensor Power Modes" 95 range 0 2 96 default 0 97 help 98 Specify the sensor power mode 99 0: High Resolution mode 100 1: Normal mode 101 2: Low Power mode 102 103endif # IIS2DH 104