Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gps_mtk.h File Reference

Mediatek MT3329 specific code. More...

#include "mcu_periph/uart.h"
#include "mtk_protocol.h"
+ Include dependency graph for gps_mtk.h:

Go to the source code of this file.

Data Structures

struct  GpsMtk


#define GPS_MTK_MAX_PAYLOAD   255
 Includes macros generated from mtk.xml. More...
#define __GpsLink(dev, _x)   dev##_x
#define _GpsLink(dev, _x)   __GpsLink(dev, _x)
#define GpsLink(_x)   _GpsLink(GPS_LINK, _x)
#define GpsBuffer()   GpsLink(ChAvailable())
#define GpsConfigure()   {}
#define GpsEvent(_sol_available_callback)
#define ReadGpsBuffer()


void gps_mtk_read_message (void)
void gps_mtk_parse (uint8_t c)


struct GpsMtk gps_mtk

Detailed Description

Mediatek MT3329 specific code.

supports: DIYDrones V1.4 protocol (AXN1.30_2278) DIYDrones V1.6 protocol (AXN1.30_2389)

documentation is partly incorrect, see mtk.xml for what seems to be "real"

Definition in file gps_mtk.h.

Macro Definition Documentation

#define __GpsLink (   dev,
)    dev##_x

Definition at line 57 of file gps_mtk.h.

#define _GpsLink (   dev,
)    __GpsLink(dev, _x)

Definition at line 58 of file gps_mtk.h.

#define GPS_MTK_MAX_PAYLOAD   255

Includes macros generated from mtk.xml.

Definition at line 31 of file gps_mtk.h.

#define GpsBuffer ( )    GpsLink(ChAvailable())

Definition at line 61 of file gps_mtk.h.

#define GpsConfigure ( )    {}

Definition at line 70 of file gps_mtk.h.

#define GpsEvent (   _sol_available_callback)
{ \
if (GpsBuffer()) { \
} \
if (gps_mtk.msg_class == MTK_DIY14_ID && \
gps_mtk.msg_id == MTK_DIY14_NAV_ID) { \
if (gps.fix == GPS_FIX_3D) { \
} \
_sol_available_callback(); \
} \
if (gps_mtk.msg_class == MTK_DIY16_ID && \
gps_mtk.msg_id == MTK_DIY16_NAV_ID) { \
if (gps.fix == GPS_FIX_3D) { \
} \
_sol_available_callback(); \
} \
} \
uint32_t last_fix_time
cpu time in sec at last valid fix
Definition: gps.h:85
#define ReadGpsBuffer()
Definition: gps_mtk.h:99
#define GpsBuffer()
Definition: gps_mtk.h:61
#define GpsConfigure()
Definition: gps_mtk.h:70
uint8_t fix
status of fix
Definition: gps.h:77
#define GPS_FIX_3D
Definition: gps.h:42
uint8_t msg_id
Definition: gps_mtk.h:36
#define FALSE
Definition: imu_chimu.h:141
struct GpsMtk gps_mtk
Definition: gps_mtk.c:82
uint32_t last_fix_ticks
cpu time in ticks at last valid fix
Definition: gps.h:84
void gps_mtk_read_message(void)
Definition: gps_mtk.c:160
volatile uint32_t nb_sec_rem
remainder of second in CPU_TICKS
Definition: sys_time.h:56
bool_t msg_available
Definition: gps_mtk.h:34
uint8_t msg_class
Definition: gps_mtk.h:37
volatile uint32_t nb_sec
full seconds since startup
Definition: sys_time.h:55
struct GpsState gps
global GPS state
Definition: gps.c:31

Definition at line 73 of file gps_mtk.h.

Referenced by event_task_ap(), and main_event().

#define GpsLink (   _x)    _GpsLink(GPS_LINK, _x)

Definition at line 59 of file gps_mtk.h.

#define ReadGpsBuffer ( )
{ \
while (GpsLink(ChAvailable())&&!gps_mtk.msg_available) \
gps_mtk_parse(GpsLink(Getch())); \
#define GpsLink(_x)
Definition: gps_mtk.h:59
void gps_mtk_parse(uint8_t c)
Definition: gps_mtk.c:285
struct GpsMtk gps_mtk
Definition: gps_mtk.c:82
bool_t msg_available
Definition: gps_mtk.h:34

Definition at line 99 of file gps_mtk.h.

Function Documentation

Variable Documentation

struct GpsMtk gps_mtk

Definition at line 82 of file gps_mtk.c.

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