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  */
27 #ifndef L3G4200D_H
28 #define L3G4200D_H
30 #include <stdint.h>
32 #include "periph/i2c.h"
33 #include "periph/gpio.h"
35 #ifdef __cplusplus
36  extern "C" {
37 #endif
42 #define L3G4200D_DEFAULT_ADDRESS 0x68
47 typedef struct {
48  int16_t acc_x;
49  int16_t acc_y;
50  int16_t acc_z;
56 typedef enum {
65 typedef enum {
85 typedef struct {
87  uint8_t addr;
88  gpio_t int1;
89  gpio_t int2;
97 typedef struct {
99  int scale;
100 } l3g4200d_t;
111 int l3g4200d_init(l3g4200d_t *dev, const l3g4200d_params_t *params);
122 int l3g4200d_read(const l3g4200d_t *dev, l3g4200d_data_t *acc_data);
132 int l3g4200d_enable(const l3g4200d_t *dev);
142 int l3g4200d_disable(const l3g4200d_t *dev);
144 #ifdef __cplusplus
145 }
146 #endif
148 #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:57
data rate: 400Hz, cut-off: 110Hz
Definition: l3g4200d.h:75
data rate: 400Hz, cut-off: 50Hz
Definition: l3g4200d.h:74
data rate: 100Hz, cut-off: 12.5Hz
Definition: l3g4200d.h:66
data rate: 100Hz, cut-off: 25Hz
Definition: l3g4200d.h:67
Device descriptor for L3G4200D sensors.
Definition: l3g4200d.h:97
data rate: 200Hz, cut-off: 25Hz
Definition: l3g4200d.h:69
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:98
int16_t acc_z
yaw rate in dgs
Definition: l3g4200d.h:50
data rate: 800Hz, cut-off: 50Hz
Definition: l3g4200d.h:78
uint8_t addr
the sensors slave address on the I2C bus
Definition: l3g4200d.h:87
unsigned int i2c_t
Default i2c_t type definition.
Definition: i2c.h:157
int scale
internal scaling factor to normalize results
Definition: l3g4200d.h:99
gpio_t int2
INT2 (DRDY) pin.
Definition: l3g4200d.h:89
data rate: 800Hz, cut-off: 30Hz
Definition: l3g4200d.h:76
int16_t acc_x
roll rate in dgs (degree per second)
Definition: l3g4200d.h:48
Sampling frequency and bandwidth settings for the gyro.
Definition: l3g4200d.h:65
data rate: 800Hz, cut-off: 35Hz
Definition: l3g4200d.h:77
Measurement scale for the gyro.
Definition: l3g4200d.h:56
gpio_t int1
INT1 pin.
Definition: l3g4200d.h:88
i2c_t i2c
I2C device the sensor is connected to.
Definition: l3g4200d.h:86
data rate: 200Hz, cut-off: 70Hz
Definition: l3g4200d.h:71
l3g4200d_mode_t mode
sampling frequency and bandwidth mode
Definition: l3g4200d.h:90
data rate: 400Hz, cut-off: 20Hz
Definition: l3g4200d.h:72
Result vector for gyro measurement.
Definition: l3g4200d.h:47
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:58
data rate: 400Hz, cut-off: 25Hz
Definition: l3g4200d.h:73
scale: 2000 degree per second
Definition: l3g4200d.h:59
int16_t acc_y
pitch rate in dgs
Definition: l3g4200d.h:49
Device initialization parameters.
Definition: l3g4200d.h:85
l3g4200d_scale_t scale
scaling factor to normalize results
Definition: l3g4200d.h:91
data rate: 200Hz, cut-off: 12.5Hz
Definition: l3g4200d.h:68
data rate: 800Hz, cut-off: 110Hz
Definition: l3g4200d.h:79
data rate: 200Hz, cut-off: 50Hz
Definition: l3g4200d.h:70
Low-level I2C peripheral driver interface definition.