lr15 2.2.1
Loading...
Searching...
No Matches
main.c File Reference

LR 15 Click Example. More...

#include "board.h"
#include "log.h"
#include "lr15.h"
#include "conversions.h"
#include "generic_pointer.h"

Macros

#define DEMO_TEXT_MESSAGE   "MIKROE - LR 15 Click board"
#define APP_BUFFER_SIZE   600
#define PROCESS_BUFFER_SIZE   200
#define RF_CFG_DEFAULT   "868, SF7, 125, 8, 8, 14, ON, OFF, OFF"
#define RX_MODE_TIMEOUT   30000

Enumerations

enum  lr15_app_state_t { LR15_POWER_UP = 1 , LR15_CONFIG_EXAMPLE , LR15_EXAMPLE }
 Example states. More...

Functions

void application_init (void)
void application_task (void)
int main (void)

Detailed Description

LR 15 Click Example.

Description

This example demonstrates the use of LR 15 Click board by showing the communication between two Click boards configured in TEST mode.

The demo application is composed of two sections :

Application Init

Initializes the driver and logger.

Application Task

Application task is split in few stages:

  • LR15_POWER_UP: Powers up the device, performs a device factory reset and reads system information.
  • LR15_CONFIG_EXAMPLE: Configures device for the LoRa P2P network mode.
  • LR15_EXAMPLE: Performs a LoRa P2P test example by exchanging messages with another LR 15 Click board.

Additional Function

  • static void lr15_clear_app_buf ( void )
  • static void lr15_log_app_buf ( void )
  • static err_t lr15_process ( lr15_t *ctx )
  • static err_t lr15_read_response ( lr15_t *ctx, uint8_t *rsp, uint32_t timeout )
  • static err_t lr15_power_up ( lr15_t *ctx )
  • static err_t lr15_config_example ( lr15_t *ctx )
  • static err_t lr15_example ( lr15_t *ctx )
Author
Stefan Filipovic

Macro Definition Documentation

◆ APP_BUFFER_SIZE

#define APP_BUFFER_SIZE   600

◆ DEMO_TEXT_MESSAGE

#define DEMO_TEXT_MESSAGE   "MIKROE - LR 15 Click board"

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   200

◆ RF_CFG_DEFAULT

#define RF_CFG_DEFAULT   "868, SF7, 125, 8, 8, 14, ON, OFF, OFF"

◆ RX_MODE_TIMEOUT

#define RX_MODE_TIMEOUT   30000

Enumeration Type Documentation

◆ lr15_app_state_t

Example states.

Predefined enum values for application example state.

Enumerator
LR15_POWER_UP 
LR15_CONFIG_EXAMPLE 
LR15_EXAMPLE 

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

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 )

◆ main()

int main ( void )