Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the source code of this file.
Macros | |
#define | UNINIT 0 |
#define | GOT_SYNC1 1 |
#define | GOT_SYNC2 2 |
#define | GOT_LEN1 3 |
#define | GOT_LEN2 4 |
#define | GOT_ID 5 |
#define | GOT_PAYLOAD 6 |
#define | GOT_CHECKSUM 7 |
#define | GOT_SYNC3 8 |
#define | SKYTRAQ_FIX_NONE 0x00 |
#define | SKYTRAQ_FIX_2D 0x01 |
#define | SKYTRAQ_FIX_3D 0x02 |
#define | SKYTRAQ_FIX_3D_DGPS 0x03 |
#define | SKYTRAQ_SYNC1 0xA0 |
#define | SKYTRAQ_SYNC2 0xA1 |
#define | SKYTRAQ_SYNC3 0x0D |
#define | SKYTRAQ_SYNC4 0x0A |
#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_WEEK(_payload) bswap16(*(uint16_t*)&_payload[4-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_TOW(_payload) __builtin_bswap32(*(uint32_t*)&_payload[6-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_LAT(_payload) (int32_t)__builtin_bswap32(*( int32_t*)&_payload[10-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_LON(_payload) (int32_t)__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_GDOP(_payload) bswap16(*(uint16_t*)&_payload[26-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_PDOP(_payload) bswap16(*(uint16_t*)&_payload[28-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_HDOP(_payload) bswap16(*(uint16_t*)&_payload[30-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_VDOP(_payload) bswap16(*(uint16_t*)&_payload[32-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_TDOP(_payload) bswap16(*(uint16_t*)&_payload[34-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_ECEFX(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[36-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_ECEFY(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[40-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_ECEFZ(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[44-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_ECEFVX(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[48-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_ECEFVY(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[52-2]) |
#define | SKYTRAQ_NAVIGATION_DATA_ECEFVZ(_payload) (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[56-2]) |
#define | MAX_DISTANCE 1000000 |
Functions | |
static uint16_t | bswap16 (uint16_t a) |
static int | distance_too_great (struct EcefCoor_i *ecef_ref, struct EcefCoor_i *ecef_pos) |
void | gps_impl_init (void) |
GPS initialization. More... | |
void | gps_skytraq_msg (void) |
void | gps_skytraq_read_message (void) |
void | gps_skytraq_parse (uint8_t c) |
Variables | |
struct GpsSkytraq | gps_skytraq |
#define GOT_CHECKSUM 7 |
Definition at line 42 of file gps_skytraq.c.
Referenced by gps_skytraq_parse().
#define GOT_ID 5 |
Definition at line 40 of file gps_skytraq.c.
Referenced by gps_skytraq_parse().
#define GOT_LEN1 3 |
Definition at line 38 of file gps_skytraq.c.
Referenced by gps_skytraq_parse().
#define GOT_LEN2 4 |
Definition at line 39 of file gps_skytraq.c.
Referenced by gps_skytraq_parse().
#define GOT_PAYLOAD 6 |
Definition at line 41 of file gps_skytraq.c.
Referenced by gps_skytraq_parse().
#define GOT_SYNC1 1 |
Definition at line 36 of file gps_skytraq.c.
Referenced by gps_skytraq_parse().
#define GOT_SYNC2 2 |
Definition at line 37 of file gps_skytraq.c.
Referenced by gps_skytraq_parse().
#define GOT_SYNC3 8 |
Definition at line 43 of file gps_skytraq.c.
Referenced by gps_skytraq_parse().
#define MAX_DISTANCE 1000000 |
Definition at line 90 of file gps_skytraq.c.
Referenced by distance_too_great().
#define SKYTRAQ_FIX_2D 0x01 |
Definition at line 46 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
#define SKYTRAQ_FIX_3D 0x02 |
Definition at line 47 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
#define SKYTRAQ_FIX_3D_DGPS 0x03 |
Definition at line 48 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
#define SKYTRAQ_FIX_NONE 0x00 |
Definition at line 45 of file gps_skytraq.c.
#define SKYTRAQ_NAVIGATION_DATA_AEL | ( | _payload | ) | __builtin_bswap32(*(uint32_t*)&_payload[18-2]) |
Definition at line 72 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
#define SKYTRAQ_NAVIGATION_DATA_ASL | ( | _payload | ) | __builtin_bswap32(*(uint32_t*)&_payload[22-2]) |
Definition at line 73 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
#define SKYTRAQ_NAVIGATION_DATA_ECEFVX | ( | _payload | ) | (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[48-2]) |
Definition at line 84 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
#define SKYTRAQ_NAVIGATION_DATA_ECEFVY | ( | _payload | ) | (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[52-2]) |
Definition at line 85 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
#define SKYTRAQ_NAVIGATION_DATA_ECEFVZ | ( | _payload | ) | (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[56-2]) |
Definition at line 86 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
#define SKYTRAQ_NAVIGATION_DATA_ECEFX | ( | _payload | ) | (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[36-2]) |
Definition at line 81 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
#define SKYTRAQ_NAVIGATION_DATA_ECEFY | ( | _payload | ) | (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[40-2]) |
Definition at line 82 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
#define SKYTRAQ_NAVIGATION_DATA_ECEFZ | ( | _payload | ) | (int32_t)__builtin_bswap32(*(uint32_t*)&_payload[44-2]) |
Definition at line 83 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
Definition at line 63 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
Definition at line 75 of file gps_skytraq.c.
Definition at line 77 of file gps_skytraq.c.
#define SKYTRAQ_NAVIGATION_DATA_LAT | ( | _payload | ) | (int32_t)__builtin_bswap32(*( int32_t*)&_payload[10-2]) |
Definition at line 69 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
#define SKYTRAQ_NAVIGATION_DATA_LON | ( | _payload | ) | (int32_t)__builtin_bswap32(*( int32_t*)&_payload[14-2]) |
Definition at line 70 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
Definition at line 64 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
Definition at line 76 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
Definition at line 79 of file gps_skytraq.c.
#define SKYTRAQ_NAVIGATION_DATA_TOW | ( | _payload | ) | __builtin_bswap32(*(uint32_t*)&_payload[6-2]) |
Definition at line 67 of file gps_skytraq.c.
Referenced by gps_skytraq_read_message().
Definition at line 78 of file gps_skytraq.c.
Definition at line 66 of file gps_skytraq.c.
#define SKYTRAQ_SYNC1 0xA0 |
Definition at line 51 of file gps_skytraq.c.
Referenced by gps_skytraq_parse().
#define SKYTRAQ_SYNC2 0xA1 |
Definition at line 52 of file gps_skytraq.c.
Referenced by gps_skytraq_parse().
#define SKYTRAQ_SYNC3 0x0D |
Definition at line 54 of file gps_skytraq.c.
Referenced by gps_skytraq_parse().
#define SKYTRAQ_SYNC4 0x0A |
Definition at line 55 of file gps_skytraq.c.
#define UNINIT 0 |
Definition at line 35 of file gps_skytraq.c.
Referenced by gps_impl_init(), and gps_skytraq_parse().
Definition at line 58 of file gps_skytraq.c.
|
static |
Definition at line 270 of file gps_skytraq.c.
References FALSE, MAX_DISTANCE, TRUE, EcefCoor_i::x, EcefCoor_i::y, and EcefCoor_i::z.
Referenced by gps_skytraq_read_message().
void gps_impl_init | ( | void | ) |
GPS initialization.
GPS model specific init implementation.
Definition at line 94 of file gps_skytraq.c.
References gps_skytraq, GpsSkytraq::status, and UNINIT.
void gps_skytraq_msg | ( | void | ) |
Definition at line 101 of file gps_skytraq.c.
References FALSE, GpsState::fix, get_sys_time_usec(), gps, GPS_FIX_3D, gps_skytraq, GPS_SKYTRAQ_ID, gps_skytraq_read_message(), GpsState::last_3dfix_ticks, GpsState::last_3dfix_time, GpsState::last_msg_ticks, GpsState::last_msg_time, GpsSkytraq::msg_available, GpsSkytraq::msg_id, sys_time::nb_sec, sys_time::nb_sec_rem, and SKYTRAQ_ID_NAVIGATION_DATA.
Referenced by GpsEvent().
void gps_skytraq_parse | ( | uint8_t | c | ) |
Definition at line 198 of file gps_skytraq.c.
References GpsSkytraq::checksum, GpsSkytraq::error_cnt, GpsSkytraq::error_last, GOT_CHECKSUM, GOT_ID, GOT_LEN1, GOT_LEN2, GOT_PAYLOAD, GOT_SYNC1, GOT_SYNC2, GOT_SYNC3, gps_skytraq, GPS_SKYTRAQ_ERR_CHECKSUM, GPS_SKYTRAQ_ERR_MSG_TOO_LONG, GPS_SKYTRAQ_ERR_OUT_OF_SYNC, GPS_SKYTRAQ_ERR_UNEXPECTED, GPS_SKYTRAQ_MAX_PAYLOAD, GpsSkytraq::len, GpsSkytraq::msg_available, GpsSkytraq::msg_buf, GpsSkytraq::msg_id, GpsSkytraq::msg_idx, SKYTRAQ_SYNC1, SKYTRAQ_SYNC2, SKYTRAQ_SYNC3, GpsSkytraq::status, TRUE, and UNINIT.
Referenced by GpsEvent().
void gps_skytraq_read_message | ( | void | ) |
Definition at line 119 of file gps_skytraq.c.
References LlaCoor_i::alt, UtmCoor_i::alt, GpsState::course, distance_too_great(), UtmCoor_f::east, UtmCoor_i::east, LtpDef_i::ecef, GpsState::ecef_pos, GpsState::ecef_vel, GpsState::fix, gps, GPS_FIX_2D, GPS_FIX_3D, GPS_FIX_NONE, gps_skytraq, GpsState::gspeed, GpsState::hmsl, LlaCoor_i::lat, LED_ON, LED_TOGGLE, LLA_FLOAT_OF_BFP, GpsState::lla_pos, LlaCoor_i::lon, ltp_def_from_ecef_i(), GpsSkytraq::msg_buf, GpsSkytraq::msg_id, nav_utm_zone0, ned_of_ecef_vect_i(), GpsState::ned_vel, UtmCoor_f::north, UtmCoor_i::north, GpsState::num_sv, GpsState::pdop, GpsSkytraq::ref_ltp, SKYTRAQ_FIX_2D, SKYTRAQ_FIX_3D, SKYTRAQ_FIX_3D_DGPS, SKYTRAQ_ID_NAVIGATION_DATA, SKYTRAQ_NAVIGATION_DATA_AEL, SKYTRAQ_NAVIGATION_DATA_ASL, SKYTRAQ_NAVIGATION_DATA_ECEFVX, SKYTRAQ_NAVIGATION_DATA_ECEFVY, SKYTRAQ_NAVIGATION_DATA_ECEFVZ, SKYTRAQ_NAVIGATION_DATA_ECEFX, SKYTRAQ_NAVIGATION_DATA_ECEFY, SKYTRAQ_NAVIGATION_DATA_ECEFZ, SKYTRAQ_NAVIGATION_DATA_FixMode, SKYTRAQ_NAVIGATION_DATA_LAT, SKYTRAQ_NAVIGATION_DATA_LON, SKYTRAQ_NAVIGATION_DATA_NumSV, SKYTRAQ_NAVIGATION_DATA_PDOP, SKYTRAQ_NAVIGATION_DATA_TOW, GpsState::speed_3d, GpsState::tow, utm_of_lla_f(), GpsState::utm_pos, EcefCoor_i::x, NedCoor_i::x, EcefCoor_i::y, NedCoor_i::y, EcefCoor_i::z, NedCoor_i::z, UtmCoor_f::zone, and UtmCoor_i::zone.
Referenced by gps_skytraq_msg().
struct GpsSkytraq gps_skytraq |
Definition at line 32 of file gps_skytraq.c.
Referenced by gps_impl_init(), gps_skytraq_msg(), gps_skytraq_parse(), gps_skytraq_read_message(), and GpsEvent().