wirepas 2.1.0.0
wirepas.h File Reference

This file contains API for Wirepas 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  wirepas_frame_t
 Wirepas Click frame data object. More...
 
struct  wirepas_t
 Wirepas Click context object. More...
 
struct  wirepas_cfg_t
 Wirepas Click configuration object. More...
 
struct  wirepas_sink_data
 Wirepas Click sink data object. More...
 

Macros

#define WIREPAS_DSAP_DATA_TX_REQUEST   0x01
 Wirepas control commands.
 
#define WIREPAS_DSAP_DATA_TX_CONFIRM   0x81
 
#define WIREPAS_DSAP_DATA_TX_TT_REQUEST   0x1F
 
#define WIREPAS_DSAP_DATA_TX_TT_CONFIRM   0x9F
 
#define WIREPAS_DSAP_DATA_TX_INDICATION   0x02
 
#define WIREPAS_DSAP_DATA_TX_RESPONSE   0x82
 
#define WIREPAS_DSAP_DATA_RX_INDICATION   0x03
 
#define WIREPAS_DSAP_DATA_RX_RESPONSE   0x83
 
#define WIREPAS_MSAP_INDICATION_POLL_REQUEST   0x04
 Wirepas MSAP attributes primitive ID.
 
#define WIREPAS_MSAP_INDICATION_POLL_CONFIRM   0x84
 
#define WIREPAS_MSAP_STACK_START_REQUEST   0x05
 
#define WIREPAS_MSAP_STACK_START_CONFIRM   0x85
 
#define WIREPAS_MSAP_STACK_STOP_REQUEST   0x06
 
#define WIREPAS_MSAP_STACK_STOP_CONFIRM   0x86
 
#define WIREPAS_MSAP_STACK_STATE_INDICATION   0x07
 
#define WIREPAS_MSAP_STACK_STATE_RESPONSE   0x87
 
#define WIREPAS_MSAP_APP_CONFIG_DATA_RX_IND   0x3F
 
#define WIREPAS_MSAP_APP_CONFIG_DATA_RX_RESP   0xBF
 
#define WIREPAS_MSAP_SCAN_NBORS_INDICATION   0x22
 
#define WIREPAS_MSAP_SCAN_NBORS_RESPONSE   0xA2
 
#define WIREPAS_CSAP_ATTRIBUTE_WRITE_REQUEST   0x0D
 Wirepas CSAP attributes primitive ID.
 
#define WIREPAS_CSAP_ATTRIBUTE_WRITE_CONFIRM   0x8D
 
#define WIREPAS_CSAP_ATTRIBUTE_READ_REQUEST   0x0E
 
#define WIREPAS_CSAP_ATTRIBUTE_READ_CONFIRM   0x8E
 
#define WIREPAS_CSAP_FACTORY_RESET_REQUEST   0x16
 
#define WIREPAS_CSAP_FACTORY_RESET_CONFIRM   0x96
 
#define WIREPAS_CSAP_ATTRIBUTE_NODE_ADDRESS   0x01
 Wirepas CSAP attributes.
 
#define WIREPAS_CSAP_ATTRIBUTE_NETWORK_ADDRESS   0x02
 
#define WIREPAS_CSAP_ATTRIBUTE_NETWORK_CHANNEL   0x03
 
#define WIREPAS_CSAP_ATTRIBUTE_NODE_ROLE   0x04
 
#define WIREPAS_FACTORY_RESET_CODE   "DoIt"
 Wirepas factory reset code.
 
#define WIREPAS_ENDCODE_OCTET   0xC0
 Wirepas factory reset code.
 
#define WIREPAS_ROUTER_NODE_MODE   0x02
 Wirepas node role mode settings.
 
#define WIREPAS_SINK_NODE_MODE   0x01
 
#define WIREPAS_PIN_MODE_HIGH   0x01
 Wirepas pin mode settings.
 
#define WIREPAS_PIN_MODE_LOW   0x00
 
#define WIREPAS_TX_DRV_BUFFER_SIZE   200
 Wirepas driver buffer size.
 
#define WIREPAS_RX_DRV_BUFFER_SIZE   500
 
#define WIREPAS_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  wirepas_return_value_t { WIREPAS_OK = 0 , WIREPAS_DATA_RDY = 1 , WIREPAS_ERROR = -1 }
 Wirepas Click return value data. More...
 

Functions

void wirepas_cfg_setup (wirepas_cfg_t *cfg)
 Wirepas configuration object setup function.
 
err_t wirepas_init (wirepas_t *ctx, wirepas_cfg_t *cfg)
 Wirepas initialization function.
 
void wirepas_default_cfg (wirepas_t *ctx)
 Wirepas default configuration function.
 
err_t wirepas_generic_write (wirepas_t *ctx, uint8_t *data_in, uint16_t len)
 Wirepas data writing function.
 
err_t wirepas_generic_read (wirepas_t *ctx, uint8_t *data_out, uint16_t len)
 Wirepas data reading function.
 
uint8_t wirepas_get_din_state (wirepas_t *ctx)
 Wirepas get DIN state function.
 
void wirepas_set_rst (wirepas_t *ctx, uint8_t pin_state)
 Wirepas set RST pin state function.
 
void wirepas_hw_reset (wirepas_t *ctx)
 Wirepas hardware reset function.
 
err_t wirepas_send_command (wirepas_t *ctx, uint8_t primitive_id, uint8_t payload_length, uint8_t *payload)
 Wirepas send command function.
 
err_t wirepas_send_ack (wirepas_t *ctx, uint8_t primitive_id, uint8_t frame_id, uint8_t result)
 Wirepas send ack function.
 
err_t wirepas_write_csap_attribute (wirepas_t *ctx, uint16_t attribute_id, uint8_t attribute_len, uint8_t *attribute_val)
 Wirepas write CSAP attribute function.
 
err_t wirepas_read_csap_attribute (wirepas_t *ctx, uint16_t attribute_id, uint8_t *attribute_len, uint8_t *attribute_val)
 Wirepas read CSAP attribute function.
 
err_t wirepas_set_node_address (wirepas_t *ctx, uint32_t address)
 Wirepas set node address function.
 
err_t wirepas_set_net_address (wirepas_t *ctx, uint32_t net_address)
 Wirepas set net address function.
 
err_t wirepas_read_frame (wirepas_t *ctx, wirepas_frame_t *frame)
 Wirepas read frame function.
 
err_t wirepas_send_data (wirepas_t *ctx, wirepas_sink_data sink_data, uint8_t tx_op, uint8_t apdu_length, uint8_t *apdu)
 Wirepas send data function.
 

Detailed Description

This file contains API for Wirepas Click Driver.

Enumeration Type Documentation

◆ wirepas_return_value_t

Wirepas Click return value data.

Predefined enum values for driver return values.

Enumerator
WIREPAS_OK 
WIREPAS_DATA_RDY 
WIREPAS_ERROR