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>
215 lines
5.5 KiB
Plaintext
215 lines
5.5 KiB
Plaintext
# FXOS8700 6-axis accelerometer/magnetometer
|
|
|
|
# Copyright (c) 2016 Freescale Semiconductor, Inc.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
menuconfig FXOS8700
|
|
bool "FXOS8700 accelerometer/magnetometer driver"
|
|
depends on I2C && HAS_DTS_I2C && HAS_DTS_GPIO
|
|
help
|
|
Enable driver for the FXOS8700 accelerometer/magnetometer.
|
|
The driver also supports MMA8451Q, MMA8652FC and MMA8653FC
|
|
accelerometers. If the driver is used with one of these
|
|
accelerometers then the Accelerometer-only mode should be selected."
|
|
|
|
if FXOS8700
|
|
|
|
choice
|
|
prompt "Mode"
|
|
default FXOS8700_MODE_ACCEL
|
|
|
|
config FXOS8700_MODE_ACCEL
|
|
bool "Accelerometer-only mode"
|
|
|
|
config FXOS8700_MODE_MAGN
|
|
bool "Magnetometer-only mode"
|
|
|
|
config FXOS8700_MODE_HYBRID
|
|
bool "Hybrid (accel+mag) mode"
|
|
|
|
endchoice
|
|
|
|
config FXOS8700_TEMP
|
|
bool "Enable temperature"
|
|
depends on FXOS8700_MODE_MAGN || FXOS8700_MODE_HYBRID
|
|
help
|
|
Enable the temperature sensor. Note that the temperature sensor is
|
|
uncalibrated and its output for a given temperature may vary from one
|
|
device to the next.
|
|
|
|
choice
|
|
prompt "Range"
|
|
default FXOS8700_RANGE_8G
|
|
|
|
config FXOS8700_RANGE_8G
|
|
bool "8g (0.976 mg/LSB)"
|
|
|
|
config FXOS8700_RANGE_4G
|
|
bool "4g (0.488 mg/LSB)"
|
|
|
|
config FXOS8700_RANGE_2G
|
|
bool "2g (0.244 mg/LSB)"
|
|
|
|
endchoice
|
|
|
|
choice
|
|
prompt "Power mode"
|
|
default FXOS8700_PM_NORMAL
|
|
|
|
config FXOS8700_PM_NORMAL
|
|
bool "Normal power mode"
|
|
|
|
config FXOS8700_PM_LOW_NOISE_LOW_POWER
|
|
bool "Low noise low power mode"
|
|
|
|
config FXOS8700_PM_HIGH_RESOLUTION
|
|
bool "High resolution power mode"
|
|
|
|
config FXOS8700_PM_LOW_POWER
|
|
bool "Low power mode"
|
|
|
|
endchoice
|
|
|
|
choice
|
|
prompt "Trigger mode"
|
|
default FXOS8700_TRIGGER_NONE
|
|
|
|
config FXOS8700_TRIGGER_NONE
|
|
bool "No trigger"
|
|
|
|
config FXOS8700_TRIGGER_GLOBAL_THREAD
|
|
bool "Use global thread"
|
|
select FXOS8700_TRIGGER
|
|
|
|
config FXOS8700_TRIGGER_OWN_THREAD
|
|
bool "Use own thread"
|
|
select FXOS8700_TRIGGER
|
|
|
|
endchoice
|
|
|
|
config FXOS8700_TRIGGER
|
|
bool
|
|
|
|
config FXOS8700_DRDY_INT1
|
|
bool "Data ready interrupt to INT1 pin"
|
|
depends on FXOS8700_TRIGGER
|
|
help
|
|
Say Y to route data ready interrupt to INT1 pin. Say N to route to
|
|
INT2 pin.
|
|
|
|
if FXOS8700_TRIGGER
|
|
|
|
config FXOS8700_THREAD_PRIORITY
|
|
int "Own thread priority"
|
|
depends on FXOS8700_TRIGGER_OWN_THREAD
|
|
default 10
|
|
|
|
config FXOS8700_THREAD_STACK_SIZE
|
|
int "Own thread stack size"
|
|
depends on FXOS8700_TRIGGER_OWN_THREAD
|
|
default 1024
|
|
|
|
menuconfig FXOS8700_PULSE
|
|
bool "Pulse detection"
|
|
help
|
|
Enable pulse detection
|
|
|
|
if FXOS8700_PULSE
|
|
|
|
config FXOS8700_PULSE_INT1
|
|
bool "Pulse interrupt to INT1 pin"
|
|
help
|
|
Say Y to route pulse interrupt to INT1 pin. Say N to route to INT2 pin.
|
|
|
|
config FXOS8700_PULSE_CFG
|
|
hex "Pulse configuration register"
|
|
range 0 0xff
|
|
default 0x3f
|
|
|
|
config FXOS8700_PULSE_THSX
|
|
hex "Pulse X-axis threshold"
|
|
range 0 0x7f
|
|
default 0x20
|
|
help
|
|
Threshold to start the pulse-event detection procedure on the X-axis.
|
|
Threshold values for each axis are unsigned 7-bit numbers with a
|
|
fixed resolution of 0.063 g/LSB, corresponding to an 8g acceleration
|
|
full-scale range.
|
|
|
|
config FXOS8700_PULSE_THSY
|
|
hex "Pulse Y-axis threshold"
|
|
range 0 0x7f
|
|
default 0x20
|
|
help
|
|
Threshold to start the pulse-event detection procedure on the Y-axis.
|
|
Threshold values for each axis are unsigned 7-bit numbers with a
|
|
fixed resolution of 0.063 g/LSB, corresponding to an 8g acceleration
|
|
full-scale range.
|
|
|
|
config FXOS8700_PULSE_THSZ
|
|
hex "Pulse Z-axis threshold"
|
|
range 0 0x7f
|
|
default 0x40
|
|
help
|
|
Threshold to start the pulse-event detection procedure on the Z-axis.
|
|
Threshold values for each axis are unsigned 7-bit numbers with a
|
|
fixed resolution of 0.063 g/LSB, corresponding to an 8g acceleration
|
|
full-scale range.
|
|
|
|
config FXOS8700_PULSE_TMLT
|
|
hex "Pulse time limit"
|
|
range 0 0x7f
|
|
default 0x18
|
|
help
|
|
The maximum time interval that can elapse between the start of the
|
|
acceleration on the selected channel exceeding the specified
|
|
threshold and the end when the channel acceleration goes back below
|
|
the specified threshold. The resolution depends upon the sample rate
|
|
(ODR) and the high-pass filter configuration
|
|
(HP_FILTER_CUTOFF[pls_hpf_en]). For ODR=800 Hz and pls_hpf_en=0, the
|
|
resolution is 0.625 ms/LSB.
|
|
|
|
config FXOS8700_PULSE_LTCY
|
|
hex "Pulse latency"
|
|
range 0 0xff
|
|
default 0x28
|
|
help
|
|
The time interval that starts after the first pulse detection where
|
|
the pulse-detection function ignores the start of a new pulse. The
|
|
resolution depends upon the sample rate (ODR) and the high-pass filter
|
|
configuration (HP_FILTER_CUTOFF[pls_hpf_en]). For ODR=800 Hz and
|
|
pls_hpf_en=0, the resolution is 1.25 ms/LSB.
|
|
|
|
config FXOS8700_PULSE_WIND
|
|
hex "Pulse window"
|
|
range 0 0xff
|
|
default 0x3c
|
|
help
|
|
The maximum interval of time that can elapse after the end of the
|
|
latency interval in which the start of the second pulse event must be
|
|
detected provided the device has been configured for double pulse
|
|
detection. The detected second pulse width must be shorter than the
|
|
time limit constraint specified by the PULSE_TMLT register, but the
|
|
end of the double pulse need not finish within the time specified by
|
|
the PULSE_WIND register. The resolution depends upon the sample rate
|
|
(ODR) and the high-pass filter configuration
|
|
(HP_FILTER_CUTOFF[pls_hpf_en]). For ODR=800 Hz and pls_hpf_en=0, the
|
|
resolution is 1.25 ms/LSB.
|
|
|
|
endif # FXOS8700_PULSE
|
|
|
|
menuconfig FXOS8700_MOTION
|
|
bool "Motion detection"
|
|
help
|
|
Enable motion detection
|
|
|
|
config FXOS8700_MOTION_INT1
|
|
bool "Motion interrupt to INT1 pin"
|
|
depends on FXOS8700_MOTION
|
|
help
|
|
Say Y to route motion interrupt to INT1 pin. Say N to route to INT2 pin.
|
|
|
|
endif # FXOS8700_TRIGGER
|
|
|
|
endif # FXOS8700
|