Loading...
Searching...
No Matches
l3g4200d.h
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 */
8
9#pragma once
10
28
29#include <stdint.h>
30
31#include "periph/i2c.h"
32#include "periph/gpio.h"
33
34#ifdef __cplusplus
35 extern "C" {
36#endif
37
51#ifndef CONFIG_L3G4200D_DEFAULT_ADDRESS
52#define CONFIG_L3G4200D_DEFAULT_ADDRESS 0x68
53#endif
55
59typedef struct {
60 int16_t acc_x;
61 int16_t acc_y;
62 int16_t acc_z;
64
73
93
105
109typedef struct {
111 int32_t scale;
112} l3g4200d_t;
113
124
134int l3g4200d_read(const l3g4200d_t *dev, l3g4200d_data_t *acc_data);
135
145
155
156#ifdef __cplusplus
157}
158#endif
159
Low-level GPIO peripheral driver interface definitions.
int l3g4200d_init(l3g4200d_t *dev, const l3g4200d_params_t *params)
Initialize a gyro.
int l3g4200d_disable(const l3g4200d_t *dev)
Power-down the given device.
l3g4200d_scale_t
Measurement scale for the gyro.
Definition l3g4200d.h:68
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.
l3g4200d_mode_t
Sampling frequency and bandwidth settings for the gyro.
Definition l3g4200d.h:77
@ L3G4200D_SCALE_250DPS
scale: 250 degree per second
Definition l3g4200d.h:69
@ L3G4200D_SCALE_500DPS
scale: 500 degree per second
Definition l3g4200d.h:70
@ L3G4200D_SCALE_2000DPS
scale: 2000 degree per second
Definition l3g4200d.h:71
@ L3G4200D_MODE_400_110
data rate: 400Hz, cut-off: 110Hz
Definition l3g4200d.h:87
@ L3G4200D_MODE_200_12
data rate: 200Hz, cut-off: 12.5Hz
Definition l3g4200d.h:80
@ L3G4200D_MODE_800_110
data rate: 800Hz, cut-off: 110Hz
Definition l3g4200d.h:91
@ L3G4200D_MODE_400_20
data rate: 400Hz, cut-off: 20Hz
Definition l3g4200d.h:84
@ L3G4200D_MODE_800_50
data rate: 800Hz, cut-off: 50Hz
Definition l3g4200d.h:90
@ L3G4200D_MODE_800_35
data rate: 800Hz, cut-off: 35Hz
Definition l3g4200d.h:89
@ L3G4200D_MODE_800_30
data rate: 800Hz, cut-off: 30Hz
Definition l3g4200d.h:88
@ L3G4200D_MODE_400_25
data rate: 400Hz, cut-off: 25Hz
Definition l3g4200d.h:85
@ L3G4200D_MODE_100_12
data rate: 100Hz, cut-off: 12.5Hz
Definition l3g4200d.h:78
@ L3G4200D_MODE_400_50
data rate: 400Hz, cut-off: 50Hz
Definition l3g4200d.h:86
@ L3G4200D_MODE_200_25
data rate: 200Hz, cut-off: 25Hz
Definition l3g4200d.h:81
@ L3G4200D_MODE_200_50
data rate: 200Hz, cut-off: 50Hz
Definition l3g4200d.h:82
@ L3G4200D_MODE_200_70
data rate: 200Hz, cut-off: 70Hz
Definition l3g4200d.h:83
@ L3G4200D_MODE_100_25
data rate: 100Hz, cut-off: 25Hz
Definition l3g4200d.h:79
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition i2c.h:144
Low-level I2C peripheral driver interface definition.
Result vector for gyro measurement.
Definition l3g4200d.h:59
int16_t acc_x
roll rate in dgs (degree per second)
Definition l3g4200d.h:60
int16_t acc_y
pitch rate in dgs
Definition l3g4200d.h:61
int16_t acc_z
yaw rate in dgs
Definition l3g4200d.h:62
Device initialization parameters.
Definition l3g4200d.h:97
gpio_t int2
INT2 (DRDY) pin.
Definition l3g4200d.h:101
uint8_t addr
the sensors slave address on the I2C bus
Definition l3g4200d.h:99
l3g4200d_scale_t scale
scaling factor to normalize results
Definition l3g4200d.h:103
gpio_t int1
INT1 pin.
Definition l3g4200d.h:100
l3g4200d_mode_t mode
sampling frequency and bandwidth mode
Definition l3g4200d.h:102
i2c_t i2c
I2C device the sensor is connected to.
Definition l3g4200d.h:98
Device descriptor for L3G4200D sensors.
Definition l3g4200d.h:109
l3g4200d_params_t params
device initialization parameters
Definition l3g4200d.h:110
int32_t scale
internal scaling factor to normalize results
Definition l3g4200d.h:111