39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
73#define XBEE3_ENTER_CMD_MODE "+++"
74#define XBEE3_EXIT_CMD_MODE "CN"
75#define XBEE3_FACTORY_RESET "RE"
76#define XBEE3_SET_NODE_IDENTIFIER "NI"
77#define XBEE3_GET_SERIAL_NUMBER "SH,SL"
78#define XBEE3_SET_DEST_ADDR_HIGH "DH"
79#define XBEE3_SET_DEST_ADDR_LOW "DL"
80#define XBEE3_APPLY_CHANGES "AC"
81#define XBEE3_API_MODE "AP"
82#define XBEE3_SAVE_CHANGES "WR"
83#define XBEE3_CMD_AT "AT"
84#define XBEE3_DELIMITER ","
85#define XBEE3_CARRIAGE_RETURN "\r"
91#define XBEE3_MODE_TRANSPARENT 0
92#define XBEE3_MODE_API_WITHOUT_ESC 1
93#define XBEE3_MODE_API_WITH_ESC 2
99#define XBEE3_BROADCAST_DEST_ADDRESS_HIGH "00000000"
100#define XBEE3_BROADCAST_DEST_ADDRESS_LOW "0000FFFF"
106#define XBEE3_RSP_OK "OK"
107#define XBEE3_RSP_ERROR "ERROR"
114#define DRV_BUFFER_SIZE 200
132#define XBEE3_MAP_MIKROBUS( cfg, mikrobus ) \
133 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
134 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
135 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_AN ); \
136 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
137 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
138 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
139 cfg.att_dtr = MIKROBUS( mikrobus, MIKROBUS_INT );
#define DRV_BUFFER_SIZE
XBEE 3 driver buffer size.
Definition xbee3.h:114
err_t xbee3_init(xbee3_t *ctx, xbee3_cfg_t *cfg)
XBEE 3 initialization function.
err_t xbee3_generic_read(xbee3_t *ctx, char *data_out, uint16_t len)
XBEE 3 data reading function.
void xbee3_hw_reset(xbee3_t *ctx)
XBEE 3 hw reset function.
void xbee3_set_cs_pin(xbee3_t *ctx, uint8_t state)
XBEE 3 set cs pin function.
void xbee3_set_rts_pin(xbee3_t *ctx, uint8_t state)
XBEE 3 set rts pin function.
err_t xbee3_set_api_mode(xbee3_t *ctx, uint8_t api_mode)
XBEE 3 set api mode function.
err_t xbee3_generic_write(xbee3_t *ctx, char *data_in, uint16_t len)
XBEE 3 data writing 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.
err_t xbee3_exit_command_mode(xbee3_t *ctx)
XBEE 3 exit command mode function.
err_t xbee3_set_device_name(xbee3_t *ctx, char *dev_name)
XBEE 3 set device name function.
err_t xbee3_save_changes(xbee3_t *ctx)
XBEE 3 save changes function.
void xbee3_cfg_setup(xbee3_cfg_t *cfg)
XBEE 3 configuration object setup function.
void xbee3_set_rst_pin(xbee3_t *ctx, uint8_t state)
XBEE 3 set rst pin function.
uint8_t xbee3_get_cts_pin(xbee3_t *ctx)
XBEE 3 get cts pin function.
err_t xbee3_get_serial_number(xbee3_t *ctx)
XBEE 3 get serial number 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_enter_command_mode(xbee3_t *ctx)
XBEE 3 enter command mode function.
err_t xbee3_apply_changes(xbee3_t *ctx)
XBEE 3 apply changes function.
err_t xbee3_factory_reset(xbee3_t *ctx)
XBEE 3 factory reset function.
XBEE 3 Click configuration object.
Definition xbee3.h:173
pin_name_t rts
Definition xbee3.h:179
uint32_t baud_rate
Definition xbee3.h:186
pin_name_t att_dtr
Definition xbee3.h:183
pin_name_t cts
Definition xbee3.h:182
bool uart_blocking
Definition xbee3.h:187
uart_data_bits_t data_bit
Definition xbee3.h:188
pin_name_t tx_pin
Definition xbee3.h:176
pin_name_t rx_pin
Definition xbee3.h:175
uart_stop_bits_t stop_bit
Definition xbee3.h:190
uart_parity_t parity_bit
Definition xbee3.h:189
pin_name_t rst
Definition xbee3.h:180
pin_name_t cs
Definition xbee3.h:181
XBEE 3 Click context object.
Definition xbee3.h:149
digital_out_t cs
Definition xbee3.h:153
digital_in_t att_dtr
Definition xbee3.h:157
digital_out_t rts
Definition xbee3.h:151
uart_t uart
Definition xbee3.h:160
digital_in_t cts
Definition xbee3.h:156
digital_out_t rst
Definition xbee3.h:152
xbee3_return_value_t
XBEE 3 Click return value data.
Definition xbee3.h:199
@ XBEE3_ERROR
Definition xbee3.h:201
@ XBEE3_OK
Definition xbee3.h:200