rn4870 2.0.0.0
main.c File Reference

Rn4870 Click example. More...

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

Macros

#define PROCESS_COUNTER   10
 
#define PROCESS_RX_BUFFER_SIZE   500
 
#define PROCESS_PARSER_BUFFER_SIZE   500
 
#define DEMO_APP_TRANSMITER
 

Functions

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

Variables

uint8_t RN4870_ADDR_MASTER [13] = {'D', 'F', '0', '0', '0', '0', '0', '6', '8', '7', '9', '0'}
 
uint8_t RN4870_ADDR_SLAVE [13] = {'D', 'F', '1', '1', '1', '1', '1', '6', '8', '7', '9', '0'}
 
uint8_t message_payload [17] = {'M', 'i', 'k', 'r', 'o', 'E', 'l', 'e', 'k', 't', 'r', 'o', 'n', 'i', 'k', 'a'}
 
uint8_t dev_type
 
uint8_t receive_buffer [255]
 
uint8_t msg_flag = 0
 
char * ptr
 

Detailed Description

Rn4870 Click example.

Description

This example reads and processes data from RN4870 clicks.

The demo application is composed of two sections :

Application Init

Initializes UART driver. Initializes device and parser.

Application Task

If 'MASTER' - connects to 'SLAVE', sends message and disconnects. If 'SLAVE' - waits for connect request and message from 'MASTER' and LOGs received message.

Additional Function

  • rn4870_process ( ) - The general process of collecting presponce that sends a module.
Author
MikroE Team

Macro Definition Documentation

◆ DEMO_APP_TRANSMITER

#define DEMO_APP_TRANSMITER

◆ PROCESS_COUNTER

#define PROCESS_COUNTER   10

◆ PROCESS_PARSER_BUFFER_SIZE

#define PROCESS_PARSER_BUFFER_SIZE   500

◆ PROCESS_RX_BUFFER_SIZE

#define PROCESS_RX_BUFFER_SIZE   500

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 )

◆ main()

int main ( void )

Variable Documentation

◆ dev_type

uint8_t dev_type

◆ message_payload

uint8_t message_payload[17] = {'M', 'i', 'k', 'r', 'o', 'E', 'l', 'e', 'k', 't', 'r', 'o', 'n', 'i', 'k', 'a'}

◆ msg_flag

uint8_t msg_flag = 0

◆ ptr

char* ptr

◆ receive_buffer

uint8_t receive_buffer[255]

◆ RN4870_ADDR_MASTER

uint8_t RN4870_ADDR_MASTER[13] = {'D', 'F', '0', '0', '0', '0', '0', '6', '8', '7', '9', '0'}

◆ RN4870_ADDR_SLAVE

uint8_t RN4870_ADDR_SLAVE[13] = {'D', 'F', '1', '1', '1', '1', '1', '6', '8', '7', '9', '0'}