gsmgps 2.0.0.0
gsmgps.h File Reference

This file contains API for GSMGPS Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  gsmgps_t
 Click ctx object definition. More...
 
struct  gsmgps_cfg_t
 Click configuration structure definition. More...
 

Macros

#define GSMGPS_MAP_MIKROBUS(cfg, mikrobus)
 
#define GSMGPS_RETVAL   uint8_t
 
#define GSMGPS_NEMA_GPGGA   1
 
#define GSMGPS_NEMA_GPGLL   3
 
#define GSMGPS_NEMA_GPGGA_NUM_ELEMENT   15
 
#define GSMGPS_NEMA_GPGLL_NUM_ELEMENT   5
 
#define GSMGPS_GPGGA_TIME   1
 
#define GSMGPS_GPGGA_LATITUDE   2
 
#define GSMGPS_GPGGA_LATITUDE_SIDE   3
 
#define GSMGPS_GPGGA_LONGITUDE   4
 
#define GSMGPS_GPGGA_LONGITUDE_SIDE   5
 
#define GSMGPS_GPGGA_QUALITY_INDICATOR   6
 
#define GSMGPS_GPGGA_NUMBER_OF_SATELLITES   7
 
#define GSMGPS_GPGGA_H_DILUTION_OF_POS   8
 
#define GSMGPS_GPGGA_ALTITUDE   9
 
#define GSMGPS_GPGGA_ALTITUDE_UNIT   10
 
#define GSMGPS_GPGGA_GEOIDAL_SEPARATION   11
 
#define GSMGPS_GPGGA_GEOIDAL_SEPARATION_UNIT   12
 
#define GSMGPS_GPGGA_TIME_SINCE_LAST_DGPS   13
 
#define GSMGPS_GPGGA_DGPS_REFERENCE_STATION_ID   14
 
#define GSMGPS_GPGLL_LATITUDE   1
 
#define GSMGPS_GPGLL_LATITUDE_SIDE   2
 
#define GSMGPS_GPGLL_LONGITUDE   3
 
#define GSMGPS_GPGLL_LONGITUDE_SIDE   4
 
#define GSMGPS_ERROR_COMMAND_OR_ELEMENT   0xFF
 
#define GSMGPS_ERROR_START_OR_END_COMMAND   0x8F
 
#define GSMGPS_ERROR_NEXT_ELEMENT   0x4F
 
#define GSMGPS_ERROR_CURRENT_ELEMENT   0x2F
 
#define GSMGPS_NO_ERROR   0x00
 
#define GSMGPS_MODULE_POWER_ON   1
 
#define GSMGPS_MODULE_POWER_OFF   0
 
#define GSMGPS_CMD_AT   "AT"
 
#define GSMGPS_CMD_ATI   "ATI"
 
#define GSMGPS_CMD_CGMR   "AT+CGMR"
 
#define GSMGPS_CMD_CFUN   "AT+CFUN"
 
#define GSMGPS_CMD_CREG   "AT+CREG"
 
#define GSMGPS_CMD_CGDCONT   "AT+CGDCONT"
 
#define GSMGPS_CMD_CIMI   "AT+CIMI"
 
#define GSMGPS_CMD_CGATT   "AT+CGATT"
 
#define GSMGPS_CMD_CSQ   "AT+CSQ"
 
#define GSMGPS_CMD_COPS   "AT+COPS"
 
#define GSMGPS_CMD_CMGS   "AT+CMGS"
 
#define GSMGPS_CMD_CMGF   "AT+CMGF"
 
#define GSMGPS_CMD_CGNSPWR   "AT+CGNSPWR"
 
#define GSMGPS_CMD_CGPSINF   "AT+CGPSINF"
 
#define DRV_RX_BUFFER_SIZE   256
 
#define DRV_TX_BUFFER_SIZE   256
 

Typedefs

typedef uint8_t gsmgps_error_t
 Error type.
 

Enumerations

enum  gsmgps_return_value_t { GSMGPS_OK = 0 , GSMGPS_ERROR = -1 }
 GSM-GPS Click return value data. More...
 

Functions

void gsmgps_cfg_setup (gsmgps_cfg_t *cfg)
 Config Object Initialization function.
 
GSMGPS_RETVAL gsmgps_init (gsmgps_t *ctx, gsmgps_cfg_t *cfg)
 Initialization function.
 
void gsmgps_module_power (gsmgps_t *ctx, uint8_t state)
 Power ON/OFF the module.
 
void gsmgps_generic_write (gsmgps_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t gsmgps_generic_read (gsmgps_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
void gsmgps_set_rts (gsmgps_t *ctx, uint8_t state)
 Sets state of the RTS pin.
 
uint8_t gsmgps_get_cts (gsmgps_t *ctx)
 CTS Pin Get function.
 
void gsmgps_send_cmd (gsmgps_t *ctx, char *cmd)
 Send command function.
 
void gsmgps_send_cmd_with_parameter (gsmgps_t *ctx, char *at_cmd_buf, char *param_buf)
 Send command function with parameter.
 
void gsmgps_send_cmd_check (gsmgps_t *ctx, char *at_cmd_buf)
 Check the sent command.
 
void gsmgps_send_cmd_parameter_check (gsmgps_t *ctx, char *at_cmd_buf)
 Check the command parameters.
 
void gsmgps_set_sim_apn (gsmgps_t *ctx, char *sim_apn)
 Set sim card APN.
 
void gsmgps_send_sms_text (gsmgps_t *ctx, char *phone_number, char *sms_text)
 GSM-GPS send SMS in text mode.
 
err_t gsmgps_send_sms_pdu (gsmgps_t *ctx, char *service_center_number, char *phone_number, char *sms_text)
 GSM-GPS send SMS in PDU mode.
 
gsmgps_error_t gsmgps_generic_parser (char *rsp, uint8_t command, uint8_t element, char *parser_buf)
 Generic parser function.
 

Detailed Description

This file contains API for GSMGPS Click driver.