lbandrtk 2.1.0.0
lbandrtk.h File Reference

This file contains API for LBAND RTK Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_spi_master.h"
#include "drv_uart.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

union  lbandrtk_ubx_frame_t
 LBAND RTK Click UBX frame union object. More...
 
struct  lbandrtk_pmp_cfg_t
 LBAND RTK Click CFG-PMP: Point to multipoint (PMP) configuration object. More...
 
struct  lbandrtk_s
 LBAND RTK Click context object. More...
 
struct  lbandrtk_cfg_t
 LBAND RTK Click configuration object. More...
 

Macros

#define LBANDRTK_CLASS_ID_UBX_ACK   0x05
 LBAND RTK UBX class and message IDs.
 
#define LBANDRTK_CLASS_ID_UBX_CFG   0x06
 
#define LBANDRTK_CLASS_ID_UBX_INF   0x04
 
#define LBANDRTK_CLASS_ID_UBX_MON   0x0A
 
#define LBANDRTK_CLASS_ID_UBX_RXM   0x02
 
#define LBANDRTK_MSG_ID_UBX_ACK_ACK   0x01
 
#define LBANDRTK_MSG_ID_UBX_ACK_NAK   0x00
 
#define LBANDRTK_MSG_ID_UBX_CFG_RST   0x04
 
#define LBANDRTK_MSG_ID_UBX_CFG_VALDEL   0x8C
 
#define LBANDRTK_MSG_ID_UBX_CFG_VALGET   0x8B
 
#define LBANDRTK_MSG_ID_UBX_CFG_VALSET   0x8A
 
#define LBANDRTK_MSG_ID_UBX_INF_ERROR   0x00
 
#define LBANDRTK_MSG_ID_UBX_INF_NOTICE   0x02
 
#define LBANDRTK_MSG_ID_UBX_INF_WARNING   0x01
 
#define LBANDRTK_MSG_ID_UBX_MON_HW2   0x0B
 
#define LBANDRTK_MSG_ID_UBX_MON_VER   0x04
 
#define LBANDRTK_MSG_ID_UBX_RXM_PMP   0x72
 
#define LBANDRTK_MSG_ID_UBX_RXM_PMREQ   0x41
 
#define LBANDRTK_VER_CFG_POLL_REQUEST   0x00
 LBAND RTK UBX configuration items setting.
 
#define LBANDRTK_VER_CFG_POLLED   0x01
 
#define LBANDRTK_LAYER_RAM   0x01
 
#define LBANDRTK_LAYER_BBR   0x02
 
#define LBANDRTK_LAYER_FLASH   0x04
 
#define LBANDRTK_LAYER_ALL   0x07
 
#define LBANDRTK_KEY_ID_SIZE_1_BIT   0x10000000ul
 
#define LBANDRTK_KEY_ID_SIZE_1_BYTE   0x20000000ul
 
#define LBANDRTK_KEY_ID_SIZE_2_BYTES   0x30000000ul
 
#define LBANDRTK_KEY_ID_SIZE_4_BYTES   0x40000000ul
 
#define LBANDRTK_KEY_ID_SIZE_8_BYTES   0x50000000ul
 
#define LBANDRTK_KEY_ID_SIZE_MASK   0x70000000ul
 
#define LBANDRTK_KEY_ID_GROUP_MASK   0x00FF0000ul
 
#define LBANDRTK_KEY_ID_ITEM_MASK   0x00000FFFul
 
#define LBANDRTK_CFG_PMP_CENTER_FREQUENCY   0x40B10011ul
 
#define LBANDRTK_CFG_PMP_SEARCH_WINDOW   0x30B10012ul
 
#define LBANDRTK_CFG_PMP_USE_SERVICE_ID   0x10B10016ul
 
#define LBANDRTK_CFG_PMP_SERVICE_ID   0x30B10017ul
 
#define LBANDRTK_CFG_PMP_DATA_RATE   0x30B10013ul
 
#define LBANDRTK_CFG_PMP_USE_DESCRAMBLER   0x10B10014ul
 
#define LBANDRTK_CFG_PMP_DESCRAMBLER_INIT   0x30B10015ul
 
#define LBANDRTK_CFG_PMP_USE_PRESCRAMBLING   0x10B10019ul
 
#define LBANDRTK_CFG_PMP_UNIQUE_WORD   0x50B1001Aul
 
#define LBANDRTK_PREAMBLE_SYNC_CHAR_1   0xB5
 LBAND RTK UBX header bytes.
 
#define LBANDRTK_PREAMBLE_SYNC_CHAR_2   0x62
 
#define LBANDRTK_MAX_PAYLOAD_LEN   528u
 LBAND RTK UBX max payload size.
 
#define LBANDRTK_DUMMY   0xFF
 LBAND RTK dummy data.
 
#define LBANDRTK_TIMEOUT   3000u
 LBAND RTK response timeout and retries values.
 
#define LBANDRTK_NUM_OF_RETRIES   5
 
#define LBANDRTK_PMP_CENTER_FREQ_EU   1545260000ul
 LBAND RTK CFG-PMP: Point to multipoint (PMP) default configuration.
 
#define LBANDRTK_PMP_CENTER_FREQ_US   1556290000ul
 
#define LBANDRTK_PMP_CENTER_FREQ   LBANDRTK_PMP_CENTER_FREQ_EU
 
#define LBANDRTK_PMP_SEARCH_WINDOW   2200u
 
#define LBANDRTK_PMP_USE_SERVICE_ID   0
 
#define LBANDRTK_PMP_SERVICE_ID   21845u
 
#define LBANDRTK_PMP_DATA_RATE   2400u
 
#define LBANDRTK_PMP_USE_DESCRAMBLER   1
 
#define LBANDRTK_PMP_DESCRAMBLER_INIT   26969u
 
#define LBANDRTK_PMP_USE_PRESCRAMBLING   0
 
#define LBANDRTK_PMP_UNIQUE_WORD_HIGH   0xE15AE893ul
 
#define LBANDRTK_PMP_UNIQUE_WORD_LOW   0xE15AE893ul
 
#define LBANDRTK_UBX_RXM_PMP_MAX_USER_DATA   504u
 LBAND RTK UBX-RXM-PMP setting.
 
#define LBANDRTK_UBX_RXM_PMP_EBN0_SCALE   0.125f
 
#define LBANDRTK_SET_DEV_ADDR   0x43
 LBAND RTK device address setting.
 
#define LBANDRTK_DRV_TX_BUFFER_SIZE   ( LBANDRTK_MAX_PAYLOAD_LEN + 8 )
 LBAND RTK driver buffer size.
 
#define LBANDRTK_DRV_RX_BUFFER_SIZE   ( LBANDRTK_MAX_PAYLOAD_LEN + 8 )
 
#define LBANDRTK_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define LBANDRTK_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define LBANDRTK_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Typedefs

typedef err_t(* lbandrtk_master_io_t) (struct lbandrtk_s *, uint8_t *, uint16_t)
 LBAND RTK Click driver interface.
 
typedef struct lbandrtk_s lbandrtk_t
 LBAND RTK Click context object.
 

Enumerations

enum  lbandrtk_drv_t { LBANDRTK_DRV_SEL_UART , LBANDRTK_DRV_SEL_SPI , LBANDRTK_DRV_SEL_I2C }
 LBAND RTK Click driver selector. More...
 
enum  lbandrtk_return_value_t { LBANDRTK_OK = 0 , LBANDRTK_ERROR = -1 }
 LBAND RTK Click return value data. More...
 

Functions

void lbandrtk_cfg_setup (lbandrtk_cfg_t *cfg)
 LBAND RTK configuration object setup function.
 
void lbandrtk_drv_interface_selection (lbandrtk_cfg_t *cfg, lbandrtk_drv_t drv_sel)
 LBAND RTK driver interface setup function.
 
err_t lbandrtk_init (lbandrtk_t *ctx, lbandrtk_cfg_t *cfg)
 LBAND RTK initialization function.
 
err_t lbandrtk_generic_write (lbandrtk_t *ctx, uint8_t *data_in, uint16_t len)
 LBAND RTK data writing function.
 
err_t lbandrtk_generic_read (lbandrtk_t *ctx, uint8_t *data_out, uint16_t len)
 LBAND RTK data reading function.
 
err_t lbandrtk_write_ubx_frame (lbandrtk_t *ctx, lbandrtk_ubx_frame_t *frame)
 LBAND RTK write ubx frame function.
 
err_t lbandrtk_read_ubx_frame (lbandrtk_t *ctx, lbandrtk_ubx_frame_t *frame)
 LBAND RTK read ubx frame function.
 
void lbandrtk_set_rst_pin (lbandrtk_t *ctx, uint8_t state)
 LBAND RTK set rst pin function.
 
void lbandrtk_set_ein_pin (lbandrtk_t *ctx, uint8_t state)
 LBAND RTK set ein pin function.
 
void lbandrtk_reset_device (lbandrtk_t *ctx)
 LBAND RTK reset device function.
 
err_t lbandrtk_check_ack (lbandrtk_t *ctx, uint8_t class_id, uint8_t msg_id)
 LBAND RTK check ack function.
 
err_t lbandrtk_set_val_8 (lbandrtk_t *ctx, uint32_t key_id, uint8_t layer, uint8_t value)
 LBAND RTK set val 8 function.
 
err_t lbandrtk_set_val_16 (lbandrtk_t *ctx, uint32_t key_id, uint8_t layer, uint16_t value)
 LBAND RTK set val 16 function.
 
err_t lbandrtk_set_val_32 (lbandrtk_t *ctx, uint32_t key_id, uint8_t layer, uint32_t value)
 LBAND RTK set val 32 function.
 
err_t lbandrtk_set_val_64 (lbandrtk_t *ctx, uint32_t key_id, uint8_t layer, uint32_t value_high, uint32_t value_low)
 LBAND RTK set val 64 function.
 
err_t lbandrtk_get_val_8 (lbandrtk_t *ctx, uint32_t key_id, uint8_t layer, uint8_t *value)
 LBAND RTK get val 8 function.
 
err_t lbandrtk_get_val_16 (lbandrtk_t *ctx, uint32_t key_id, uint8_t layer, uint16_t *value)
 LBAND RTK get val 16 function.
 
err_t lbandrtk_get_val_32 (lbandrtk_t *ctx, uint32_t key_id, uint8_t layer, uint32_t *value)
 LBAND RTK get val 32 function.
 
err_t lbandrtk_get_val_64 (lbandrtk_t *ctx, uint32_t key_id, uint8_t layer, uint32_t *value_high, uint32_t *value_low)
 LBAND RTK get val 64 function.
 
err_t lbandrtk_set_default_pmp_cfg (lbandrtk_t *ctx)
 LBAND RTK set default pmp cfg function.
 
err_t lbandrtk_set_pmp_cfg (lbandrtk_t *ctx, lbandrtk_pmp_cfg_t pmp_cfg)
 LBAND RTK set pmp cfg function.
 
err_t lbandrtk_get_pmp_cfg (lbandrtk_t *ctx, lbandrtk_pmp_cfg_t *pmp_cfg)
 LBAND RTK get pmp cfg function.
 

Detailed Description

This file contains API for LBAND RTK Click Driver.

Typedef Documentation

◆ lbandrtk_master_io_t

typedef err_t(* lbandrtk_master_io_t) (struct lbandrtk_s *, uint8_t *, uint16_t)

LBAND RTK Click driver interface.

Definition of driver interface of LBAND RTK Click driver. Driver serial interface.

◆ lbandrtk_t

typedef struct lbandrtk_s lbandrtk_t

LBAND RTK Click context object.

Context object definition of LBAND RTK Click driver.

Enumeration Type Documentation

◆ lbandrtk_drv_t

LBAND RTK Click driver selector.

Selects target driver interface of LBAND RTK Click driver.

Enumerator
LBANDRTK_DRV_SEL_UART 

UART driver descriptor.

LBANDRTK_DRV_SEL_SPI 

SPI driver descriptor.

LBANDRTK_DRV_SEL_I2C 

I2C driver descriptor.

◆ lbandrtk_return_value_t

LBAND RTK Click return value data.

Predefined enum values for driver return values.

Enumerator
LBANDRTK_OK 
LBANDRTK_ERROR