lriot 2.1.0.0
|
GNSS scan driver definition for LR1110 modem. More...
#include <stdbool.h>
#include <stdint.h>
#include "modem/lr1110_modem_gnss_types.h"
#include "modem/lr1110_modem_common.h"
#include "lriot.h"
Go to the source code of this file.
Functions | |
err_t | lr1110_modem_gnss_set_constellations_to_use (lriot_t *ctx, lr1110_modem_gnss_constellation_mask_t constellation_to_use) |
Activate the GNSS scan constellation. | |
err_t | lr1110_modem_gnss_read_used_constellations (lriot_t *ctx, lr1110_modem_gnss_constellation_mask_t *constellations_used) |
Read constellation used by the GNSS scanner from the almanac update configuration. | |
err_t | lr1110_modem_gnss_set_almanac_update (lriot_t *ctx, lr1110_modem_gnss_constellation_mask_t constellations_to_update) |
Activate the almanac update. | |
err_t | lr1110_modem_gnss_read_almanac_update (lriot_t *ctx, lr1110_modem_gnss_constellation_mask_t *constellations_to_update) |
Function to read the almanac update configuration. | |
err_t | lr1110_modem_gnss_set_frequency_search (lriot_t *ctx, lr1110_modem_gnss_frequency_search_space_mask_t frequency_search_space) |
Set the GNSS frequency search. | |
err_t | lr1110_modem_gnss_read_frequency_search (lriot_t *ctx, lr1110_modem_gnss_frequency_search_space_mask_t *frequency_search_space) |
Read constellation used by the GNSS scanner from the almanac update configuration. | |
err_t | lr1110_modem_gnss_read_firmware_version (lriot_t *ctx, lr1110_modem_gnss_version_t *version) |
Function to read the GNSS firmware version. | |
err_t | lr1110_modem_gnss_read_supported_constellations (lriot_t *ctx, lr1110_modem_gnss_constellation_mask_t *supported_constellations) |
Function to read the supported constellation, GPS or BEIDOU other constellations. | |
err_t | lr1110_modem_gnss_almanac_full_update (lriot_t *ctx, lr1110_modem_gnss_almanac_full_update_bytestream_t almanac_bytestream) |
Update full almanac for all satellites. | |
err_t | lr1110_modem_gnss_one_chunk_almanac_update (lriot_t *ctx, lr1110_modem_gnss_almanac_one_chunk_bytestream_t almanac_one_chunk_bytestream) |
One chunk almanac update. | |
err_t | lr1110_modem_gnss_set_assistance_position (lriot_t *ctx, lr1110_modem_gnss_solver_assistance_position_t *assistance_position) |
Function to set the assistance position. | |
err_t | lr1110_modem_gnss_read_assistance_position (lriot_t *ctx, lr1110_modem_gnss_solver_assistance_position_t *assistance_position) |
Function to read the assistance position. | |
err_t | lr1110_modem_gnss_set_xtal_error (lriot_t *ctx, float xtal_error_in_ppm) |
Function to set the Xtal error. | |
err_t | lr1110_modem_gnss_read_xtal_error (lriot_t *ctx, float *xtal_error_in_ppm) |
Function to read the Xtal error. | |
err_t | lr1110_modem_gnss_get_context (lriot_t *ctx, lr1110_modem_gnss_context_t *gnss_context) |
Function to read context status. | |
err_t | lr1110_modem_gnss_get_nb_detected_satellites (lriot_t *ctx, uint8_t *nb_detected_satellites) |
Get the number of detected satellites during last scan. | |
err_t | lr1110_modem_gnss_get_detected_satellites (lriot_t *ctx, uint8_t nb_detected_satellites, lr1110_modem_gnss_detected_satellite_t *detected_satellite_id_snr) |
Get the satellites detected on last scan with their IDs and C/N (aka. CNR) | |
err_t | lr1110_modem_gnss_get_timings (lriot_t *ctx, lr1110_modem_gnss_timings_t *timings) |
Get the timings spent in signal acquisition and signal analyzis. | |
err_t | lr1110_modem_gnss_almanac_read_by_index (lriot_t *ctx, uint8_t sv_id, uint8_t nb_sv, uint8_t *almanac_read, uint8_t buffer_len) |
Read at maximum 11 sv’s Almanac, starting from sv id. | |
err_t | lr1110_modem_gnss_scan_autonomous (lriot_t *ctx, lr1110_modem_gnss_search_mode_t effort_mode, uint8_t gnss_result_mask, uint8_t nb_sat) |
GNSS scan with no assisted parameters needed. | |
err_t | lr1110_modem_gnss_scan_assisted (lriot_t *ctx, lr1110_modem_gnss_search_mode_t effort_mode, uint8_t gnss_result_mask, uint8_t nb_sat) |
GNSS scan with assisted parameters. | |
err_t | lr1110_modem_gnss_push_solver_msg (lriot_t *ctx, uint8_t *payload, uint16_t payload_size) |
Push data received from solver to LR1110 modem. | |
GNSS scan driver definition for LR1110 modem.
Revised BSD License Copyright Semtech Corporation 2020. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
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.
err_t lr1110_modem_gnss_almanac_full_update | ( | lriot_t * | ctx, |
lr1110_modem_gnss_almanac_full_update_bytestream_t | almanac_bytestream ) |
Update full almanac for all satellites.
This function is to be used to update satellites almanac. Note that all 128 satellite almanacs must be update in a row. Therefore, this function must be called 128 times in a row without any other calls in between.
[in] | ctx | Chip implementation context |
[in] | almanac_bytestream | Almanac buffer to update all almanac of the LR1110. It is up to the application to ensure that the buffer almanac_bytestream is indeed of size LR1110_MODEM_GNSS_FULL_ALMANAC_WRITE_BUFFER_SIZE |
err_t lr1110_modem_gnss_almanac_read_by_index | ( | lriot_t * | ctx, |
uint8_t | sv_id, | ||
uint8_t | nb_sv, | ||
uint8_t * | almanac_read, | ||
uint8_t | buffer_len ) |
Read at maximum 11 sv’s Almanac, starting from sv id.
[in] | ctx | Chip implementation context |
[in] | sv_id | Satellite ID |
[in] | nb_sv | Number of satellites |
[out] | almanac_read | The almanac buffer |
[in] | buffer_len | Buffer len of the almanac_read buffer. |
err_t lr1110_modem_gnss_get_context | ( | lriot_t * | ctx, |
lr1110_modem_gnss_context_t * | gnss_context ) |
Function to read context status.
[in] | ctx | Chip implementation context |
[out] | gnss_context | lr1110_modem_gnss_context_t |
err_t lr1110_modem_gnss_get_detected_satellites | ( | lriot_t * | ctx, |
uint8_t | nb_detected_satellites, | ||
lr1110_modem_gnss_detected_satellite_t * | detected_satellite_id_snr ) |
Get the satellites detected on last scan with their IDs and C/N (aka. CNR)
[in] | ctx | Chip implementation context |
[in] | nb_detected_satellites | Number of detected satellites on last scan (obtained by calling lr1110_gnss_get_nb_detected_satellites) |
[out] | detected_satellite_id_snr | Pointer to an array of structures of size big enough to contain nb_detected_satellites elements |
err_t lr1110_modem_gnss_get_nb_detected_satellites | ( | lriot_t * | ctx, |
uint8_t * | nb_detected_satellites ) |
Get the number of detected satellites during last scan.
[in] | ctx | Chip implementation context |
[out] | nb_detected_satellites | Number of satellites detected |
err_t lr1110_modem_gnss_get_timings | ( | lriot_t * | ctx, |
lr1110_modem_gnss_timings_t * | timings ) |
Get the timings spent in signal acquisition and signal analyzis.
These timings allow to compute the current timings of the last GNSS scan.
[in] | ctx | Chip implementation context |
[out] | timings | GNSS timings of last GNSS scan |
err_t lr1110_modem_gnss_one_chunk_almanac_update | ( | lriot_t * | ctx, |
lr1110_modem_gnss_almanac_one_chunk_bytestream_t | almanac_one_chunk_bytestream ) |
One chunk almanac update.
This function is to be used to update a single chunk almanac. Note that all 129 chunks almanacs must be updated in a row. Therefore, this function must be called 129 times in a row without any other calls in between.
On the contrary, lr1110_gnss_almanac_full_update can be used to update all almanacs in one call, but the application must be able to provide a buffer that holds all almanac (>2kB).
[in] | ctx | Chip implementation context |
[in] | almanac_one_chunk_bytestream | Almanac buffer to update one chunk almanac of the LR1110. It is up to the application to ensure that bytestream is at least LR1110_MODEM_GNSS_SINGLE_ALMANAC_WRITE_SIZE long. |
err_t lr1110_modem_gnss_push_solver_msg | ( | lriot_t * | ctx, |
uint8_t * | payload, | ||
uint16_t | payload_size ) |
Push data received from solver to LR1110 modem.
[in] | ctx | Chip implementation context |
[in] | payload | Payload received from solver |
[in] | payload_size | Size of the payload received from solver (in bytes) |
err_t lr1110_modem_gnss_read_almanac_update | ( | lriot_t * | ctx, |
lr1110_modem_gnss_constellation_mask_t * | constellations_to_update ) |
Function to read the almanac update configuration.
[in] | ctx | Chip implementation context |
[out] | constellations_to_update | Bit mask of the constellations to mark to update. See lr1110_modem_gnss_constellation_t for the possible values |
err_t lr1110_modem_gnss_read_assistance_position | ( | lriot_t * | ctx, |
lr1110_modem_gnss_solver_assistance_position_t * | assistance_position ) |
Function to read the assistance position.
The assistance position read may be different from the one set beforehand with lr1110_modem_gnss_set_assistance_position due to a scaling computation.
[in] | ctx | Chip implementation context |
[out] | assistance_position | latitude 12 bits and longitude 12 bits lr1110_modem_gnss_solver_assistance_position_t |
err_t lr1110_modem_gnss_read_firmware_version | ( | lriot_t * | ctx, |
lr1110_modem_gnss_version_t * | version ) |
Function to read the GNSS firmware version.
[in] | ctx | Chip implementation context |
[out] | version | GNSS Firmware version currently running on the chip |
err_t lr1110_modem_gnss_read_frequency_search | ( | lriot_t * | ctx, |
lr1110_modem_gnss_frequency_search_space_mask_t * | frequency_search_space ) |
Read constellation used by the GNSS scanner from the almanac update configuration.
[in] | ctx | Chip implementation context |
[out] | frequency_search_space | Bit mask of the frequency search space used. See lr1110_modem_gnss_frequency_search_space_mask_t for the possible values |
err_t lr1110_modem_gnss_read_supported_constellations | ( | lriot_t * | ctx, |
lr1110_modem_gnss_constellation_mask_t * | supported_constellations ) |
Function to read the supported constellation, GPS or BEIDOU other constellations.
[in] | ctx | Chip implementation context |
[out] | supported_constellations | Bit mask of the constellations used. See lr1110_modem_gnss_constellation_mask_t for the possible values |
err_t lr1110_modem_gnss_read_used_constellations | ( | lriot_t * | ctx, |
lr1110_modem_gnss_constellation_mask_t * | constellations_used ) |
Read constellation used by the GNSS scanner from the almanac update configuration.
[in] | ctx | Chip implementation context |
[out] | constellations_used | Bit mask of the constellations used. See lr1110_modem_gnss_constellation_mask_t for the possible values |
err_t lr1110_modem_gnss_read_xtal_error | ( | lriot_t * | ctx, |
float * | xtal_error_in_ppm ) |
Function to read the Xtal error.
[in] | ctx | Chip implementation context |
[out] | xtal_error_in_ppm | value returned between +/-30ppm |
err_t lr1110_modem_gnss_scan_assisted | ( | lriot_t * | ctx, |
lr1110_modem_gnss_search_mode_t | effort_mode, | ||
uint8_t | gnss_result_mask, | ||
uint8_t | nb_sat ) |
GNSS scan with assisted parameters.
[in] | ctx | Chip implementation context |
[in] | effort_mode | Effort mode lr1110_modem_gnss_search_mode_t |
[in] | gnss_result_mask | Bit mask indicating which information is added in the output payload lr1110_modem_gnss_result_mask_e |
[in] | nb_sat | The expected number of satellite to provide. This value must be in the range [0:128] |
err_t lr1110_modem_gnss_scan_autonomous | ( | lriot_t * | ctx, |
lr1110_modem_gnss_search_mode_t | effort_mode, | ||
uint8_t | gnss_result_mask, | ||
uint8_t | nb_sat ) |
GNSS scan with no assisted parameters needed.
[in] | ctx | Chip implementation context |
[in] | effort_mode | Effort mode lr1110_modem_gnss_search_mode_t |
[in] | gnss_result_mask | Bit mask indicating which information is added in the output payload lr1110_modem_gnss_result_mask_e |
[in] | nb_sat | The expected number of satellite to provide. This value must be in the range [0:128] |
err_t lr1110_modem_gnss_set_almanac_update | ( | lriot_t * | ctx, |
lr1110_modem_gnss_constellation_mask_t | constellations_to_update ) |
Activate the almanac update.
[in] | ctx | Chip implementation context |
[in] | constellations_to_update | Bit mask of the constellations to mark to update. See lr1110_modem_gnss_constellation_t for the possible values |
err_t lr1110_modem_gnss_set_assistance_position | ( | lriot_t * | ctx, |
lr1110_modem_gnss_solver_assistance_position_t * | assistance_position ) |
Function to set the assistance position.
[in] | ctx | Chip implementation context |
[in] | assistance_position | latitude 12 bits and longitude 12 bits lr1110_modem_gnss_solver_assistance_position_t |
err_t lr1110_modem_gnss_set_constellations_to_use | ( | lriot_t * | ctx, |
lr1110_modem_gnss_constellation_mask_t | constellation_to_use ) |
Activate the GNSS scan constellation.
[in] | ctx | Chip implementation context |
[in] | constellation_mask | Bit mask of the constellations to use. See lr1110_modem_gnss_constellation_mask_t for the possible values |
err_t lr1110_modem_gnss_set_frequency_search | ( | lriot_t * | ctx, |
lr1110_modem_gnss_frequency_search_space_mask_t | frequency_search_space ) |
Set the GNSS frequency search.
[in] | ctx | Chip implementation context |
[in] | frequency_search_space | Bit mask of the frequency search space to use. See lr1110_modem_gnss_frequency_search_space_mask_t for the possible values |
err_t lr1110_modem_gnss_set_xtal_error | ( | lriot_t * | ctx, |
float | xtal_error_in_ppm ) |
Function to set the Xtal error.
[in] | ctx | Chip implementation context |
[in] | xtal_error_in_ppm | value in +/-40ppm |