zigbee  2.0.0.0
Modules | Functions
ZigBee Click Driver

API for configuring and manipulating ZigBee Click driver. More...

Modules

 ZigBee Device Settings
 Settings for registers of ZigBee Click driver.
 
 ZigBee MikroBUS Map
 MikroBUS pin mapping of ZigBee Click driver.
 

Functions

void zigbee_cfg_setup (zigbee_cfg_t *cfg)
 ZigBee configuration object setup function. More...
 
err_t zigbee_init (zigbee_t *ctx, zigbee_cfg_t *cfg)
 ZigBee initialization function. More...
 
err_t zigbee_generic_write (zigbee_t *ctx, char *data_buf, uint16_t len)
 ZigBee data writing function. More...
 
err_t zigbee_generic_read (zigbee_t *ctx, char *data_buf, uint16_t max_len)
 ZigBee data reading function. More...
 
void zigbee_send_at (zigbee_t *ctx, uint8_t *at_buf, uint8_t *suffix_buf)
 Function merges two string and sends it to device. More...
 
void zigbee_send_cmd (zigbee_t *ctx, uint8_t *cmd_buf)
 Function sends string to device. More...
 
uint8_t zigbee_resp (zigbee_t *ctx, char *data_in)
 Function checking driver buffer string. More...
 
char * zigbee_error_handler (zigbee_t *ctx, uint8_t error_code)
 Function for converting error code to error message. More...
 
void zigbee_set_pin_rst (zigbee_t *ctx, uint8_t status)
 Function setting RST pin status. More...
 
void zigbee_set_pin_fw (zigbee_t *ctx, uint8_t status)
 Function setting FW pin status. More...
 
uint8_t zigbee_get_pin_int (zigbee_t *ctx)
 Function getting INT pin status. More...
 
void zigbee_restart (zigbee_t *ctx)
 Function for reseting device. More...
 

Detailed Description

API for configuring and manipulating ZigBee Click driver.

Function Documentation

◆ zigbee_cfg_setup()

void zigbee_cfg_setup ( zigbee_cfg_t cfg)

ZigBee configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ zigbee_error_handler()

char* zigbee_error_handler ( zigbee_t ctx,
uint8_t  error_code 
)

Function for converting error code to error message.

This function is used for converting error code to error message.

Parameters
[in]ctx: Click context object. See zigbee_t object definition for detailed explanation.
[in]error_code: Error hex code.
Returns
Returns string for certain error_code

◆ zigbee_generic_read()

err_t zigbee_generic_read ( zigbee_t ctx,
char *  data_buf,
uint16_t  max_len 
)

ZigBee data reading function.

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

Parameters
[in]ctx: Click context object. See zigbee_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]max_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.

◆ zigbee_generic_write()

err_t zigbee_generic_write ( zigbee_t ctx,
char *  data_buf,
uint16_t  len 
)

ZigBee data writing function.

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

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

◆ zigbee_get_pin_int()

uint8_t zigbee_get_pin_int ( zigbee_t ctx)

Function getting INT pin status.

This function is used for getting the state of INT pin.

Parameters
[in]ctx: Click context object. See zigbee_t object definition for detailed explanation.
Returns
Returns pin status.

◆ zigbee_init()

err_t zigbee_init ( zigbee_t ctx,
zigbee_cfg_t cfg 
)

ZigBee initialization function.

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

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

◆ zigbee_resp()

uint8_t zigbee_resp ( zigbee_t ctx,
char *  data_in 
)

Function checking driver buffer string.

This function is checking driver buffer for the codes.

Parameters
[in]ctx: Click context object. See zigbee_t object definition for detailed explanation.
[in]data_in: Pointer to data.
Returns
  • 0x00 - ZIGBEE_OP_WAIT,
  • 0xAA - ZIGBEE_OP_OK,
  • 0xBB - ZIGBEE_OP_ERROR,
  • 0xCC - ZIGBEE_OP_NL.

◆ zigbee_restart()

void zigbee_restart ( zigbee_t ctx)

Function for reseting device.

This function is used for restarting device.

Parameters
[in]ctx: Click context object. See zigbee_t object definition for detailed explanation.
Returns
Nothing.

◆ zigbee_send_at()

void zigbee_send_at ( zigbee_t ctx,
uint8_t *  at_buf,
uint8_t *  suffix_buf 
)

Function merges two string and sends it to device.

This function is used to send AT command plus parameter that it needs.

Parameters
[in]ctx: Click context object. See zigbee_t object definition for detailed explanation.
[in]at_buf: Pointer to at macro defined in driver.
[in]suffix_buf: Pointer to string that concats to at_buf.
Returns
Nothing.

◆ zigbee_send_cmd()

void zigbee_send_cmd ( zigbee_t ctx,
uint8_t *  cmd_buf 
)

Function sends string to device.

This function is used to send commands via UART.

Parameters
[in]ctx: Click context object. See zigbee_t object definition for detailed explanation.
[in]cmd_buf: String that will be sent to device.
Returns
Nothing.

◆ zigbee_set_pin_fw()

void zigbee_set_pin_fw ( zigbee_t ctx,
uint8_t  status 
)

Function setting FW pin status.

This function is used for setting state of the FW pin.

Parameters
[in]ctx: Click context object. See zigbee_t object definition for detailed explanation.
[in]status: Pin status.
Returns
Nothing.

◆ zigbee_set_pin_rst()

void zigbee_set_pin_rst ( zigbee_t ctx,
uint8_t  status 
)

Function setting RST pin status.

This function is used for setting state of the RST pin.

Parameters
[in]ctx: Click context object. See zigbee_t object definition for detailed explanation.
[in]status: Pin status.
Returns
Nothing.