lr14  2.1.0.0
Macros | Enumerations | Functions
main.c File Reference

LR 14 Click Example. More...

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

Macros

#define DEMO_TEXT_MESSAGE   "MIKROE - LR 14 click board"
 
#define APP_BUFFER_SIZE   600
 
#define PROCESS_BUFFER_SIZE   200
 
#define READ_RESPONSE_TIMEOUT_MS   120000
 
#define NETWORK_WORK_MODE_P2P_LORA   "0"
 
#define P2P_MODE_FREQUENCY   "868000000"
 
#define P2P_MODE_SPREADING_FACTOR   "12"
 
#define P2P_MODE_BANDWIDTH   "0"
 
#define P2P_MODE_CODE_RATE   "0"
 
#define P2P_MODE_PREAMBLE_LENGTH   "8"
 
#define P2P_MODE_TX_POWER   "22"
 
#define P2P_RX_MODE_TIMEOUT   "30000"
 

Enumerations

enum  lr14_app_state_t { LR14_POWER_UP = 1, LR14_CONFIG_EXAMPLE, LR14_EXAMPLE }
 Example states. More...
 

Functions

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

Detailed Description

LR 14 Click Example.

Description

This example demonstrates the use of LR 14 click board by showing the communication between two click boards configured in P2P network 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:

Additional Function

Author
Stefan Filipovic

Macro Definition Documentation

◆ APP_BUFFER_SIZE

#define APP_BUFFER_SIZE   600

◆ DEMO_TEXT_MESSAGE

#define DEMO_TEXT_MESSAGE   "MIKROE - LR 14 click board"

◆ NETWORK_WORK_MODE_P2P_LORA

#define NETWORK_WORK_MODE_P2P_LORA   "0"

◆ P2P_MODE_BANDWIDTH

#define P2P_MODE_BANDWIDTH   "0"

◆ P2P_MODE_CODE_RATE

#define P2P_MODE_CODE_RATE   "0"

◆ P2P_MODE_FREQUENCY

#define P2P_MODE_FREQUENCY   "868000000"

◆ P2P_MODE_PREAMBLE_LENGTH

#define P2P_MODE_PREAMBLE_LENGTH   "8"

◆ P2P_MODE_SPREADING_FACTOR

#define P2P_MODE_SPREADING_FACTOR   "12"

◆ P2P_MODE_TX_POWER

#define P2P_MODE_TX_POWER   "22"

◆ P2P_RX_MODE_TIMEOUT

#define P2P_RX_MODE_TIMEOUT   "30000"

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   200

◆ READ_RESPONSE_TIMEOUT_MS

#define READ_RESPONSE_TIMEOUT_MS   120000

Enumeration Type Documentation

◆ lr14_app_state_t

Example states.

Predefined enum values for application example state.

Enumerator
LR14_POWER_UP 
LR14_CONFIG_EXAMPLE 
LR14_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  )