Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
gps_ubx.h File Reference

UBX protocol specific code. More...

#include "mcu_periph/uart.h"
#include "ubx_protocol.h"
+ Include dependency graph for gps_ubx.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  GpsUbx


#define GPS_NB_CHANNELS   16
 Includes macros generated from ubx.xml. More...
#define GPS_UBX_MAX_PAYLOAD   255
#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 gps_ubx_ucenter_event()   {}
#define GpsEvent(_sol_available_callback)
#define ReadGpsBuffer()
#define CFG_RST_Reset_Hardware   0x00
#define CFG_RST_Reset_Controlled   0x01
#define CFG_RST_Reset_Controlled_GPS_only   0x02
#define CFG_RST_Reset_Controlled_GPS_stop   0x08
#define CFG_RST_Reset_Controlled_GPS_start   0x09
#define CFG_RST_BBR_Hotstart   0x0000
#define CFG_RST_BBR_Warmstart   0x0001
#define CFG_RST_BBR_Coldstart   0xffff
#define gps_ubx_Reset(_val)
#define GpsUartSendMessage   GpsLink(SendMessage)
#define GpsUartSend1(c)   GpsLink(Transmit(c))
#define UbxInitCheksum()   { gps_ubx.send_ck_a = gps_ubx.send_ck_b = 0; }
#define UpdateChecksum(c)   { gps_ubx.send_ck_a += c; gps_ubx.send_ck_b += gps_ubx.send_ck_a; }
#define UbxSend1(c)   { uint8_t i8=c; GpsUartSend1(i8); UpdateChecksum(i8); }
#define UbxSend2(c)   { uint16_t i16=c; UbxSend1(i16&0xff); UbxSend1(i16 >> 8); }
#define UbxSend1ByAddr(x)   { UbxSend1(*x); }
#define UbxSend2ByAddr(x)   { UbxSend1(*x); UbxSend1(*(x+1)); }
#define UbxSend4ByAddr(x)   { UbxSend1(*x); UbxSend1(*(x+1)); UbxSend1(*(x+2)); UbxSend1(*(x+3)); }
#define GpsUartSetBaudrate(_a)   GpsLink(SetBaudrate(_a))
#define UbxHeader(nav_id, msg_id, len)
#define UbxTrailer()   { GpsUartSend1(gps_ubx.send_ck_a); GpsUartSend1(gps_ubx.send_ck_b); GpsUartSendMessage(); }


void gps_ubx_read_message (void)
void gps_ubx_parse (uint8_t c)
void ubxsend_cfg_rst (uint16_t, uint8_t)


struct GpsUbx gps_ubx

Detailed Description

UBX protocol specific code.

Definition in file gps_ubx.h.

Macro Definition Documentation

#define __GpsLink (   dev,
)    dev##_x

Definition at line 88 of file gps_ubx.h.

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

Definition at line 89 of file gps_ubx.h.

#define CFG_RST_BBR_Coldstart   0xffff

Definition at line 149 of file gps_ubx.h.

#define CFG_RST_BBR_Hotstart   0x0000

Definition at line 147 of file gps_ubx.h.

#define CFG_RST_BBR_Warmstart   0x0001

Definition at line 148 of file gps_ubx.h.

#define CFG_RST_Reset_Controlled   0x01

Definition at line 142 of file gps_ubx.h.

#define CFG_RST_Reset_Controlled_GPS_only   0x02

Definition at line 143 of file gps_ubx.h.

#define CFG_RST_Reset_Controlled_GPS_start   0x09

Definition at line 145 of file gps_ubx.h.

#define CFG_RST_Reset_Controlled_GPS_stop   0x08

Definition at line 144 of file gps_ubx.h.

#define CFG_RST_Reset_Hardware   0x00

Definition at line 141 of file gps_ubx.h.

#define GPS_NB_CHANNELS   16

Includes macros generated from ubx.xml.

Definition at line 39 of file gps_ubx.h.

#define GPS_UBX_MAX_PAYLOAD   255

Definition at line 41 of file gps_ubx.h.

Referenced by gps_ubx_parse().

#define gps_ubx_Reset (   _val)
{ \
gps_ubx.reset = _val; \
#define CFG_RST_Reset_Controlled
Definition: gps_ubx.h:142
void ubxsend_cfg_rst(uint16_t, uint8_t)
Definition: jsbsim_gps.c:66
struct GpsUbx gps_ubx
Definition: gps_ubx.c:58
#define CFG_RST_BBR_Coldstart
Definition: gps_ubx.h:149
#define CFG_RST_BBR_Warmstart
Definition: gps_ubx.h:148

Definition at line 153 of file gps_ubx.h.

#define gps_ubx_ucenter_event (   void)    {}

Definition at line 95 of file gps_ubx.h.

#define GpsBuffer ( )    GpsLink(ChAvailable())

Definition at line 92 of file gps_ubx.h.

#define GpsEvent (   _sol_available_callback)
{ \
} \
if (gps_ubx.msg_class == UBX_NAV_ID && \
(gps_ubx.msg_id == UBX_NAV_VELNED_ID || \
(gps_ubx.msg_id == UBX_NAV_SOL_ID && \
gps_ubx.have_velned == 0))) { \
} \
_sol_available_callback(); \
} \
} \
uint32_t last_3dfix_ticks
cpu time ticks at last valid 3D fix
Definition: gps.h:85
bool_t msg_available
Definition: gps_ubx.h:43
uint8_t fix
status of fix
Definition: gps.h:78
#define GPS_FIX_3D
Definition: gps.h:43
#define FALSE
Definition: imu_chimu.h:141
void gps_ubx_read_message(void)
Definition: gps_ubx.c:73
uint8_t msg_class
Definition: gps_ubx.h:46
#define gps_ubx_ucenter_event()
Definition: gps_ubx.h:95
#define GpsBuffer()
Definition: gps_ubx.h:92
volatile uint32_t nb_sec_rem
remainder of seconds since startup in CPU_TICKS
Definition: sys_time.h:70
struct GpsUbx gps_ubx
Definition: gps_ubx.c:58
uint8_t have_velned
Definition: gps_ubx.h:58
uint32_t last_msg_ticks
cpu time ticks at last received GPS message
Definition: gps.h:87
volatile uint32_t nb_sec
full seconds since startup
Definition: sys_time.h:69
uint32_t last_3dfix_time
cpu time in sec at last valid 3D fix
Definition: gps.h:86
uint32_t last_msg_time
cpu time in sec at last received GPS message
Definition: gps.h:88
#define ReadGpsBuffer()
Definition: gps_ubx.h:126
struct GpsState gps
global GPS state
Definition: gps.c:41
uint8_t msg_id
Definition: gps_ubx.h:45

Definition at line 103 of file gps_ubx.h.

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

Definition at line 90 of file gps_ubx.h.

#define GpsUartSend1 (   c)    GpsLink(Transmit(c))

Definition at line 162 of file gps_ubx.h.

#define GpsUartSendMessage   GpsLink(SendMessage)

Definition at line 160 of file gps_ubx.h.

#define GpsUartSetBaudrate (   _a)    GpsLink(SetBaudrate(_a))

Definition at line 170 of file gps_ubx.h.

Referenced by gps_ubx_ucenter_autobaud(), and gps_ubx_ucenter_configure().

#define ReadGpsBuffer ( )
{ \
while (GpsLink(ChAvailable())&&!gps_ubx.msg_available) \
gps_ubx_parse(GpsLink(Getch())); \
bool_t msg_available
Definition: gps_ubx.h:43
#define GpsLink(_x)
Definition: gps_ubx.h:90
void gps_ubx_parse(uint8_t c)
Definition: gps_ubx.c:194
struct GpsUbx gps_ubx
Definition: gps_ubx.c:58

Definition at line 126 of file gps_ubx.h.

#define UbxHeader (   nav_id,
{ \
GpsUartSend1(UBX_SYNC1); \
GpsUartSend1(UBX_SYNC2); \
UbxSend1(nav_id); \
UbxSend1(msg_id); \
UbxSend2(len); \
#define UbxInitCheksum()
Definition: gps_ubx.h:163
#define UbxSend1(c)
Definition: gps_ubx.h:165
#define UbxSend2(c)
Definition: gps_ubx.h:166
#define GpsUartSend1(c)
Definition: gps_ubx.h:162

Definition at line 172 of file gps_ubx.h.

#define UbxInitCheksum ( )    { gps_ubx.send_ck_a = gps_ubx.send_ck_b = 0; }

Definition at line 163 of file gps_ubx.h.

#define UbxSend1 (   c)    { uint8_t i8=c; GpsUartSend1(i8); UpdateChecksum(i8); }

Definition at line 165 of file gps_ubx.h.

#define UbxSend1ByAddr (   x)    { UbxSend1(*x); }

Definition at line 167 of file gps_ubx.h.

#define UbxSend2 (   c)    { uint16_t i16=c; UbxSend1(i16&0xff); UbxSend1(i16 >> 8); }

Definition at line 166 of file gps_ubx.h.

#define UbxSend2ByAddr (   x)    { UbxSend1(*x); UbxSend1(*(x+1)); }

Definition at line 168 of file gps_ubx.h.

#define UbxSend4ByAddr (   x)    { UbxSend1(*x); UbxSend1(*(x+1)); UbxSend1(*(x+2)); UbxSend1(*(x+3)); }

Definition at line 169 of file gps_ubx.h.

#define UbxTrailer ( )    { GpsUartSend1(gps_ubx.send_ck_a); GpsUartSend1(gps_ubx.send_ck_b); GpsUartSendMessage(); }

Definition at line 181 of file gps_ubx.h.

#define UpdateChecksum (   c)    { gps_ubx.send_ck_a += c; gps_ubx.send_ck_b += gps_ubx.send_ck_a; }

Definition at line 164 of file gps_ubx.h.

Function Documentation

void ubxsend_cfg_rst ( uint16_t  ,

Definition at line 66 of file jsbsim_gps.c.

Variable Documentation