Firmware library for the X-NUCLEO-NFC01A1 Dynamic NFC Tag board.

Dependencies:   M24SR

Dependents:   NFC M2M_2016_STM32 MyongjiElec_capstone1 IDW01M1_Cloud_IBM ... more

Fork of X_NUCLEO_NFC01A1 by ST Expansion SW Team

X-NUCLEO-NFC01A1 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-NFC01A1 Dynamic NFC Tag Expansion Board based on M24SR.

Firmware Library

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

Example applications

1. Hello World
2. Asynchronous Hello World

Revision:
19:0b65a5813059
Parent:
9:9f2e2e68d695
Child:
20:aad5727cb8c6
--- a/X_NUCLEO_NFC01A1.h	Fri Jan 22 09:04:51 2016 +0000
+++ b/X_NUCLEO_NFC01A1.h	Thu Jan 28 14:01:18 2016 +0000
@@ -49,6 +49,8 @@
  */
 class X_NUCLEO_NFC01A1 {
 
+public:
+
 private:
 	/**
 	 * Ponter to the singleton instance, NULL if not allocated.
@@ -60,18 +62,20 @@
 	static const uint8_t M24SR_ADDR;
 
 	/**
-	 * constructor
+	 * Constructor
 	 * @param devI2C I2C channel used to communicate with the board.
+	 * @param eventCallback Function that will be called when the gpo pin status change.
 	 * @param gpoName Name of the gpio pin of the M24SR chip.
 	 * @param RFDisableName Pin that controls the rf antenna status.
 	 * @param led1Name Pin to control the led1 status.
 	 * @param led2Name Pin to control the led1 status.
 	 * @param led3Name Pin to control the led1 status.
 	 */
-	X_NUCLEO_NFC01A1(I2C &devI2C, const PinName &gpoName,
- 			const PinName &RFDisableName, const PinName &led1Name,
- 			const PinName &led2Name, const PinName &led3Name):
- 				mM24SR(M24SR_ADDR,devI2C,gpoName,RFDisableName),
+	X_NUCLEO_NFC01A1(I2C &devI2C,Nfc::gpoEventCallback eventCallback,
+			const PinName &gpoName,	const PinName &RFDisableName,
+			const PinName &led1Name, const PinName &led2Name,
+			const PinName &led3Name):
+ 				mM24SR(M24SR_ADDR,devI2C,eventCallback,gpoName,RFDisableName),
 				mNfcLed1(led1Name),mNfcLed2(led2Name),mNfcLed3(led3Name){}
 
 public:
@@ -79,13 +83,14 @@
 	static const PinName DEFAULT_SDL_PIN; //!< Default pin used for the M24SR SDL signal.
 	static const PinName DEFAULT_GPO_PIN; //!< Default pin used for the M24SR GPO signal.
 	static const PinName DEFAULT_RF_DISABLE_PIN; //!< Default pin used for M24SR RF_DISABLE signal.
-	static const PinName DEFAULT_LED1_PIN; //!< Default pin to controll the led 1.
-	static const PinName DEFAULT_LED2_PIN; //!< Default pin to controll the led 2.
-	static const PinName DEFAULT_LED3_PIN; //!< Default pin to controll the led 3.
+	static const PinName DEFAULT_LED1_PIN; //!< Default pin to control the led 1.
+	static const PinName DEFAULT_LED2_PIN; //!< Default pin to control the led 2.
+	static const PinName DEFAULT_LED3_PIN; //!< Default pin to control the led 3.
 
     /**
 	 * Create or return an instance of X_NUCLEO_NFC01A1.
 	 * @param devI2C I2C channel used to communicate with the board.
+	 * @param eventCallback Function that will be called when the gpo pin status change.
 	 * @param gpoName Name of the gpio pin of the M24SR chip.
 	 * @param RFDisableName Pin that controls the rf antenna status.
 	 * @param led1Name Pin to control the led1 status.
@@ -93,6 +98,7 @@
 	 * @param led3Name Pin to control the led1 status.
 	 */
 	static X_NUCLEO_NFC01A1* Instance(I2C &devI2C,
+			Nfc::gpoEventCallback eventCallback,
 			const PinName &gpoName = DEFAULT_GPO_PIN,
  			const PinName &RFDisableName = DEFAULT_RF_DISABLE_PIN,
  			const PinName &led1Name = DEFAULT_LED1_PIN,