Getting data from NFC, LPC8N04 MCU

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Getting data from NFC, LPC8N04 MCU

Getting data from NFC, LPC8N04 MCU

Hello NFC Community,

 

This document focuses to the configuration of the LPC8N04 to be controlled by the data it receives though the NFC interface.

The document is based on the nfc_eeprom project of LPC8N04’s SDK.

pastedImage_1.png

It will basically be necessary to modify the code within while(1) loop as below.

 

Get the data from NFC and store it on d_Data buffer:

           

if (NDEFT2T_GetMessage(g_NdefInstance, g_Data, sizeof(g_Data))) {

 /* Save NDEF Data into EEPROM */

 //Chip_EEPROM_Write(LPC_EEPROM, 0, g_Data, sizeof(g_Data));

 }

Clear respective semaphore and Flag:

/** Clear Memory Write Semaphore */

 releaseMemSemaphore();

 /** Clear Write Flag */

 g_TargetWritten = 0;

 

Now that the information is in the g_Data buffer now you may proceed to verify the received data with the one expected to trigger a function e.g., to turn on/off a led.

 

if(g_Data[7] == 'A')

 {

 Led_Set(true);

 }

 else if(g_Data[7] == 'B')

 {

 Led_Set(false);

 }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

 

 

On the other side, it will only be necessary to approach the reader to the LPC8N04's antenna and the NDEFT2T_GetMessage(g_NdefInstance, g_Data, sizeof(g_Data)) function will get the data and store it on the g_data buffer mentioned above.

Happy development!

BR,

Ivan.

No ratings
Version history
Last update:
‎09-10-2020 02:34 AM
Updated by: