lr
2.0.0.0
|
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... | |
void lr_cfg_setup | ( | lr_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void lr_cmd | ( | lr_t * | ctx, |
char * | cmd, | ||
char * | response | ||
) |
Send command function.
ctx | Click object. |
comd | Well formated command string. |
response | Response 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.
void lr_default_cfg | ( | lr_t * | ctx, |
bool | cb_default, | ||
void(*)(char *response) | response_p | ||
) |
Click Default Configuration function.
ctx | Click object. |
cb_default | Callback 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.
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.
int32_t lr_generic_read | ( | lr_t * | ctx, |
char * | data_buf, | ||
uint16_t | max_len | ||
) |
Generic read function.
ctx | Click object. |
data_buf | Data buffer for read data. |
max_len | The maximum length of data that can be read. |
@description This function read maximum length of data.
void lr_generic_write | ( | lr_t * | ctx, |
char * | data_buf, | ||
uint16_t | len | ||
) |
Generic write function.
ctx | Click object. |
data_buf | Data buffer for sends. |
len | Number of bytes for sends. |
@description This function write specific number of bytes
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void lr_isr_process | ( | lr_t * | ctx | ) |
Main Process.
ctx | Click object. |
@description Function must be placed inside the infinite while loop.
uint8_t lr_join | ( | lr_t * | ctx, |
char * | join_mode, | ||
char * | response | ||
) |
Function for setting join mode.
ctx | Click object. |
join_mode | Join mode. |
response | Response. |
@description This function sets join mode.
Function for writing mac parameters.
ctx | Click object. |
mac | Mac structure object |
@description This function write mac parameters to tx_buffer.
void lr_put_char | ( | lr_t * | ctx, |
char | data_in | ||
) |
Function for write char.
ctx | Click object. |
data_in | Char to be written |
@description Function write char into ctx objects.
uint8_t lr_rx | ( | lr_t * | ctx, |
char * | window_size, | ||
char * | response | ||
) |
Main receiver function
ctx | Click object. |
window_size | Window size. |
response | Response. |
@description This function is used for receive message.
void lr_rx_isr | ( | lr_t * | ctx, |
char | rx_input | ||
) |
Receiver.
ctx | Click object. |
rx_input | Data from uart receive register |
@description Must be placed inside the user made uart interrupt routine.
void lr_tick_conf | ( | lr_t * | ctx, |
uint32_t | timer_limit | ||
) |
Timer Configuration.
ctx | Click 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
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.
void lr_tick_isr | ( | lr_t * | ctx | ) |
Timer.
ctx | Click object. |
@description Used for host timing. Should be placed inside the previously made interrupt routine made by user that occurs on every one milisecond.
uint8_t lr_tx | ( | lr_t * | ctx, |
char * | buffer | ||
) |
Main tnanceiver function.
ctx | Click object. |
buffer | Buffer to be send. |
@description This function is used for sending message.