Device Driver for ST L3Gxxxx 3-axis gyroscope sensor family. More...
Device Driver for ST L3Gxxxx 3-axis gyroscope sensor family.
Definition in file l3gxxxx.h.
#include <stdbool.h>#include <stdint.h>#include "mutex.h"#include "periph/gpio.h"#include "periph/i2c.h"#include "periph/spi.h"#include "l3gxxxx_regs.h" Include dependency graph for l3gxxxx.h:
 Include dependency graph for l3gxxxx.h: This graph shows which files directly or indirectly include this file:
 This graph shows which files directly or indirectly include this file:Go to the source code of this file.
| Data Structures | |
| struct | l3gxxxx_int_event_cfg_t | 
| Event interrupt generator configuration (axis movement and wake-up)  More... | |
| union | l3gxxxx_int_event_src_t | 
| Event interrupt sources (axis movement and wake-up)  More... | |
| union | l3gxxxx_int_data_src_t | 
| Data interrupt sources (data ready and FIFO status)  More... | |
| struct | l3gxxxx_int_src_t | 
| Composite type for all possible interrupt sources.  More... | |
| struct | l3gxxxx_raw_data_t | 
| Raw output data set as two's complements.  More... | |
| struct | l3gxxxx_data_t | 
| Angular rates in millidegrees per seconds (mdps)  More... | |
| struct | l3gxxxx_i2c_params_t | 
| L3Gxxxx I2C interface parameters.  More... | |
| struct | l3gxxxx_spi_params_t | 
| L3Gxxxx SPI interface parameters.  More... | |
| struct | l3gxxxx_if_params_t | 
| L3Gxxxx Hardware interface parameters union.  More... | |
| struct | l3gxxxx_params_t | 
| L3Gxxxx device initialization parameters.  More... | |
| struct | l3gxxxx_t | 
| L3Gxxxx sensor device data structure type.  More... | |
| Macros | |
| #define | L3GXXXX_INT_DATA | 
| Data interrupts (Data ready and FIFO status)  More... | |
| Typedefs | |
| typedef l3gxxxx_raw_data_t | l3gxxxx_raw_data_fifo_t[32] | 
| Raw output data FIFO type. | |
| typedef l3gxxxx_data_t | l3gxxxx_data_fifo_t[32] | 
| Angular rates FIFO type. | |
| L3Gxxxx addresses | |
| #define | L3GXXXX_I2C_ADDR_1 (0x68) | 
| SDO pin is low. | |
| #define | L3GXXXX_I2C_ADDR_2 (0x69) | 
| SDO pin is high. | |
| L3Gxxxx chip ids | |
| #define | L3GXXXX_CHIP_ID_L3GD20H (0xd7) | 
| Chip ID for L3GD20H. | |
| #define | L3GXXXX_CHIP_ID_L3GD20 (0xd4) | 
| Chip ID for L3GD20. | |
| #define | L3GXXXX_CHIP_ID_X3G42XXD (0xd3) | 
| Chip ID for L3G4200D, I3G4250D, A3G4250D. | |
| Sensor initialization and configuration | |
| int | l3gxxxx_init (l3gxxxx_t *dev, const l3gxxxx_params_t *params) | 
| Initialize the L3Gxxxx sensor device.  More... | |
| int | l3gxxxx_set_mode (l3gxxxx_t *dev, l3gxxxx_odr_t odr, bool x, bool y, bool z) | 
| Set sensor mode.  More... | |
| int | l3gxxxx_set_scale (l3gxxxx_t *dev, l3gxxxx_scale_t scale) | 
| Set full scale.  More... | |
| Power saving functions | |
| int | l3gxxxx_power_down (l3gxxxx_t *dev) | 
| Power down the sensor.  More... | |
| int | l3gxxxx_power_up (l3gxxxx_t *dev) | 
| Power up the sensor.  More... | |
| int | l3gxxxx_sleep (l3gxxxx_t *dev) | 
| Sleep mode.  More... | |
| int | l3gxxxx_wake_up (l3gxxxx_t *dev) | 
| Wake-up the sensor.  More... | |
| Basic sensor data handling | |
| int | l3gxxxx_data_ready (const l3gxxxx_t *dev) | 
| Data ready status function.  More... | |
| int | l3gxxxx_read (const l3gxxxx_t *dev, l3gxxxx_data_t *data) | 
| Read last sample of angular rates in millidegree per second (mpds)  More... | |
| int | l3gxxxx_read_raw (const l3gxxxx_t *dev, l3gxxxx_raw_data_t *raw) | 
| Read last sample of raw output data as 16 bit two's complements.  More... | |
| FIFO handling | |
| int | l3gxxxx_set_fifo_mode (l3gxxxx_t *dev, l3gxxxx_fifo_mode_t mode, uint8_t watermark) | 
| Set FIFO mode and watermark level (threshold)  More... | |
| int | l3gxxxx_read_fifo (const l3gxxxx_t *dev, l3gxxxx_data_fifo_t data) | 
| Get all samples of angular rates stored in the FIFO (unit mdps)  More... | |
| int | l3gxxxx_read_raw_fifo (const l3gxxxx_t *dev, l3gxxxx_raw_data_fifo_t raw) | 
| Get all samples of raw output data stored in the FIFO.  More... | |
| Filter configuration and handling | |
| int | l3gxxxx_select_output_filter (l3gxxxx_t *dev, l3gxxxx_filter_sel_t filter) | 
| Filter selection for raw output data.  More... | |
| int | l3gxxxx_config_hpf (const l3gxxxx_t *dev, l3gxxxx_hpf_mode_t mode, uint8_t cutoff) | 
| Config HPF (high pass filter) for output data.  More... | |
| int | l3gxxxx_set_hpf_ref (const l3gxxxx_t *dev, int8_t ref) | 
| Set HPF (high pass filter) reference.  More... | |
| int | l3gxxxx_get_hpf_ref (const l3gxxxx_t *dev, int8_t *ref) | 
| Get HPF (high pass filter) reference.  More... | |
| Interrupt configuration and handling | |
| int | l3gxxxx_enable_int (const l3gxxxx_t *dev, l3gxxxx_int_types_t mask, bool enable) | 
| Enable or disable event and/or data interrupts on signal INT1andINT2/DRDYMore... | |
| l3gxxxx_int_src_t | l3gxxxx_wait_int (l3gxxxx_t *dev) | 
| Wait for event and/or data interrupts on signals INT1andINT2/DRDYMore... | |
| int | l3gxxxx_set_int_event_cfg (const l3gxxxx_t *dev, const l3gxxxx_int_event_cfg_t *cfg) | 
| Set new configuration for event interrupt generation.  More... | |
| int | l3gxxxx_get_int_event_cfg (const l3gxxxx_t *dev, l3gxxxx_int_event_cfg_t *cfg) | 
| Get current configuration of event interrupt generation.  More... | |
| Low level interface functions | |
| int | l3gxxxx_reg_write (const l3gxxxx_t *dev, uint8_t reg, const uint8_t *data, uint8_t len) | 
| Direct write to register.  More... | |
| int | l3gxxxx_reg_read (const l3gxxxx_t *dev, uint8_t reg, uint8_t *data, uint8_t len) | 
| Direct read from register.  More... | |