nfctag5 2.0.0.0
main.c File Reference

NFCTag5 Click example. More...

#include "board.h"
#include "log.h"
#include "nfctag5.h"

Macros

#define URI_DATA   "www.mikroe.com/nfc-tag-5-click"
 
#define TEXT_MESSAGE_ADDRESS   0x0100
 
#define TEXT_MESSAGE   "MikroE - NFC Tag 5 click"
 

Functions

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

Detailed Description

NFCTag5 Click example.

Description

This example demonstrates the use of NFC Tag 5 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 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.

Note
Trying to write/read in RF mode (for example, processing NDEF URI record with a smartphone) while writing to memory over I2C is in progress can interrupt and block the I2C communication.
Author
Stefan Filipovic

Macro Definition Documentation

◆ TEXT_MESSAGE

#define TEXT_MESSAGE   "MikroE - NFC Tag 5 click"

Text message content that will be stored to memory

◆ TEXT_MESSAGE_ADDRESS

#define TEXT_MESSAGE_ADDRESS   0x0100

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

◆ URI_DATA

#define URI_DATA   "www.mikroe.com/nfc-tag-5-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 )