mbusrf4 2.0.0.0

Functions

void mbusrf4_cfg_setup (mbusrf4_cfg_t *cfg)
 Config Object Initialization function.
 
MBUSRF4_RETVAL mbusrf4_init (mbusrf4_t *ctx, mbusrf4_cfg_t *cfg)
 Initialization function.
 
void mbusrf4_generic_write (mbusrf4_t *ctx, char *data_buf, uint16_t len)
 Generic write function.
 
int32_t mbusrf4_generic_read (mbusrf4_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function.
 
uint8_t mbusrf4_get_state_rts (mbusrf4_t *ctx)
 Get Interrupt state of the RTS(INT) pin.
 
void mbusrf4_set_communication_mode (mbusrf4_t *ctx, uint8_t mode)
 Set communication SPI/UART.
 
void mbusrf4_send_command (mbusrf4_t *ctx, uint8_t command, uint8_t length, uint8_t *payload_buff)
 Send command - UART communication.
 
void mbusrf4_transmit_data (mbusrf4_t *ctx, uint8_t *tx_buf, uint8_t tx_len)
 
uint8_t mbusrf4_get_state_ind (mbusrf4_t *ctx)
 Get Interrupt state of the IND(AN) pin.
 

Detailed Description

Function Documentation

◆ mbusrf4_cfg_setup()

void mbusrf4_cfg_setup ( mbusrf4_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ mbusrf4_generic_read()

int32_t mbusrf4_generic_read ( mbusrf4_t * ctx,
char * data_buf,
uint16_t max_len )

Generic read function.

Parameters
ctxClick object.
data_bufData buffer for read data.
max_lenThe maximum length of data that can be read.
Returns
Number of reads data.

@description This function read data of maximum length.

◆ mbusrf4_generic_write()

void mbusrf4_generic_write ( mbusrf4_t * ctx,
char * data_buf,
uint16_t len )

Generic write function.

Parameters
ctxClick object.
data_bufData buffer for sends.
lenNumber of bytes for sends.

@description This function write specific number of data.

◆ mbusrf4_get_state_ind()

uint8_t mbusrf4_get_state_ind ( mbusrf4_t * ctx)

Get Interrupt state of the IND(AN) pin.

Parameters
ctxClick object.

@description This function gets state of IND pin.

◆ mbusrf4_get_state_rts()

uint8_t mbusrf4_get_state_rts ( mbusrf4_t * ctx)

Get Interrupt state of the RTS(INT) pin.

Parameters
ctxClick object.

@description This function get state of RTS pin.

Parameters
ctxClick object.

@description This function gets state of RTS pin.

◆ mbusrf4_init()

MBUSRF4_RETVAL mbusrf4_init ( mbusrf4_t * ctx,
mbusrf4_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ mbusrf4_send_command()

void mbusrf4_send_command ( mbusrf4_t * ctx,
uint8_t command,
uint8_t length,
uint8_t * payload_buff )

Send command - UART communication.

Parameters
ctxClick object.
commandCommand
lengthNumber of bytes in Payload buffer
payload_buffPointer to a payload buffer

@description Header and checksum are calculated and sent at the beginning (header) and finally (checksum)

◆ mbusrf4_set_communication_mode()

void mbusrf4_set_communication_mode ( mbusrf4_t * ctx,
uint8_t mode )

Set communication SPI/UART.

Parameters
ctxClick object.
modeSelect communication SPI/UART (UART is default)

@description This function sets desired mode.

◆ mbusrf4_transmit_data()

void mbusrf4_transmit_data ( mbusrf4_t * ctx,
uint8_t * tx_buf,
uint8_t tx_len )