|
|
@ -931,6 +931,27 @@ typedef struct { |
|
|
|
uint32_t heading_accuracy; |
|
|
|
} ubx_nav_velned; |
|
|
|
|
|
|
|
typedef struct |
|
|
|
{ |
|
|
|
uint8_t chn; // Channel number, 255 for SVx not assigned to channel |
|
|
|
uint8_t svid; // Satellite ID |
|
|
|
uint8_t flags; // Bitmask |
|
|
|
uint8_t quality; // Bitfield |
|
|
|
uint8_t cno; // Carrier to Noise Ratio (Signal Strength) |
|
|
|
uint8_t elev; // Elevation in integer degrees |
|
|
|
int16_t azim; // Azimuth in integer degrees |
|
|
|
int32_t prRes; // Pseudo range residual in centimetres |
|
|
|
} ubx_nav_svinfo_channel; |
|
|
|
|
|
|
|
typedef struct |
|
|
|
{ |
|
|
|
uint32_t time; // GPS Millisecond time of week |
|
|
|
uint8_t numCh; // Number of channels |
|
|
|
uint8_t globalFlags; // Bitmask, Chip hardware generation 0:Antaris, 1:u-blox 5, 2:u-blox 6 |
|
|
|
uint16_t reserved2; // Reserved |
|
|
|
ubx_nav_svinfo_channel channel[16]; // 16 satellites * 12 byte |
|
|
|
} ubx_nav_svinfo; |
|
|
|
|
|
|
|
enum { |
|
|
|
PREAMBLE1 = 0xb5, |
|
|
|
PREAMBLE2 = 0x62, |
|
|
@ -943,6 +964,7 @@ enum { |
|
|
|
MSG_STATUS = 0x3, |
|
|
|
MSG_SOL = 0x6, |
|
|
|
MSG_VELNED = 0x12, |
|
|
|
MSG_SVINFO = 0x30, |
|
|
|
MSG_CFG_PRT = 0x00, |
|
|
|
MSG_CFG_RATE = 0x08, |
|
|
|
MSG_CFG_SET_RATE = 0x01, |
|
|
@ -989,7 +1011,8 @@ static union { |
|
|
|
ubx_nav_status status; |
|
|
|
ubx_nav_solution solution; |
|
|
|
ubx_nav_velned velned; |
|
|
|
uint8_t bytes[64]; |
|
|
|
ubx_nav_svinfo svinfo; |
|
|
|
uint8_t bytes[200]; |
|
|
|
} _buffer; |
|
|
|
|
|
|
|
void _update_checksum(uint8_t *data, uint8_t len, uint8_t *ck_a, uint8_t *ck_b) |
|
|
@ -1068,6 +1091,7 @@ static bool GPS_UBLOX_newFrame(uint8_t data) |
|
|
|
|
|
|
|
static bool UBLOX_parse_gps(void) |
|
|
|
{ |
|
|
|
int i; |
|
|
|
switch (_msg_id) { |
|
|
|
case MSG_POSLLH: |
|
|
|
//i2c_dataset.time = _buffer.posllh.time; |
|
|
@ -1096,6 +1120,17 @@ static bool UBLOX_parse_gps(void) |
|
|
|
GPS_ground_course = (uint16_t) (_buffer.velned.heading_2d / 10000); // Heading 2D deg * 100000 rescaled to deg * 10 |
|
|
|
_new_speed = true; |
|
|
|
break; |
|
|
|
case MSG_SVINFO: |
|
|
|
GPS_numCh = _buffer.svinfo.numCh; |
|
|
|
if (GPS_numCh > 16) |
|
|
|
GPS_numCh = 16; |
|
|
|
for (i = 0; i < GPS_numCh; i++){ |
|
|
|
GPS_svinfo_chn[i]= _buffer.svinfo.channel[i].chn; |
|
|
|
GPS_svinfo_svid[i]= _buffer.svinfo.channel[i].svid; |
|
|
|
GPS_svinfo_quality[i]=_buffer.svinfo.channel[i].quality; |
|
|
|
GPS_svinfo_cno[i]= _buffer.svinfo.channel[i].cno; |
|
|
|
} |
|
|
|
break; |
|
|
|
default: |
|
|
|
return false; |
|
|
|
} |
|
|
|