lr  2.0.0.0
Functions
Public function

Functions

void lr_cfg_setup (lr_cfg_t *cfg)
 Config Object Initialization function. More...
 
LR_RETVAL lr_init (lr_t *ctx, lr_cfg_t *cfg)
 Initialization function. More...
 
void lr_default_cfg (lr_t *ctx, bool cb_default, void(*response_p)(char *response))
 Click Default Configuration function. More...
 
void lr_generic_write (lr_t *ctx, char *data_buf, uint16_t len)
 Generic write function. More...
 
int32_t lr_generic_read (lr_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function. More...
 
void lr_cmd (lr_t *ctx, char *cmd, char *response)
 Send command function. More...
 
uint8_t lr_mac_tx (lr_t *ctx, lr_mac_t *mac)
 Function for writing mac parameters. More...
 
uint8_t lr_join (lr_t *ctx, char *join_mode, char *response)
 Function for setting join mode. More...
 
uint8_t lr_rx (lr_t *ctx, char *window_size, char *response)
 Main receiver function
More...
 
uint8_t lr_tx (lr_t *ctx, char *buffer)
 Main tnanceiver function. More...
 
void lr_rx_isr (lr_t *ctx, char rx_input)
 Receiver. More...
 
void lr_tick_isr (lr_t *ctx)
 Timer. More...
 
void lr_tick_conf (lr_t *ctx, uint32_t timer_limit)
 Timer Configuration. More...
 
void lr_isr_process (lr_t *ctx)
 Main Process. More...
 
void lr_put_char (lr_t *ctx, char data_in)
 Function for write char. More...
 

Detailed Description

Function Documentation

◆ lr_cfg_setup()

void lr_cfg_setup ( lr_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.

◆ lr_cmd()

void lr_cmd ( lr_t ctx,
char *  cmd,
char *  response 
)

Send command function.

Parameters
ctxClick object.
comdWell formated command string.
responseResponse data.

@description Used by parser to send data inside the software buffer. User can send valid commands with this function but command string and data should be well formated.

◆ lr_default_cfg()

void lr_default_cfg ( lr_t ctx,
bool  cb_default,
void(*)(char *response)  response_p 
)

Click Default Configuration function.

Parameters
ctxClick object.
cb_defaultCallback Default
-pointer to user made callback function that receiving response as argument and will be executed one every response

@description This function executes default configuration for LR click.

Note
 
Module restart issues the response from the module with current firmware version.
Must be called before any other operation. Resets the module and sets 
all flags and parameters to default value.

◆ lr_generic_read()

int32_t lr_generic_read ( lr_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 maximum length of data.

◆ lr_generic_write()

void lr_generic_write ( lr_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 bytes

◆ lr_init()

LR_RETVAL lr_init ( lr_t ctx,
lr_cfg_t cfg 
)

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

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

◆ lr_isr_process()

void lr_isr_process ( lr_t ctx)

Main Process.

Parameters
ctxClick object.

@description Function must be placed inside the infinite while loop.

◆ lr_join()

uint8_t lr_join ( lr_t ctx,
char *  join_mode,
char *  response 
)

Function for setting join mode.

Parameters
ctxClick object.
join_modeJoin mode.
responseResponse.

@description This function sets join mode.

◆ lr_mac_tx()

uint8_t lr_mac_tx ( lr_t ctx,
lr_mac_t mac 
)

Function for writing mac parameters.

Parameters
ctxClick object.
macMac structure object

@description This function write mac parameters to tx_buffer.

◆ lr_put_char()

void lr_put_char ( lr_t ctx,
char  data_in 
)

Function for write char.

Parameters
ctxClick object.
data_inChar to be written

@description Function write char into ctx objects.

◆ lr_rx()

uint8_t lr_rx ( lr_t ctx,
char *  window_size,
char *  response 
)

Main receiver function

Parameters
ctxClick object.
window_sizeWindow size.
responseResponse.

@description This function is used for receive message.

◆ lr_rx_isr()

void lr_rx_isr ( lr_t ctx,
char  rx_input 
)

Receiver.

Parameters
ctxClick object.
rx_inputData from uart receive register

@description Must be placed inside the user made uart interrupt routine.

◆ lr_tick_conf()

void lr_tick_conf ( lr_t ctx,
uint32_t  timer_limit 
)

Timer Configuration.

Parameters
ctxClick object.
timer_limit( 0 ~ 4294967296 )

@description Used to configure host watchdog. When timeout occurs response with no data will be parsed. If user provide 0 as argument timer will be turned off. By default after the initialization timer limit is turned on and set to TIMER_EXPIRED

Note
  
RN2483 have it's own watchdog timer, this one should be longer than watchdog and can be 
used to restart the module in case of when library does not receiving responses from the 
module.

◆ lr_tick_isr()

void lr_tick_isr ( lr_t ctx)

Timer.

Parameters
ctxClick object.

@description Used for host timing. Should be placed inside the previously made interrupt routine made by user that occurs on every one milisecond.

◆ lr_tx()

uint8_t lr_tx ( lr_t ctx,
char *  buffer 
)

Main tnanceiver function.

Parameters
ctxClick object.
bufferBuffer to be send.

@description This function is used for sending message.