Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gps_mtk.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 
34 #ifndef MTK_H
35 #define MTK_H
36 
37 #include "subsystems/gps.h"
38 #include "mcu_periph/uart.h"
39 
41 #include "mtk_protocol.h"
42 
43 #define GPS_MTK_MAX_PAYLOAD 255
44 
45 #ifndef PRIMARY_GPS
46 #define PRIMARY_GPS GPS_MTK
47 #endif
48 
49 struct GpsMtk {
51  uint8_t msg_buf[GPS_MTK_MAX_PAYLOAD] __attribute__((aligned));
54 
62 
65 
66  struct GpsState state;
67 };
68 
69 extern struct GpsMtk gps_mtk;
70 
71 extern void gps_mtk_event(void);
72 extern void gps_mtk_init(void);
73 
74 #define gps_mtk_periodic_check() gps_periodic_check(&gps_mtk.state)
75 
76 #ifdef GPS_CONFIGURE
77 extern void gps_configure(void);
78 extern void gps_configure_uart(void);
79 extern bool gps_configuring;
80 #define GpsConfigure() { \
81  if (gps_configuring) \
82  gps_configure(); \
83  }
84 #else
85 #define GpsConfigure() {}
86 #endif
87 
88 
89 #endif /* MTK_H */
unsigned short uint16_t
Definition: types.h:16
void gps_mtk_init(void)
Definition: gps_mtk.c:111
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
uint8_t msg_idx
Definition: gps_mtk.h:57
uint8_t error_cnt
Definition: gps_mtk.h:60
#define GPS_MTK_MAX_PAYLOAD
Includes macros generated from mtk.xml.
Definition: gps_mtk.h:43
uint8_t send_ck_b
Definition: gps_mtk.h:59
uint8_t status_flags
Definition: gps_mtk.h:63
uint8_t ck_b
Definition: gps_mtk.h:58
bool msg_available
Definition: gps_mtk.h:50
uint8_t ck_a
Definition: gps_mtk.h:58
struct GpsMtk gps_mtk
Definition: gps_mtk.c:83
uint8_t msg_buf[GPS_MTK_MAX_PAYLOAD]
Definition: gps_mtk.h:51
data structure for GPS information
Definition: gps.h:81
uint16_t len
Definition: gps_mtk.h:56
Device independent GPS code (interface)
uint8_t send_ck_a
Definition: gps_mtk.h:59
struct GpsState state
Definition: gps_mtk.h:66
uint8_t msg_class
Definition: gps_mtk.h:53
uint8_t status
Definition: gps_mtk.h:55
Definition: gps_mtk.h:49
unsigned char uint8_t
Definition: types.h:14
uint8_t sol_flags
Definition: gps_mtk.h:64
void gps_mtk_event(void)
Definition: gps_mtk.c:123
uint8_t error_last
Definition: gps_mtk.h:61
uint8_t msg_id
Definition: gps_mtk.h:52