nplc 2.1.0.0
main.c File Reference

N-PLC Click Example. More...

#include "board.h"
#include "log.h"
#include "nplc.h"

Macros

#define DEMO_TEXT_MESSAGE   "MikroE - N-PLC click board"
 
#define PROCESS_BUFFER_SIZE   200
 
#define RSP_TIMEOUT_MS   20000
 

Functions

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

Detailed Description

N-PLC Click Example.

Description

This example demonstrates the use of an N-PLC click boards by showing the communication between the two click boards configured as a receiver and transmitter.

The demo application is composed of two sections :

Application Init

Initializes the driver, resets the click board to default config, displays the firmware version and switches to data operation mode. After that displays the selected application mode and sends an initial message in case of transmitter mode.

Application Task

Reads all the received data and echoes them back to the transmitter. The received and echoed messages will be displayed on the USB UART.

Note
Once both devices are programmed, one as a receiver and the other as a transmitter, you will need to reset the transmitter board in order to start the communication by sending an initial message.
Author
Stefan Filipovic

Macro Definition Documentation

◆ DEMO_TEXT_MESSAGE

#define DEMO_TEXT_MESSAGE   "MikroE - N-PLC click board"

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   200

◆ RSP_TIMEOUT_MS

#define RSP_TIMEOUT_MS   20000

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 )