mbusrf4  2.0.0.0
Functions

Functions

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

Detailed Description

Function Documentation

◆ mbusrf4_cfg_setup()

void mbusrf4_cfg_setup ( mbusrf4_cfg_t cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

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.

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.

This function write specific number of data.

◆ mbusrf4_get_state_rts()

uint8_t mbusrf4_get_state_rts ( mbusrf4_t ctx)

Get Interrupt state of the RTS(INT) pin.

Get Interrupt state of the IND(AN) pin.

Parameters
ctxClick object.

This function get state of RTS pin.

Parameters
ctxClick object.

This function gets state of IND pin.

◆ mbusrf4_init()

MBUSRF4_RETVAL mbusrf4_init ( mbusrf4_t ctx,
mbusrf4_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

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)

This function sets desired mode.