Paparazzi UAS  v6.2_unstable
Paparazzi is a free software Unmanned Aircraft System.
l3gd20.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Felix Ruess <felix.ruess@gmail.com>
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
28 #ifndef L3GD20_H
29 #define L3GD20_H
30 
31 /* Include address and register definition */
33 
34 
40 #define L3GD20_SENS_2000_NUM 5004
41 #define L3GD20_SENS_2000_DEN 1000
42 
49  L3G_CONF_DONE = 5
50 };
51 
52 struct L3gd20Config {
53  bool spi_3_wire;
54 
56  enum L3gd20DRBW drbw;
57 };
58 
59 static inline void l3gd20_set_default_config(struct L3gd20Config *c)
60 {
61  c->spi_3_wire = false;
62 
65 }
66 
67 #endif /* L3GD20_H */
enum L3gd20DRBW drbw
Data rate and bandwidth.
Definition: l3gd20.h:56
L3gd20ConfStatus
Definition: l3gd20.h:43
@ L3G_CONF_REG4
Definition: l3gd20.h:47
@ L3G_CONF_UNINIT
Definition: l3gd20.h:44
@ L3G_CONF_DONE
Definition: l3gd20.h:49
@ L3G_CONF_WHO_AM_I
Definition: l3gd20.h:45
@ L3G_CONF_WHO_AM_I_OK
Definition: l3gd20.h:46
@ L3G_CONF_ENABLE
Definition: l3gd20.h:48
bool spi_3_wire
Set 3-wire SPI mode, if FALSE: 4-wire SPI mode.
Definition: l3gd20.h:53
enum L3gd20FullScale full_scale
gyro full scale
Definition: l3gd20.h:55
static void l3gd20_set_default_config(struct L3gd20Config *c)
Definition: l3gd20.h:59
ST L3GD20 3-axis gyroscope register definitions.
L3gd20FullScale
Definition: l3gd20_regs.h:79
@ L3GD20_FS_2000dps2
Definition: l3gd20_regs.h:83
L3gd20DRBW
Definition: l3gd20_regs.h:60
@ L3GD20_DRBW_760Hz_100BW
Definition: l3gd20_regs.h:76