Go to the documentation of this file.
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 NEOMESH2_CMD_NACK_SEND 0x02
74 #define NEOMESH2_CMD_ACK_SEND 0x03
75 #define NEOMESH2_CMD_NODE_STATUS 0x07
76 #define NEOMESH2_CMD_NODE_INFO 0x08
77 #define NEOMESH2_CMD_NEIGHBOUR_LIST 0x09
78 #define NEOMESH2_CMD_NETWORK_COMMAND 0x0A
79 #define NEOMESH2_CMD_SAPI_TO_AAPI 0x0B
80 #define NEOMESH2_CMD_ROUTE_INFO 0x0C
81 #define NEOMESH2_CMD_WES_COMMAND 0x10
82 #define NEOMESH2_CMD_WES_SETUP_RSP 0x11
83 #define NEOMESH2_CMD_GET_SW_VERSION 0x14
84 #define NEOMESH2_CMD_ALT_MODE 0x20
90 #define NEOMESH2_RSP_ACK 0x50
91 #define NEOMESH2_RSP_NACK 0x51
92 #define NEOMESH2_RSP_ACK_HOST 0x52
93 #define NEOMESH2_RSP_ACK_HOST_HAPA 0x53
94 #define NEOMESH2_RSP_NACK_HOST 0x54
95 #define NEOMESH2_RSP_NACK_HOST_HAPA 0x55
96 #define NEOMESH2_RSP_NACK_SEND 0x56
97 #define NEOMESH2_RSP_NACK_DROP 0x57
98 #define NEOMESH2_RSP_NODE_INFO 0x58
99 #define NEOMESH2_RSP_NEIGHBOUR_LIST 0x59
100 #define NEOMESH2_RSP_NETWORK_COMMAND 0x5A
101 #define NEOMESH2_RSP_ROUTE_INFO 0x5C
102 #define NEOMESH2_RSP_WES_STATUS 0x60
103 #define NEOMESH2_RSP_WES_SETUP 0x61
104 #define NEOMESH2_RSP_GET_SW_VERSION 0x64
105 #define NEOMESH2_RSP_ALT_MODE 0x70
111 #define NEOMESH2_SAPI_CMD_LOGIN 0x0103u
112 #define NEOMESH2_SAPI_CMD_RESET_LIST_ITERATOR 0x0104u
113 #define NEOMESH2_SAPI_CMD_GET_LIST 0x0105u
114 #define NEOMESH2_SAPI_CMD_GET_SETTING_FLASH 0x0106u
115 #define NEOMESH2_SAPI_CMD_GET_SETTING_RAM 0x0107u
116 #define NEOMESH2_SAPI_CMD_COMMIT_SETTINGS 0x0108u
117 #define NEOMESH2_SAPI_CMD_DISCARD_SETTINGS 0x0109u
118 #define NEOMESH2_SAPI_CMD_SET_SETTING 0x010Au
119 #define NEOMESH2_SAPI_CMD_START_PROTOCOL_STACK 0x0112u
120 #define NEOMESH2_SAPI_CMD_START_BOOTLOADER 0x0113u
121 #define NEOMESH2_SAPI_HEADER 0x3E
122 #define NEOMESH2_SAPI_TRAIL 0x21
128 #define NEOMESH2_SAPI_RSP_OK 0x0380u
129 #define NEOMESH2_SAPI_RSP_ERROR 0x0381u
130 #define NEOMESH2_SAPI_RSP_BOOTLOADER_START 0x0382u
131 #define NEOMESH2_SAPI_RSP_PROTOCOL_STACK_START 0x0383u
132 #define NEOMESH2_SAPI_RSP_PROTOCOL_STACK_ERROR 0x0384u
133 #define NEOMESH2_SAPI_RSP_RESET 0x0385u
134 #define NEOMESH2_SAPI_RSP_SETTINGS_LIST_OUTPUT 0x0185u
135 #define NEOMESH2_SAPI_RSP_SETTINGS_VALUE 0x0186u
141 #define NEOMESH2_SAPI_LOGIN_PASSWORD_0 0x4C
142 #define NEOMESH2_SAPI_LOGIN_PASSWORD_1 0x76
143 #define NEOMESH2_SAPI_LOGIN_PASSWORD_2 0x6C
144 #define NEOMESH2_SAPI_LOGIN_PASSWORD_3 0x31
145 #define NEOMESH2_SAPI_LOGIN_PASSWORD_4 0x30
151 #define NEOMESH2_SAPI_SETTINGS_ID_NODE_ID 0x0A
157 #define NEOMESH2_TIMEOUT_MS 20000ul
163 #define NEOMESH2_MAX_PAYLOAD_LEN 255
170 #define NEOMESH2_TX_DRV_BUFFER_SIZE 300u
171 #define NEOMESH2_RX_DRV_BUFFER_SIZE 300u
189 #define NEOMESH2_MAP_MIKROBUS( cfg, mikrobus ) \
190 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
191 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
192 cfg.app = MIKROBUS( mikrobus, MIKROBUS_AN ); \
193 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
194 cfg.wes = MIKROBUS( mikrobus, MIKROBUS_CS ); \
195 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
196 cfg.wup = MIKROBUS( mikrobus, MIKROBUS_INT );
bool uart_blocking
Definition: neomesh2.h:244
void neomesh2_set_rst_pin(neomesh2_t *ctx, uint8_t state)
NeoMesh 2 set rst pin function.
NeoMesh 2 Click data frame object.
Definition: neomesh2.h:268
digital_out_t rst
Definition: neomesh2.h:208
uint8_t cmd
Definition: neomesh2.h:257
void neomesh2_cfg_setup(neomesh2_cfg_t *cfg)
NeoMesh 2 configuration object setup function.
uint8_t neomesh2_get_cts_pin(neomesh2_t *ctx)
NeoMesh 2 get cts pin function.
uint8_t neomesh2_get_wup_pin(neomesh2_t *ctx)
NeoMesh 2 get wup pin function.
@ NEOMESH2_ERROR
Definition: neomesh2.h:282
digital_in_t app
Definition: neomesh2.h:212
err_t neomesh2_read_aapi_frame(neomesh2_t *ctx, neomesh2_aapi_frame_t *frame)
NeoMesh 2 read aapi frame function.
NeoMesh 2 Click context object.
Definition: neomesh2.h:206
uint16_t cmd
Definition: neomesh2.h:269
uint8_t len
Definition: neomesh2.h:258
err_t neomesh2_read_sapi_frame(neomesh2_t *ctx, neomesh2_sapi_frame_t *frame)
NeoMesh 2 read sapi frame function.
void neomesh2_set_wes_pin(neomesh2_t *ctx, uint8_t state)
NeoMesh 2 set wes pin function.
digital_in_t wup
Definition: neomesh2.h:214
pin_name_t wes
Definition: neomesh2.h:238
digital_out_t wes
Definition: neomesh2.h:209
pin_name_t wup
Definition: neomesh2.h:240
uart_t uart
Definition: neomesh2.h:217
#define NEOMESH2_MAX_PAYLOAD_LEN
NeoMesh 2 payload length.
Definition: neomesh2.h:163
uint8_t len
Definition: neomesh2.h:270
@ NEOMESH2_TIMEOUT
Definition: neomesh2.h:283
err_t neomesh2_send_sapi_frame(neomesh2_t *ctx, neomesh2_sapi_frame_t *frame)
NeoMesh 2 send sapi frame function.
@ NEOMESH2_OK
Definition: neomesh2.h:281
NeoMesh 2 Click data frame object.
Definition: neomesh2.h:256
uint32_t baud_rate
Definition: neomesh2.h:243
#define NEOMESH2_RX_DRV_BUFFER_SIZE
Definition: neomesh2.h:171
uart_stop_bits_t stop_bit
Definition: neomesh2.h:247
pin_name_t rst
Definition: neomesh2.h:237
uart_parity_t parity_bit
Definition: neomesh2.h:246
pin_name_t tx_pin
Definition: neomesh2.h:233
NeoMesh 2 Click configuration object.
Definition: neomesh2.h:230
uint8_t neomesh2_get_app_pin(neomesh2_t *ctx)
NeoMesh 2 get app pin function.
pin_name_t app
Definition: neomesh2.h:236
digital_in_t cts
Definition: neomesh2.h:213
err_t neomesh2_send_aapi_frame(neomesh2_t *ctx, neomesh2_aapi_frame_t *frame)
NeoMesh 2 send aapi frame function.
uart_data_bits_t data_bit
Definition: neomesh2.h:245
pin_name_t rx_pin
Definition: neomesh2.h:232
#define NEOMESH2_TX_DRV_BUFFER_SIZE
NeoMesh 2 driver buffer size.
Definition: neomesh2.h:170
neomesh2_return_value_t
NeoMesh 2 Click return value data.
Definition: neomesh2.h:280
err_t neomesh2_init(neomesh2_t *ctx, neomesh2_cfg_t *cfg)
NeoMesh 2 initialization function.
pin_name_t cts
Definition: neomesh2.h:239