gnssmax 2.0.0.0
main.c File Reference

GNSSMAX Click Example. More...

#include "board.h"
#include "log.h"
#include "gnssmax.h"

Macros

#define PROCESS_BUFFER_SIZE   700
 
#define DATA_BUFFER_SIZE   30
 
#define RSP_GNGGA   "GNGGA"
 
#define RSP_START   '$'
 
#define RSP_SEPARATOR   ','
 
#define RSP_GNGGA_LATITUDE_ELEMENT   2
 
#define RSP_GNGGA_LONGITUDE_ELEMENT   4
 
#define RSP_GNGGA_ALTITUDE_ELEMENT   9
 

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

err_t last_error_flag
 

Detailed Description

GNSSMAX Click Example.

Description

This example showcases device abillity to read data outputed from device and show it's coordinates and altitude when connected.

The demo application is composed of two sections :

Application Init

Initializes host communication modules, additioaln GPIO's used for control of device and resets device.

Application Task

Reads data from device and wait's untill device is connected. While not connected it will log '.'. When conneceted and received data for latitude, longitude, and altitude it will log that data parsed from "GNGGA" command.

Additional Function

  • static void gnssmax_clear_app_buf ( void )
  • static err_t gnssmax_process ( void )
  • static err_t gnssmax_cmd_parser ( char *cmd )
  • static err_t gnssmax_element_parser ( char *cmd, uint8_t element, char *element_data )
Note
For the device to connect it can take it from 1 to 10 minutes. Time to connect is depending on weather.
Author
Luka Filipovic

Macro Definition Documentation

◆ DATA_BUFFER_SIZE

#define DATA_BUFFER_SIZE   30

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   700

◆ RSP_GNGGA

#define RSP_GNGGA   "GNGGA"

◆ RSP_GNGGA_ALTITUDE_ELEMENT

#define RSP_GNGGA_ALTITUDE_ELEMENT   9

◆ RSP_GNGGA_LATITUDE_ELEMENT

#define RSP_GNGGA_LATITUDE_ELEMENT   2

◆ RSP_GNGGA_LONGITUDE_ELEMENT

#define RSP_GNGGA_LONGITUDE_ELEMENT   4

◆ RSP_SEPARATOR

#define RSP_SEPARATOR   ','

◆ RSP_START

#define RSP_START   '$'

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )

Variable Documentation

◆ last_error_flag

err_t last_error_flag