minor changes
This commit is contained in:
parent
146e05d320
commit
3c736d87fe
1 changed files with 33 additions and 32 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
# Driver for the L3GD20H 3-axes digital output gyroscope
|
# Driver for the L3GD20H 3-axes digital output gyroscope
|
||||||
|
|
||||||
The driver is for the usage with the ESP8266 and [esp-open-rtos](https://github.com/SuperHouse/esp-open-rtos).
|
The driver is for the usage with the ESP8266 and [esp-open-rtos](https://github.com/SuperHouse/esp-open-rtos). If you can't find it in folder [extras/l3gd20h](https://github.com/SuperHouse/esp-open-rtos/tree/master/extras) of original repository, it is not yet merged. Please take a look to branch [l3gd20h](https://github.com/gschorcht/esp-open-rtos/tree/l3gd20h) of my fork in that case.
|
||||||
|
|
||||||
It is also working with ESP32 and [ESP-IDF](https://github.com/espressif/esp-idf.git) using a wrapper component for ESP8266 functions, see folder ```components/esp8266_wrapper```, as well as Linux based systems using a wrapper library.
|
It is also working with ESP32 and [ESP-IDF](https://github.com/espressif/esp-idf.git) using a wrapper component for ESP8266 functions, see folder ```components/esp8266_wrapper```, as well as Linux based systems using a wrapper library.
|
||||||
|
|
||||||
|
|
@ -87,9 +87,9 @@ Raw **output data** (**raw data**) are given as 16-bit signed integer values in
|
||||||
|
|
||||||
Full Scale | Resolution | Driver symbol
|
Full Scale | Resolution | Driver symbol
|
||||||
-----------:|-----------:|:---------------
|
-----------:|-----------:|:---------------
|
||||||
±245 dps | 2 mdps | l3gd20h_scale_245dps
|
±245 dps | 2 mdps | ```l3gd20h_scale_245dps```
|
||||||
±500 dps | 4 mdps | l3gd20h_scale_500dps
|
±500 dps | 4 mdps | ```l3gd20h_scale_500dps```
|
||||||
±2000 dps | 16 mdps | l3gd20h_scale_2000dps
|
±2000 dps | 16 mdps | ```l3gd20h_scale_2000dps```
|
||||||
|
|
||||||
By default, a full scale of ±245 dps is used. Function ```l3gd20h_set_scale``` can be used to change it.
|
By default, a full scale of ±245 dps is used. Function ```l3gd20h_set_scale``` can be used to change it.
|
||||||
|
|
||||||
|
|
@ -147,10 +147,10 @@ The filters applied to the output data are selected with function ```l3gd20h_sel
|
||||||
|
|
||||||
Driver symbol | Low pass filter (LPF2) used | High pass filter (HPF) used
|
Driver symbol | Low pass filter (LPF2) used | High pass filter (HPF) used
|
||||||
:--------------|:-----------------------------:|:---------------------:
|
:--------------|:-----------------------------:|:---------------------:
|
||||||
l3gd20h_no_filter | - | -
|
```l3gd20h_no_filter``` | - | -
|
||||||
l3gd20h_hpf_only | x | -
|
```l3gd20h_hpf_only``` | x | -
|
||||||
l3gd20h_lpf2_only | - | x
|
```l3gd20h_lpf2_only``` | - | x
|
||||||
l3gd20h_hpf_and_lpf2 | x | x
|
```l3gd20h_hpf_and_lpf2``` | x | x
|
||||||
|
|
||||||
These filters can also be applied to data used for event interrupt generation (selective axis movement and wake up). The filter mode is defined by member ```filter``` in the settings of interrupt generator configuration, see function ```l3gd20h_set_int_event_config```.
|
These filters can also be applied to data used for event interrupt generation (selective axis movement and wake up). The filter mode is defined by member ```filter``` in the settings of interrupt generator configuration, see function ```l3gd20h_set_int_event_config```.
|
||||||
|
|
||||||
|
|
@ -158,9 +158,9 @@ While the cutoff frequency of the low pass filter (LPF2) is fixed and depends on
|
||||||
|
|
||||||
Driver symbol | HPF mode
|
Driver symbol | HPF mode
|
||||||
:--------------|:---------
|
:--------------|:---------
|
||||||
l3gd20h_hpf_normal | Normal mode
|
```l3gd20h_hpf_normal``` | Normal mode
|
||||||
l3gd20h_hpf_reference | Reference mode
|
```l3gd20h_hpf_reference``` | Reference mode
|
||||||
l3gd20h_hpf_autoreset | Auto-reset on interrupt
|
```l3gd20h_hpf_autoreset``` | Auto-reset on interrupt
|
||||||
|
|
||||||
For each output data rate (ODR), 10 different HPF cutoff frequencies can be used.
|
For each output data rate (ODR), 10 different HPF cutoff frequencies can be used.
|
||||||
|
|
||||||
|
|
@ -186,13 +186,13 @@ In order to limit the rate at which the host processor has to fetch the data, th
|
||||||
|
|
||||||
Driver symbol | FIFO mode
|
Driver symbol | FIFO mode
|
||||||
--------------|-------------------------
|
--------------|-------------------------
|
||||||
l3gd20h_bypass | Bypass mode (FIFO is not used)
|
```l3gd20h_bypass``` | Bypass mode (FIFO is not used)
|
||||||
l3gd20h_fifo | FIFO mode
|
```l3gd20h_fifo``` | FIFO mode
|
||||||
l3gd20h_stream | Stream mode
|
```l3gd20h_stream``` | Stream mode
|
||||||
l3gd20h_stream_to_fifo | Stream-to-FIFO mode
|
```l3gd20h_stream_to_fifo``` | Stream-to-FIFO mode
|
||||||
l3gd20h_bypass_to_stream | Bypass-to-Stream mode
|
```l3gd20h_bypass_to_stream``` | Bypass-to-Stream mode
|
||||||
l3gd20h_dynamic_stream | Dynamic Stream mode
|
```l3gd20h_dynamic_stream``` | Dynamic Stream mode
|
||||||
l3gd20h_bypass_to_fifo | Bypass to FIFO mode
|
```l3gd20h_bypass_to_fifo``` | Bypass to FIFO mode
|
||||||
|
|
||||||
The FIFO mode can be set using function ```l3gd20h_set_fifo_mode```. This function takes two parameters, the FIFO mode and a threshold value which defines a watermark level. When the FIFO content exceeds this level, a watermark flag is set and an interrupt can be generated. They can be used to gather a minimum number of axes angular rate samples with the sensor before the data are fetched as a single read operation from the sensor.
|
The FIFO mode can be set using function ```l3gd20h_set_fifo_mode```. This function takes two parameters, the FIFO mode and a threshold value which defines a watermark level. When the FIFO content exceeds this level, a watermark flag is set and an interrupt can be generated. They can be used to gather a minimum number of axes angular rate samples with the sensor before the data are fetched as a single read operation from the sensor.
|
||||||
|
|
||||||
|
|
@ -239,23 +239,23 @@ void user_task_periodic (void *pvParameters)
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Interrupts
|
## Interrupts
|
||||||
|
|
||||||
The L3GD20H allows to activate interrupts on two dedicated interrupt signals
|
The L3GD20H allows to activate interrupts on two dedicated interrupt signals
|
||||||
|
|
||||||
- for data interrupts (data ready and FIFO status) on signal **```DRDY/INT2```**, and
|
- for data interrupts (data ready and FIFO status) on signal **```DRDY/INT2```**, and
|
||||||
- for event interrupts (axis movement and wake up) on signal **```INT1```**.
|
- for event interrupts (axis movement and wake up) on signal **```INT1```**.
|
||||||
|
|
||||||
#### Data interrupts (data ready and FIFO status) on signal **```DRDY/INT2```**
|
### Data interrupts (data ready and FIFO status) on signal **```DRDY/INT2```**
|
||||||
|
|
||||||
Interrupts on signal ```DRDY/INT2``` can be generated by following sources:
|
Interrupts on signal ```DRDY/INT2``` can be generated by following sources:
|
||||||
|
|
||||||
Interrupt source | Driver symbol
|
Interrupt source | Driver symbol
|
||||||
:-----------------|:-------------
|
:-----------------|:-------------
|
||||||
Output data become ready to read | l3gd20h_int_data_ready
|
Output data become ready to read | ```l3gd20h_int_data_ready```
|
||||||
FIFO content exceeds the watermark level | l3gd20h_int_fifo_threshold
|
FIFO content exceeds the watermark level | ```l3gd20h_int_fifo_threshold```
|
||||||
FIFO is completely filled | l3gd20h_int_fifo_overrun
|
FIFO is completely filled | ```l3gd20h_int_fifo_overrun```
|
||||||
FIFO becomes empty | l3gd20h_int_fifo_empty
|
FIFO becomes empty | ```l3gd20h_int_fifo_empty```
|
||||||
|
|
||||||
Each of these interrupt sources can be enabled or disabled separately with function ```l3gd20h_enable_int```. By default all interrupt sources are disabled.
|
Each of these interrupt sources can be enabled or disabled separately with function ```l3gd20h_enable_int```. By default all interrupt sources are disabled.
|
||||||
|
|
||||||
|
|
@ -284,7 +284,7 @@ void int2_handler ()
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Event interrupts (Axes movement and wake up) on signal **```INT1```**
|
### Event interrupts (Axes movement and wake up) on signal **```INT1```**
|
||||||
|
|
||||||
This interrupt signal allows to recognize independent rotations of the x, y and z axes. For this purpose, a separate threshold can be defined for each axis. If activated, the angular rate of each axis is compared with its threshold to check whether it is below or above the threshold. The results of all activated comparisons are combined OR or AND to generate the interrupt signal.
|
This interrupt signal allows to recognize independent rotations of the x, y and z axes. For this purpose, a separate threshold can be defined for each axis. If activated, the angular rate of each axis is compared with its threshold to check whether it is below or above the threshold. The results of all activated comparisons are combined OR or AND to generate the interrupt signal.
|
||||||
|
|
||||||
|
|
@ -359,6 +359,7 @@ void int1_handler ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
**Please note:** If the interrupt is configured to be latched, the interrupt signal is active until the interrupt source is read. Otherwise the interrupt signal is only active as long as the interrupt condition is satisfied.
|
||||||
|
|
||||||
**Please note** Activating all threshold comparisons and the OR combination is the most flexible way, functions like selective axis movement can then be realized combining the different interrupt sources. Following example realizes also the selective axis movement recognition (SA) for the z-axis.
|
**Please note** Activating all threshold comparisons and the OR combination is the most flexible way, functions like selective axis movement can then be realized combining the different interrupt sources. Following example realizes also the selective axis movement recognition (SA) for the z-axis.
|
||||||
|
|
||||||
|
|
@ -407,25 +408,25 @@ void int1_handler ()
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Interrupt signal properties
|
### Interrupt signal properties
|
||||||
|
|
||||||
By default, interrupt signals are high active. Using function ```l3gd20h_config_int_signals```, the level of the interrupt signal and the type of the interrupt outputs can be changed.
|
By default, interrupt signals are high active. Using function ```l3gd20h_config_int_signals```, the level of the interrupt signal and the type of the interrupt outputs can be changed.
|
||||||
|
|
||||||
Driver symbol | Meaning
|
Driver symbol | Meaning
|
||||||
:-------------|:-------
|
:-------------|:-------
|
||||||
l3gd20h_high_active | Interrupt signal is high active (default)
|
```l3gd20h_high_active``` | Interrupt signal is high active (default)
|
||||||
l3gd20h_low_active | Interrupt signal is low active
|
```l3gd20h_low_active``` | Interrupt signal is low active
|
||||||
|
|
||||||
Driver symbol | Meaning
|
Driver symbol | Meaning
|
||||||
:-------------|:-------
|
:-------------|:-------
|
||||||
l3gd20h_push_pull | Interrupt output is pushed/pulled
|
```l3gd20h_push_pull``` | Interrupt output is pushed/pulled
|
||||||
l3gd20h_open_drain | Interrupt output is open-drain
|
```l3gd20h_open_drain``` | Interrupt output is open-drain
|
||||||
|
|
||||||
### Temperature sensor
|
## Temperature sensor
|
||||||
|
|
||||||
The L3GD20H contains a temperature sensor. Function ```l3gd20h_get_temperature``` can be used to get the temperature. The temperature is given as 8-bit signed integer values in 2’s complement.
|
The L3GD20H contains a temperature sensor. Function ```l3gd20h_get_temperature``` can be used to get the temperature. The temperature is given as 8-bit signed integer values in 2’s complement.
|
||||||
|
|
||||||
### Low level functions
|
## Low level functions
|
||||||
|
|
||||||
The L3GD20H is a very complex and flexible sensor with a lot of features. It can be used for a big number of different use cases. Since it is quite impossible to implement a high level interface which is generic enough to cover all the functionality of the sensor for all different use cases, there are two low level interface functions that allow direct read and write access to the registers of the sensor.
|
The L3GD20H is a very complex and flexible sensor with a lot of features. It can be used for a big number of different use cases. Since it is quite impossible to implement a high level interface which is generic enough to cover all the functionality of the sensor for all different use cases, there are two low level interface functions that allow direct read and write access to the registers of the sensor.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue