|
20 | 20 |
|
21 | 21 | /** Time mark in GLO nav string, GLO ICD, pg. 16 */
|
22 | 22 | #define GLO_TM (0x3E375096)
|
| 23 | +/** Length of GLO time mark */ |
23 | 24 | #define GLO_TM_LEN 30
|
24 | 25 |
|
| 26 | +/* States of receiver GLO bitstream */ |
25 | 27 | typedef enum {
|
26 | 28 | INVALID = -1,
|
27 |
| - SYNC_TM, |
28 |
| - GET_DATA_BIT |
29 |
| -} glo_decode_machine; |
| 29 | + SYNC_TM, /**< Time mark search */ |
| 30 | + GET_DATA_BIT /**< Data bit receive */ |
| 31 | +} glo_receive_machine; |
30 | 32 |
|
| 33 | +/* The structure is used for GLO receive and decode bitstream */ |
31 | 34 | typedef struct {
|
32 |
| - u32 string_bits[NAV_MSG_GLO_STRING_BITS_LEN]; |
33 |
| - u32 tm_buff; |
34 |
| - u16 current_head_bit_index; |
35 |
| - u8 next_string_id; |
36 |
| - u8 meander_bits_cnt; |
37 |
| - u8 manchester; |
38 |
| - glo_decode_machine state; |
| 35 | + u32 string_bits[NAV_MSG_GLO_STRING_BITS_LEN]; /**< buffer for one GLO string */ |
| 36 | + u16 current_head_bit_index; /**< how many bits written into GLO string buffer*/ |
| 37 | + u16 nt; /**< tmp container for TOE calculation */ |
| 38 | + u8 next_string_id; /**< what is the next string we need for parsing */ |
| 39 | + u8 n4; /**< tmp container for TOE calculation */ |
| 40 | + u8 hrs; /**< tmp container for TOE calculation */ |
| 41 | + u8 min; /**< tmp container for TOE calculation */ |
| 42 | + u8 sec; /**< tmp container for TOE calculation */ |
| 43 | + glo_receive_machine state; /**< current state of receiver */ |
| 44 | + u8 meander_bits_cnt:2; /**< counter for line code bits, MAX is 2 */ |
| 45 | + u8 manchester:2; /**< 2 bits line code received */ |
39 | 46 | } nav_msg_glo_t;
|
40 | 47 |
|
41 | 48 | void nav_msg_init_glo(nav_msg_glo_t *n);
|
42 | 49 | s8 process_string_glo(nav_msg_glo_t *n, ephemeris_t *e);
|
43 |
| -u32 extract_word_glo(const nav_msg_glo_t *n, u16 bit_index, u8 n_bits); //TODO: remove after tests |
| 50 | +u32 extract_word_glo(const nav_msg_glo_t *n, u16 bit_index, u8 n_bits); |
44 | 51 | s8 nav_msg_update_glo(nav_msg_glo_t *n, bool bit_val);
|
45 | 52 |
|
46 | 53 | #endif /* LIBSWIFTNAV_NAV_MSG_GLO_H */
|
0 commit comments