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:
3:fa914de381ae
Parent:
1:15d4a123ef6b
Child:
6:96389fb79676
--- a/X_NUCLEO_NFC01A1.h	Mon Dec 21 10:17:35 2015 +0000
+++ b/X_NUCLEO_NFC01A1.h	Mon Dec 21 13:00:48 2015 +0000
@@ -56,12 +56,6 @@
 	 */
 	static const uint8_t M24SR_ADDR;
 
-	static const PinName GPO_PIN;
-	static const PinName RF_DISABLE_PIN;
-	static const PinName LED1_PIN;
-	static const PinName LED2_PIN;
-	static const PinName LED3_PIN;
-
 	/**
 	 * constructor
 	 * @param devI2C i2c channel used for communicate with the board
@@ -71,15 +65,27 @@
 	 * @param led2Name pin for control the led1 status
 	 * @param led3Name pin for control the led1 status
 	 */
-	X_NUCLEO_NFC01A1(I2C &devI2C) :
-			mM24SR(M24SR_ADDR, devI2C, GPO_PIN, RF_DISABLE_PIN), mNfcLed1(
-					LED1_PIN), mNfcLed2(LED2_PIN), mNfcLed3(LED3_PIN) {	}
+	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),
+				mNfcLed1(led1Name),mNfcLed2(led2Name),mNfcLed3(led3Name){}
 
 public:
-	const static PinName DEFAULT_SDA_PIN;
-	const static PinName DEFAULT_SDL_PIN;
+	static const PinName DEFAULT_SDA_PIN;
+	static const PinName DEFAULT_SDL_PIN;
+	static const PinName DEFAULT_GPO_PIN;
+	static const PinName DEFAULT_RF_DISABLE_PIN;
+	static const PinName DEFAULT_LED1_PIN;
+	static const PinName DEFAULT_LED2_PIN;
+	static const PinName DEFAULT_LED3_PIN;
 
-	static X_NUCLEO_NFC01A1* Instance(I2C &devI2C);
+	static X_NUCLEO_NFC01A1* Instance(I2C &devI2C,
+			const PinName &gpoName = DEFAULT_GPO_PIN,
+ 			const PinName &RFDisableName = DEFAULT_RF_DISABLE_PIN,
+ 			const PinName &led1Name = DEFAULT_LED1_PIN,
+ 			const PinName &led2Name = DEFAULT_LED2_PIN,
+ 			const PinName &led3Name = DEFAULT_LED3_PIN);
 
 	/**
 	 * @return board led1