xbee3 2.1.0.0
XBEE 3 Click Driver

API for configuring and manipulating XBEE 3 Click driver. More...

Topics

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

Functions

void xbee3_cfg_setup (xbee3_cfg_t *cfg)
 XBEE 3 configuration object setup function.
 
err_t xbee3_init (xbee3_t *ctx, xbee3_cfg_t *cfg)
 XBEE 3 initialization function.
 
err_t xbee3_generic_write (xbee3_t *ctx, char *data_in, uint16_t len)
 XBEE 3 data writing function.
 
err_t xbee3_generic_read (xbee3_t *ctx, char *data_out, uint16_t len)
 XBEE 3 data reading function.
 
void xbee3_set_rts_pin (xbee3_t *ctx, uint8_t state)
 XBEE 3 set rts pin function.
 
void xbee3_set_rst_pin (xbee3_t *ctx, uint8_t state)
 XBEE 3 set rst pin function.
 
void xbee3_set_cs_pin (xbee3_t *ctx, uint8_t state)
 XBEE 3 set cs pin function.
 
uint8_t xbee3_get_cts_pin (xbee3_t *ctx)
 XBEE 3 get cts pin function.
 
uint8_t xbee3_get_att_dtr_pin (xbee3_t *ctx)
 XBEE 3 get att_dtr pin function.
 
err_t xbee3_write_command (xbee3_t *ctx, char *data_buf)
 XBEE 3 write command function.
 
void xbee3_hw_reset (xbee3_t *ctx)
 XBEE 3 hw reset function.
 
err_t xbee3_enter_command_mode (xbee3_t *ctx)
 XBEE 3 enter command mode function.
 
err_t xbee3_exit_command_mode (xbee3_t *ctx)
 XBEE 3 exit command mode function.
 
err_t xbee3_factory_reset (xbee3_t *ctx)
 XBEE 3 factory reset function.
 
err_t xbee3_get_serial_number (xbee3_t *ctx)
 XBEE 3 get serial number function.
 
err_t xbee3_set_device_name (xbee3_t *ctx, char *dev_name)
 XBEE 3 set device name function.
 
err_t xbee3_set_destination_address (xbee3_t *ctx, char *dest_addr_high, char *dest_addr_low)
 XBEE 3 set destination address function.
 
err_t xbee3_set_api_mode (xbee3_t *ctx, uint8_t api_mode)
 XBEE 3 set api mode function.
 
err_t xbee3_apply_changes (xbee3_t *ctx)
 XBEE 3 apply changes function.
 
err_t xbee3_save_changes (xbee3_t *ctx)
 XBEE 3 save changes function.
 

Detailed Description

API for configuring and manipulating XBEE 3 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ xbee3_apply_changes()

err_t xbee3_apply_changes ( xbee3_t * ctx)

XBEE 3 apply changes function.

This function applies changes by sending the AC command.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ xbee3_cfg_setup()

void xbee3_cfg_setup ( xbee3_cfg_t * cfg)

XBEE 3 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ xbee3_enter_command_mode()

err_t xbee3_enter_command_mode ( xbee3_t * ctx)

XBEE 3 enter command mode function.

This function is used to enter to command mode by issuing the command character (CC).

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ xbee3_exit_command_mode()

err_t xbee3_exit_command_mode ( xbee3_t * ctx)

XBEE 3 exit command mode function.

This function is used to exits to command mode by issuing the exit command (CN).

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ xbee3_factory_reset()

err_t xbee3_factory_reset ( xbee3_t * ctx)

XBEE 3 factory reset function.

This function factory resets the device.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
xbee3_save_changes( ) must be called after to save the changes enacted with factory reset.

◆ xbee3_generic_read()

err_t xbee3_generic_read ( xbee3_t * ctx,
char * data_out,
uint16_t len )

XBEE 3 data reading function.

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

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]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.
Note
None.

◆ xbee3_generic_write()

err_t xbee3_generic_write ( xbee3_t * ctx,
char * data_in,
uint16_t len )

XBEE 3 data writing function.

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

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

◆ xbee3_get_att_dtr_pin()

uint8_t xbee3_get_att_dtr_pin ( xbee3_t * ctx)

XBEE 3 get att_dtr pin function.

This function returns the SPI Attention or UART Data Present indicator Or Sleep Control line (ATT_DTR) pin logic state.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ xbee3_get_cts_pin()

uint8_t xbee3_get_cts_pin ( xbee3_t * ctx)

XBEE 3 get cts pin function.

This function returns the clear to send (CTS) pin logic state.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ xbee3_get_serial_number()

err_t xbee3_get_serial_number ( xbee3_t * ctx)

XBEE 3 get serial number function.

This function sends a get serial number command.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ xbee3_hw_reset()

void xbee3_hw_reset ( xbee3_t * ctx)

XBEE 3 hw reset function.

This function resets the module by toggling the RST pin.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ xbee3_init()

err_t xbee3_init ( xbee3_t * ctx,
xbee3_cfg_t * cfg )

XBEE 3 initialization function.

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

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

◆ xbee3_save_changes()

err_t xbee3_save_changes ( xbee3_t * ctx)

XBEE 3 save changes function.

This function saves changes by sending the WR command.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ xbee3_set_api_mode()

err_t xbee3_set_api_mode ( xbee3_t * ctx,
uint8_t api_mode )

XBEE 3 set api mode function.

This function sets the api mode.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
[in]api_mode:
  • 0 - Transparent mode,
  • 1 - API mode without ESC.
  • 2 - API mode with ESC.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ xbee3_set_cs_pin()

void xbee3_set_cs_pin ( xbee3_t * ctx,
uint8_t state )

XBEE 3 set cs pin function.

This function sets the chip select (CS) pin to a desired state.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ xbee3_set_destination_address()

err_t xbee3_set_destination_address ( xbee3_t * ctx,
char * dest_addr_high,
char * dest_addr_low )

XBEE 3 set destination address function.

This function sets the destination address high and low bytes.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
[in]dest_addr_high: Destination address high bytes as hex string ( up to 8 characters ).
[in]dest_addr_low: Destination address low bytes as hex string ( up to 8 characters ).
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ xbee3_set_device_name()

err_t xbee3_set_device_name ( xbee3_t * ctx,
char * dev_name )

XBEE 3 set device name function.

This function sets the device name (node identifier).

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
[in]dev_name: Device name ( up to 20 characters ).
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ xbee3_set_rst_pin()

void xbee3_set_rst_pin ( xbee3_t * ctx,
uint8_t state )

XBEE 3 set rst pin function.

This function sets the reset (RST) pin to a desired state.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ xbee3_set_rts_pin()

void xbee3_set_rts_pin ( xbee3_t * ctx,
uint8_t state )

XBEE 3 set rts pin function.

This function sets the request to send (RTS) pin to a desired state.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ xbee3_write_command()

err_t xbee3_write_command ( xbee3_t * ctx,
char * data_buf )

XBEE 3 write command function.

This function sends a desired AT command with the CR byte appended to.

Parameters
[in]ctx: Click context object. See xbee3_t object definition for detailed explanation.
[in]data_buf: Command string.
Returns
  • >=0 - Success,
  • <0 - Error. See #err_t definition for detailed explanation.
Note
None.