ntag5link 2.0.0.0
main.c File Reference

NTAG5Link Click example. More...

#include "board.h"
#include "log.h"
#include "ntag5link.h"

Macros

#define URI_DATA   "www.mikroe.com/ntag-5-link-click"
 
#define TEXT_MESSAGE_ADDRESS   0x0040
 
#define TEXT_MESSAGE   "MikroE - NTAG 5 Link click"
 

Functions

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

Detailed Description

NTAG5Link Click example.

Description

This example demonstrates the use of NTAG 5 Link click board by programming the specified NDEF URI record to the memory, and showing the memory read/write feature.

The demo application is composed of two sections :

Application Init

Initializes the driver and logger and performs the click default configuration which enables the device and formats its user memory. After that it programs the specified NDEF URI record to the memory.

Application Task

Writes a desired number of data bytes to the memory and verifies that it is written correctly by reading from the same memory location and displaying the memory content on the USB UART approximately every 5 seconds.

Author
Stefan Filipovic

Macro Definition Documentation

◆ TEXT_MESSAGE

#define TEXT_MESSAGE   "MikroE - NTAG 5 Link click"

Text message content that will be stored to memory

◆ TEXT_MESSAGE_ADDRESS

#define TEXT_MESSAGE_ADDRESS   0x0040

Starting block address to where the text message will be stored Must be > ( NTAG5LINK_NDEF_MESSAGE_START_ADDRESS + sizeof ( URI_DATA ) / NTAG5LINK_MEMORY_BLOCK_SIZE + 3 ) to avoid overwriting NDEF URI record.

◆ URI_DATA

#define URI_DATA   "www.mikroe.com/ntag-5-link-click"

URL to store to memory as NDEF URI record

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 )