Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
23 #ifndef L3G4200D_H
24 #define L3G4200D_H
26 #include <stdint.h>
28 #include "periph/i2c.h"
29 #include "periph/gpio.h"
31 #ifdef __cplusplus
32  extern "C" {
33 #endif
38 #define L3G4200D_DEFAULT_ADDRESS 0x68
43 typedef struct {
44  int16_t acc_x;
45  int16_t acc_y;
46  int16_t acc_z;
52 typedef enum {
61 typedef enum {
81 typedef struct {
83  uint8_t addr;
84  gpio_t int1;
85  gpio_t int2;
93 typedef struct {
95  int scale;
96 } l3g4200d_t;
107 int l3g4200d_init(l3g4200d_t *dev, const l3g4200d_params_t *params);
118 int l3g4200d_read(const l3g4200d_t *dev, l3g4200d_data_t *acc_data);
128 int l3g4200d_enable(const l3g4200d_t *dev);
138 int l3g4200d_disable(const l3g4200d_t *dev);
140 #ifdef __cplusplus
141 }
142 #endif
144 #endif /* L3G4200D_H */
int l3g4200d_init(l3g4200d_t *dev, const l3g4200d_params_t *params)
Initialize a gyro.
scale: 250 degree per second
Definition: l3g4200d.h:53
data rate: 400Hz, cut-off: 110Hz
Definition: l3g4200d.h:71
data rate: 400Hz, cut-off: 50Hz
Definition: l3g4200d.h:70
data rate: 100Hz, cut-off: 12.5Hz
Definition: l3g4200d.h:62
data rate: 100Hz, cut-off: 25Hz
Definition: l3g4200d.h:63
Device descriptor for L3G4200D sensors.
Definition: l3g4200d.h:93
data rate: 200Hz, cut-off: 25Hz
Definition: l3g4200d.h:65
int l3g4200d_disable(const l3g4200d_t *dev)
Power-down the given device.
Low-level GPIO peripheral driver interface definitions.
l3g4200d_params_t params
device initialization parameters
Definition: l3g4200d.h:94
int16_t acc_z
yaw rate in dgs
Definition: l3g4200d.h:46
data rate: 800Hz, cut-off: 50Hz
Definition: l3g4200d.h:74
uint8_t addr
the sensors slave address on the I2C bus
Definition: l3g4200d.h:83
unsigned int i2c_t
Default i2c_t type definition.
Definition: i2c.h:157
int scale
internal scaling factor to normalize results
Definition: l3g4200d.h:95
gpio_t int2
INT2 (DRDY) pin.
Definition: l3g4200d.h:85
data rate: 800Hz, cut-off: 30Hz
Definition: l3g4200d.h:72
int16_t acc_x
roll rate in dgs (degree per second)
Definition: l3g4200d.h:44
Sampling frequency and bandwidth settings for the gyro.
Definition: l3g4200d.h:61
data rate: 800Hz, cut-off: 35Hz
Definition: l3g4200d.h:73
Measurement scale for the gyro.
Definition: l3g4200d.h:52
gpio_t int1
INT1 pin.
Definition: l3g4200d.h:84
i2c_t i2c
I2C device the sensor is connected to.
Definition: l3g4200d.h:82
data rate: 200Hz, cut-off: 70Hz
Definition: l3g4200d.h:67
l3g4200d_mode_t mode
sampling frequency and bandwidth mode
Definition: l3g4200d.h:86
data rate: 400Hz, cut-off: 20Hz
Definition: l3g4200d.h:68
Result vector for gyro measurement.
Definition: l3g4200d.h:43
int l3g4200d_read(const l3g4200d_t *dev, l3g4200d_data_t *acc_data)
Read angular speed value in degree per second from gyro.
int l3g4200d_enable(const l3g4200d_t *dev)
Power-up the given device.
scale: 500 degree per second
Definition: l3g4200d.h:54
data rate: 400Hz, cut-off: 25Hz
Definition: l3g4200d.h:69
scale: 2000 degree per second
Definition: l3g4200d.h:55
int16_t acc_y
pitch rate in dgs
Definition: l3g4200d.h:45
Device initialization parameters.
Definition: l3g4200d.h:81
l3g4200d_scale_t scale
scaling factor to normalize results
Definition: l3g4200d.h:87
data rate: 200Hz, cut-off: 12.5Hz
Definition: l3g4200d.h:64
data rate: 800Hz, cut-off: 110Hz
Definition: l3g4200d.h:75
data rate: 200Hz, cut-off: 50Hz
Definition: l3g4200d.h:66
Low-level I2C peripheral driver interface definition.