rn4870 2.0.0.0
rn4870.h File Reference

This file contains API for RN4870 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  rn4870_t
 Click ctx object definition. More...
 
struct  rn4870_cfg_t
 Click configuration structure definition. More...
 

Macros

#define RN4870_MAP_MIKROBUS(cfg, mikrobus)
 
#define RN4870_RETVAL   uint8_t
 
#define RN4870_OK   0x00
 
#define RN4870_INIT_ERROR   0xFF
 
#define RN4870_DEVICETYPE_MASTER   0x02
 
#define RN4870_DEVICETYPE_SLAVE   0x03
 
#define RN4870_ID_MASTER   0x35
 
#define RN4870_ID_SLAVE   0x32
 
#define RN4870_MTYPE_MSG   'M'
 
#define RN4870_DTYPE_STRING   0x5331
 
#define DRV_RX_BUFFER_SIZE   500
 

Functions

void rn4870_cfg_setup (rn4870_cfg_t *cfg)
 Config Object Initialization function.
 
RN4870_RETVAL rn4870_init (rn4870_t *ctx, rn4870_cfg_t *cfg)
 Initialization function.
 
void rn4870_reset (rn4870_t *ctx)
 Hardware reset function.
 
void rn4870_generic_write (rn4870_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t rn4870_generic_read (rn4870_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
uint8_t rn4870_int_get (rn4870_t *ctx)
 Get interrupt state function.
 
void rn4870_rst_set (rn4870_t *ctx, uint8_t pin_state)
 Set states of RST pin to desired state.
 
void rn4870_cs_set (rn4870_t *ctx, uint8_t pin_state)
 Set states of CS pin to desired state.
 
void rn4870_uart_write (rn4870_t *ctx, uint8_t *wr_buf)
 UART write function.
 
void rn4870_initialize (rn4870_t *ctx, char *p_addr)
 Initialization RN4870 module.
 
void rn4870_connect (rn4870_t *ctx, char *p_addr)
 Connecting to slave device.
 
void rn4870_send (rn4870_t *ctx, uint8_t msg_type, uint16_t data_type, uint8_t id, uint8_t *payload)
 Send message function.
 
void rn4870_disconnect (rn4870_t *ctx)
 Disconnecting from slave device.
 
void rn4870_receive (rn4870_t *ctx, char tmp)
 Receiving character function.
 
uint8_t rn4870_read (rn4870_t *ctx, uint8_t *process_buffer)
 Reading received message.
 

Detailed Description

This file contains API for RN4870 Click driver.