g2c  2.0.0.0
Data Structures | Macros | Typedefs | Functions
g2c.h File Reference

This file contains API for G2C 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  g2c_t
 Click ctx object definition. More...
 
struct  g2c_cfg_t
 Click configuration structure definition. More...
 

Macros

#define G2C_MAP_MIKROBUS(cfg, mikrobus)
 
#define G2C_RETVAL   uint8_t
 
#define G2C_OK   0x00
 
#define G2C_INIT_ERROR   0xFF
 
#define G2C_PARSER_NO_ERROR   0x00
 
#define G2C_PARSER_ERROR_REF   0x01
 
#define G2C_PARSER_ERROR_CMD   0x02
 
#define G2C_PARSER_ERROR_DATA   0x04
 
#define G2C_STATUS_DEVICE_READY   1
 
#define G2C_STATUS_ACT_NETWORK_AND_BROKER   4
 
#define G2C_STATUS_ACT_NETWORK   2
 
#define G2C_STATUS_ACT_BROKER   3
 
#define G2C_STATUS_DEVICE_BUSY   0
 
#define G2C_MODULE_POWER_ON   1
 
#define G2C_MODULE_POWER_OFF   0
 
#define DRV_RX_BUFFER_SIZE   500
 

Typedefs

typedef uint8_t g2c_actuator_sw_t
 Error type. More...
 
typedef int16_t g2c_actuator_cnt_t
 
typedef char g2c_actuator_str_t
 
typedef uint8_t g2c_error_t
 

Functions

void g2c_cfg_setup (g2c_cfg_t *cfg)
 Config Object Initialization function. More...
 
G2C_RETVAL g2c_init (g2c_t *ctx, g2c_cfg_t *cfg)
 Initialization function. More...
 
void g2c_module_power (g2c_t *ctx, uint8_t power_state, uint8_t bootloader)
 Power module. More...
 
void g2c_reset (g2c_t *ctx)
 Reset module. More...
 
void g2c_generic_write (g2c_t *ctx, char *data_buf, uint16_t len)
 Generic write function. More...
 
int32_t g2c_generic_read (g2c_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function. More...
 
void g2c_send_command (g2c_t *ctx, char *command)
 Function for send command. More...
 
void g2c_send_operator_cfg (g2c_t *ctx, char *op_username, char *op_password)
 Operater ( Network ) configuration. More...
 
void g2c_send_broker_cfg (g2c_t *ctx, char *brc_key, char *brc_password)
 Broker configuration. More...
 
void g2c_send_data_ref (g2c_t *ctx, char *reference_buf, char *data_buf)
 Send data reference. More...
 
g2c_error_t g2c_actuator_sw_parser (char *rsp, char *act_ref, g2c_actuator_sw_t *sw_state)
 Switch parser function. More...
 
g2c_error_t g2c_actuator_cnt_parser (char *rsp, char *act_ref, g2c_actuator_cnt_t *num_data)
 Counter parser function. More...
 
g2c_error_t g2c_actuator_str_parser (char *rsp, char *act_ref, g2c_actuator_str_t *str_data)
 String parser function. More...
 

Detailed Description

This file contains API for G2C Click driver.