lbandrtk 2.1.0.0
LBAND RTK Click Driver

API for configuring and manipulating LBAND RTK Click driver. More...

Topics

 LBAND RTK Registers Settings
 Settings for registers of LBAND RTK Click driver.
 
 LBAND RTK MikroBUS Map
 MikroBUS pin mapping of LBAND RTK Click driver.
 

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

API for configuring and manipulating LBAND RTK Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ lbandrtk_cfg_setup()

void lbandrtk_cfg_setup ( lbandrtk_cfg_t * cfg)

LBAND RTK configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See lbandrtk_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ lbandrtk_check_ack()

err_t lbandrtk_check_ack ( lbandrtk_t * ctx,
uint8_t class_id,
uint8_t msg_id )

LBAND RTK check ack function.

This function waits for an acknowledge UBX frame for the specifies message ID to arrive and checks it.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]class_id: Class of message to check the acknowledge for.
[in]msg_id: ID of message to check the acknowledge for.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_drv_interface_selection()

void lbandrtk_drv_interface_selection ( lbandrtk_cfg_t * cfg,
lbandrtk_drv_t drv_sel )

LBAND RTK driver interface setup function.

This function sets a serial driver interface which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See lbandrtk_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See lbandrtk_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be call before init function to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ lbandrtk_generic_read()

err_t lbandrtk_generic_read ( lbandrtk_t * ctx,
uint8_t * data_out,
uint16_t len )

LBAND RTK data reading function.

This function reads a desired number of data bytes from the module.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • >=0 - Number of data bytes read.
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_generic_write()

err_t lbandrtk_generic_write ( lbandrtk_t * ctx,
uint8_t * data_in,
uint16_t len )

LBAND RTK data writing function.

This function writes a desired number of data bytes to the module.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • >=0 - Success, or number of data bytes written in the case of UART,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_get_pmp_cfg()

err_t lbandrtk_get_pmp_cfg ( lbandrtk_t * ctx,
lbandrtk_pmp_cfg_t * pmp_cfg )

LBAND RTK get pmp cfg function.

This function reads the Point to multipoint (PMP) configuration from RAM layer.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[out]pmp_cfg: Point to multipoint (PMP) configuration structure read. See lbandrtk_pmp_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_get_val_16()

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.

This function reads the UBX-CFG 2-bytes value from the selected key ID.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]key_id: Configuration key ID to read.
[in]layer: Memory layer where the value will be read from (Only one layer could be selected).
  • 0x01 - RAM,
  • 0x02 - BBR,
  • 0x04 - FLASH.
[out]value: Output value read.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_get_val_32()

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.

This function reads the UBX-CFG 4-bytes value from the selected key ID.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]key_id: Configuration key ID to read.
[in]layer: Memory layer where the value will be read from (Only one layer could be selected).
  • 0x01 - RAM,
  • 0x02 - BBR,
  • 0x04 - FLASH.
[out]value: Output value read.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_get_val_64()

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.

This function reads the UBX-CFG 8-bytes value from the selected key ID.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]key_id: Configuration key ID to read.
[in]layer: Memory layer where the value will be read from (Only one layer could be selected).
  • 0x01 - RAM,
  • 0x02 - BBR,
  • 0x04 - FLASH.
[out]value_high: 4 higher bytes of value read.
[out]value_low: 4 lower bytes of value read.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_get_val_8()

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.

This function reads the UBX-CFG 1-bit or 1-byte value from the selected key ID.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]key_id: Configuration key ID to read.
[in]layer: Memory layer where the value will be read from (Only one layer could be selected).
  • 0x01 - RAM,
  • 0x02 - BBR,
  • 0x04 - FLASH.
[out]value: Output value read.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_init()

err_t lbandrtk_init ( lbandrtk_t * ctx,
lbandrtk_cfg_t * cfg )

LBAND RTK initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See lbandrtk_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_read_ubx_frame()

err_t lbandrtk_read_ubx_frame ( lbandrtk_t * ctx,
lbandrtk_ubx_frame_t * frame )

LBAND RTK read ubx frame function.

This function waits for an UBX frame message to arrive and reads it.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[out]frame: UBX frame message read. See lbandrtk_ubx_frame_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_reset_device()

void lbandrtk_reset_device ( lbandrtk_t * ctx)

LBAND RTK reset device function.

This function resets the device by toggling the RST pin.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ lbandrtk_set_default_pmp_cfg()

err_t lbandrtk_set_default_pmp_cfg ( lbandrtk_t * ctx)

LBAND RTK set default pmp cfg function.

This function sets the Point to multipoint (PMP) to default configuration to RAM layer.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
Refer to LBANDRTK_PMP_x macros definition if you want to check or change the default configuration.

◆ lbandrtk_set_ein_pin()

void lbandrtk_set_ein_pin ( lbandrtk_t * ctx,
uint8_t state )

LBAND RTK set ein pin function.

This function sets the EXTINT pin logic state.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ lbandrtk_set_pmp_cfg()

err_t lbandrtk_set_pmp_cfg ( lbandrtk_t * ctx,
lbandrtk_pmp_cfg_t pmp_cfg )

LBAND RTK set pmp cfg function.

This function sets the specified Point to multipoint (PMP) configuration to RAM layer.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]pmp_cfg: Point to multipoint (PMP) configuration structure to be set. See lbandrtk_pmp_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_set_rst_pin()

void lbandrtk_set_rst_pin ( lbandrtk_t * ctx,
uint8_t state )

LBAND RTK set rst pin function.

This function sets the RST pin logic state.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ lbandrtk_set_val_16()

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.

This function sets the UBX-CFG 2-bytes value to the selected key ID.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]key_id: Configuration key ID to set.
[in]layer: Bit mask for memory layer where the value will be set.
  • 0x01 - RAM,
  • 0x02 - BBR,
  • 0x04 - FLASH,
  • 0x07 - All layers.
[in]value: Value to be set.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_set_val_32()

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.

This function sets the UBX-CFG 4-bytes value to the selected key ID.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]key_id: Configuration key ID to set.
[in]layer: Bit mask for memory layer where the value will be set.
  • 0x01 - RAM,
  • 0x02 - BBR,
  • 0x04 - FLASH,
  • 0x07 - All layers.
[in]value: Value to be set.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_set_val_64()

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.

This function sets the UBX-CFG 8-bytes value to the selected key ID.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]key_id: Configuration key ID to set.
[in]layer: Bit mask for memory layer where the value will be set.
  • 0x01 - RAM,
  • 0x02 - BBR,
  • 0x04 - FLASH,
  • 0x07 - All layers.
[in]value_high: 4 higher bytes of value to be set.
[in]value_low: 4 lower bytes of value to be set.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_set_val_8()

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.

This function sets the UBX-CFG 1-bit or 1-byte value to the selected key ID.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in]key_id: Configuration key ID to set.
[in]layer: Bit mask for memory layer where the value will be set.
  • 0x01 - RAM,
  • 0x02 - BBR,
  • 0x04 - FLASH,
  • 0x07 - All layers.
[in]value: Value to be set.
Returns
  • 0 - Success,
  • -1 - Error or timeout. See #err_t definition for detailed explanation.
Note
None.

◆ lbandrtk_write_ubx_frame()

err_t lbandrtk_write_ubx_frame ( lbandrtk_t * ctx,
lbandrtk_ubx_frame_t * frame )

LBAND RTK write ubx frame function.

This function sends the provided UBX frame to the module.

Parameters
[in]ctx: Click context object. See lbandrtk_t object definition for detailed explanation.
[in,out]frame: UBX frame to send (No need for the header and checksum bytes to be set). See lbandrtk_ubx_frame_t object definition for detailed explanation.
Returns
  • >=0 - Success, or number of data bytes written in the case of UART,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.