| # Kconfig - LSM6DSL accelerometer and gyroscope sensor configuration |
| # options |
| |
| # |
| # Copyright (c) 2017 Linaro Limited |
| # |
| # SPDX-License-Identifier: Apache-2.0 |
| # |
| |
| menuconfig LSM6DSL |
| bool "LSM6DSL I2C/SPI accelerometer and gyroscope Chip" |
| depends on SENSOR && (I2C || SPI) |
| help |
| Enable driver for LSM6DSL accelerometer and gyroscope |
| sensor. |
| |
| choice LSM6DSL_BUS_TYPE |
| prompt "Interface to AP" |
| depends on LSM6DSL |
| help |
| Select interface the LSM6DSL driver is connected to AP |
| |
| config LSM6DSL_I2C |
| depends on I2C |
| bool "I2C Interface" |
| |
| config LSM6DSL_SPI |
| depends on SPI |
| bool "SPI Interface" |
| |
| endchoice |
| |
| config LSM6DSL_DEV_NAME |
| string "LSM6DSL device name" |
| depends on (LSM6DSL_I2C && !HAS_DTS_I2C_DEVICE) || LSM6DSL_SPI |
| default "LSM6DSL" |
| |
| if !HAS_DTS_I2C_DEVICE |
| |
| config LSM6DSL_I2C_ADDR |
| hex "LSM6DSL I2C address" |
| depends on LSM6DSL && LSM6DSL_I2C |
| default 0x6A |
| range 0x6A 0x6B |
| help |
| I2C address of the LSM6DSL sensor. |
| Use 0x6A if the SA0 pin is pulled to GND or 0x6B if the SA0 pin |
| is pulled to VCC. |
| |
| config LSM6DSL_I2C_MASTER_DEV_NAME |
| string "I2C master name where LSM6DSL chip is connected" |
| depends on LSM6DSL && LSM6DSL_I2C |
| default "I2C_2" |
| help |
| Specify the device name of the I2C master device to which LSM6DSL is |
| connected. |
| |
| endif #HAS_DTS_I2C_DEVICE |
| |
| if !HAS_DTS_SPI_DEVICE |
| |
| config LSM6DSL_SPI_SELECT_SLAVE |
| hex "LSM6DSL SPI slave select pin" |
| depends on LSM6DSL && LSM6DSL_SPI |
| default 1 |
| help |
| LSM6DSL SPI chip select pin (active low). |
| |
| config LSM6DSL_SPI_BUS_FREQ |
| int "LSM6DSL SPI bus speed in Hz" |
| default 8000000 |
| depends on LSM6DSL && LSM6DSL_SPI |
| help |
| This is the maximum supported SPI bus frequency. The chip supports a |
| frequency up to 10MHz. |
| |
| config LSM6DSL_SPI_MASTER_DEV_NAME |
| string "SPI master name where LSM6DSL chip is connected" |
| depends on LSM6DSL && LSM6DSL_SPI |
| default "SPI_2" |
| help |
| Specify the device name of the spi master device to which LSM6DSL is |
| connected. |
| |
| endif #HAS_DTS_SPI_DEVICE |
| |
| config LSM6DSL_SPI_GPIO_CS |
| bool "LSM6DSL SPI CS through a GPIO pin" |
| depends on LSM6DSL && LSM6DSL_SPI |
| help |
| This option is useful if one needs to manage SPI CS through a GPIO |
| pin to by-pass the SPI controller's CS logic. |
| |
| if !HAS_DTS_SPI_PINS |
| |
| config LSM6DSL_SPI_GPIO_CS_DRV_NAME |
| string "GPIO driver's name to use to drive SPI CS through" |
| default "" |
| depends on LSM6DSL_SPI_GPIO_CS |
| help |
| This option is mandatory to set which GPIO controller to use in order |
| to actually emulate the SPI CS. |
| |
| config LSM6DSL_SPI_GPIO_CS_PIN |
| int "GPIO PIN to use to drive SPI CS through" |
| default 0 |
| depends on LSM6DSL_SPI_GPIO_CS |
| help |
| This option is mandatory to set which GPIO pin to use in order |
| to actually emulate the SPI CS. |
| |
| endif # !HAS_DTS_SPI_PINS |
| |
| choice LSM6DSL_TRIGGER_MODE |
| prompt "Trigger mode" |
| depends on LSM6DSL |
| help |
| Specify the type of triggering to be used by the driver. |
| |
| config LSM6DSL_TRIGGER_NONE |
| bool "No trigger" |
| |
| config LSM6DSL_TRIGGER_GLOBAL_THREAD |
| bool "Use global thread" |
| depends on GPIO |
| select LSM6DSL_TRIGGER |
| |
| config LSM6DSL_TRIGGER_OWN_THREAD |
| bool "Use own thread" |
| depends on GPIO |
| select LSM6DSL_TRIGGER |
| |
| endchoice |
| |
| config LSM6DSL_TRIGGER |
| bool |
| depends on LSM6DSL |
| |
| if !HAS_DTS_SPI_PINS |
| |
| config LSM6DSL_GPIO_DEV_NAME |
| string "GPIO device" |
| depends on LSM6DSL && LSM6DSL_TRIGGER |
| help |
| The device name of the GPIO device to which the LSM6DSL interrupt pin |
| is connected. |
| |
| config LSM6DSL_GPIO_PIN_NUM |
| int "Interrupt GPIO pin number" |
| depends on LSM6DSL && LSM6DSL_TRIGGER |
| help |
| The number of the GPIO on which the interrupt signal from the LSM6DSL |
| chip will be received. |
| |
| endif #HAS_DTS_SPI_DEVICE |
| |
| config LSM6DSL_THREAD_PRIORITY |
| int "Thread priority" |
| depends on LSM6DSL && LSM6DSL_TRIGGER_OWN_THREAD |
| default 10 |
| help |
| Priority of thread used by the driver to handle interrupts. |
| |
| config LSM6DSL_THREAD_STACK_SIZE |
| int "Thread stack size" |
| depends on LSM6DSL && LSM6DSL_TRIGGER_OWN_THREAD |
| default 1024 |
| help |
| Stack size of thread used by the driver to handle interrupts. |
| |
| config LSM6DSL_ENABLE_TEMP |
| bool "Enable temperature" |
| depends on LSM6DSL |
| help |
| Enable/disable temperature |
| |
| config LSM6DSL_SENSORHUB |
| bool "Enable I2C sensorhub feature" |
| depends on LSM6DSL |
| help |
| Enable/disable internal sensorhub |
| |
| if LSM6DSL_SENSORHUB |
| |
| config LSM6DSL_ENABLE_INTERNAL_PULLUP |
| bool "Enabled internals pull-up resistors" |
| default y |
| |
| choice LSM6DSL_EXTERNAL_SENSOR_0 |
| prompt "External sensor 0" |
| help |
| Choose the external sensor 0 connected to LSM6DS3. |
| |
| config LSM6DSL_EXT0_LIS2MDL |
| bool "LIS2MDL" |
| |
| config LSM6DSL_EXT0_LPS22HB |
| bool "LPS22HB" |
| |
| endchoice |
| |
| endif #LSM6DSL_SENSORHUB |
| |
| menu "Attributes" |
| depends on LSM6DSL |
| |
| config LSM6DSL_GYRO_FS |
| int "Gyroscope full-scale range" |
| depends on LSM6DSL |
| default 0 |
| help |
| Specify the default gyroscope full-scale range. |
| An X value for the config represents a range of +/- X degree per |
| second. Valid values are: |
| 0: Full Scale selected at runtime |
| 125: +/- 125dps |
| 245: +/- 245dps |
| 500: +/- 500dps |
| 1000: +/- 1000dps |
| 2000: +/- 2000dps |
| |
| config LSM6DSL_GYRO_ODR |
| int "Gyroscope Output data rate frequency" |
| depends on LSM6DSL |
| range 0 10 |
| default 0 |
| help |
| Specify the default accelerometer output data rate expressed in |
| samples per second (Hz). |
| 0: ODR selected at runtime |
| 1: 12.5Hz |
| 2: 26Hz |
| 3: 52Hz |
| 4: 104Hz |
| 5: 208Hz |
| 6: 416Hz |
| 7: 833Hz |
| 8: 1660Hz |
| 9: 3330Hz |
| 10: 6660Hz |
| |
| config LSM6DSL_ACCEL_FS |
| int "Accelerometer full-scale range" |
| depends on LSM6DSL |
| default 0 |
| help |
| Specify the default accelerometer full-scale range. |
| An X value for the config represents a range of +/- X G. Valid values |
| are: |
| 0: Full Scale selected at runtime |
| 2: +/- 2g |
| 4: +/- 4g |
| 8: +/- 8g |
| 16: +/- 16g |
| |
| config LSM6DSL_ACCEL_ODR |
| int "Accelerometer Output data rate frequency" |
| depends on LSM6DSL |
| range 0 10 |
| default 0 |
| help |
| Specify the default accelerometer output data rate expressed in |
| samples per second (Hz). |
| 0: ODR selected at runtime |
| 1: 12.5Hz |
| 2: 26Hz |
| 3: 52Hz |
| 4: 104Hz |
| 5: 208Hz |
| 6: 416Hz |
| 7: 833Hz |
| 8: 1660Hz |
| 9: 3330Hz |
| 10: 6660Hz |
| endmenu |