mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-11 23:15:57 +00:00
I think people might be reading differences into 'if' and 'depends on' that aren't there, like maybe 'if' being needed to "hide" a symbol, while 'depends on' just adds a dependency. There are no differences between 'if' and 'depends on'. 'if' is just a shorthand for 'depends on'. They work the same when it comes to creating implicit menus too. The way symbols get "hidden" is through their dependencies not being satisfied ('if'/'depends on' get copied up as a dependency on the prompt). Since 'if' and 'depends on' are the same, an 'if' with just a single symbol in it can be replaced with a 'depends on'. IMO, it's best to avoid 'if' there as a style choice too, because it confuses people into thinking there's deep Kconfig magic going on that requires 'if'. Going for 'depends on' can also remove some nested 'if's, which generates nicer symbol information and docs, because nested 'if's really are so simple/dumb that they just add the dependencies from both 'if's to all symbols within. Replace a bunch of single-symbol 'if's with 'depends on' to despam the Kconfig files a bit and make it clearer how things work. Also do some other minor related dependency refactoring. The replacement isn't complete. Will fix up the rest later. Splitting it a bit to make it more manageable. (Everything above is true for choices, menus, and comments as well.) Detected by tweaking the Kconfiglib parsing code. It's impossible to detect after parsing, because 'if' turns into 'depends on'. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
146 lines
2.9 KiB
Plaintext
146 lines
2.9 KiB
Plaintext
# 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 (I2C && HAS_DTS_I2C) || SPI
|
|
help
|
|
Enable driver for LSM6DSL accelerometer and gyroscope
|
|
sensor.
|
|
|
|
if LSM6DSL
|
|
|
|
choice LSM6DSL_TRIGGER_MODE
|
|
prompt "Trigger mode"
|
|
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
|
|
|
|
config LSM6DSL_THREAD_PRIORITY
|
|
int "Thread priority"
|
|
depends on 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_TRIGGER_OWN_THREAD
|
|
default 1024
|
|
help
|
|
Stack size of thread used by the driver to handle interrupts.
|
|
|
|
config LSM6DSL_ENABLE_TEMP
|
|
bool "Enable temperature"
|
|
help
|
|
Enable/disable temperature
|
|
|
|
config LSM6DSL_SENSORHUB
|
|
bool "Enable I2C sensorhub feature"
|
|
help
|
|
Enable/disable internal sensorhub
|
|
|
|
choice LSM6DSL_EXTERNAL_SENSOR_0
|
|
prompt "External sensor 0"
|
|
depends on LSM6DSL_SENSORHUB
|
|
help
|
|
Choose the external sensor 0 connected to LSM6DS3.
|
|
|
|
config LSM6DSL_EXT0_LIS2MDL
|
|
bool "LIS2MDL"
|
|
|
|
config LSM6DSL_EXT0_LPS22HB
|
|
bool "LPS22HB"
|
|
|
|
endchoice
|
|
|
|
menu "Attributes"
|
|
|
|
config LSM6DSL_GYRO_FS
|
|
int "Gyroscope full-scale range"
|
|
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"
|
|
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"
|
|
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"
|
|
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
|
|
|
|
endif # LSM6DSL
|