X_NUCLEO_NFC02A1 library for M24LR

Dependencies:   ST_INTERFACES

Dependents:   HelloWorld_NFC02A1_mbedOS HelloWorld_NFC02A1laatste HelloWorld_NFC02A1

Fork of X_NUCLEO_NFC02A1 by ST Expansion SW Team

X-NUCLEO-NFC02A1 Dynamic NFC Tag Expansion Board Firmware Package

Introduction

This firmware package includes Components Device Drivers, Board Support Package and example applications for STMicroelectronics X-NUCLEO-NFC02A1 Dynamic NFC Tag Expansion Board based on M24LR.

Firmware Library

Class X_NUCLEO_NFC02A1 is intended to represent the Dynamic NFC Tag Expansion Board with the same name.
It provides an API to access to the M24LR component and to the three onboard LEDs.
It is intentionally implemented as a singleton because only one X_NUCLEO_NFC02A1 at a time might be deployed in a HW component stack.
The library also provides an implementation of the NDEF library API for M24LR, providing an simple way to read/write NDEF formatted messages from/to the M24LR dynamic NFC tag.

Example application

Hello World is a simple application to program and read an URI from the NFC tag.

Revision:
4:0287f5476fe0
Parent:
0:71bff5ad0a49
Child:
5:900640bf1cff
--- a/m24lr/NDefNfcTagM24LR.h	Thu Sep 29 05:48:12 2016 +0000
+++ b/m24lr/NDefNfcTagM24LR.h	Fri Sep 30 11:46:18 2016 +0000
@@ -44,7 +44,7 @@
 #include "NDefNfcTag.h"
 #include "Nfc.h"
 
-#define NFC_OK                      0
+
 #define NDEF_OK                     0
 #define NDEF_ERROR                  1
 #define NDEF_ERROR_MEMORY_TAG       2
@@ -93,14 +93,11 @@
 
         virtual bool readByte(const uint16_t byteOffset, const uint16_t byteLength,
                 uint8_t *buffer, byteOperationCallback_t callback,CallbackStatus_t *callbackStatus);
-                bool NDefWriteByte(const uint8_t *buffer, uint16_t length,uint16_t offset);
-
-
-        
+                
 
     private:
-        bool NDefReadByte(const uint16_t byteOffset, const uint16_t length,
-             uint8_t *buffer);
+        uint16_t NDefWriteByte(const uint8_t *buffer, uint16_t length,uint16_t offset);
+        uint16_t NDefReadByte(const uint16_t byteOffset, const uint16_t length, uint8_t *buffer);
 
         uint16_t ReadData( uint16_t Offset , uint16_t DataSize , uint8_t* pData );
         uint16_t WriteData( uint16_t Offset , uint32_t DataSize , uint8_t *pData );