Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
navdata.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2013 Dino Hensen, Vincent van Hoek
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 
30 #ifndef NAVDATA_H_
31 #define NAVDATA_H_
32 
33 #include "std.h"
34 
42 
46 
52 
54 
59 
63 
65 
66  uint32_t sum_echo; //unsigned long
68 
70 
73 
77 
79 
80 } __attribute__((packed));
81 
82 /* The baro calibration received from the navboard */
95 
96  // These values are calculated
98 };
99 
100 /* Navdata board defines */
101 #define NAVDATA_PACKET_SIZE 60
102 #define NAVDATA_START_BYTE 0x3A
103 #define NAVDATA_CMD_START 0x01
104 #define NAVDATA_CMD_STOP 0x02
105 #define NAVDATA_CMD_BARO_CALIB 0x17
106 
107 #define ARDRONE_GPIO_PORT 0x32524
108 #define ARDRONE_GPIO_PIN_NAVDATA 177
109 
110 /* Main navdata structure */
111 struct navdata_t {
112  bool_t is_initialized;
113  int fd;
114 
120 
123 
125  bool_t baro_available;
126  bool_t imu_lost;
127 };
128 extern struct navdata_t navdata;
129 
130 
131 bool_t navdata_init(void);
132 void navdata_update(void);
133 int16_t navdata_height(void);
134 
135 /* This should be moved to the uart handling part! */
136 ssize_t full_write(int fd, const uint8_t *buf, size_t count);
137 ssize_t full_read(int fd, uint8_t *buf, size_t count);
138 
139 #endif /* NAVDATA_H_ */
unsigned short uint16_t
Definition: types.h:16
unsigned long uint32_t
Definition: types.h:18
signed short int16_t
Definition: types.h:17
signed long int32_t
Definition: types.h:19
struct adc_buf * buf
Definition: adc_arch.c:587
unsigned char uint8_t
Definition: types.h:14
int fd
Definition: serial.c:26