mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
ce04d978ef
Co-authored-by: Leandro Lanzieri <leandro.lanzieri@haw-hamburg.de>
460 lines
14 KiB
Plaintext
460 lines
14 KiB
Plaintext
# Copyright (c) 2021 Gunar Schorcht
|
|
#
|
|
# This file is subject to the terms and conditions of the GNU Lesser
|
|
# General Public License v2.1. See the file LICENSE in the top level
|
|
# directory for more details.
|
|
#
|
|
|
|
config HAVE_L3GD20H
|
|
bool
|
|
select MODULE_L3GXXXX if MODULE_SAUL_DEFAULT
|
|
help
|
|
Indicates that L3GD20H sensor is present.
|
|
|
|
config HAVE_L3GD20
|
|
bool
|
|
select MODULE_L3GXXXX if MODULE_SAUL_DEFAULT
|
|
help
|
|
Indicates that L3GD20 sensor is present.
|
|
|
|
config HAVE_L3G4200D_NG
|
|
bool
|
|
select MODULE_L3GXXXX if MODULE_SAUL_DEFAULT
|
|
help
|
|
Indicates that L3G4200D sensor is present.
|
|
|
|
config HAVE_A3G4250D
|
|
bool
|
|
select MODULE_L3GXXXX if MODULE_SAUL_DEFAULT
|
|
help
|
|
Indicates that A3G4250D sensor is present.
|
|
|
|
config HAVE_I3G4250D
|
|
bool
|
|
select MODULE_L3GXXXX if MODULE_SAUL_DEFAULT
|
|
help
|
|
Indicates that A3G4250D sensor is present.
|
|
|
|
config HAVE_L3GXXXX_I2C
|
|
bool
|
|
|
|
config HAVE_L3GXXXX_SPI
|
|
bool
|
|
|
|
menuconfig MODULE_L3GXXXX
|
|
bool "L3GXXX 3-axis gyroscope sensor"
|
|
depends on TEST_KCONFIG
|
|
help
|
|
Driver for ST L3GXXXX 3-axis gyroscope sensor family.
|
|
The driver supports L3GD20H, L3GD20, L3G4200D, I3G4250D and A3G4250D.
|
|
|
|
if MODULE_L3GXXXX
|
|
|
|
menu "Sensor variants used"
|
|
|
|
config MODULE_L3GD20H
|
|
bool "L3GD20H"
|
|
default y if HAVE_L3GD20H
|
|
default y if !MODULE_L3GD20 && !MODULE_L3G4200D_NG && !MODULE_A3G4250D && !MODULE_I3G4250D
|
|
|
|
help
|
|
Enables the support for L3GD20H.
|
|
|
|
config MODULE_L3GD20
|
|
bool "L3GD20"
|
|
default y if HAVE_L3GD20
|
|
help
|
|
Enables the support for L3GD20.
|
|
|
|
config MODULE_L3G4200D_NG
|
|
bool "L3G4200D"
|
|
default y if HAVE_L3G4200D_NG
|
|
help
|
|
Enables the support for L3G4200D.
|
|
|
|
config MODULE_A3G4250D
|
|
bool "A3G4250D"
|
|
default y if HAVE_A3G4250D
|
|
help
|
|
Enables the support for A3G4250D.
|
|
|
|
config MODULE_I3G4250D
|
|
bool "I3G4250D"
|
|
default y if HAVE_I3G4250D
|
|
help
|
|
Enables the support for I3G4250D.
|
|
|
|
endmenu
|
|
|
|
choice
|
|
bool "Device interface"
|
|
default MODULE_L3GXXXX_I2C if HAVE_L3GXXXX_I2C
|
|
default MODULE_L3GXXXX_SPI if HAVE_L3GXXXX_SPI
|
|
help
|
|
The device can be connected via I2C or SPI, select the right one.
|
|
|
|
config MODULE_L3GXXXX_I2C
|
|
bool "I2C"
|
|
depends on HAS_PERIPH_I2C
|
|
select MODULE_PERIPH_I2C
|
|
|
|
config MODULE_L3GXXXX_SPI
|
|
bool "SPI"
|
|
depends on HAS_PERIPH_SPI
|
|
depends on HAS_PERIPH_GPIO
|
|
select MODULE_PERIPH_SPI
|
|
select MODULE_PERIPH_GPIO
|
|
|
|
endchoice
|
|
|
|
config MODULE_L3GXXXX_LOW_ODR
|
|
bool "Support of low output data rates"
|
|
depends on MODULE_L3GD20H
|
|
help
|
|
Low data rates are only supported on L3GD20H.
|
|
|
|
choice
|
|
bool "Output data rate (ODR)"
|
|
default L3GXXXX_ODR_100_25
|
|
help
|
|
Measurements are performed at a defined output rate (ODR) with a
|
|
user selectable bandwidth. Select the ouput data rate of the sensor
|
|
an the cutoff frequency of the LPF2 filter. The cutoff frequency of
|
|
LPF1 is fix for a given output data rate.
|
|
|
|
config L3GXXXX_ODR_100_12
|
|
bool "High ODR 100 Hz, LPF2 cutoff 12.5 Hz (LPF1 cutoff 32 Hz)"
|
|
config L3GXXXX_ODR_100_25
|
|
bool "High ODR 100 Hz, LPF2 cutoff 25 Hz (LPF1 cutoff 32 Hz)"
|
|
config L3GXXXX_ODR_200_12
|
|
bool "High ODR 200 Hz, LPF1 cutoff 63.3 Hz, LPF2 cutoff 12.5 Hz"
|
|
config L3GXXXX_ODR_200_25
|
|
bool "High ODR 200 Hz, LPF1 cutoff 63.3 Hz, LPF2 cutoff 25 Hz"
|
|
config L3GXXXX_ODR_200_50
|
|
bool "High ODR 200 Hz, LPF1 cutoff 63.3 Hz, LPF2 cutoff 50 Hz"
|
|
config L3GXXXX_ODR_200_70
|
|
bool "High ODR 200 Hz, LPF1 cutoff 63.3 Hz, LPF2 cutoff 70 Hz"
|
|
config L3GXXXX_ODR_400_20
|
|
bool "High ODR 400 Hz, LPF1 cutoff 128 Hz, LPF2 cutoff 20 Hz"
|
|
config L3GXXXX_ODR_400_25
|
|
bool "High ODR 400 Hz, LPF1 cutoff 128 Hz, LPF2 cutoff 25 Hz"
|
|
config L3GXXXX_ODR_400_50
|
|
bool "High ODR 400 Hz, LPF1 cutoff 128 Hz, LPF2 cutoff 50 Hz"
|
|
config L3GXXXX_ODR_400_110
|
|
bool "High ODR 400 Hz, LPF1 cutoff 128 Hz, LPF2 cutoff 110 Hz"
|
|
config L3GXXXX_ODR_800_30
|
|
bool "High ODR 800 Hz, LPF1 cutoff 211 Hz, LPF2 cutoff 30 Hz"
|
|
config L3GXXXX_ODR_800_35
|
|
bool "High ODR 800 Hz, LPF1 cutoff 211 Hz, LPF2 cutoff 35 Hz"
|
|
config L3GXXXX_ODR_800_50
|
|
bool "High ODR 800 Hz, LPF1 cutoff 211 Hz, LPF2 cutoff 50 Hz"
|
|
config L3GXXXX_ODR_800_100
|
|
bool "High ODR 800 Hz, LPF1 cutoff 211 Hz, LPF2 cutoff 100 Hz"
|
|
|
|
if MODULE_L3GXXXX_LOW_ODR
|
|
|
|
config L3GXXXX_ODR_12
|
|
bool "Low ODR 12.5 Hz, LPF1 cutoff 3.9 Hz, LPF2 not used"
|
|
config L3GXXXX_ODR_25
|
|
bool "Low ODR 25 Hz, LPF1 cutoff 7.8 Hz, LPF2 not used"
|
|
config L3GXXXX_ODR_50
|
|
bool "Low ODR 50 Hz, LPF1 cutoff 16 Hz, LPF2 cutoff 16.6 Hz"
|
|
|
|
endif # MODULE_L3GXXXX_LOW_ODR
|
|
|
|
endchoice
|
|
|
|
choice
|
|
bool "Full scale"
|
|
default L3GXXXX_SCALE_245_DPS
|
|
help
|
|
The full scale value determines the sensitivity of the sensor and thus
|
|
the range and resolution of the sensor's output data. The resolution
|
|
of the output data is about Full Scale/INT16_MAX.
|
|
|
|
config L3GXXXX_SCALE_245_DPS
|
|
bool "±245 dps"
|
|
help
|
|
The typical sensitivity is 8.75 mdps.
|
|
|
|
if !MODULE_A3G4250D
|
|
|
|
config L3GXXXX_SCALE_500_DPS
|
|
bool "±500 dps"
|
|
help
|
|
The Typical sensitivity is 17.5 mdps.
|
|
|
|
config L3GXXXX_SCALE_2000_DPS
|
|
bool "±2000 dps"
|
|
help
|
|
The typical sensitivity is 70 mdps.
|
|
|
|
endif # !MODULE_A3G4250D
|
|
|
|
endchoice
|
|
|
|
choice
|
|
bool "Filters used for output data"
|
|
default L3GXXXX_HPF_AND_LPF2
|
|
help
|
|
L3Gxxxx sensors integrate a combination of two low pass filters (LPF)
|
|
and one high pass filter (HPF) which can be used to filter the output
|
|
data. First, raw sensor data are always filtered by LPF1 with a cutoff
|
|
frequency that is fixed for the selected output data rate (ODR).
|
|
The resulting data can then optionally be filtered by HPF and LPF2.
|
|
Both filters can be used or bypassed.
|
|
Please note: The filter selection for the output data also affects the
|
|
filter selection for event interrupt generation. If the HPF is enabled
|
|
for filtering the output data, it is also active for filtering the
|
|
sensor data used for interrupt generation if the LPF2 is enabled for
|
|
interrupt generation.
|
|
|
|
config L3GXXXX_NO_FILTER
|
|
bool "HPF and LPF2 are not used"
|
|
|
|
config L3GXXXX_HPF_ONLY
|
|
bool "only HPF is used"
|
|
|
|
config L3GXXXX_LPF2_ONLY
|
|
bool "only LPF2 used"
|
|
|
|
config L3GXXXX_HPF_AND_LPF2
|
|
bool "HPF and LPF2 are used"
|
|
|
|
endchoice
|
|
|
|
if L3GXXXX_HPF_ONLY || L3GXXXX_HPF_AND_LPF2 || L3GXXXX_INT1_HPF_ONLY || L3GXXXX_INT1_HPF_AND_LPF2
|
|
|
|
choice
|
|
bool "HPF mode"
|
|
help
|
|
The high pass filter (HPF) can be used in different modes. Select
|
|
the right one.
|
|
|
|
config L3GXXXX_HPF_NORMAL
|
|
bool "Normal mode"
|
|
help
|
|
In Normal mode, the HPF is reset by reading REFERENCE register.
|
|
|
|
config L3GXXXX_HPF_REFERENCE
|
|
bool "Reference mode"
|
|
help
|
|
In Reference mode, the output data are the difference to the
|
|
value written to the REFERENCE register.
|
|
|
|
config L3GXXXX_HPF_AUTORESET
|
|
bool "Autoreset mode"
|
|
help
|
|
In Autoreset mode, the HPF is automatically reset when a configured
|
|
interrupt event occurs.
|
|
|
|
endchoice
|
|
|
|
config L3GXXXX_HPF_CUTOFF
|
|
int "HPF cutoff frequency n = [0...9]"
|
|
range 0 9
|
|
default 0
|
|
help
|
|
The cutoff frequency is specified as a value from 0 to 9, which defines
|
|
the cutoff frequency depending on the selected sensor mode and the
|
|
output data rate. Details can be found in the data sheet for the CTRL2
|
|
register field HPCF.
|
|
|
|
endif # L3GXXXX_HPF_ONLY || L3GXXXX_HPF_AND_LPF2 || L3GXXXX_INT1_HPF_ONLY || L3GXXXX_INT1_HPF_AND_LPF2
|
|
|
|
config MODULE_L3GXXXX_FIFO
|
|
bool "Support for the 32 level FIFO"
|
|
help
|
|
The 32 level FIFO is used to collect a number of sensor
|
|
data samples before the data have to be fetched by the MCU.
|
|
|
|
if MODULE_L3GXXXX_FIFO
|
|
|
|
choice
|
|
bool "FIFO mode"
|
|
default L3GXXXX_FIFO_MODE_FIFO
|
|
help
|
|
The 32 level FIFO is used to collect a number of sensor
|
|
data samples before the data have to be fetched by the MCU. Select
|
|
the right mode of the FIFO.
|
|
|
|
config L3GXXXX_FIFO_MODE_BYPASS
|
|
bool "Bypass mode (FIFO is not used)"
|
|
help
|
|
The FIFO is not used.
|
|
|
|
config L3GXXXX_FIFO_MODE_FIFO
|
|
bool "FIFO mode"
|
|
help
|
|
Data samples are stored in the FIFO until it is full.
|
|
|
|
config L3GXXXX_FIFO_MODE_STREAM
|
|
bool "Stream mode"
|
|
help
|
|
The FIFO is used as ring buffer and newest data samples are stored.
|
|
continuously
|
|
|
|
config L3GXXXX_FIFO_MODE_DYNAMIC_STREAM
|
|
bool "Dynamic Stream mode"
|
|
help
|
|
Like the Stream mode, but differs in reading the first data sample
|
|
after emptying.
|
|
|
|
config L3GXXXX_FIFO_MODE_STREAM_TO_FIFO
|
|
bool "Stream-to-FIFO mode"
|
|
help
|
|
The FIFO is used in stream mode until an event interrupt is triggered
|
|
and then switches to FIFO mode.
|
|
|
|
config L3GXXXX_FIFO_MODE_BYPASS_TO_STREAM
|
|
bool "Bypass-to-Stream mode"
|
|
help
|
|
The FIFO is not used until an event interrupt is triggered
|
|
and then switches to Stream mode
|
|
|
|
config L3GXXXX_FIFO_MODE_BYPASS_TO_FIFO
|
|
bool "Bypass-to-FIFO mode"
|
|
help
|
|
The FIFO is not used until an event interrupt is triggered
|
|
and then switches to FIFO mode.
|
|
|
|
endchoice
|
|
|
|
config L3GXXXX_FIFO_WATERMARK
|
|
int "FIFO watermark level (threshold)"
|
|
range 1 23
|
|
default 31
|
|
help
|
|
If the number of data samples in FIFO becomes greater than this
|
|
watermark level (threshold), the WTM (FTH) flag in FIFO_SRC register
|
|
is set and an interrupt can be triggered on signal INT2/DRDY if data
|
|
ready and FIFO status interrupts is enabled.
|
|
|
|
endif # MODULE_L3GXXXX_FIFO
|
|
|
|
config MODULE_L3GXXXX_IRQ_EVENT
|
|
bool "Support for event interrupts on signal INT1"
|
|
depends on HAS_PERIPH_GPIO_IRQ
|
|
select MODULE_PERIPH_GPIO_IRQ
|
|
help
|
|
Event interrupts on signal INT2/DRDY can be used to recognize
|
|
axes movements or wake-up.
|
|
|
|
if MODULE_L3GXXXX_IRQ_EVENT
|
|
|
|
config L3GXXXX_INT1_X_THRESH
|
|
int "Threshold for X axis events"
|
|
range 0 32767
|
|
default 4012
|
|
help
|
|
Threshold values are defined for raw data values. Their resolution
|
|
therefore depends on the selected full range (default ~30 at 245 dps):
|
|
254 dps -> LSB value ~7.5 mdps,
|
|
500 dps -> LSB value ~15.3 mdps,
|
|
2000 dps -> LSB value ~61 mdps
|
|
|
|
config L3GXXXX_INT1_Y_THRESH
|
|
int "Threshold for Y axis events"
|
|
range 0 32767
|
|
default 4012
|
|
help
|
|
Threshold values are defined for raw data values. Their resolution
|
|
therefore depends on the selected full range (default ~30 at 245 dps):
|
|
254 dps -> LSB value ~7.5 mdps,
|
|
500 dps -> LSB value ~15.3 mdps,
|
|
2000 dps -> LSB value ~61 mdps
|
|
|
|
config L3GXXXX_INT1_Z_THRESH
|
|
int "Threshold for Z axis events"
|
|
range 0 32767
|
|
default 4012
|
|
help
|
|
Threshold values are defined for raw data values. Their resolution
|
|
therefore depends on the selected full range (default ~30 at 245 dps):
|
|
254 dps -> LSB value ~7.5 mdps,
|
|
500 dps -> LSB value ~15.3 mdps,
|
|
2000 dps -> LSB value ~61 mdps
|
|
|
|
config L3GXXXX_INT1_X_GT_THRESH
|
|
bool "Interrupt generation enabled for |X| > X threshold (X high event)"
|
|
default y
|
|
|
|
config L3GXXXX_INT1_X_LT_THRESH
|
|
bool "Interrupt generation enabled for |X| < X threshold (X low event)"
|
|
default n
|
|
|
|
config L3GXXXX_INT1_Y_GT_THRESH
|
|
bool "Interrupt generation enabled for |Y| > Y threshold (Y high event)"
|
|
default y
|
|
|
|
config L3GXXXX_INT1_Y_LT_THRESH
|
|
bool "Interrupt generation enabled for |Y| < Y threshold (Y low event)"
|
|
default n
|
|
|
|
config L3GXXXX_INT1_Z_GT_THRESH
|
|
bool "Interrupt generation enabled for |Z| > Z threshold (Z high event)"
|
|
default y
|
|
|
|
config L3GXXXX_INT1_Z_LT_THRESH
|
|
bool "Interrupt generation enabled for |Z| < Z threshold (Z low event)"
|
|
default n
|
|
|
|
choice
|
|
bool "Filters used for event interrupt generation"
|
|
default L3GXXXX_INT1_HPF_AND_LPF2
|
|
help
|
|
The combination of high pass filter (HPF) and low pass filter 2 (LPF2)
|
|
can also be used to filter the sensor data for event interrupt
|
|
generation.
|
|
Please note: The filter selection for the interrupt generation also
|
|
affects the filter selection for the output data. If the HPF is enabled
|
|
for interrupt generation, it is also active for filtering the
|
|
output data if the LPF2 is enabled for output data.
|
|
|
|
config L3GXXXX_INT1_NO_FILTER
|
|
bool "HPF and LPF2 are not used"
|
|
|
|
config L3GXXXX_INT1_HPF_ONLY
|
|
bool "only HPF is used"
|
|
|
|
config L3GXXXX_INT1_LPF2_ONLY
|
|
bool "only LPF2 used"
|
|
|
|
config L3GXXXX_INT1_HPF_AND_LPF2
|
|
bool "HPF and LPF2 are used"
|
|
|
|
endchoice
|
|
|
|
config L3GXXXX_INT1_AND
|
|
bool "Combination of interupt events"
|
|
default n
|
|
help
|
|
y (AND) = all enabled axes passed their tresholds,
|
|
n (OR) = at least one axis passed its threshold
|
|
|
|
config L3GXXXX_INT1_LATCH
|
|
bool "Interrupt latch enable"
|
|
default n
|
|
help
|
|
If enabled, the interrupt is latched until the interrupt source has
|
|
been read.
|
|
|
|
endif # MODULE_L3GXXXX_IRQ_EVENT
|
|
|
|
config MODULE_L3GXXXX_IRQ_DATA
|
|
bool "Support for data interrupts on signal INT2/DRDY (Data Ready and FIFO status)"
|
|
depends on HAS_PERIPH_GPIO_IRQ
|
|
select MODULE_PERIPH_GPIO_IRQ
|
|
help
|
|
Data ready and FIFO status interrupts on signal INT2/DRDY
|
|
can be used to determine when data are ready to be read or when the
|
|
status of the FIFO changes.
|
|
|
|
config MODULE_L3GXXXX_SLEEP
|
|
bool "Support for sleep and wake-up function"
|
|
|
|
config MODULE_L3GXXXX_CONFIG
|
|
bool "Support for configuration of the sensor at runtime"
|
|
|
|
endif # MODULE_L3GXXXX
|