lriot 2.1.0.0
lr1110_gnss_types.h
Go to the documentation of this file.
1
35#ifndef LR1110_GNSS_TYPES_H
36#define LR1110_GNSS_TYPES_H
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42/*
43 * -----------------------------------------------------------------------------
44 * --- DEPENDENCIES ------------------------------------------------------------
45 */
46
47#include <stdbool.h>
48#include <stdint.h>
49
50/*
51 * -----------------------------------------------------------------------------
52 * --- PUBLIC MACROS -----------------------------------------------------------
53 */
54
55/*
56 * -----------------------------------------------------------------------------
57 * --- PUBLIC CONSTANTS --------------------------------------------------------
58 */
59
63#define LR1110_GNSS_MAX_SIZE_ARRAY 2820
64
68#define LR1110_GNSS_FULL_UPDATE_N_ALMANACS ( 128 )
69
73#define LR1110_GNSS_SINGLE_ALMANAC_READ_SIZE ( 22 )
74
78#define LR1110_GNSS_SINGLE_ALMANAC_WRITE_SIZE ( 20 )
79
83#define LR1110_GNSS_CONTEXT_STATUS_LENGTH ( 9 )
84
88#define LR1110_GNSS_FULL_ALMANAC_READ_BUFFER_SIZE \
89 ( ( LR1110_GNSS_FULL_UPDATE_N_ALMANACS * LR1110_GNSS_SINGLE_ALMANAC_READ_SIZE ) + 4 )
90
91#define LR1110_GNSS_DMC_ALMANAC_UPDATE_POS ( 1U )
92#define LR1110_GNSS_DMC_ALMANAC_UPDATE_GPS_MASK ( 0x01UL << LR1110_GNSS_DMC_ALMANAC_UPDATE_POS )
93#define LR1110_GNSS_DMC_ALMANAC_UPDATE_BEIDOU_MASK ( 0x02UL << LR1110_GNSS_DMC_ALMANAC_UPDATE_POS )
94
95#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_MSB_POS ( 0U )
96#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_MSB_MASK ( 0x01UL << LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_MSB_POS )
97
98#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_LSB_POS ( 7U )
99#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_LSB_MASK ( 0x01UL << LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_LSB_POS )
100
101/*
102 * -----------------------------------------------------------------------------
103 * --- PUBLIC TYPES ------------------------------------------------------------
104 */
105
110
121
133
142
149
158
168
190
198
207
219
230
239typedef uint32_t lr1110_gnss_date_t;
240
245
250
259
269
278
287
300
301/*
302 * -----------------------------------------------------------------------------
303 * --- PUBLIC FUNCTIONS PROTOTYPES ---------------------------------------------
304 */
305
306#ifdef __cplusplus
307}
308#endif
309
310#endif // LR1110_GNSS_TYPES_H
311
312/* --- EOF ------------------------------------------------------------------ */
lr1110_gnss_search_mode_t
Search mode for GNSS scan.
Definition lr1110_gnss_types.h:154
@ LR1110_GNSS_OPTION_BEST_EFFORT
Add additional search if not all satellites are found.
Definition lr1110_gnss_types.h:156
@ LR1110_GNSS_OPTION_DEFAULT
Search all requested satellites or fail.
Definition lr1110_gnss_types.h:155
lr1110_gnss_message_dmc_opcode_t
Message to DMC operation code.
Definition lr1110_gnss_types.h:195
@ LR1110_GNSS_DMC_STATUS
Status message in payload.
Definition lr1110_gnss_types.h:196
struct lr1110_gnss_context_status_s lr1110_gnss_context_status_t
Structure for GNSS context status.
lr1110_gnss_message_host_status_t
Message to host indicating the status of the message.
Definition lr1110_gnss_types.h:173
@ LR1110_GNSS_HOST_ALMANAC_UPDATE_FAILS_CRC_ERROR
Definition lr1110_gnss_types.h:183
@ LR1110_GNSS_HOST_IQ_CAPTURE_FAILS
Definition lr1110_gnss_types.h:179
@ LR1110_GNSS_HOST_UNIMPLEMENTED_CMD
Definition lr1110_gnss_types.h:176
@ LR1110_GNSS_HOST_UNEXPECTED_CMD
Definition lr1110_gnss_types.h:175
@ LR1110_GNSS_HOST_ALMANAC_VERSION_NOT_SUPPORTED
Definition lr1110_gnss_types.h:187
@ LR1110_GNSS_HOST_ALMANAC_IN_FLASH_TOO_OLD
Definition lr1110_gnss_types.h:182
@ LR1110_GNSS_HOST_ALMANAC_CRC_ERROR
Definition lr1110_gnss_types.h:186
@ LR1110_GNSS_HOST_INVALID_PARAMETERS
Definition lr1110_gnss_types.h:177
@ LR1110_GNSS_HOST_NO_SATELLITE_DETECTED
Definition lr1110_gnss_types.h:181
@ LR1110_GNSS_HOST_OK
Definition lr1110_gnss_types.h:174
@ LR1110_GNSS_HOST_NOT_ENOUGH_SV_DETECTED_TO_BUILD_A_NAV_MESSAGE
Definition lr1110_gnss_types.h:188
@ LR1110_GNSS_HOST_MESSAGE_SANITY_CHECK_ERROR
Definition lr1110_gnss_types.h:178
@ LR1110_GNSS_HOST_NO_TIME
Definition lr1110_gnss_types.h:180
@ LR1110_GNSS_HOST_ALMANAC_UPDATE_NOT_ALLOWED
Definition lr1110_gnss_types.h:185
@ LR1110_GNSS_HOST_ALMANAC_UPDATE_FAILS_FLASH_INTEGRITY_ERROR
Definition lr1110_gnss_types.h:184
lr1110_gnss_destination_t
GNSS response type indicates the destination: Host MCU, GNSS solver or GNSS DMC.
Definition lr1110_gnss_types.h:163
@ LR1110_GNSS_DESTINATION_DMC
GNSS DMC.
Definition lr1110_gnss_types.h:166
@ LR1110_GNSS_DESTINATION_HOST
Host MCU.
Definition lr1110_gnss_types.h:164
@ LR1110_GNSS_DESTINATION_SOLVER
GNSS Solver.
Definition lr1110_gnss_types.h:165
lr1110_gnss_freq_search_space_e
GNSS frequency search space.
Definition lr1110_gnss_types.h:224
@ LR1110_GNSS_FREQUENCY_SEARCH_SPACE_2_KHZ
Definition lr1110_gnss_types.h:228
@ LR1110_GNSS_FREQUENCY_SEARCH_SPACE_500_HZ
Definition lr1110_gnss_types.h:226
@ LR1110_GNSS_FREQUENCY_SEARCH_SPACE_250_HZ
Definition lr1110_gnss_types.h:225
@ LR1110_GNSS_FREQUENCY_SEARCH_SPACE_1_KHZ
Definition lr1110_gnss_types.h:227
lr1110_gnss_result_fields_e
bit mask indicating which information is added in the output payload - to be used with LR1110_GNSS_SC...
Definition lr1110_gnss_types.h:127
@ LR1110_GNSS_RESULTS_DOPPLER_MASK
Definition lr1110_gnss_types.h:129
@ LR1110_GNSS_RESULTS_DOPPLER_ENABLE_MASK
Add Doppler information if set.
Definition lr1110_gnss_types.h:128
@ LR1110_GNSS_RESULTS_BIT_CHANGE_MASK
Add bit change if set.
Definition lr1110_gnss_types.h:131
#define LR1110_GNSS_CONTEXT_STATUS_LENGTH
Size of the almanac of the GNSS context status buffer.
Definition lr1110_gnss_types.h:83
uint8_t lr1110_gnss_satellite_id_t
Satellite ID type.
Definition lr1110_gnss_types.h:109
enum lr1110_gnss_error_code_e lr1110_gnss_error_code_t
GNSS error codes.
struct lr1110_gnss_timings_s lr1110_gnss_timings_t
GNSS timings of the LR1110.
uint32_t lr1110_gnss_date_t
Representation of absolute time for GNSS operations.
Definition lr1110_gnss_types.h:239
uint8_t lr1110_gnss_almanac_full_read_bytestream_t[LR1110_GNSS_FULL_ALMANAC_READ_BUFFER_SIZE]
Buffer that holds data for all almanacs full update - when reading.
Definition lr1110_gnss_types.h:244
lr1110_gnss_error_code_e
GNSS error codes.
Definition lr1110_gnss_types.h:212
@ LR1110_GNSS_ERROR_UPDATE_CRC_MISMATCH
Definition lr1110_gnss_types.h:215
@ LR1110_GNSS_ERROR_ALMANAC_TOO_OLD
Definition lr1110_gnss_types.h:214
@ LR1110_GNSS_NO_ERROR
Definition lr1110_gnss_types.h:213
@ LR1110_GNSS_ERROR_UPDATE_FLASH_MEMORY_INTEGRITY
Definition lr1110_gnss_types.h:216
@ LR1110_GNSS_ERROR_ALMANAC_UPDATE_NOT_ALLOWED
Impossible to update more than one constellation at a time.
Definition lr1110_gnss_types.h:217
lr1110_gnss_constellation_t
Constellation identifiers.
Definition lr1110_gnss_types.h:138
@ LR1110_GNSS_GPS_MASK
Definition lr1110_gnss_types.h:139
@ LR1110_GNSS_BEIDOU_MASK
Definition lr1110_gnss_types.h:140
lr1110_gnss_result_fields_legacy_e
Bit mask indicating which information is added in the output payload - to be used with LR1110_GNSS_SC...
Definition lr1110_gnss_types.h:116
@ LR1110_GNSS_RESULTS_LEGACY_BIT_CHANGE_MASK
Add bit change if set.
Definition lr1110_gnss_types.h:119
@ LR1110_GNSS_RESULTS_LEGACY_DOPPLER_MASK
Add all Doppler information if set - up to 5 if not.
Definition lr1110_gnss_types.h:118
@ LR1110_GNSS_RESULTS_LEGACY_PSEUDO_RANGE_MASK
Add pseudo-range information if set.
Definition lr1110_gnss_types.h:117
uint8_t lr1110_gnss_constellation_mask_t
Bit mask of constellation configurations.
Definition lr1110_gnss_types.h:148
enum lr1110_gnss_freq_search_space_e lr1110_gnss_freq_search_space_t
GNSS frequency search space.
struct lr1110_gnss_version_s lr1110_gnss_version_t
Version structure of the LR1110 GNSS firmware.
#define LR1110_GNSS_FULL_ALMANAC_READ_BUFFER_SIZE
Size of the whole almanac when reading.
Definition lr1110_gnss_types.h:88
struct lr1110_gnss_solver_assistance_position_s lr1110_gnss_solver_assistance_position_t
Assistance position.
uint8_t lr1110_gnss_context_status_bytestream_t[LR1110_GNSS_CONTEXT_STATUS_LENGTH]
Buffer that holds data for context status.
Definition lr1110_gnss_types.h:249
struct lr1110_gnss_detected_satellite_s lr1110_gnss_detected_satellite_t
Detected SV structure.
lr1110_gnss_scan_mode_t
GNSS single or double scan mode.
Definition lr1110_gnss_types.h:203
@ LR1110_GNSS_SCAN_MODE_3_SINGLE_SCAN_AND_5_FAST_SCANS
Generated NAV message format = NAV2.
Definition lr1110_gnss_types.h:205
@ LR1110_GNSS_SCAN_MODE_0_SINGLE_SCAN_LEGACY
Generated NAV message format = NAV1.
Definition lr1110_gnss_types.h:204
Structure for GNSS context status.
Definition lr1110_gnss_types.h:292
uint8_t firmware_version
Definition lr1110_gnss_types.h:293
uint8_t error_code
Definition lr1110_gnss_types.h:295
bool almanac_update_gps
Definition lr1110_gnss_types.h:296
uint32_t global_almanac_crc
Definition lr1110_gnss_types.h:294
bool almanac_update_beidou
Definition lr1110_gnss_types.h:297
uint8_t freq_search_space
Definition lr1110_gnss_types.h:298
Detected SV structure.
Definition lr1110_gnss_types.h:264
int16_t doppler
SV doppler in Hz.
Definition lr1110_gnss_types.h:267
lr1110_gnss_satellite_id_t satellite_id
Definition lr1110_gnss_types.h:265
int8_t cnr
Carrier-to-noise ration (C/N0) in dB-Hz.
Definition lr1110_gnss_types.h:266
Assistance position.
Definition lr1110_gnss_types.h:255
float longitude
Longitude 12 bits (longitude in degree * 2048/180) with resolution 0.088°
Definition lr1110_gnss_types.h:257
float latitude
Latitude 12 bits (latitude in degree * 2048/90) with resolution 0.044°
Definition lr1110_gnss_types.h:256
GNSS timings of the LR1110.
Definition lr1110_gnss_types.h:274
uint32_t computation_ms
Definition lr1110_gnss_types.h:276
uint32_t radio_ms
Definition lr1110_gnss_types.h:275
Version structure of the LR1110 GNSS firmware.
Definition lr1110_gnss_types.h:283
uint8_t gnss_almanac
Version of the almanac format.
Definition lr1110_gnss_types.h:285
uint8_t gnss_firmware
Version of the firmware.
Definition lr1110_gnss_types.h:284