xbee2 2.1.0.0
xbee2.h File Reference

This file contains API for XBEE 2 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  xbee2_t
 XBEE 2 Click context object. More...
 
struct  xbee2_cfg_t
 XBEE 2 Click configuration object. More...
 

Macros

#define XBEE2_ENTER_CMD_MODE   "+++"
 XBEE 2 list of AT commands.
 
#define XBEE2_EXIT_CMD_MODE   "CN"
 
#define XBEE2_FACTORY_RESET   "RE"
 
#define XBEE2_SET_NODE_IDENTIFIER   "NI"
 
#define XBEE2_GET_SERIAL_NUMBER   "SH,SL"
 
#define XBEE2_SET_DEST_ADDR_HIGH   "DH"
 
#define XBEE2_SET_DEST_ADDR_LOW   "DL"
 
#define XBEE2_APPLY_CHANGES   "AC"
 
#define XBEE2_API_MODE   "AP"
 
#define XBEE2_DEV_ROLE   "CE"
 
#define XBEE2_SAVE_CHANGES   "WR"
 
#define XBEE2_CMD_AT   "AT"
 
#define XBEE2_DELIMITER   ","
 
#define XBEE2_CARRIAGE_RETURN   "\r"
 
#define XBEE2_MODE_TRANSPARENT   0
 XBEE 2 mode settings.
 
#define XBEE2_MODE_API_WITHOUT_ESC   1
 
#define XBEE2_MODE_API_WITH_ESC   2
 
#define XBEE2_DEVICE_ROLE_JOIN_NETWORK   0
 XBEE 2 device role settings.
 
#define XBEE2_DEVICE_ROLE_FORM_NETWORK   1
 
#define XBEE2_BROADCAST_DEST_ADDRESS_HIGH   "00000000"
 XBEE 2 destination address settings.
 
#define XBEE2_BROADCAST_DEST_ADDRESS_LOW   "0000FFFF"
 
#define XBEE2_RSP_OK   "OK"
 XBEE 2 device response for AT commands.
 
#define XBEE2_RSP_ERROR   "ERROR"
 
#define DRV_BUFFER_SIZE   200
 XBEE 2 driver buffer size.
 
#define XBEE2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  xbee2_return_value_t { XBEE2_OK = 0 , XBEE2_ERROR = -1 }
 XBEE 2 Click return value data. More...
 

Functions

void xbee2_cfg_setup (xbee2_cfg_t *cfg)
 XBEE 2 configuration object setup function.
 
err_t xbee2_init (xbee2_t *ctx, xbee2_cfg_t *cfg)
 XBEE 2 initialization function.
 
err_t xbee2_generic_write (xbee2_t *ctx, char *data_in, uint16_t len)
 XBEE 2 data writing function.
 
err_t xbee2_generic_read (xbee2_t *ctx, char *data_out, uint16_t len)
 XBEE 2 data reading function.
 
void xbee2_set_rts_pin (xbee2_t *ctx, uint8_t state)
 XBEE 2 set rts pin function.
 
void xbee2_set_rst_pin (xbee2_t *ctx, uint8_t state)
 XBEE 2 set rst pin function.
 
void xbee2_set_cs_pin (xbee2_t *ctx, uint8_t state)
 XBEE 2 set cs pin function.
 
uint8_t xbee2_get_cts_pin (xbee2_t *ctx)
 XBEE 2 get cts pin function.
 
uint8_t xbee2_get_att_dtr_pin (xbee2_t *ctx)
 XBEE 2 get att_dtr pin function.
 
err_t xbee2_write_command (xbee2_t *ctx, char *data_buf)
 XBEE 2 write command function.
 
void xbee2_hw_reset (xbee2_t *ctx)
 XBEE 2 hw reset function.
 
err_t xbee2_enter_command_mode (xbee2_t *ctx)
 XBEE 2 enter command mode function.
 
err_t xbee2_exit_command_mode (xbee2_t *ctx)
 XBEE 2 exit command mode function.
 
err_t xbee2_factory_reset (xbee2_t *ctx)
 XBEE 2 factory reset function.
 
err_t xbee2_get_serial_number (xbee2_t *ctx)
 XBEE 2 get serial number function.
 
err_t xbee2_set_device_name (xbee2_t *ctx, char *dev_name)
 XBEE 2 set device name function.
 
err_t xbee2_set_destination_address (xbee2_t *ctx, char *dest_addr_high, char *dest_addr_low)
 XBEE 2 set destination address function.
 
err_t xbee2_set_api_mode (xbee2_t *ctx, uint8_t api_mode)
 XBEE 2 set api mode function.
 
err_t xbee2_set_device_role (xbee2_t *ctx, uint8_t dev_role)
 XBEE 2 set device role function.
 
err_t xbee2_apply_changes (xbee2_t *ctx)
 XBEE 2 apply changes function.
 
err_t xbee2_save_changes (xbee2_t *ctx)
 XBEE 2 save changes function.
 

Detailed Description

This file contains API for XBEE 2 Click Driver.

Enumeration Type Documentation

◆ xbee2_return_value_t

XBEE 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
XBEE2_OK 
XBEE2_ERROR