lr 2.1.0.0
|
API for configuring and manipulating LR Click driver. More...
Topics | |
LR Device Settings | |
Settings for registers of LR Click driver. | |
LR MikroBUS Map | |
MikroBUS pin mapping of LR Click driver. | |
Functions | |
void | lr_cfg_setup (lr_cfg_t *cfg) |
LR configuration object setup function. | |
err_t | lr_init (lr_t *ctx, lr_cfg_t *cfg) |
LR initialization function. | |
void | lr_default_cfg (lr_t *ctx, bool cb_default, void(*response_p)(char *response)) |
LR default configuration function. | |
void | lr_generic_write (lr_t *ctx, char *data_buf, uint16_t len) |
LR data writing function. | |
int32_t | lr_generic_read (lr_t *ctx, char *data_buf, uint16_t max_len) |
LR data reading function. | |
void | lr_cmd (lr_t *ctx, char *cmd, char *response) |
Send command function. | |
uint8_t | lr_mac_tx (lr_t *ctx, lr_mac_t *mac) |
Function for writing mac parameters. | |
uint8_t | lr_join (lr_t *ctx, char *join_mode, char *response) |
Function for setting join mode. | |
uint8_t | lr_rx (lr_t *ctx, char *window_size, char *response) |
Main receiver function | |
uint8_t | lr_tx (lr_t *ctx, char *buffer) |
Main tnanceiver function. | |
void | lr_rx_isr (lr_t *ctx, char rx_input) |
Receiver. | |
void | lr_tick_isr (lr_t *ctx) |
Timer. | |
void | lr_tick_conf (lr_t *ctx, uint32_t timer_limit) |
Timer Configuration. | |
void | lr_isr_process (lr_t *ctx) |
Main Process. | |
void | lr_put_char (lr_t *ctx, char data_in) |
Function for write char. | |
API for configuring and manipulating LR Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void lr_cfg_setup | ( | lr_cfg_t * | cfg | ) |
LR configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See lr_cfg_t object definition for detailed explanation. |
void lr_cmd | ( | lr_t * | ctx, |
char * | cmd, | ||
char * | response ) |
Send command function.
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.
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
[in] | comd | : Well formated command string. |
[out] | response | : Response data. |
void lr_default_cfg | ( | lr_t * | ctx, |
bool | cb_default, | ||
void(*)(char *response) | response_p ) |
LR default configuration function.
This function executes a default configuration of LR click board.
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
0
- Success, -1
- Error.int32_t lr_generic_read | ( | lr_t * | ctx, |
char * | data_buf, | ||
uint16_t | max_len ) |
LR data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
[out] | data_buf | : Output read data. |
[in] | max_len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. void lr_generic_write | ( | lr_t * | ctx, |
char * | data_buf, | ||
uint16_t | len ) |
LR data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
[in] | data_buf | : Data buffer for sending. |
[in] | len | : Number of bytes for sending. |
LR initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See lr_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void lr_isr_process | ( | lr_t * | ctx | ) |
Main Process.
Function must be placed inside the infinite while loop.
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
uint8_t lr_join | ( | lr_t * | ctx, |
char * | join_mode, | ||
char * | response ) |
Function for setting join mode.
This function sets join mode.
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
[in] | join_mode | : Join mode. |
[out] | response | : Response. |
Function for writing mac parameters.
This function write mac parameters to tx_buffer.
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
[in] | mac | : Mac structure object |
void lr_put_char | ( | lr_t * | ctx, |
char | data_in ) |
Function for write char.
Function write char into ctx objects.
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
[in] | data_in | : Char to be written |
uint8_t lr_rx | ( | lr_t * | ctx, |
char * | window_size, | ||
char * | response ) |
Main receiver function
This function is used for receive message.
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
[in] | window_size | : Window size. |
[out] | response | : Response. |
void lr_rx_isr | ( | lr_t * | ctx, |
char | rx_input ) |
Receiver.
Must be placed inside the user made uart interrupt routine.
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
[in] | rx_input | : Data from uart receive register |
void lr_tick_conf | ( | lr_t * | ctx, |
uint32_t | timer_limit ) |
Timer Configuration.
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
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |
[in] | timer_limit | : ( 0 ~ 4294967296 ) |
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.
Used for host timing. Should be placed inside the previously made interrupt routine made by user that occurs on every one milisecond.
[in] | ctx | : Click context object. See lr_t object definition for detailed explanation. |