Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
gps_ubx.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2011 The Paparazzi Team
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 
27 #ifndef GPS_UBX_H
28 #define GPS_UBX_H
29 
30 #include "modules/gps/gps.h"
31 
32 #ifdef GPS_I2C
34 #else
35 #include "mcu_periph/uart.h"
36 #endif
37 
38 #ifndef GPS_UBX_NB
39 #define GPS_UBX_NB 1
40 #endif
41 
42 #ifndef PRIMARY_GPS
43 #define PRIMARY_GPS GPS_UBX
44 #endif
45 
46 extern void gps_ubx_init(void);
47 extern void gps_ubx_event(void);
48 extern void gps_ubx_parse_HITL_UBX(uint8_t *buf);
49 
50 #define GPS_UBX_NB_CHANNELS 40
51 #define GPS_UBX_MAX_PAYLOAD 512
52 
53 struct GpsUbx {
54  struct link_device *dev;
56  uint8_t msg_buf[GPS_UBX_MAX_PAYLOAD] __attribute__((aligned));
59 
67 
70  bool pacc_valid;
71 
72  struct GpsState state;
73 };
74 
75 extern struct GpsUbx gps_ubx[GPS_UBX_NB];
76 extern uint8_t gps_ubx_reset;
77 
78 /*
79  * This part is used by the autopilot to read data from a uart
80  */
81 #include "pprzlink/pprzlink_device.h"
82 
83 extern void ubx_header(struct link_device *dev, uint8_t nav_id, uint8_t msg_id, uint16_t len);
84 extern void ubx_trailer(struct link_device *dev);
85 extern void ubx_send_bytes(struct link_device *dev, uint8_t len, uint8_t *bytes);
86 extern void ubx_send_cfg_rst(struct link_device *dev, uint16_t bbr, uint8_t reset_mode);
87 
88 extern void gps_ubx_periodic_check(void);
89 
90 #endif /* GPS_UBX_H */
Device independent GPS code (interface)
data structure for GPS information
Definition: gps.h:87
void gps_ubx_periodic_check(void)
Definition: gps_ubx.c:695
uint16_t len
Definition: gps_ubx.h:61
void ubx_trailer(struct link_device *dev)
Definition: gps_ubx.c:632
uint8_t ck_b
Definition: gps_ubx.h:63
void gps_ubx_parse_HITL_UBX(uint8_t *buf)
Definition: gps_ubx.c:164
struct GpsState state
Definition: gps_ubx.h:72
void ubx_header(struct link_device *dev, uint8_t nav_id, uint8_t msg_id, uint16_t len)
Definition: gps_ubx.c:615
void ubx_send_cfg_rst(struct link_device *dev, uint16_t bbr, uint8_t reset_mode)
uint8_t status_flags
Definition: gps_ubx.h:68
uint8_t status
Definition: gps_ubx.h:60
void gps_ubx_event(void)
Definition: gps_ubx.c:137
#define GPS_UBX_NB
Definition: gps_ubx.h:39
uint8_t msg_class
Definition: gps_ubx.h:58
struct link_device * dev
Definition: gps_ubx.h:54
uint8_t gps_ubx_reset
Definition: gps_ubx.c:77
struct GpsUbx gps_ubx[GPS_UBX_NB]
Definition: gps_ubx.c:76
uint8_t sol_flags
Definition: gps_ubx.h:69
void gps_ubx_init(void)
Definition: gps_ubx.c:115
uint8_t msg_buf[GPS_UBX_MAX_PAYLOAD]
Definition: gps_ubx.h:56
uint8_t error_cnt
Definition: gps_ubx.h:65
bool pacc_valid
Definition: gps_ubx.h:70
uint8_t send_ck_b
Definition: gps_ubx.h:64
uint8_t send_ck_a
Definition: gps_ubx.h:64
uint8_t msg_id
Definition: gps_ubx.h:57
void ubx_send_bytes(struct link_device *dev, uint8_t len, uint8_t *bytes)
Definition: gps_ubx.c:644
uint8_t error_last
Definition: gps_ubx.h:66
#define GPS_UBX_MAX_PAYLOAD
Definition: gps_ubx.h:51
bool msg_available
Definition: gps_ubx.h:55
uint8_t ck_a
Definition: gps_ubx.h:63
uint16_t msg_idx
Definition: gps_ubx.h:62
Definition: gps_ubx.h:53
pprz link device for Ublox over I2C
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:74
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98