Paparazzi UAS
v7.0_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 */
32
#include "
peripherals/l3gd20_regs.h
"
33
34
40
#define L3GD20_SENS_2000_NUM 5004
41
#define L3GD20_SENS_2000_DEN 1000
42
43
enum
L3gd20ConfStatus
{
44
L3G_CONF_UNINIT
= 0,
45
L3G_CONF_WHO_AM_I
= 1,
46
L3G_CONF_WHO_AM_I_OK
= 2,
47
L3G_CONF_REG4
= 3,
48
L3G_CONF_ENABLE
= 4,
49
L3G_CONF_DONE
= 5
50
};
51
52
struct
L3gd20Config
{
53
bool
spi_3_wire
;
54
55
enum
L3gd20FullScale
full_scale
;
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
63
c->
drbw
=
L3GD20_DRBW_760Hz_100BW
;
64
c->
full_scale
=
L3GD20_FS_2000dps2
;
65
}
66
67
#endif
/* L3GD20_H */
L3gd20Config::drbw
enum L3gd20DRBW drbw
Data rate and bandwidth.
Definition:
l3gd20.h:56
L3gd20ConfStatus
L3gd20ConfStatus
Definition:
l3gd20.h:43
L3G_CONF_REG4
@ L3G_CONF_REG4
Definition:
l3gd20.h:47
L3G_CONF_UNINIT
@ L3G_CONF_UNINIT
Definition:
l3gd20.h:44
L3G_CONF_DONE
@ L3G_CONF_DONE
Definition:
l3gd20.h:49
L3G_CONF_WHO_AM_I
@ L3G_CONF_WHO_AM_I
Definition:
l3gd20.h:45
L3G_CONF_WHO_AM_I_OK
@ L3G_CONF_WHO_AM_I_OK
Definition:
l3gd20.h:46
L3G_CONF_ENABLE
@ L3G_CONF_ENABLE
Definition:
l3gd20.h:48
L3gd20Config::spi_3_wire
bool spi_3_wire
Set 3-wire SPI mode, if FALSE: 4-wire SPI mode.
Definition:
l3gd20.h:53
L3gd20Config::full_scale
enum L3gd20FullScale full_scale
gyro full scale
Definition:
l3gd20.h:55
l3gd20_set_default_config
static void l3gd20_set_default_config(struct L3gd20Config *c)
Definition:
l3gd20.h:59
L3gd20Config
Definition:
l3gd20.h:52
l3gd20_regs.h
ST L3GD20 3-axis gyroscope register definitions.
L3gd20FullScale
L3gd20FullScale
Definition:
l3gd20_regs.h:79
L3GD20_FS_2000dps2
@ L3GD20_FS_2000dps2
Definition:
l3gd20_regs.h:83
L3gd20DRBW
L3gd20DRBW
Definition:
l3gd20_regs.h:60
L3GD20_DRBW_760Hz_100BW
@ L3GD20_DRBW_760Hz_100BW
Definition:
l3gd20_regs.h:76
sw
airborne
peripherals
l3gd20.h
Generated on Thu Dec 5 2024 13:05:31 for Paparazzi UAS by
1.9.1