lriot 2.1.0.0
lr1110_gnss_types.h File Reference

GNSS scan driver types for LR1110. More...

#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Data Structures

struct  lr1110_gnss_solver_assistance_position_s
 Assistance position. More...
 
struct  lr1110_gnss_detected_satellite_s
 Detected SV structure. More...
 
struct  lr1110_gnss_timings_s
 GNSS timings of the LR1110. More...
 
struct  lr1110_gnss_version_s
 Version structure of the LR1110 GNSS firmware. More...
 
struct  lr1110_gnss_context_status_s
 Structure for GNSS context status. More...
 

Macros

#define LR1110_GNSS_MAX_SIZE_ARRAY   2820
 Maximal buffer size.
 
#define LR1110_GNSS_FULL_UPDATE_N_ALMANACS   ( 128 )
 Number of almanacs in full update payload.
 
#define LR1110_GNSS_SINGLE_ALMANAC_READ_SIZE   ( 22 )
 Size of the almanac of a single satellite when reading.
 
#define LR1110_GNSS_SINGLE_ALMANAC_WRITE_SIZE   ( 20 )
 Size of the almanac of a single satellite when writing.
 
#define LR1110_GNSS_CONTEXT_STATUS_LENGTH   ( 9 )
 Size of the almanac of the GNSS context status buffer.
 
#define LR1110_GNSS_FULL_ALMANAC_READ_BUFFER_SIZE    ( ( LR1110_GNSS_FULL_UPDATE_N_ALMANACS * LR1110_GNSS_SINGLE_ALMANAC_READ_SIZE ) + 4 )
 Size of the whole almanac when reading.
 
#define LR1110_GNSS_DMC_ALMANAC_UPDATE_POS   ( 1U )
 
#define LR1110_GNSS_DMC_ALMANAC_UPDATE_GPS_MASK   ( 0x01UL << LR1110_GNSS_DMC_ALMANAC_UPDATE_POS )
 
#define LR1110_GNSS_DMC_ALMANAC_UPDATE_BEIDOU_MASK   ( 0x02UL << LR1110_GNSS_DMC_ALMANAC_UPDATE_POS )
 
#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_MSB_POS   ( 0U )
 
#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_MSB_MASK   ( 0x01UL << LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_MSB_POS )
 
#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_LSB_POS   ( 7U )
 
#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_LSB_MASK   ( 0x01UL << LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_LSB_POS )
 

Typedefs

typedef uint8_t lr1110_gnss_satellite_id_t
 Satellite ID type.
 
typedef uint8_t lr1110_gnss_constellation_mask_t
 Bit mask of constellation configurations.
 
typedef enum lr1110_gnss_error_code_e lr1110_gnss_error_code_t
 GNSS error codes.
 
typedef enum lr1110_gnss_freq_search_space_e lr1110_gnss_freq_search_space_t
 GNSS frequency search space.
 
typedef uint32_t lr1110_gnss_date_t
 Representation of absolute time for GNSS operations.
 
typedef 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.
 
typedef uint8_t lr1110_gnss_context_status_bytestream_t[LR1110_GNSS_CONTEXT_STATUS_LENGTH]
 Buffer that holds data for context status.
 
typedef struct lr1110_gnss_solver_assistance_position_s lr1110_gnss_solver_assistance_position_t
 Assistance position.
 
typedef struct lr1110_gnss_detected_satellite_s lr1110_gnss_detected_satellite_t
 Detected SV structure.
 
typedef struct lr1110_gnss_timings_s lr1110_gnss_timings_t
 GNSS timings of the LR1110.
 
typedef struct lr1110_gnss_version_s lr1110_gnss_version_t
 Version structure of the LR1110 GNSS firmware.
 
typedef struct lr1110_gnss_context_status_s lr1110_gnss_context_status_t
 Structure for GNSS context status.
 

Enumerations

enum  lr1110_gnss_result_fields_legacy_e { LR1110_GNSS_RESULTS_LEGACY_PSEUDO_RANGE_MASK = ( 1 << 0 ) , LR1110_GNSS_RESULTS_LEGACY_DOPPLER_MASK = ( 1 << 1 ) , LR1110_GNSS_RESULTS_LEGACY_BIT_CHANGE_MASK = ( 1 << 2 ) }
 Bit mask indicating which information is added in the output payload - to be used with LR1110_GNSS_SCAN_MODE_0_SINGLE_SCAN_LEGACY. More...
 
enum  lr1110_gnss_result_fields_e { LR1110_GNSS_RESULTS_DOPPLER_ENABLE_MASK = ( 1 << 0 ) , LR1110_GNSS_RESULTS_DOPPLER_MASK = ( 1 << 1 ) , LR1110_GNSS_RESULTS_BIT_CHANGE_MASK = ( 1 << 2 ) }
 bit mask indicating which information is added in the output payload - to be used with LR1110_GNSS_SCAN_MODE_3_SINGLE_SCAN_AND_5_FAST_SCANS More...
 
enum  lr1110_gnss_constellation_t { LR1110_GNSS_GPS_MASK = 0x01 , LR1110_GNSS_BEIDOU_MASK = 0x02 }
 Constellation identifiers. More...
 
enum  lr1110_gnss_search_mode_t { LR1110_GNSS_OPTION_DEFAULT = 0x00 , LR1110_GNSS_OPTION_BEST_EFFORT = 0x01 }
 Search mode for GNSS scan. More...
 
enum  lr1110_gnss_destination_t { LR1110_GNSS_DESTINATION_HOST = 0x00 , LR1110_GNSS_DESTINATION_SOLVER = 0x01 , LR1110_GNSS_DESTINATION_DMC = 0x02 }
 GNSS response type indicates the destination: Host MCU, GNSS solver or GNSS DMC. More...
 
enum  lr1110_gnss_message_host_status_t {
  LR1110_GNSS_HOST_OK = 0x00 , LR1110_GNSS_HOST_UNEXPECTED_CMD = 0x01 , LR1110_GNSS_HOST_UNIMPLEMENTED_CMD = 0x02 , LR1110_GNSS_HOST_INVALID_PARAMETERS = 0x03 ,
  LR1110_GNSS_HOST_MESSAGE_SANITY_CHECK_ERROR = 0x04 , LR1110_GNSS_HOST_IQ_CAPTURE_FAILS = 0x05 , LR1110_GNSS_HOST_NO_TIME = 0x06 , LR1110_GNSS_HOST_NO_SATELLITE_DETECTED = 0x07 ,
  LR1110_GNSS_HOST_ALMANAC_IN_FLASH_TOO_OLD = 0x08 , LR1110_GNSS_HOST_ALMANAC_UPDATE_FAILS_CRC_ERROR = 0x09 , LR1110_GNSS_HOST_ALMANAC_UPDATE_FAILS_FLASH_INTEGRITY_ERROR = 0x0A , LR1110_GNSS_HOST_ALMANAC_UPDATE_NOT_ALLOWED = 0x0B ,
  LR1110_GNSS_HOST_ALMANAC_CRC_ERROR = 0x0C , LR1110_GNSS_HOST_ALMANAC_VERSION_NOT_SUPPORTED = 0x0D , LR1110_GNSS_HOST_NOT_ENOUGH_SV_DETECTED_TO_BUILD_A_NAV_MESSAGE = 0x10
}
 Message to host indicating the status of the message. More...
 
enum  lr1110_gnss_message_dmc_opcode_t { LR1110_GNSS_DMC_STATUS = 0x18 }
 Message to DMC operation code. More...
 
enum  lr1110_gnss_scan_mode_t { LR1110_GNSS_SCAN_MODE_0_SINGLE_SCAN_LEGACY = 0x00 , LR1110_GNSS_SCAN_MODE_3_SINGLE_SCAN_AND_5_FAST_SCANS = 0x03 }
 GNSS single or double scan mode. More...
 
enum  lr1110_gnss_error_code_e {
  LR1110_GNSS_NO_ERROR = 0 , LR1110_GNSS_ERROR_ALMANAC_TOO_OLD = 1 , LR1110_GNSS_ERROR_UPDATE_CRC_MISMATCH = 2 , LR1110_GNSS_ERROR_UPDATE_FLASH_MEMORY_INTEGRITY = 3 ,
  LR1110_GNSS_ERROR_ALMANAC_UPDATE_NOT_ALLOWED = 4
}
 GNSS error codes. More...
 
enum  lr1110_gnss_freq_search_space_e { LR1110_GNSS_FREQUENCY_SEARCH_SPACE_250_HZ = 0 , LR1110_GNSS_FREQUENCY_SEARCH_SPACE_500_HZ = 1 , LR1110_GNSS_FREQUENCY_SEARCH_SPACE_1_KHZ = 2 , LR1110_GNSS_FREQUENCY_SEARCH_SPACE_2_KHZ = 3 }
 GNSS frequency search space. More...
 

Detailed Description

GNSS scan driver types for LR1110.

The Clear BSD License Copyright Semtech Corporation 2021. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the Semtech corporation nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SEMTECH CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Macro Definition Documentation

◆ LR1110_GNSS_CONTEXT_STATUS_LENGTH

#define LR1110_GNSS_CONTEXT_STATUS_LENGTH   ( 9 )

Size of the almanac of the GNSS context status buffer.

◆ LR1110_GNSS_DMC_ALMANAC_UPDATE_BEIDOU_MASK

#define LR1110_GNSS_DMC_ALMANAC_UPDATE_BEIDOU_MASK   ( 0x02UL << LR1110_GNSS_DMC_ALMANAC_UPDATE_POS )

◆ LR1110_GNSS_DMC_ALMANAC_UPDATE_GPS_MASK

#define LR1110_GNSS_DMC_ALMANAC_UPDATE_GPS_MASK   ( 0x01UL << LR1110_GNSS_DMC_ALMANAC_UPDATE_POS )

◆ LR1110_GNSS_DMC_ALMANAC_UPDATE_POS

#define LR1110_GNSS_DMC_ALMANAC_UPDATE_POS   ( 1U )

◆ LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_LSB_MASK

#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_LSB_MASK   ( 0x01UL << LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_LSB_POS )

◆ LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_LSB_POS

#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_LSB_POS   ( 7U )

◆ LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_MSB_MASK

#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_MSB_MASK   ( 0x01UL << LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_MSB_POS )

◆ LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_MSB_POS

#define LR1110_GNSS_DMC_FREQUENCY_SEARCH_SPACE_MSB_POS   ( 0U )

◆ LR1110_GNSS_FULL_ALMANAC_READ_BUFFER_SIZE

#define LR1110_GNSS_FULL_ALMANAC_READ_BUFFER_SIZE    ( ( LR1110_GNSS_FULL_UPDATE_N_ALMANACS * LR1110_GNSS_SINGLE_ALMANAC_READ_SIZE ) + 4 )

Size of the whole almanac when reading.

◆ LR1110_GNSS_FULL_UPDATE_N_ALMANACS

#define LR1110_GNSS_FULL_UPDATE_N_ALMANACS   ( 128 )

Number of almanacs in full update payload.

◆ LR1110_GNSS_MAX_SIZE_ARRAY

#define LR1110_GNSS_MAX_SIZE_ARRAY   2820

Maximal buffer size.

(128sv * 22bytes + 4bytes for CRC)

◆ LR1110_GNSS_SINGLE_ALMANAC_READ_SIZE

#define LR1110_GNSS_SINGLE_ALMANAC_READ_SIZE   ( 22 )

Size of the almanac of a single satellite when reading.

◆ LR1110_GNSS_SINGLE_ALMANAC_WRITE_SIZE

#define LR1110_GNSS_SINGLE_ALMANAC_WRITE_SIZE   ( 20 )

Size of the almanac of a single satellite when writing.

Typedef Documentation

◆ lr1110_gnss_almanac_full_read_bytestream_t

typedef 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.

◆ lr1110_gnss_constellation_mask_t

Bit mask of constellation configurations.

See also
lr1110_gnss_constellation_t

◆ lr1110_gnss_context_status_bytestream_t

typedef uint8_t lr1110_gnss_context_status_bytestream_t[LR1110_GNSS_CONTEXT_STATUS_LENGTH]

Buffer that holds data for context status.

◆ lr1110_gnss_context_status_t

Structure for GNSS context status.

◆ lr1110_gnss_date_t

typedef uint32_t lr1110_gnss_date_t

Representation of absolute time for GNSS operations.

The GNSS absolute time is represented as a 32 bits word that is the number of seconds elapsed since January 6th 1980, 00:00:00

The GNSS absolute time must take into account the Leap Seconds between UTC time and GPS time.

◆ lr1110_gnss_detected_satellite_t

◆ lr1110_gnss_error_code_t

GNSS error codes.

◆ lr1110_gnss_freq_search_space_t

GNSS frequency search space.

◆ lr1110_gnss_satellite_id_t

typedef uint8_t lr1110_gnss_satellite_id_t

Satellite ID type.

◆ lr1110_gnss_solver_assistance_position_t

◆ lr1110_gnss_timings_t

GNSS timings of the LR1110.

◆ lr1110_gnss_version_t

Version structure of the LR1110 GNSS firmware.

Enumeration Type Documentation

◆ lr1110_gnss_constellation_t

Constellation identifiers.

Enumerator
LR1110_GNSS_GPS_MASK 
LR1110_GNSS_BEIDOU_MASK 

◆ lr1110_gnss_destination_t

GNSS response type indicates the destination: Host MCU, GNSS solver or GNSS DMC.

Enumerator
LR1110_GNSS_DESTINATION_HOST 

Host MCU.

LR1110_GNSS_DESTINATION_SOLVER 

GNSS Solver.

LR1110_GNSS_DESTINATION_DMC 

GNSS DMC.

◆ lr1110_gnss_error_code_e

GNSS error codes.

Enumerator
LR1110_GNSS_NO_ERROR 
LR1110_GNSS_ERROR_ALMANAC_TOO_OLD 
LR1110_GNSS_ERROR_UPDATE_CRC_MISMATCH 
LR1110_GNSS_ERROR_UPDATE_FLASH_MEMORY_INTEGRITY 
LR1110_GNSS_ERROR_ALMANAC_UPDATE_NOT_ALLOWED 

Impossible to update more than one constellation at a time.

◆ lr1110_gnss_freq_search_space_e

GNSS frequency search space.

Enumerator
LR1110_GNSS_FREQUENCY_SEARCH_SPACE_250_HZ 
LR1110_GNSS_FREQUENCY_SEARCH_SPACE_500_HZ 
LR1110_GNSS_FREQUENCY_SEARCH_SPACE_1_KHZ 
LR1110_GNSS_FREQUENCY_SEARCH_SPACE_2_KHZ 

◆ lr1110_gnss_message_dmc_opcode_t

Message to DMC operation code.

Enumerator
LR1110_GNSS_DMC_STATUS 

Status message in payload.

◆ lr1110_gnss_message_host_status_t

Message to host indicating the status of the message.

Enumerator
LR1110_GNSS_HOST_OK 
LR1110_GNSS_HOST_UNEXPECTED_CMD 
LR1110_GNSS_HOST_UNIMPLEMENTED_CMD 
LR1110_GNSS_HOST_INVALID_PARAMETERS 
LR1110_GNSS_HOST_MESSAGE_SANITY_CHECK_ERROR 
LR1110_GNSS_HOST_IQ_CAPTURE_FAILS 
LR1110_GNSS_HOST_NO_TIME 
LR1110_GNSS_HOST_NO_SATELLITE_DETECTED 
LR1110_GNSS_HOST_ALMANAC_IN_FLASH_TOO_OLD 
LR1110_GNSS_HOST_ALMANAC_UPDATE_FAILS_CRC_ERROR 
LR1110_GNSS_HOST_ALMANAC_UPDATE_FAILS_FLASH_INTEGRITY_ERROR 
LR1110_GNSS_HOST_ALMANAC_UPDATE_NOT_ALLOWED 
LR1110_GNSS_HOST_ALMANAC_CRC_ERROR 
LR1110_GNSS_HOST_ALMANAC_VERSION_NOT_SUPPORTED 
LR1110_GNSS_HOST_NOT_ENOUGH_SV_DETECTED_TO_BUILD_A_NAV_MESSAGE 

◆ lr1110_gnss_result_fields_e

bit mask indicating which information is added in the output payload - to be used with LR1110_GNSS_SCAN_MODE_3_SINGLE_SCAN_AND_5_FAST_SCANS

Enumerator
LR1110_GNSS_RESULTS_DOPPLER_ENABLE_MASK 

Add Doppler information if set.

LR1110_GNSS_RESULTS_DOPPLER_MASK 

Add up to 14 Doppler if set - up to 7 if not. Valid if LR1110_GNSS_RESULTS_DOPPLER_ENABLE_MASK is set

LR1110_GNSS_RESULTS_BIT_CHANGE_MASK 

Add bit change if set.

◆ lr1110_gnss_result_fields_legacy_e

Bit mask indicating which information is added in the output payload - to be used with LR1110_GNSS_SCAN_MODE_0_SINGLE_SCAN_LEGACY.

Enumerator
LR1110_GNSS_RESULTS_LEGACY_PSEUDO_RANGE_MASK 

Add pseudo-range information if set.

LR1110_GNSS_RESULTS_LEGACY_DOPPLER_MASK 

Add all Doppler information if set - up to 5 if not.

LR1110_GNSS_RESULTS_LEGACY_BIT_CHANGE_MASK 

Add bit change if set.

◆ lr1110_gnss_scan_mode_t

GNSS single or double scan mode.

Enumerator
LR1110_GNSS_SCAN_MODE_0_SINGLE_SCAN_LEGACY 

Generated NAV message format = NAV1.

LR1110_GNSS_SCAN_MODE_3_SINGLE_SCAN_AND_5_FAST_SCANS 

Generated NAV message format = NAV2.

◆ lr1110_gnss_search_mode_t

Search mode for GNSS scan.

Enumerator
LR1110_GNSS_OPTION_DEFAULT 

Search all requested satellites or fail.

LR1110_GNSS_OPTION_BEST_EFFORT 

Add additional search if not all satellites are found.