Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Modules
Pages
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 */
32
#include "
peripherals/l3gd20_regs.h
"
33
34
enum
L3gd20ConfStatus
{
35
L3G_CONF_UNINIT
= 0,
36
L3G_CONF_WHO_AM_I
= 1,
37
L3G_CONF_WHO_AM_I_OK
= 2,
38
L3G_CONF_REG4
= 3,
39
L3G_CONF_ENABLE
= 4,
40
L3G_CONF_DONE
= 5
41
};
42
43
struct
L3gd20Config
{
44
bool_t
spi_3_wire
;
45
46
enum
L3gd20FullScale
full_scale
;
47
enum
L3gd20DRBW
drbw
;
48
};
49
50
static
inline
void
l3gd20_set_default_config
(
struct
L3gd20Config
*c)
51
{
52
c->
spi_3_wire
=
FALSE
;
53
54
c->
drbw
=
L3GD20_DRBW_760Hz_100BW
;
55
c->
full_scale
=
L3GD20_FS_2000dps2
;
56
}
57
58
#endif
/* L3GD20_H */
L3gd20Config
Definition:
l3gd20.h:43
L3G_CONF_REG4
Definition:
l3gd20.h:38
L3gd20Config::drbw
enum L3gd20DRBW drbw
Data rate and bandwidth.
Definition:
l3gd20.h:47
L3GD20_DRBW_760Hz_100BW
Definition:
l3gd20_regs.h:76
FALSE
#define FALSE
Definition:
std.h:5
l3gd20_set_default_config
static void l3gd20_set_default_config(struct L3gd20Config *c)
Definition:
l3gd20.h:50
L3gd20Config::full_scale
enum L3gd20FullScale full_scale
gyro full scale
Definition:
l3gd20.h:46
l3gd20_regs.h
ST L3GD20 3-axis gyroscope register definitions.
L3GD20_FS_2000dps2
Definition:
l3gd20_regs.h:83
L3gd20ConfStatus
L3gd20ConfStatus
Definition:
l3gd20.h:34
L3gd20DRBW
L3gd20DRBW
Definition:
l3gd20_regs.h:60
L3G_CONF_UNINIT
Definition:
l3gd20.h:35
L3G_CONF_WHO_AM_I
Definition:
l3gd20.h:36
L3gd20FullScale
L3gd20FullScale
Definition:
l3gd20_regs.h:79
L3gd20Config::spi_3_wire
bool_t spi_3_wire
Set 3-wire SPI mode, if FALSE: 4-wire SPI mode.
Definition:
l3gd20.h:44
L3G_CONF_ENABLE
Definition:
l3gd20.h:39
L3G_CONF_DONE
Definition:
l3gd20.h:40
L3G_CONF_WHO_AM_I_OK
Definition:
l3gd20.h:37
sw
airborne
peripherals
l3gd20.h
Generated on Tue Jun 21 2016 14:01:23 for Paparazzi UAS by
1.8.8