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_ubx.c File Reference
#include "subsystems/gps.h"
#include "led.h"
+ Include dependency graph for gps_ubx.c:

Go to the source code of this file.

Macros

#define UNINIT   0
 
#define GOT_SYNC1   1
 
#define GOT_SYNC2   2
 
#define GOT_CLASS   3
 
#define GOT_ID   4
 
#define GOT_LEN1   5
 
#define GOT_LEN2   6
 
#define GOT_PAYLOAD   7
 
#define GOT_CHECKSUM1   8
 
#define GPS_UBX_ERR_NONE   0
 
#define GPS_UBX_ERR_OVERRUN   1
 
#define GPS_UBX_ERR_MSG_TOO_LONG   2
 
#define GPS_UBX_ERR_CHECKSUM   3
 
#define GPS_UBX_ERR_UNEXPECTED   4
 
#define GPS_UBX_ERR_OUT_OF_SYNC   5
 
#define UTM_HEM_NORTH   0
 
#define UTM_HEM_SOUTH   1
 
#define GpsUartSend1(c)   GpsLink(Transmit(c))
 
#define GpsUartSetBaudrate(_a)   GpsLink(SetBaudrate(_a))
 
#define GpsUartRunning   GpsLink(TxRunning)
 
#define GpsUartSendMessage   GpsLink(SendMessage)
 
#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 UbxTrailer()   { GpsUartSend1(gps_ubx.send_ck_a); GpsUartSend1(gps_ubx.send_ck_b); GpsUartSendMessage(); }
 
#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 UbxHeader(nav_id, msg_id, len)
 

Functions

void gps_impl_init (void)
 
void gps_ubx_read_message (void)
 
void gps_ubx_parse (uint8_t c)
 
void ubxsend_cfg_rst (uint16_t bbr, uint8_t reset_mode)
 

Variables

struct GpsUbx gps_ubx
 

Macro Definition Documentation

#define GOT_CHECKSUM1   8

Definition at line 42 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_CLASS   3

Definition at line 37 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_ID   4

Definition at line 38 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_LEN1   5

Definition at line 39 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_LEN2   6

Definition at line 40 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_PAYLOAD   7

Definition at line 41 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_SYNC1   1

Definition at line 35 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GOT_SYNC2   2

Definition at line 36 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GPS_UBX_ERR_CHECKSUM   3

Definition at line 48 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GPS_UBX_ERR_MSG_TOO_LONG   2

Definition at line 47 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GPS_UBX_ERR_NONE   0

Definition at line 45 of file gps_ubx.c.

Referenced by gps_impl_init().

#define GPS_UBX_ERR_OUT_OF_SYNC   5

Definition at line 50 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GPS_UBX_ERR_OVERRUN   1

Definition at line 46 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GPS_UBX_ERR_UNEXPECTED   4

Definition at line 49 of file gps_ubx.c.

Referenced by gps_ubx_parse().

#define GpsUartRunning   GpsLink(TxRunning)

Definition at line 58 of file gps_ubx.c.

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

Definition at line 56 of file gps_ubx.c.

#define GpsUartSendMessage   GpsLink(SendMessage)

Definition at line 59 of file gps_ubx.c.

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

Definition at line 57 of file gps_ubx.c.

Referenced by gps_ubx_ucenter_autobaud(), and gps_ubx_ucenter_configure().

#define UbxHeader (   nav_id,
  msg_id,
  len 
)
Value:
{ \
GpsUartSend1(UBX_SYNC1); \
GpsUartSend1(UBX_SYNC2); \
UbxSend1(nav_id); \
UbxSend1(msg_id); \
UbxSend2(len); \
}
#define UbxSend2(c)
Definition: gps_ubx.c:66
#define GpsUartSend1(c)
Definition: gps_ubx.c:56
#define UbxInitCheksum()
Definition: gps_ubx.c:61
#define UbxSend1(c)
Definition: gps_ubx.c:65

Definition at line 71 of file gps_ubx.c.

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

Definition at line 61 of file gps_ubx.c.

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

Definition at line 65 of file gps_ubx.c.

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

Definition at line 67 of file gps_ubx.c.

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

Definition at line 66 of file gps_ubx.c.

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

Definition at line 68 of file gps_ubx.c.

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

Definition at line 69 of file gps_ubx.c.

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

Definition at line 63 of file gps_ubx.c.

#define UNINIT   0

Definition at line 34 of file gps_ubx.c.

Referenced by gps_impl_init(), and gps_ubx_parse().

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

Definition at line 62 of file gps_ubx.c.

#define UTM_HEM_NORTH   0

Definition at line 52 of file gps_ubx.c.

#define UTM_HEM_SOUTH   1

Definition at line 53 of file gps_ubx.c.

Referenced by gps_ubx_read_message().

Function Documentation

void ubxsend_cfg_rst ( uint16_t  bbr,
uint8_t  reset_mode 
)

Definition at line 277 of file gps_ubx.c.

Variable Documentation