[Refactor] UBX Protocol: Removed unsupported CFG Timepulse message, added NAV Status message

rocketry
Richard Eoin Meadows 2014-10-06 19:04:48 +01:00
rodzic b86e3dd0be
commit b79b3299cd
2 zmienionych plików z 21 dodań i 43 usunięć

Wyświetl plik

@ -98,24 +98,6 @@ __PACKED__ struct ubx_cfg_nav5 {
uint32_t res4;
} payload;
};
/**
* UBX CFG TP TimePulse Parameters
*/
__PACKED__ struct ubx_cfg_tp {
ubx_message_id_t id;
enum ubx_packet_state state;
struct {
uint32_t interval;
uint32_t length;
int8_t status;
uint8_t timeRef;
uint8_t flags;
uint8_t res;
int16_t antennaCableDelay;
int16_t rfGroupDelay;
int32_t userDelay;
} payload;
};
/**
* UBX CFG TP5 TimePulse Parameters
*/
@ -236,5 +218,21 @@ __PACKED__ struct ubx_nav_sol {
uint32_t res2;
} payload;
};
/**
* UBX NAV STATUS Receiver Navigation Status
*/
__PACKED__ struct ubx_nav_status {
ubx_message_id_t id;
enum ubx_packet_state state;
struct {
uint32_t iTOW;
uint8_t gpsFix;
int8_t flags;
int8_t fixStat;
int8_t flags2;
uint32_t ttff;
uint32_t msss;
} payload;
};
#endif /* UBX_MESSAGES_H */

Wyświetl plik

@ -68,26 +68,26 @@ uint8_t ubx_irq_buffer[UBX_BUFFER_LEN];
/**
* UBX Messages
*/
volatile struct ubx_cfg_ant ubx_cfg_ant = { .id = (UBX_CFG | (0x07 << 8)) };
volatile struct ubx_cfg_ant ubx_cfg_ant = { .id = (UBX_CFG | (0x13 << 8)) };
volatile struct ubx_cfg_nav5 ubx_cfg_nav5 = { .id = (UBX_CFG | (0x24 << 8)) };
volatile struct ubx_cfg_tp ubx_cfg_tp = { .id = (UBX_CFG | (0x07 << 8)) };
volatile struct ubx_cfg_tp5 ubx_cfg_tp5 = { .id = (UBX_CFG | (0x31 << 8)) };
volatile struct ubx_cfg_prt ubx_cfg_prt = { .id = (UBX_CFG | (0x00 << 8)) };
volatile struct ubx_nav_posllh ubx_nav_posllh = { .id = (UBX_NAV | (0x02 << 8)) };
volatile struct ubx_nav_timeutc ubx_nav_timeutc = { .id = (UBX_NAV | (0x21 << 8)) };
volatile struct ubx_nav_sol ubx_nav_sol = { .id = (UBX_NAV | (0x06 << 8)) };
volatile struct ubx_nav_status ubx_nav_status = { .id = (UBX_NAV | (0x03 << 8)) };
/**
* UBX Message Type List
*/
volatile ubx_message_t* const ubx_messages[] = {
(ubx_message_t*)&ubx_cfg_ant,
(ubx_message_t*)&ubx_cfg_nav5,
(ubx_message_t*)&ubx_cfg_tp,
(ubx_message_t*)&ubx_cfg_tp5,
(ubx_message_t*)&ubx_cfg_prt,
(ubx_message_t*)&ubx_nav_posllh,
(ubx_message_t*)&ubx_nav_timeutc,
(ubx_message_t*)&ubx_nav_sol};
(ubx_message_t*)&ubx_nav_sol,
(ubx_message_t*)&ubx_nav_status};
/**
* Platform specific handlers
@ -282,6 +282,7 @@ void gps_update()
_ubx_send_message((ubx_message_t*)&ubx_nav_posllh, NULL, 0);
_ubx_send_message((ubx_message_t*)&ubx_nav_sol, NULL, 0);
_ubx_send_message((ubx_message_t*)&ubx_nav_timeutc, NULL, 0);
_ubx_send_message((ubx_message_t*)&ubx_nav_status, NULL, 0);
}
/**
* Return the latest received messages
@ -319,27 +320,6 @@ void gps_set_platform_model(void)
}
}
/**
* Set the GPS timepulse settings using the CFG_TP message
*/
void gps_set_timepulse(void)
{
/* Send the Request */
_ubx_poll((ubx_message_t*)&ubx_cfg_tp);
/* Define the settings we want */
ubx_cfg_tp.payload.interval = 2; /* 2µS */
ubx_cfg_tp.payload.length = 1; /* 1µS */
ubx_cfg_tp.payload.status = 1; /* On, Positive */
ubx_cfg_tp.payload.timeRef = 1; /* Align GPS time */
ubx_cfg_tp.payload.flags = 0x1; /* Run outside lock */
ubx_cfg_tp.payload.antennaCableDelay = 50; /* 50 nS */
/* Write the new settings */
_ubx_send_message((ubx_message_t*)&ubx_cfg_tp,
(uint8_t*)&ubx_cfg_tp.payload,
sizeof(ubx_cfg_tp.payload));
}
/**
* Set the GPS timepulse settings using the CFG_TP5 message
*/