STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
ubx.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
Include dependency graph for ubx.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ubx_item_t
struct  ubx_pvt_t
struct  ubx_rf_t
struct  ubx_sats_t

Macros

#define UBX_CLASS_NAV   0x01U
#define UBX_CLASS_ACK   0x05U
#define UBX_CLASS_CFG   0x06U
#define UBX_CLASS_MON   0x0AU
#define UBX_ID_NAV_PVT   0x07U
#define UBX_ID_NAV_SAT   0x35U
#define UBX_ID_MON_RF   0x38U
#define UBX_ID_ACK_ACK   0x01U
#define UBX_ID_ACK_NAK   0x00U
#define UBX_ID_CFG_VALSET   0x8AU
#define UBX_NAV_PVT_LEN   92U
#define UBX_KEY_UART1_BAUDRATE   0x40520001UL
#define UBX_KEY_UART1OUTPROT_NMEA   0x10740002UL
#define UBX_KEY_MSGOUT_NAV_PVT_UART1   0x20910007UL
#define UBX_KEY_RATE_MEAS   0x30210001UL
#define UBX_KEY_NAVSPG_DYNMODEL   0x20110021UL
#define UBX_DYNMODEL_AIR4   8U
#define UBX_ANT_INIT   0U
#define UBX_ANT_DONTKNOW   1U
#define UBX_ANT_OK   2U
#define UBX_ANT_SHORT   3U
#define UBX_ANT_OPEN   4U
#define UBX_ANT_POWER_OFF   0U
#define UBX_ANT_POWER_ON   1U
#define UBX_ANT_POWER_DONTKNOW   2U

Functions

size_t ubx_frame (uint8_t *out, size_t cap, uint8_t cls, uint8_t id, const uint8_t *payload, uint16_t len)
size_t ubx_valset (uint8_t *out, size_t cap, const ubx_item_t *items, size_t count)
bool ubx_parse_nav_pvt (const uint8_t *payload, uint16_t len, ubx_pvt_t *out)
size_t ubx_poll (uint8_t *out, size_t cap, uint8_t cls, uint8_t id)
bool ubx_parse_mon_rf (const uint8_t *payload, uint16_t len, ubx_rf_t *out)
bool ubx_sat_summary (const uint8_t *payload, uint16_t len, ubx_sats_t *out)

Macro Definition Documentation

◆ UBX_ANT_DONTKNOW

#define UBX_ANT_DONTKNOW   1U

Definition at line 87 of file ubx.h.

◆ UBX_ANT_INIT

#define UBX_ANT_INIT   0U

Definition at line 86 of file ubx.h.

◆ UBX_ANT_OK

#define UBX_ANT_OK   2U

Definition at line 88 of file ubx.h.

◆ UBX_ANT_OPEN

#define UBX_ANT_OPEN   4U

Definition at line 90 of file ubx.h.

◆ UBX_ANT_POWER_DONTKNOW

#define UBX_ANT_POWER_DONTKNOW   2U

Definition at line 93 of file ubx.h.

◆ UBX_ANT_POWER_OFF

#define UBX_ANT_POWER_OFF   0U

Definition at line 91 of file ubx.h.

◆ UBX_ANT_POWER_ON

#define UBX_ANT_POWER_ON   1U

Definition at line 92 of file ubx.h.

◆ UBX_ANT_SHORT

#define UBX_ANT_SHORT   3U

Definition at line 89 of file ubx.h.

◆ UBX_CLASS_ACK

#define UBX_CLASS_ACK   0x05U

Definition at line 32 of file ubx.h.

Referenced by ack(), on_frame(), and test_frame_roundtrip_through_parser().

◆ UBX_CLASS_CFG

#define UBX_CLASS_CFG   0x06U

Definition at line 33 of file ubx.h.

Referenced by ack(), module_rx(), on_frame(), test_frame_roundtrip_through_parser(), and ubx_valset().

◆ UBX_CLASS_MON

#define UBX_CLASS_MON   0x0AU

Definition at line 34 of file ubx.h.

Referenced by gnss_core_request_status(), and on_frame().

◆ UBX_CLASS_NAV

#define UBX_CLASS_NAV   0x01U

◆ UBX_DYNMODEL_AIR4

#define UBX_DYNMODEL_AIR4   8U

Definition at line 48 of file ubx.h.

Referenced by check_gps(), send_config(), and test_valset_configuration().

◆ UBX_ID_ACK_ACK

#define UBX_ID_ACK_ACK   0x01U

Definition at line 38 of file ubx.h.

Referenced by ack(), on_frame(), and test_frame_roundtrip_through_parser().

◆ UBX_ID_ACK_NAK

#define UBX_ID_ACK_NAK   0x00U

Definition at line 39 of file ubx.h.

Referenced by ack().

◆ UBX_ID_CFG_VALSET

#define UBX_ID_CFG_VALSET   0x8AU

Definition at line 40 of file ubx.h.

Referenced by ack(), module_rx(), on_frame(), test_frame_roundtrip_through_parser(), and ubx_valset().

◆ UBX_ID_MON_RF

#define UBX_ID_MON_RF   0x38U

Definition at line 37 of file ubx.h.

Referenced by gnss_core_request_status(), and on_frame().

◆ UBX_ID_NAV_PVT

#define UBX_ID_NAV_PVT   0x07U

Definition at line 35 of file ubx.h.

Referenced by on_frame(), pvt(), and test_nav_pvt_through_the_frame_parser().

◆ UBX_ID_NAV_SAT

#define UBX_ID_NAV_SAT   0x35U

Definition at line 36 of file ubx.h.

Referenced by gnss_core_request_status(), and on_frame().

◆ UBX_KEY_MSGOUT_NAV_PVT_UART1

#define UBX_KEY_MSGOUT_NAV_PVT_UART1   0x20910007UL

Definition at line 45 of file ubx.h.

Referenced by on_valset(), send_config(), and test_valset_configuration().

◆ UBX_KEY_NAVSPG_DYNMODEL

#define UBX_KEY_NAVSPG_DYNMODEL   0x20110021UL

Definition at line 47 of file ubx.h.

Referenced by on_valset(), send_config(), and test_valset_configuration().

◆ UBX_KEY_RATE_MEAS

#define UBX_KEY_RATE_MEAS   0x30210001UL

Definition at line 46 of file ubx.h.

Referenced by on_valset(), send_config(), and test_valset_configuration().

◆ UBX_KEY_UART1_BAUDRATE

#define UBX_KEY_UART1_BAUDRATE   0x40520001UL

Definition at line 43 of file ubx.h.

Referenced by configure(), on_valset(), and test_valset_baud().

◆ UBX_KEY_UART1OUTPROT_NMEA

#define UBX_KEY_UART1OUTPROT_NMEA   0x10740002UL

Definition at line 44 of file ubx.h.

Referenced by on_valset(), send_config(), and test_valset_configuration().

◆ UBX_NAV_PVT_LEN

#define UBX_NAV_PVT_LEN   92U

Definition at line 41 of file ubx.h.

Referenced by pvt(), test_nav_pvt_through_the_frame_parser(), and ubx_parse_nav_pvt().

Function Documentation

◆ ubx_frame()

size_t ubx_frame ( uint8_t * out,
size_t cap,
uint8_t cls,
uint8_t id,
const uint8_t * payload,
uint16_t len )

Definition at line 5 of file ubx.c.

References a, and b.

Referenced by ack(), pvt(), test_frame_roundtrip_through_parser(), ubx_poll(), and ubx_valset().

◆ ubx_parse_mon_rf()

bool ubx_parse_mon_rf ( const uint8_t * payload,
uint16_t len,
ubx_rf_t * out )

Definition at line 104 of file ubx.c.

References b, p, and u16().

Referenced by on_frame().

◆ ubx_parse_nav_pvt()

bool ubx_parse_nav_pvt ( const uint8_t * payload,
uint16_t len,
ubx_pvt_t * out )

Definition at line 66 of file ubx.c.

References i32(), p, u32(), and UBX_NAV_PVT_LEN.

Referenced by on_pvt(), and test_nav_pvt_through_the_frame_parser().

◆ ubx_poll()

size_t ubx_poll ( uint8_t * out,
size_t cap,
uint8_t cls,
uint8_t id )

Definition at line 96 of file ubx.c.

References NULL, and ubx_frame().

Referenced by gnss_core_request_status().

◆ ubx_sat_summary()

bool ubx_sat_summary ( const uint8_t * payload,
uint16_t len,
ubx_sats_t * out )

Definition at line 119 of file ubx.c.

References p, and u32().

Referenced by on_frame().

◆ ubx_valset()

size_t ubx_valset ( uint8_t * out,
size_t cap,
const ubx_item_t * items,
size_t count )