xbee 2.1.0.0
|
API for configuring and manipulating XBEE Click driver. More...
Topics | |
XBEE Device Settings | |
Settings for registers of XBEE Click driver. | |
XBEE MikroBUS Map | |
MikroBUS pin mapping of XBEE Click driver. | |
Functions | |
void | xbee_cfg_setup (xbee_cfg_t *cfg) |
XBEE configuration object setup function. | |
err_t | xbee_init (xbee_t *ctx, xbee_cfg_t *cfg) |
XBEE initialization function. | |
err_t | xbee_generic_write (xbee_t *ctx, char *data_in, uint16_t len) |
XBEE data writing function. | |
err_t | xbee_generic_read (xbee_t *ctx, char *data_out, uint16_t len) |
XBEE data reading function. | |
void | xbee_set_rts_pin (xbee_t *ctx, uint8_t state) |
XBEE set rts pin function. | |
void | xbee_set_rst_pin (xbee_t *ctx, uint8_t state) |
XBEE set rst pin function. | |
void | xbee_set_cs_pin (xbee_t *ctx, uint8_t state) |
XBEE set cs pin function. | |
uint8_t | xbee_get_cts_pin (xbee_t *ctx) |
XBEE get cts pin function. | |
uint8_t | xbee_get_att_dtr_pin (xbee_t *ctx) |
XBEE get att_dtr pin function. | |
err_t | xbee_write_command (xbee_t *ctx, char *data_buf) |
XBEE write command function. | |
void | xbee_hw_reset (xbee_t *ctx) |
XBEE hw reset function. | |
err_t | xbee_enter_command_mode (xbee_t *ctx) |
XBEE enter command mode function. | |
err_t | xbee_exit_command_mode (xbee_t *ctx) |
XBEE exit command mode function. | |
err_t | xbee_factory_reset (xbee_t *ctx) |
XBEE factory reset function. | |
err_t | xbee_get_serial_number (xbee_t *ctx) |
XBEE get serial number function. | |
err_t | xbee_set_device_name (xbee_t *ctx, char *dev_name) |
XBEE set device name function. | |
err_t | xbee_set_destination_address (xbee_t *ctx, char *dest_addr_high, char *dest_addr_low) |
XBEE set destination address function. | |
err_t | xbee_set_api_mode (xbee_t *ctx, uint8_t api_mode) |
XBEE set api mode function. | |
err_t | xbee_apply_changes (xbee_t *ctx) |
XBEE apply changes function. | |
err_t | xbee_save_changes (xbee_t *ctx) |
XBEE save changes function. | |
API for configuring and manipulating XBEE Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
err_t xbee_apply_changes | ( | xbee_t * | ctx | ) |
XBEE apply changes function.
This function applies changes by sending the AC command.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. void xbee_cfg_setup | ( | xbee_cfg_t * | cfg | ) |
XBEE configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See xbee_cfg_t object definition for detailed explanation. |
err_t xbee_enter_command_mode | ( | xbee_t * | ctx | ) |
XBEE enter command mode function.
This function is used to enter to command mode by issuing the command character (CC).
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t xbee_exit_command_mode | ( | xbee_t * | ctx | ) |
XBEE exit command mode function.
This function is used to exits to command mode by issuing the exit command (CN).
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t xbee_factory_reset | ( | xbee_t * | ctx | ) |
XBEE factory reset function.
This function factory resets the device.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t xbee_generic_read | ( | xbee_t * | ctx, |
char * | data_out, | ||
uint16_t | len ) |
XBEE data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. err_t xbee_generic_write | ( | xbee_t * | ctx, |
char * | data_in, | ||
uint16_t | len ) |
XBEE data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
[in] | data_in | : Data buffer for sending. |
[in] | len | : Number of bytes for sending. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. uint8_t xbee_get_att_dtr_pin | ( | xbee_t * | ctx | ) |
XBEE 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.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
uint8_t xbee_get_cts_pin | ( | xbee_t * | ctx | ) |
XBEE get cts pin function.
This function returns the clear to send (CTS) pin logic state.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
err_t xbee_get_serial_number | ( | xbee_t * | ctx | ) |
XBEE get serial number function.
This function sends a get serial number command.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. void xbee_hw_reset | ( | xbee_t * | ctx | ) |
XBEE hw reset function.
This function resets the module by toggling the RST pin.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
err_t xbee_init | ( | xbee_t * | ctx, |
xbee_cfg_t * | cfg ) |
XBEE initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See xbee_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t xbee_save_changes | ( | xbee_t * | ctx | ) |
XBEE save changes function.
This function saves changes by sending the WR command.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t xbee_set_api_mode | ( | xbee_t * | ctx, |
uint8_t | api_mode ) |
XBEE set api mode function.
This function sets the api mode.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
[in] | api_mode | :
|
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. void xbee_set_cs_pin | ( | xbee_t * | ctx, |
uint8_t | state ) |
XBEE set cs pin function.
This function sets the chip select (CS) pin to a desired state.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t xbee_set_destination_address | ( | xbee_t * | ctx, |
char * | dest_addr_high, | ||
char * | dest_addr_low ) |
XBEE set destination address function.
This function sets the destination address high and low bytes.
[in] | ctx | : Click context object. See xbee_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 ). |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. err_t xbee_set_device_name | ( | xbee_t * | ctx, |
char * | dev_name ) |
XBEE set device name function.
This function sets the device name (node identifier).
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
[in] | dev_name | : Device name ( up to 20 characters ). |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. void xbee_set_rst_pin | ( | xbee_t * | ctx, |
uint8_t | state ) |
XBEE set rst pin function.
This function sets the reset (RST) pin to a desired state.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void xbee_set_rts_pin | ( | xbee_t * | ctx, |
uint8_t | state ) |
XBEE set rts pin function.
This function sets the request to send (RTS) pin to a desired state.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t xbee_write_command | ( | xbee_t * | ctx, |
char * | data_buf ) |
XBEE write command function.
This function sends a desired AT command with the CR byte appended to.
[in] | ctx | : Click context object. See xbee_t object definition for detailed explanation. |
[in] | data_buf | : Command string. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation.