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_skytraq.h File Reference
#include "mcu_periph/uart.h"
+ Include dependency graph for gps_skytraq.h:

Go to the source code of this file.

Data Structures

struct  GpsSkytraq
 

Macros

#define SKYTRAQ_SYNC1   0xA0
 
#define SKYTRAQ_SYNC2   0xA1
 
#define SKYTRAQ_SYNC3   0x0D
 
#define SKYTRAQ_SYNC4   0x0A
 
#define SKYTRAQ_ID_NAVIGATION_DATA   0XA8
 
#define SKYTRAQ_NAVIGATION_DATA_FixMode(_payload)   (uint8_t) (*((uint8_t*)_payload+2-2))
 
#define SKYTRAQ_NAVIGATION_DATA_NumSV(_payload)   (uint8_t) (*((uint8_t*)_payload+3-2))
 
#define SKYTRAQ_NAVIGATION_DATA_TOW(_payload)   __builtin_bswap32(*(uint32_t*)&_payload[ 6-2])
 
#define SKYTRAQ_NAVIGATION_DATA_LAT(_payload)   __builtin_bswap32(*( int32_t*)&_payload[10-2])
 
#define SKYTRAQ_NAVIGATION_DATA_LON(_payload)   __builtin_bswap32(*( int32_t*)&_payload[14-2])
 
#define SKYTRAQ_NAVIGATION_DATA_AEL(_payload)   __builtin_bswap32(*(uint32_t*)&_payload[18-2])
 
#define SKYTRAQ_NAVIGATION_DATA_ASL(_payload)   __builtin_bswap32(*(uint32_t*)&_payload[22-2])
 
#define SKYTRAQ_NAVIGATION_DATA_ECEFX(_payload)   __builtin_bswap32(*( int32_t*)&_payload[36-2])
 
#define SKYTRAQ_NAVIGATION_DATA_ECEFY(_payload)   __builtin_bswap32(*( int32_t*)&_payload[40-2])
 
#define SKYTRAQ_NAVIGATION_DATA_ECEFZ(_payload)   __builtin_bswap32(*( int32_t*)&_payload[44-2])
 
#define SKYTRAQ_NAVIGATION_DATA_ECEFVX(_payload)   __builtin_bswap32(*( int32_t*)&_payload[48-2])
 
#define SKYTRAQ_NAVIGATION_DATA_ECEFVY(_payload)   __builtin_bswap32(*( int32_t*)&_payload[52-2])
 
#define SKYTRAQ_NAVIGATION_DATA_ECEFVZ(_payload)   __builtin_bswap32(*( int32_t*)&_payload[56-2])
 
#define GPS_SKYTRAQ_ERR_NONE   0
 
#define GPS_SKYTRAQ_ERR_OVERRUN   1
 
#define GPS_SKYTRAQ_ERR_MSG_TOO_LONG   2
 
#define GPS_SKYTRAQ_ERR_CHECKSUM   3
 
#define GPS_SKYTRAQ_ERR_OUT_OF_SYNC   4
 
#define GPS_SKYTRAQ_ERR_UNEXPECTED   5
 
#define GPS_SKYTRAQ_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 GpsEvent(_sol_available_callback)
 
#define ReadGpsBuffer()
 

Functions

void gps_skytraq_read_message (void)
 
void gps_skytraq_parse (uint8_t c)
 

Variables

struct GpsSkytraq gps_skytraq
 

Macro Definition Documentation

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

Definition at line 85 of file gps_skytraq.h.

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

Definition at line 86 of file gps_skytraq.h.

#define GPS_SKYTRAQ_ERR_CHECKSUM   3

Definition at line 61 of file gps_skytraq.h.

Referenced by gps_skytraq_parse().

#define GPS_SKYTRAQ_ERR_MSG_TOO_LONG   2

Definition at line 60 of file gps_skytraq.h.

Referenced by gps_skytraq_parse().

#define GPS_SKYTRAQ_ERR_NONE   0

Definition at line 58 of file gps_skytraq.h.

#define GPS_SKYTRAQ_ERR_OUT_OF_SYNC   4

Definition at line 62 of file gps_skytraq.h.

Referenced by gps_skytraq_parse().

#define GPS_SKYTRAQ_ERR_OVERRUN   1

Definition at line 59 of file gps_skytraq.h.

#define GPS_SKYTRAQ_ERR_UNEXPECTED   5

Definition at line 63 of file gps_skytraq.h.

Referenced by gps_skytraq_parse().

#define GPS_SKYTRAQ_MAX_PAYLOAD   255

Definition at line 65 of file gps_skytraq.h.

Referenced by gps_skytraq_parse().

#define GpsBuffer ( )    GpsLink(ChAvailable())

Definition at line 89 of file gps_skytraq.h.

#define GpsEvent (   _sol_available_callback)
Value:
{ \
if (GpsBuffer()) { \
} \
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
uint8_t msg_id
Definition: gps_skytraq.h:69
uint8_t fix
status of fix
Definition: gps.h:77
#define GPS_FIX_3D
Definition: gps.h:42
#define FALSE
Definition: imu_chimu.h:141
void gps_skytraq_read_message(void)
Definition: gps_skytraq.c:61
uint32_t last_fix_ticks
cpu time in ticks at last valid fix
Definition: gps.h:84
#define SKYTRAQ_ID_NAVIGATION_DATA
Definition: gps_skytraq.h:34
volatile uint32_t nb_sec_rem
remainder of second in CPU_TICKS
Definition: sys_time.h:56
bool_t msg_available
Definition: gps_skytraq.h:68
#define ReadGpsBuffer()
Definition: gps_skytraq.h:108
struct GpsSkytraq gps_skytraq
Definition: gps_skytraq.c:31
volatile uint32_t nb_sec
full seconds since startup
Definition: sys_time.h:55
#define GpsBuffer()
Definition: gps_skytraq.h:89
struct GpsState gps
global GPS state
Definition: gps.c:31

Definition at line 91 of file gps_skytraq.h.

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

Definition at line 87 of file gps_skytraq.h.

#define ReadGpsBuffer ( )
Value:
{ \
while (GpsLink(ChAvailable())&&!gps_skytraq.msg_available) \
}
#define GpsLink(_x)
Definition: gps_skytraq.h:87
bool_t msg_available
Definition: gps_skytraq.h:68
struct GpsSkytraq gps_skytraq
Definition: gps_skytraq.c:31
void gps_skytraq_parse(uint8_t c)
Definition: gps_skytraq.c:125

Definition at line 108 of file gps_skytraq.h.

#define SKYTRAQ_ID_NAVIGATION_DATA   0XA8

Definition at line 34 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_AEL (   _payload)    __builtin_bswap32(*(uint32_t*)&_payload[18-2])

Definition at line 43 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_ASL (   _payload)    __builtin_bswap32(*(uint32_t*)&_payload[22-2])

Definition at line 44 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_ECEFVX (   _payload)    __builtin_bswap32(*( int32_t*)&_payload[48-2])

Definition at line 51 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_ECEFVY (   _payload)    __builtin_bswap32(*( int32_t*)&_payload[52-2])

Definition at line 52 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_ECEFVZ (   _payload)    __builtin_bswap32(*( int32_t*)&_payload[56-2])

Definition at line 53 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_ECEFX (   _payload)    __builtin_bswap32(*( int32_t*)&_payload[36-2])

Definition at line 48 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_ECEFY (   _payload)    __builtin_bswap32(*( int32_t*)&_payload[40-2])

Definition at line 49 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_ECEFZ (   _payload)    __builtin_bswap32(*( int32_t*)&_payload[44-2])

Definition at line 50 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_FixMode (   _payload)    (uint8_t) (*((uint8_t*)_payload+2-2))

Definition at line 36 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_LAT (   _payload)    __builtin_bswap32(*( int32_t*)&_payload[10-2])

Definition at line 41 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_LON (   _payload)    __builtin_bswap32(*( int32_t*)&_payload[14-2])

Definition at line 42 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_NumSV (   _payload)    (uint8_t) (*((uint8_t*)_payload+3-2))

Definition at line 37 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_NAVIGATION_DATA_TOW (   _payload)    __builtin_bswap32(*(uint32_t*)&_payload[ 6-2])

Definition at line 40 of file gps_skytraq.h.

Referenced by gps_skytraq_read_message().

#define SKYTRAQ_SYNC1   0xA0

Definition at line 27 of file gps_skytraq.h.

Referenced by gps_skytraq_parse().

#define SKYTRAQ_SYNC2   0xA1

Definition at line 28 of file gps_skytraq.h.

Referenced by gps_skytraq_parse().

#define SKYTRAQ_SYNC3   0x0D

Definition at line 30 of file gps_skytraq.h.

Referenced by gps_skytraq_parse().

#define SKYTRAQ_SYNC4   0x0A

Definition at line 31 of file gps_skytraq.h.

Function Documentation

Variable Documentation

struct GpsSkytraq gps_skytraq

Definition at line 31 of file gps_skytraq.c.

Referenced by gps_impl_init(), gps_skytraq_parse(), and gps_skytraq_read_message().