lr5 2.0.0.0
main.c File Reference

LR5 Click example. More...

#include "board.h"
#include "log.h"
#include "lr5.h"
#include "string.h"

Macros

#define PROCESS_COUNTER   10
 
#define PROCESS_RX_BUFFER_SIZE   300
 

Functions

void make_response (uint8_t *rsp_code, uint8_t *rsp_length, uint8_t *rsp_data)
 
void log_response ()
 
void wait_response ()
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

lr5_cmd_t response
 

Detailed Description

LR5 Click example.

Description

This example reads and processes data from LR 5 clicks.

The demo application is composed of two sections :

Application Init

Initializes UART interface and UART interrupt, and performs a module reset commands.

Application Task

Performs a group of commands to get FW version, the serial number provided by Mipot, DevEUI, the session status, the activation status and the parameters for the selected channel. Also sets the next transmission data rate to the desired value. The responses from the Mipot module to the host will be sent to the uart terminal.

Additional Function

  • lr5_process - The general process of collecting data the module sends.
  • make_response - Stores data from the module to the response structure.
  • log_response - Sends the received response from the module to the uart terminal.
  • wait_response - Waits until response from the module is ready and then calls the response logging function, or writes the error message on the uart terminal.
Author
MikroE Team

Macro Definition Documentation

◆ PROCESS_COUNTER

#define PROCESS_COUNTER   10

◆ PROCESS_RX_BUFFER_SIZE

#define PROCESS_RX_BUFFER_SIZE   300

Function Documentation

◆ application_init()

void application_init ( void )

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ log_response()

void log_response ( )

◆ main()

int main ( void )

◆ make_response()

void make_response ( uint8_t * rsp_code,
uint8_t * rsp_length,
uint8_t * rsp_data )

◆ wait_response()

void wait_response ( )

Variable Documentation

◆ response

lr5_cmd_t response