gnssmax2  2.1.0.0
Modules | Functions
GNSS MAX 2 Click Driver

API for configuring and manipulating GNSS MAX 2 Click driver. More...

Modules

 GNSS MAX 2 Device Settings
 Settings for registers of GNSS MAX 2 Click driver.
 
 GNSS MAX 2 MikroBUS Map
 MikroBUS pin mapping of GNSS MAX 2 Click driver.
 

Functions

void gnssmax2_cfg_setup (gnssmax2_cfg_t *cfg)
 GNSS MAX 2 configuration object setup function. More...
 
void gnssmax2_drv_interface_sel (gnssmax2_cfg_t *cfg, gnssmax2_drv_t drv_sel)
 GNSS MAX 2 driver interface setup function. More...
 
err_t gnssmax2_init (gnssmax2_t *ctx, gnssmax2_cfg_t *cfg)
 GNSS MAX 2 initialization function. More...
 
err_t gnssmax2_generic_write (gnssmax2_t *ctx, uint8_t *data_in, uint16_t len)
 GNSS MAX 2 data writing function. More...
 
err_t gnssmax2_generic_read (gnssmax2_t *ctx, uint8_t *data_out, uint16_t len)
 GNSS MAX 2 data reading function. More...
 
uint8_t gnssmax2_get_pps_pin (gnssmax2_t *ctx)
 GNSS MAX 2 get PPS pin function. More...
 
void gnssmax2_set_exi_pin (gnssmax2_t *ctx, uint8_t state)
 GNSS MAX 2 set EXI pin function. More...
 
void gnssmax2_set_rst_pin (gnssmax2_t *ctx, uint8_t state)
 GNSS MAX 2 set RST pin function. More...
 
void gnssmax2_reset_device (gnssmax2_t *ctx)
 GNSS MAX 2 reset device function. More...
 
err_t gnssmax2_parse_gga (uint8_t *rsp_buf, uint8_t gga_element, uint8_t *element_data)
 GNSS MAX 2 parse GGA function. More...
 

Detailed Description

API for configuring and manipulating GNSS MAX 2 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

◆ gnssmax2_cfg_setup()

void gnssmax2_cfg_setup ( gnssmax2_cfg_t cfg)

GNSS MAX 2 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ gnssmax2_drv_interface_sel()

void gnssmax2_drv_interface_sel ( gnssmax2_cfg_t cfg,
gnssmax2_drv_t  drv_sel 
)

GNSS MAX 2 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 gnssmax2_cfg_t object definition for detailed explanation.
[in]drv_sel: Driver interface selection. See gnssmax2_drv_t object definition for detailed explanation.
Returns
Nothing.
Note
This driver selection should be called 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.

◆ gnssmax2_generic_read()

err_t gnssmax2_generic_read ( gnssmax2_t ctx,
uint8_t *  data_out,
uint16_t  len 
)

GNSS MAX 2 data reading function.

This function reads a desired number of data bytes by using UART or I2C serial interface.

Parameters
[in]ctx: Click context object. See gnssmax2_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,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ gnssmax2_generic_write()

err_t gnssmax2_generic_write ( gnssmax2_t ctx,
uint8_t *  data_in,
uint16_t  len 
)

GNSS MAX 2 data writing function.

This function writes a desired number of data bytes by using UART or I2C serial interface.

Parameters
[in]ctx: Click context object. See gnssmax2_t object definition for detailed explanation.
[in]data_in: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gnssmax2_get_pps_pin()

uint8_t gnssmax2_get_pps_pin ( gnssmax2_t ctx)

GNSS MAX 2 get PPS pin function.

This function returns the pulse per second (PPS) pin logic state.

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

◆ gnssmax2_init()

err_t gnssmax2_init ( gnssmax2_t ctx,
gnssmax2_cfg_t cfg 
)

GNSS MAX 2 initialization function.

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

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

◆ gnssmax2_parse_gga()

err_t gnssmax2_parse_gga ( uint8_t *  rsp_buf,
uint8_t  gga_element,
uint8_t *  element_data 
)

GNSS MAX 2 parse GGA function.

This function parses the GGA data from the read response buffer.

Parameters
[in]rsp_buf: Response buffer.
[in]gga_element: GGA element position [1-14].
[out]element_data: Element data parsed.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ gnssmax2_reset_device()

void gnssmax2_reset_device ( gnssmax2_t ctx)

GNSS MAX 2 reset device function.

This function resets the device by toggling the RST pin.

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

◆ gnssmax2_set_exi_pin()

void gnssmax2_set_exi_pin ( gnssmax2_t ctx,
uint8_t  state 
)

GNSS MAX 2 set EXI pin function.

This function sets the EXI pin logic state.

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

◆ gnssmax2_set_rst_pin()

void gnssmax2_set_rst_pin ( gnssmax2_t ctx,
uint8_t  state 
)

GNSS MAX 2 set RST pin function.

This function sets the RST pin logic state.

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