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
gps_skytraq.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 Antoine Drouin <poinix@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 
22 #ifndef GPS_SKYTRAQ_H
23 #define GPS_SKYTRAQ_H
24 
25 #include "mcu_periph/uart.h"
26 
27 #define SKYTRAQ_ID_NAVIGATION_DATA 0XA8
28 
29 /* last error type */
37 };
38 
39 #define GPS_SKYTRAQ_MAX_PAYLOAD 255
40 struct GpsSkytraq {
42  bool_t msg_available;
44 
51 
52  struct LtpDef_i ref_ltp;
53 };
54 
55 extern struct GpsSkytraq gps_skytraq;
56 
57 
58 /*
59  * This part is used by the autopilot to read data from a uart
60  */
61 #include "mcu_periph/link_device.h"
62 
63 extern void gps_skytraq_read_message(void);
64 extern void gps_skytraq_parse(uint8_t c);
65 extern void gps_skytraq_msg(void);
66 
67 static inline void GpsEvent(void)
68 {
69  struct link_device *dev = &((GPS_LINK).device);
70 
71  while (dev->char_available(dev->periph)) {
72  gps_skytraq_parse(dev->get_byte(dev->periph));
75  }
76  }
77 }
78 
79 #endif /* GPS_SKYTRAQ_H */
unsigned short uint16_t
Definition: types.h:16
struct LtpDef_i ref_ltp
Definition: gps_skytraq.h:52
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
bool_t msg_available
Definition: gps_skytraq.h:42
definition of the local (flat earth) coordinate system
enum GpsSkytraqError error_last
Definition: gps_skytraq.h:50
void gps_skytraq_msg(void)
Definition: gps_skytraq.c:101
GpsSkytraqError
Definition: gps_skytraq.h:30
static void GpsEvent(void)
Definition: gps_skytraq.h:67
uint8_t msg_buf[GPS_SKYTRAQ_MAX_PAYLOAD]
Definition: gps_skytraq.h:41
void gps_skytraq_read_message(void)
Definition: gps_skytraq.c:119
#define GPS_SKYTRAQ_MAX_PAYLOAD
Definition: gps_skytraq.h:39
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:69
uint8_t msg_id
Definition: gps_skytraq.h:43
unsigned char uint8_t
Definition: types.h:14
struct GpsSkytraq gps_skytraq
Definition: gps_skytraq.c:32
uint16_t len
Definition: gps_skytraq.h:46
uint8_t status
Definition: gps_skytraq.h:45
uint8_t error_cnt
Definition: gps_skytraq.h:49
void gps_skytraq_parse(uint8_t c)
Definition: gps_skytraq.c:198
uint8_t checksum
Definition: gps_skytraq.h:48
uint8_t msg_idx
Definition: gps_skytraq.h:47