ST / X_NUCLEO_NFC01A1

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:
24:9f98eafa2d39
Parent:
23:d07138541feb
Child:
25:caa16fd0e50b
--- a/m24sr/m24sr_class.h	Mon Feb 01 15:32:40 2016 +0000
+++ b/m24sr/m24sr_class.h	Tue Feb 02 16:04:24 2016 +0000
@@ -81,7 +81,7 @@
 	 * @brief Constructor.
 	 * @param address I2C address of the component.
 	 * @param I2C     I2C device to be used for communication.
-	 * @param eventCallback Function that will be called when the gpo pin status change.
+	 * @param eventCallback Function that will be called when the gpo pin status changes.
 	 * @param GPOPinName Pin used as GPIO.
 	 * @param RFDISPinName Pin used to disable the RF function.
 	 */
@@ -423,12 +423,12 @@
 	}M24SR_command_t;
 
 	/**
-	 * User parameter used invoke the command, it is used for remember the data between a
-	 * command and a rensponse
+ 	 * User parameter used to invoke a command,
+ 	 * it is used to provide the data back with the response
 	 */
 	typedef struct{
 		uint8_t *data; //!< data
-		uint16_t length; //!< number of byte in the data array
+		uint16_t length; //!< number of bytes in the data array
 		uint16_t offset; //!< offset parameter used in the read/write command
 	}M24SR_command_data_t;
 
@@ -436,27 +436,27 @@
 	 * Communication mode used by this device
 	 */
 	typedef enum{
-		SYNC,//!< SYNC wait the command response before return
-		ASYNC//!< ASYNC use a callback for notify the end of a command
+		SYNC,//!< SYNC wait the command response before returning
+		ASYNC//!< ASYNC use a callback to notify the end of a command
 	}M24SR_communication_t;
 
 	/**
-	 * Type of communication that we are using
+	 * Type of communication being used
 	 */
 	M24SR_communication_t mCommunicationType;
 
 	/**
-	 * The class is wait the answer of this command
+	 * Last pending command
 	 */
 	M24SR_command_t mLastCommandSend;
 
 	/**
-	 * Parameter used for invoke the last command
+	 * Parameter used to invoke the last command
 	 */
 	M24SR_command_data_t mLastCommandData;
 
 	/**
-	 * Interrupt object fired when the gpo status change
+	 * Interrupt object fired when the gpo status changes
 	 */
 	InterruptIn mGpoEventInterrupt;
 private:
@@ -464,30 +464,30 @@
 
 	/**
 	 * Object with the callback used to send a ManageGPO command.
-	 * This class is equivalent to call the method:
+	 * This class is equivalent to calling the methods:
 	 * <ul>
 	 *   <li> SelectedApplication </li>
 	 *   <li> SelectSystemfile </li>
 	 *   <li> ReadBinar: read the old value </li>
-	 *   <li> onVerifyed </li>
+	 *   <li> onVerified </li>
 	 *   <li> onUpdatedBinary: write the new value</li>
 	 * </ul>
 	 */
-	class ManageGPOCallback : public Nfc::Callback{
+	class ManageGPOCallback : public Nfc::Callbacks{
 
 	public:
 
 		/**
-		 * Create the MamageGpoCallback command chain.
-		 * @param parent component where run the command.
+		 * Build the chain of callbacks.
+		 * @param parent Parent component to run the command on.
 		 */
 		ManageGPOCallback(M24SR &parent):mParent(parent),
 				mGpoConfig(HIGH_IMPEDANCE),mReadGpoConfig(0),mI2CGpo(true){}
 
 
 		/**
-		 * Command parameters
-		 * @param i2cGpo true if you want change the i2c gpo, false for change the rf gpo.
+		 * Command parameters.
+		 * @param i2cGpo true to change the i2c gpo, false for the rf gpo.
 		 * @param newConfig new gpo function.
 		 */
 		void setNewGpoConfig(bool i2cGpo,NFC_GPO_MGMT newConfig){
@@ -517,7 +517,7 @@
 				onFinishCommand(nfc,status);
 		}
 
-		virtual void onVerifyed(Nfc *nfc,NFC_StatusTypeDef status,PasswordType_t, const uint8_t*){
+		virtual void onVerified(Nfc *nfc,NFC_StatusTypeDef status,PasswordType_t, const uint8_t*){
 			if(status!=NFC_SUCCESS)
 				return onFinishCommand(nfc,status);
 
@@ -545,9 +545,9 @@
 	private:
 
 		/**
-		 * Remove the private callback and call the user callback
-		 * @param nfc Object where the command complete
-		 * @param status Command status
+		 * Remove the private callback and call the user callback.
+		 * @param nfc Object where the command was send.
+		 * @param status Command status.
 		 */
 		void onFinishCommand(Nfc *nfc,NFC_StatusTypeDef status){
 			mParent.mComponentCallback=NULL;
@@ -559,7 +559,7 @@
 		}//onFinishCommand
 
 		/**
-		 * component where run the command
+		 * Component where send the commands
 		 */
 		M24SR &mParent;
 
@@ -567,12 +567,12 @@
 		NFC_GPO_MGMT mGpoConfig;
 
 		/**
-		 * variable where store the read gpo configuration
+		 * variable where storeing the read gpo configuration
 		 */
 		uint8_t mReadGpoConfig;
 
 		/**
-		 * true for change the i2c gpo, false for change the rf gpo
+		 * true to change the i2c gpo, false to change the rf gpo
 		 */
 		bool mI2CGpo;
 
@@ -586,25 +586,25 @@
 
 	/**
 	 * Object with the callback used to read the component ID
-	 * This class is equivalent to call the method:
+	 * This class is equivalent to calling the methods:
 	 * <ul>
 	 *   <li> SelectedApplication </li>
 	 *   <li> SelectSystemfile </li>
 	 *   <li> ReadBinary </li>
 	 * </ul>
 	 */
-	class ReadIDCallback : public Nfc::Callback{
+	class ReadIDCallback : public Nfc::Callbacks{
 
 	public:
 
 		/**
-		 * build the chain of callback
-		 * @param parent object where send the command
+		 * Build the chain of callbacks.
+		 * @param parent object where to send the command to.
 		 */
 		ReadIDCallback(M24SR &parent):mParent(parent),mIdPtr(NULL){}
 
 		/**
-		 * set the location where write the result
+		 * Set the variable containing the result
 		 * @param idPtr
 		 */
 		void readIdOn(uint8_t *idPtr){
@@ -634,9 +634,9 @@
 	private:
 
 		/**
-		 * remove the private callback and call the user onReadId function
-		 * @param nfc object where the command run
-		 * @param status command status
+		 * Remove the private callback and call the user onReadId function.
+		 * @param nfc Object where the command was send.
+		 * @param status Command status.
 		 */
 		void onFinishCommand(Nfc *nfc,NFC_StatusTypeDef status){
 			mParent.mComponentCallback=NULL;
@@ -646,16 +646,17 @@
 		M24SR& mParent;
 
 		/**
-		 * location where write the read id
+		 * pointer to read id
 		 */
 		uint8_t *mIdPtr;
 	};
 
-	friend class ReadIDCallback;
+
 	/**
 	 * Object containing the callback chain needed to read the component id
 	 */
 	ReadIDCallback mReadIDCallback;
+	friend class ReadIDCallback;
 
 	/**
 	 * Convert a generic enum to the value used by the M24SR chip.