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 select IIS2DH_TRIGGER 32 33config IIS2DH_TRIGGER_OWN_THREAD 34 bool "Use own thread" 35 depends on GPIO 36 select IIS2DH_TRIGGER 37 38endchoice 39 40config IIS2DH_TRIGGER 41 bool 42 43if IIS2DH_TRIGGER 44 45config IIS2DH_THREAD_PRIORITY 46 int "Thread priority" 47 depends on IIS2DH_TRIGGER_OWN_THREAD 48 default 10 49 help 50 Priority of thread used by the driver to handle interrupts. 51 52config IIS2DH_THREAD_STACK_SIZE 53 int "Thread stack size" 54 depends on IIS2DH_TRIGGER_OWN_THREAD 55 default 1024 56 help 57 Stack size of thread used by the driver to handle interrupts. 58 59endif # IIS2DH_TRIGGER 60 61config IIS2DH_RANGE 62 int "Accelerometer Full-scale range setting" 63 default 0 64 help 65 Specify the default accelerometer full-scale range. 66 Valid values are: 67 0: Full Scale selected at runtime 68 2: +/- 2g 69 4: +/- 4g 70 8: +/- 8g 71 16: +/- 16g 72 73config IIS2DH_ODR 74 int "Accelerometer sampling frequency (ODR)" 75 range 0 9 76 default 0 77 help 78 Specify the default accelerometer output data rate expressed in 79 samples per second (Hz). 80 0: ODR selected at runtime 81 1: 1 Hz 82 2: 10 Hz 83 3: 25 Hz 84 4: 50 Hz 85 5: 100 Hz 86 6: 200 Hz 87 7: 400 Hz 88 8: 1620 Hz (only LP) 89 9: Depends by mode. LP: 5376 Hz - NORM or HR: 1344 Hz 90 91config IIS2DH_POWER_MODE 92 int "Sensor Power Modes" 93 range 0 2 94 default 0 95 help 96 Specify the sensor power mode 97 0: High Resolution mode 98 1: Normal mode 99 2: Low Power mode 100 101endif # IIS2DH 102