lr3 2.0.0.0
lr3.h File Reference

This file contains API for LR 3 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  lr3_t
 Click ctx object definition. More...
 
struct  lr3_cfg_t
 Click configuration structure definition. More...
 
struct  lr3_message_t
 
struct  lr3_tx_msg_t
 

Macros

#define LR3_MAP_MIKROBUS(cfg, mikrobus)
 
#define LR3_RETVAL   uint8_t
 
#define LR3_OK   0x00
 
#define LR3_INIT_ERROR   0xFF
 
#define FRAME_HEADER   0xAA
 
#define RESPONSE_BIT   0x80
 
#define LR3_CMD_RESET   0x30
 
#define LR3_CMD_FACTORY_RESET   0x31
 
#define LR3_CMD_EEPROM_WRITE   0x32
 
#define LR3_CMD_EEPROM_READ   0x33
 
#define LR3_CMD_GET_FW_VERSION   0x34
 
#define LR3_CMD_GET_SERIAL_NO   0x35
 
#define LR3_ENABLE_PAIRING   0x40
 
#define LR3_GET_NETWORK_TABLE_SIZE   0x42
 
#define LR3_GET_NETWORK_TABLE_ROW   0x43
 
#define LR3_DEL_NET_TABLE_ROW   0x44
 
#define LR3_DEL_ALL_NETWORK_TABLE   0x45
 
#define LR3_GET_PAIRING_REQUEST   0x48
 
#define LR3_GET_ACTIVATION_STATUS   0x4A
 
#define LR3_TX_MESSAGE   0x50
 
#define LR3_CHECK_LINK_REQUEST   0x56
 
#define LR3_SET_APP_KEY   0x58
 
#define LR3_INDICATES_DEVICE_PAIRING   0x41
 
#define LR3_INDICATES_PAIRING_CONFIRM   0x49
 
#define LR3_INDICATES_TX_MSG_CONFIRMED   0x51
 
#define LR3_INDICATES_TX_MSG_UNCONFIRMED   0x52
 
#define LR3_INDICATES_RX_MSG   0x53
 
#define LR3_INDICATES_LINK_CHECK   0x57
 
#define LR3_INDICATES_TX_SESSION_ABORT   0x59
 
#define LR3_OK   0x00
 
#define LR3_ERR_ADDR_RANGE   0x01
 
#define LR3_ERR_NOT_IDLE   0x02
 
#define LR3_ERR_PL_LEN   0xFC
 
#define LR3_ERR_CHKSUM   0xFD
 
#define LR3_ERR_RESPONSE   0xFE
 
#define LR3_ERR_HEADER   0xFF
 
#define LR3_UNCONFIRMED_DATA_TX   0x00
 
#define LR3_CONFIRMED_DATA_TX   0x01
 
#define LR3_BROADCAST_MESSAGE   0xFFFFFFFF
 
#define LR3_MODULE_POWER_ON   1
 
#define LR3_MODULE_POWER_OFF   0
 
#define DRV_RX_BUFFER_SIZE   500
 

Typedefs

typedef void(* lr3_ind_hdl_t) (uint8_t *cmd, uint8_t *p_load_size, uint8_t *p_load)
 LR3_TYPES Types.
 

Functions

void lr3_cfg_setup (lr3_cfg_t *cfg)
 Config Object Initialization function.
 
LR3_RETVAL lr3_init (lr3_t *ctx, lr3_cfg_t *cfg)
 Initialization function.
 
uint8_t lr3_chk_sum (lr3_message_t *cmd)
 Check sum function.
 
int32_t lr3_generic_read (lr3_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
void lr3_generic_write (lr3_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
void lr3_hard_reset (lr3_t *ctx)
 Hardware reset function.
 
void lr3_wake_up (lr3_t *ctx, uint8_t state)
 Wake Up function.
 
void lr3_set_ind_handler (lr3_t *ctx, lr3_ind_hdl_t hdl)
 Set indication handler function.
 
uint8_t lr3_command (lr3_t *ctx, lr3_message_t *msg, lr3_message_t *rsp)
 Command function.
 
uint8_t lr3_read_message_process (lr3_t *ctx)
 Process function.
 
LR3_RETVAL lr3_soft_reset (lr3_t *ctx)
 Software reset function.
 
LR3_RETVAL lr3_factory_reset (lr3_t *ctx)
 Factory reset function.
 
LR3_RETVAL lr3_write_eeprom (lr3_t *ctx, uint8_t address, uint8_t n_bytes, uint8_t *data_in)
 EEPROM write function.
 
LR3_RETVAL lr3_read_eeprom (lr3_t *ctx, uint8_t address, uint8_t n_bytes, uint8_t *data_out)
 EEPROM read function.
 
LR3_RETVAL lr3_get_fw_version (lr3_t *ctx, uint32_t *fw_version)
 Get FW Version function.
 
LR3_RETVAL lr3_get_serial_no (lr3_t *ctx, uint32_t *serial_no)
 Get Serial Number function.
 
LR3_RETVAL lr3_enable_pairing (lr3_t *ctx, uint8_t state)
 Enable Pairing function.
 
LR3_RETVAL lr3_get_network_table_size (lr3_t *ctx)
 Get Network Table Size function.
 
LR3_RETVAL lr3_get_network_table_row (lr3_t *ctx, uint8_t index, uint8_t *data_out)
 Get Network Table Row function.
 
LR3_RETVAL lr3_delete_network_table_row (lr3_t *ctx, uint8_t *device_id)
 Delete Network Table Row function.
 
LR3_RETVAL lr3_delete_all_network_table (lr3_t *ctx)
 Delete All Network Table function.
 
LR3_RETVAL lr3_tx_message (lr3_t *ctx, lr3_tx_msg_t *tx_msg)
 Radio frame Transmission function.
 
LR3_RETVAL lr3_get_pairing_request (lr3_t *ctx)
 Get Pairing Request function.
 
LR3_RETVAL lr3_get_activation_status (lr3_t *ctx, uint8_t *data_out)
 Get Activation Status function.
 
LR3_RETVAL lr3_check_link_request (lr3_t *ctx, uint8_t power, uint8_t message_num, uint8_t message_th)
 Radio frame Transmission function.
 
LR3_RETVAL lr3_set_app_key (lr3_t *ctx, uint8_t *app_key)
 Set App Key function.
 

Detailed Description

This file contains API for LR 3 Click driver.