neomesh2 2.1.0.0
neomesh2.h File Reference

This file contains API for NeoMesh 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  neomesh2_t
 NeoMesh 2 Click context object. More...
 
struct  neomesh2_cfg_t
 NeoMesh 2 Click configuration object. More...
 
struct  neomesh2_aapi_frame_t
 NeoMesh 2 Click data frame object. More...
 
struct  neomesh2_sapi_frame_t
 NeoMesh 2 Click data frame object. More...
 

Macros

#define NEOMESH2_CMD_NACK_SEND   0x02
 NeoMesh 2 AAPI control commands.
 
#define NEOMESH2_CMD_ACK_SEND   0x03
 
#define NEOMESH2_CMD_NODE_STATUS   0x07
 
#define NEOMESH2_CMD_NODE_INFO   0x08
 
#define NEOMESH2_CMD_NEIGHBOUR_LIST   0x09
 
#define NEOMESH2_CMD_NETWORK_COMMAND   0x0A
 
#define NEOMESH2_CMD_SAPI_TO_AAPI   0x0B
 
#define NEOMESH2_CMD_ROUTE_INFO   0x0C
 
#define NEOMESH2_CMD_WES_COMMAND   0x10
 
#define NEOMESH2_CMD_WES_SETUP_RSP   0x11
 
#define NEOMESH2_CMD_GET_SW_VERSION   0x14
 
#define NEOMESH2_CMD_ALT_MODE   0x20
 
#define NEOMESH2_RSP_ACK   0x50
 NeoMesh 2 application data response.
 
#define NEOMESH2_RSP_NACK   0x51
 
#define NEOMESH2_RSP_ACK_HOST   0x52
 
#define NEOMESH2_RSP_ACK_HOST_HAPA   0x53
 
#define NEOMESH2_RSP_NACK_HOST   0x54
 
#define NEOMESH2_RSP_NACK_HOST_HAPA   0x55
 
#define NEOMESH2_RSP_NACK_SEND   0x56
 
#define NEOMESH2_RSP_NACK_DROP   0x57
 
#define NEOMESH2_RSP_NODE_INFO   0x58
 
#define NEOMESH2_RSP_NEIGHBOUR_LIST   0x59
 
#define NEOMESH2_RSP_NETWORK_COMMAND   0x5A
 
#define NEOMESH2_RSP_ROUTE_INFO   0x5C
 
#define NEOMESH2_RSP_WES_STATUS   0x60
 
#define NEOMESH2_RSP_WES_SETUP   0x61
 
#define NEOMESH2_RSP_GET_SW_VERSION   0x64
 
#define NEOMESH2_RSP_ALT_MODE   0x70
 
#define NEOMESH2_SAPI_CMD_LOGIN   0x0103u
 NeoMesh 2 SAPI control commands.
 
#define NEOMESH2_SAPI_CMD_RESET_LIST_ITERATOR   0x0104u
 
#define NEOMESH2_SAPI_CMD_GET_LIST   0x0105u
 
#define NEOMESH2_SAPI_CMD_GET_SETTING_FLASH   0x0106u
 
#define NEOMESH2_SAPI_CMD_GET_SETTING_RAM   0x0107u
 
#define NEOMESH2_SAPI_CMD_COMMIT_SETTINGS   0x0108u
 
#define NEOMESH2_SAPI_CMD_DISCARD_SETTINGS   0x0109u
 
#define NEOMESH2_SAPI_CMD_SET_SETTING   0x010Au
 
#define NEOMESH2_SAPI_CMD_START_PROTOCOL_STACK   0x0112u
 
#define NEOMESH2_SAPI_CMD_START_BOOTLOADER   0x0113u
 
#define NEOMESH2_SAPI_HEADER   0x3E
 
#define NEOMESH2_SAPI_TRAIL   0x21
 
#define NEOMESH2_SAPI_RSP_OK   0x0380u
 NeoMesh 2 system data response.
 
#define NEOMESH2_SAPI_RSP_ERROR   0x0381u
 
#define NEOMESH2_SAPI_RSP_BOOTLOADER_START   0x0382u
 
#define NEOMESH2_SAPI_RSP_PROTOCOL_STACK_START   0x0383u
 
#define NEOMESH2_SAPI_RSP_PROTOCOL_STACK_ERROR   0x0384u
 
#define NEOMESH2_SAPI_RSP_RESET   0x0385u
 
#define NEOMESH2_SAPI_RSP_SETTINGS_LIST_OUTPUT   0x0185u
 
#define NEOMESH2_SAPI_RSP_SETTINGS_VALUE   0x0186u
 
#define NEOMESH2_SAPI_LOGIN_PASSWORD_0   0x4C
 NeoMesh 2 login password settings.
 
#define NEOMESH2_SAPI_LOGIN_PASSWORD_1   0x76
 
#define NEOMESH2_SAPI_LOGIN_PASSWORD_2   0x6C
 
#define NEOMESH2_SAPI_LOGIN_PASSWORD_3   0x31
 
#define NEOMESH2_SAPI_LOGIN_PASSWORD_4   0x30
 
#define NEOMESH2_SAPI_SETTINGS_ID_NODE_ID   0x0A
 NeoMesh 2 SAPI settings ID.
 
#define NEOMESH2_TIMEOUT_MS   20000ul
 NeoMesh 2 CTS/WUP timeout wait.
 
#define NEOMESH2_MAX_PAYLOAD_LEN   255
 NeoMesh 2 payload length.
 
#define NEOMESH2_TX_DRV_BUFFER_SIZE   300u
 NeoMesh 2 driver buffer size.
 
#define NEOMESH2_RX_DRV_BUFFER_SIZE   300u
 
#define NEOMESH2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  neomesh2_return_value_t { NEOMESH2_OK = 0 , NEOMESH2_ERROR = -1 , NEOMESH2_TIMEOUT = -2 }
 NeoMesh 2 Click return value data. More...
 

Functions

void neomesh2_cfg_setup (neomesh2_cfg_t *cfg)
 NeoMesh 2 configuration object setup function.
 
err_t neomesh2_init (neomesh2_t *ctx, neomesh2_cfg_t *cfg)
 NeoMesh 2 initialization function.
 
err_t neomesh2_send_aapi_frame (neomesh2_t *ctx, neomesh2_aapi_frame_t *frame)
 NeoMesh 2 send aapi frame function.
 
err_t neomesh2_read_aapi_frame (neomesh2_t *ctx, neomesh2_aapi_frame_t *frame)
 NeoMesh 2 read aapi frame function.
 
err_t neomesh2_send_sapi_frame (neomesh2_t *ctx, neomesh2_sapi_frame_t *frame)
 NeoMesh 2 send sapi frame function.
 
err_t neomesh2_read_sapi_frame (neomesh2_t *ctx, neomesh2_sapi_frame_t *frame)
 NeoMesh 2 read sapi frame function.
 
void neomesh2_set_rst_pin (neomesh2_t *ctx, uint8_t state)
 NeoMesh 2 set rst pin function.
 
void neomesh2_set_wes_pin (neomesh2_t *ctx, uint8_t state)
 NeoMesh 2 set wes pin function.
 
uint8_t neomesh2_get_app_pin (neomesh2_t *ctx)
 NeoMesh 2 get app pin 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.
 

Detailed Description

This file contains API for NeoMesh 2 Click Driver.

Enumeration Type Documentation

◆ neomesh2_return_value_t

NeoMesh 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
NEOMESH2_OK 
NEOMESH2_ERROR 
NEOMESH2_TIMEOUT