Skip to content

Commit

Permalink
ubx: add basic support for upd/sos, save on shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
cire831 committed Jul 1, 2021
1 parent cf5e63a commit cdaa741
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 1 deletion.
32 changes: 32 additions & 0 deletions include/ublox_msg.h
Original file line number Diff line number Diff line change
Expand Up @@ -728,4 +728,36 @@ typedef struct {
} PACKED ubx_tim_tp_t;


/* UBX_CLASS_UPD (09) */
enum {
UBX_UPD_SOS = 0x14, /* save on shutdown */
UBX_UPD_SOS_CREATE = 0,
UBX_UPD_SOS_CLEAR = 1,
UBX_UPD_SOS_ACK = 2,
UBX_UPD_SOS_RESTORED = 3,

UBX_UPD_SOS_ACK_NACK = 0,
UBX_UPD_SOS_ACK_ACK = 1,

UBX_UPD_SOS_RSP_UNK = 0, /* weird */
UBX_UPD_SOS_RSP_FAIL = 1, /* nope */
UBX_UPD_SOS_RSP_OK = 2, /* restored */
UBX_UPD_SOS_RSP_NONE = 3, /* no backup present */
};

typedef struct {
uint8_t sync1;
uint8_t sync2;
uint8_t class; /* upd - 09 */
uint8_t id; /* sos - 14 */
uint16_t len; /* 4/8 bytes */
uint8_t cmd;
uint8_t reserved1[3];
uint8_t rsp;
uint8_t reserved2[3];
uint8_t chkA;
uint8_t chkB;
} PACKED ubx_upd_sos_t;


#endif /* __UBLOX_MSG_H__ */
2 changes: 1 addition & 1 deletion tools/utils/tagcore/tagcore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@author: Eric B. Decker
"""

__version__ = '0.4.10.dev1'
__version__ = '0.4.10.dev2'

__all__ = [
'CORE_REV', # core_rev.py
Expand Down
36 changes: 36 additions & 0 deletions tos/chips/ublox/ublox_driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,16 @@ const uint8_t ubx_cfg_rst_full_hw[] = {
0x23, 0x9b,
};

const uint8_t ubx_cfg_rst_stop_gnss[] = {
UBX_SYNC1, UBX_SYNC2,
UBX_CLASS_CFG, UBX_CFG_RST,
0x04, 0x00, /* len 4 bytes */
0x00, 0x00, /* no clear, hot start if possible */
0x08, /* resetMode: 8 gnss stop */
0x00, /* reserved */
0x16, 0x74,
};

const uint8_t ubx_cfg_tp5_poll[] = {
UBX_SYNC1, UBX_SYNC2,
UBX_CLASS_CFG, UBX_CFG_TP5, /* time pulse 0 */
Expand Down Expand Up @@ -354,6 +364,32 @@ const uint8_t ubx_tim_tp_poll[] = {
};


const uint8_t ubx_upd_sos_create[] = {
UBX_SYNC1, UBX_SYNC2,
UBX_CLASS_UPD, UBX_UPD_SOS, /* save on shutdown */
0x04, 0x00, /* length, 4 bytes */
0x00, /* cmd 0, create */
0x00, 0x00, 0x00,
0x21, 0xEC,
};

const uint8_t ubx_upd_sos_clear[] = {
UBX_SYNC1, UBX_SYNC2,
UBX_CLASS_UPD, UBX_UPD_SOS, /* save on shutdown */
0x04, 0x00, /* length, 4 bytes */
0x01, /* cmd 1, clear */
0x00, 0x00, 0x00,
0x22, 0xF0,
};

const uint8_t ubx_upd_sos_poll[] = {
UBX_SYNC1, UBX_SYNC2,
UBX_CLASS_UPD, UBX_UPD_SOS, /* save on shutdown */
0x00, 0x00, /* length, 0 bytes */
0x22, 0xF0,
};


/*
* Instrumentation, Stats
*
Expand Down

0 comments on commit cdaa741

Please sign in to comment.