241 lines
4.9 KiB
Plaintext
241 lines
4.9 KiB
Plaintext
# Kconfig - LIS2DH Three Axis Accelerometer configuration options
|
|
|
|
#
|
|
# Copyright (c) 2017 Intel Corporation
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
menuconfig LIS2DH
|
|
bool
|
|
prompt "LIS2DH Three Axis Accelerometer"
|
|
depends on I2C || SPI
|
|
help
|
|
Enable driver for LIS2DH SPI/I2C-based triaxial accelerometer sensor.
|
|
|
|
config LIS2DH_NAME
|
|
string "Driver name"
|
|
default "LIS2DH"
|
|
depends on LIS2DH
|
|
help
|
|
Device name with which the LIS2DH sensor is identified.
|
|
|
|
choice
|
|
prompt "Sensor Bus Type"
|
|
depends on LIS2DH
|
|
default LIS2DH_BUS_SPI
|
|
help
|
|
Specify bus type, SPI versus I2C, to which the sensor is attached.
|
|
|
|
config LIS2DH_BUS_SPI
|
|
bool "SPI bus"
|
|
depends on SPI
|
|
help
|
|
Use a SPI master to communicate with accelerometer (SPI slave)
|
|
|
|
config LIS2DH_BUS_I2C
|
|
bool "I2C bus"
|
|
depends on I2C
|
|
help
|
|
Use an I2C master to communicate with accelerometer (I2C slave)
|
|
|
|
endchoice
|
|
|
|
config LIS2DH_SPI_MASTER_DEV_NAME
|
|
string "SPI master device name"
|
|
depends on LIS2DH && LIS2DH_BUS_SPI
|
|
default "SPI_0"
|
|
help
|
|
Specify the device name of the SPI master device to which LIS2DH is
|
|
connected.
|
|
|
|
config LIS2DH_SPI_SS_1
|
|
int "LIS2DH SPI slave 1 select number"
|
|
depends on LIS2DH && LIS2DH_BUS_SPI
|
|
range 1 4
|
|
default 1
|
|
help
|
|
SPI slave select line to use to talk to LIS2DH sensor.
|
|
|
|
config LIS2DH_SPI_FREQUENCY
|
|
int "SPI clock frequency"
|
|
depends on LIS2DH && LIS2DH_BUS_SPI
|
|
range 125000 10000000
|
|
default 4000000
|
|
help
|
|
SPI clock frequency to use. Make sure the SPI master hardware supports
|
|
this frequency.
|
|
|
|
config LIS2DH_I2C_ADDR
|
|
hex "LIS2DH I2C address"
|
|
depends on LIS2DH && LIS2DH_BUS_I2C
|
|
default 0x18
|
|
help
|
|
I2C address of the LIS2DH sensor.
|
|
|
|
0x18: Choose this option if the SDO pin is pulled to GND.
|
|
0x19: Choose this option if the SDO pin is pulled to VDDIO.
|
|
|
|
config LIS2DH_I2C_MASTER_DEV_NAME
|
|
string
|
|
prompt "I2C master where LIS2DH is connected"
|
|
depends on LIS2DH && LIS2DH_BUS_I2C
|
|
default "I2C_0"
|
|
help
|
|
Specify the device name of the I2C master device to which LIS2DH is
|
|
connected.
|
|
|
|
choice
|
|
prompt "Trigger mode"
|
|
depends on LIS2DH
|
|
default LIS2DH_TRIGGER_GLOBAL_THREAD
|
|
help
|
|
Specify the type of triggering to be used by the driver.
|
|
|
|
config LIS2DH_TRIGGER_NONE
|
|
bool "No trigger"
|
|
|
|
config LIS2DH_TRIGGER_GLOBAL_THREAD
|
|
bool "Use global thread"
|
|
depends on GPIO
|
|
select LIS2DH_TRIGGER
|
|
|
|
config LIS2DH_TRIGGER_OWN_THREAD
|
|
bool "Use own thread"
|
|
depends on GPIO
|
|
select LIS2DH_TRIGGER
|
|
|
|
endchoice
|
|
|
|
config LIS2DH_TRIGGER
|
|
bool
|
|
depends on LIS2DH
|
|
|
|
config LIS2DH_GPIO_DEV_NAME
|
|
string "GPIO device"
|
|
default "GPIO_0"
|
|
depends on LIS2DH && LIS2DH_TRIGGER
|
|
help
|
|
The device name of the GPIO device to which the LIS2DH interrupt pins
|
|
are connected.
|
|
|
|
config LIS2DH_INT1_GPIO_PIN
|
|
int "Interrupt 1 GPIO pin number"
|
|
range 0 254
|
|
default 25
|
|
depends on LIS2DH && LIS2DH_TRIGGER
|
|
help
|
|
The number of the GPIO on which the interrupt 1 signal from the LIS2DH
|
|
chip will be received.
|
|
|
|
config LIS2DH_INT2_GPIO_PIN
|
|
int "Interrupt 2 GPIO pin number"
|
|
range 0 254
|
|
default 26
|
|
depends on LIS2DH && LIS2DH_TRIGGER
|
|
help
|
|
The number of the GPIO on which the interrupt 2 signal from the LIS2DH
|
|
chip will be received.
|
|
|
|
config LIS2DH_THREAD_PRIORITY
|
|
int "Thread priority"
|
|
depends on LIS2DH && LIS2DH_TRIGGER_OWN_THREAD
|
|
default 10
|
|
help
|
|
Priority of thread used by the driver to handle interrupts.
|
|
|
|
config LIS2DH_THREAD_STACK_SIZE
|
|
int "Thread stack size"
|
|
depends on LIS2DH && LIS2DH_TRIGGER_OWN_THREAD
|
|
default 1024
|
|
help
|
|
Stack size of thread used by the driver to handle interrupts.
|
|
|
|
choice
|
|
prompt "Acceleration measurement range"
|
|
depends on LIS2DH
|
|
default LIS2DH_ACCEL_RANGE_RUNTIME
|
|
help
|
|
Initial measurement full scale range for acceleration values.
|
|
|
|
config LIS2DH_ACCEL_RANGE_RUNTIME
|
|
bool "Set at runtime"
|
|
|
|
config LIS2DH_ACCEL_RANGE_2G
|
|
bool "+/-2g"
|
|
|
|
config LIS2DH_ACCEL_RANGE_4G
|
|
bool "+/-4g"
|
|
|
|
config LIS2DH_ACCEL_RANGE_8G
|
|
bool "+/-8g"
|
|
|
|
config LIS2DH_ACCEL_RANGE_16G
|
|
bool "+/-16g"
|
|
|
|
endchoice
|
|
|
|
choice
|
|
prompt "Power mode"
|
|
depends on LIS2DH
|
|
default LIS2DH_POWER_MODE_NORMAL
|
|
help
|
|
Choose between normal or low power operation mode for chip at init.
|
|
|
|
config LIS2DH_POWER_MODE_NORMAL
|
|
bool "normal"
|
|
|
|
config LIS2DH_POWER_MODE_LOW
|
|
bool "low"
|
|
|
|
endchoice
|
|
|
|
choice
|
|
prompt "Output data rate frequency"
|
|
depends on LIS2DH
|
|
default LIS2DH_ODR_RUNTIME
|
|
help
|
|
Initial data rate frequency of acceleration data at initialization.
|
|
Supported values:
|
|
1Hz, 10Hz, 25Hz, 50Hz, 100Hz, 200Hz, 400Hz in all power modes
|
|
1620Hz, 5376Hz in low power mode only
|
|
1344Hz in normal power mode
|
|
|
|
config LIS2DH_ODR_RUNTIME
|
|
bool "Set at runtime"
|
|
|
|
config LIS2DH_ODR_1
|
|
bool "1Hz"
|
|
|
|
config LIS2DH_ODR_2
|
|
bool "10Hz"
|
|
|
|
config LIS2DH_ODR_3
|
|
bool "25Hz"
|
|
|
|
config LIS2DH_ODR_4
|
|
bool "50Hz"
|
|
|
|
config LIS2DH_ODR_5
|
|
bool "100Hz"
|
|
|
|
config LIS2DH_ODR_6
|
|
bool "200Hz"
|
|
|
|
config LIS2DH_ODR_7
|
|
bool "400Hz"
|
|
|
|
config LIS2DH_ODR_8
|
|
bool "1.6KHz"
|
|
depends on LIS2DH_POWER_MODE_LOW
|
|
|
|
config LIS2DH_ODR_9_NORMAL
|
|
bool "1.25KHz"
|
|
depends on LIS2DH_POWER_MODE_NORMAL
|
|
|
|
config LIS2DH_ODR_9_LOW
|
|
bool "5KHz"
|
|
depends on LIS2DH_POWER_MODE_LOW
|
|
|
|
endchoice
|