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_mtk.c File Reference
+ Include dependency graph for gps_mtk.c:

Go to the source code of this file.

Macros

#define MTK_DIY_OUTPUT_RATE   MTK_DIY_OUTPUT_4HZ
 
#define OUTPUT_RATE   4
 
#define UNINIT   0
 
#define GOT_SYNC1_14   1
 
#define GOT_SYNC2_14   2
 
#define GOT_CLASS_14   3
 
#define GOT_SYNC1_16   4
 
#define GOT_SYNC2_16   5
 
#define GOT_ID   6
 
#define GOT_PAYLOAD   7
 
#define GOT_CHECKSUM1   8
 
#define GPS_MTK_ERR_NONE   0
 
#define GPS_MTK_ERR_OVERRUN   1
 
#define GPS_MTK_ERR_MSG_TOO_LONG   2
 
#define GPS_MTK_ERR_CHECKSUM   3
 
#define GPS_MTK_ERR_UNEXPECTED   4
 
#define GPS_MTK_ERR_OUT_OF_SYNC   5
 
#define MTK_DIY_FIX_3D   3
 
#define MTK_DIY_FIX_2D   2
 
#define MTK_DIY_FIX_NONE   1
 
#define SECS_MINUTE   (60)
 
#define SECS_HOUR   (60*60)
 
#define SECS_DAY   (60*60*24)
 
#define SECS_WEEK   (60*60*24*7)
 
#define isleap(x)   ((((x)%400)==0) || (!(((x)%100)==0) && (((x)%4)==0)))
 

Functions

void gps_impl_init (void)
 GPS initialization. More...
 
void gps_mtk_msg (void)
 
static void gps_mtk_time2itow (uint32_t gps_date, uint32_t gps_time, int16_t *gps_week, uint32_t *gps_itow)
 
void gps_mtk_read_message (void)
 
void gps_mtk_parse (uint8_t c)
 

Variables

const int8_t DAYS_MONTH [12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }
 
struct GpsMtk gps_mtk
 

Macro Definition Documentation

#define GOT_CHECKSUM1   8

Definition at line 56 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define GOT_CLASS_14   3

Definition at line 51 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define GOT_ID   6

Definition at line 54 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define GOT_PAYLOAD   7

Definition at line 55 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define GOT_SYNC1_14   1

Definition at line 49 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define GOT_SYNC1_16   4

Definition at line 52 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define GOT_SYNC2_14   2

Definition at line 50 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define GOT_SYNC2_16   5

Definition at line 53 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define GPS_MTK_ERR_CHECKSUM   3

Definition at line 62 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define GPS_MTK_ERR_MSG_TOO_LONG   2

Definition at line 61 of file gps_mtk.c.

#define GPS_MTK_ERR_NONE   0

Definition at line 59 of file gps_mtk.c.

Referenced by gps_impl_init().

#define GPS_MTK_ERR_OUT_OF_SYNC   5

Definition at line 64 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define GPS_MTK_ERR_OVERRUN   1

Definition at line 60 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define GPS_MTK_ERR_UNEXPECTED   4

Definition at line 63 of file gps_mtk.c.

Referenced by gps_mtk_parse().

#define isleap (   x)    ((((x)%400)==0) || (!(((x)%100)==0) && (((x)%4)==0)))

Definition at line 78 of file gps_mtk.c.

Referenced by gps_mtk_time2itow().

#define MTK_DIY_FIX_2D   2

Definition at line 68 of file gps_mtk.c.

Referenced by gps_mtk_read_message().

#define MTK_DIY_FIX_3D   3

Definition at line 67 of file gps_mtk.c.

Referenced by gps_mtk_read_message().

#define MTK_DIY_FIX_NONE   1

Definition at line 69 of file gps_mtk.c.

#define MTK_DIY_OUTPUT_RATE   MTK_DIY_OUTPUT_4HZ

Definition at line 44 of file gps_mtk.c.

#define OUTPUT_RATE   4

Definition at line 45 of file gps_mtk.c.

Referenced by gps_mtk_read_message().

#define SECS_DAY   (60*60*24)

Definition at line 75 of file gps_mtk.c.

Referenced by gps_mtk_time2itow().

#define SECS_HOUR   (60*60)

Definition at line 74 of file gps_mtk.c.

Referenced by gps_mtk_time2itow().

#define SECS_MINUTE   (60)

Definition at line 73 of file gps_mtk.c.

Referenced by gps_mtk_time2itow().

#define SECS_WEEK   (60*60*24*7)

Definition at line 76 of file gps_mtk.c.

#define UNINIT   0

Definition at line 48 of file gps_mtk.c.

Referenced by gps_impl_init(), and gps_mtk_parse().

Function Documentation

void gps_impl_init ( void  )

GPS initialization.

GPS model specific init implementation.

Definition at line 106 of file gps_mtk.c.

References GpsMtk::error_cnt, GpsMtk::error_last, FALSE, gps_mtk, GPS_MTK_ERR_NONE, GpsMtk::msg_available, GpsMtk::status, TRUE, and UNINIT.

void gps_mtk_msg ( void  )
static void gps_mtk_time2itow ( uint32_t  gps_date,
uint32_t  gps_time,
int16_t gps_week,
uint32_t gps_itow 
)
static

Definition at line 145 of file gps_mtk.c.

References DAYS_MONTH, isleap, SECS_DAY, SECS_HOUR, and SECS_MINUTE.

Referenced by gps_mtk_read_message().

+ Here is the caller graph for this function:

Variable Documentation

const int8_t DAYS_MONTH[12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }

Definition at line 80 of file gps_mtk.c.

Referenced by gps_mtk_time2itow().

struct GpsMtk gps_mtk

Definition at line 82 of file gps_mtk.c.

Referenced by gps_impl_init(), gps_mtk_msg(), gps_mtk_parse(), gps_mtk_read_message(), and GpsEvent().