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

Files at this revision

API Documentation at this revision

Comitter:
giovannivisentini
Date:
Wed Feb 03 08:52:54 2016 +0000
Parent:
24:9f98eafa2d39
Child:
26:2090378b0b51
Commit message:
update docs

Changed in this revision

Interfaces/Nfc_class.h Show annotated file Show diff for this revision Revisions of this file
m24sr/m24sr_class.cpp Show annotated file Show diff for this revision Revisions of this file
m24sr/m24sr_class.h Show annotated file Show diff for this revision Revisions of this file
--- a/Interfaces/Nfc_class.h	Tue Feb 02 16:04:24 2016 +0000
+++ b/Interfaces/Nfc_class.h	Wed Feb 03 08:52:54 2016 +0000
@@ -89,111 +89,166 @@
 	class Callbacks{
 	public:
 
-		/** called when GetSession or KillSession finish */
+		/** called when GetSession or ForceGetSession completes
+		 * @see Nfc#GetSession
+		 * @see Nfc#ForceGetSession */
 		virtual void onSessionOpen(Nfc *nfc,NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
 
+		/** called when Deselect completes
+		 * @see Nfc#Deselect */
 		virtual void onDeselect(Nfc *nfc,NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
 
+		/** called when SelectedApplication completes
+		 * @see Nfc#SelectedApplication */
 		virtual void onSelectedApplication(Nfc *nfc,NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
-
+		
+		/** called when SelectedCCFile completes
+		 * @see Nfc#SelectedCCFile */
 		virtual void onSelectedCCFile(Nfc *nfc,NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
 
+		/** called when SelectedNDEFFile completes
+		 * @see Nfc#SelectedNDEFFile */
 		virtual void onSelectedNDEFFile(Nfc *nfc,NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
 
+		/** called when SelectedSystemFile completes
+		 * @see Nfc#SelectedSystemFile */
 		virtual void onSelectedSystemFile(Nfc *nfc,NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
 
+		/** called when ReadBinary or STReadBinary completes
+		 * @see Nfc#ReadBinary
+		 * @see Nfc#STReadBinary */
 		virtual void onReadByte(Nfc *nfc,NFC_StatusTypeDef status,
 				uint16_t offset,uint8_t *readByte, uint16_t nReadByte){
 			(void)nfc; (void)status;(void)offset; (void)readByte; (void)nReadByte;
 		}
 
+		/** called when UpdatedBinary completes
+		 * @see Nfc#UpdatedBinary */
 		virtual void onUpdatedBinary(Nfc *nfc,NFC_StatusTypeDef status,uint16_t offset,
 				uint8_t *writeByte,uint16_t nWriteByte){
 			(void)nfc; (void)status; (void)writeByte; (void)nWriteByte; (void)offset;
 		}
 
+		/** called when Verify completes
+		 * @see Nfc#Verify */	
 		virtual void onVerified(Nfc *nfc,NFC_StatusTypeDef status,PasswordType_t uPwdId,
 				const uint8_t *pwd){
 			(void)nfc; (void)status;(void)uPwdId;(void)pwd;
 		}
 
+		/** called when ManageI2CGPO completes
+		 * @see Nfc#ManageI2CGPO */
 		virtual void onManageI2CGPO(Nfc *nfc,NFC_StatusTypeDef status,NFC_GPO_MGMT newStatus){
 			(void)nfc; (void)status;(void)newStatus;
 		}
 
+		/** called when ManageRFGPO completes
+		 * @see Nfc#ManageRFGPO */
 		virtual void onManageRFGPO(Nfc *nfc,NFC_StatusTypeDef status,NFC_GPO_MGMT newStatus){
 			(void)nfc; (void)status;(void)newStatus;
 		}
 
+		/** called when ChangeReferenceData completes
+		 * @see Nfc#ChangeReferenceData */
 		virtual void onChangeReferenceData(Nfc *nfc ,NFC_StatusTypeDef status,PasswordType_t type,
 				uint8_t *data){
 			(void)nfc; (void)status;(void)type;(void)data;
 		}
 
+		/** called when EnableVerificationRequirement completes
+		 * @see Nfc#EnableVerificationRequirement */	
 		virtual void onEnableVerificationRequirement(Nfc *nfc ,NFC_StatusTypeDef status,PasswordType_t type){
 			(void)nfc; (void)status;(void)type;
 		}
-
+		
+		/** called when DisableVerificationRequirement completes
+		 * @see Nfc#DisableVerificationRequirement */	
 		virtual void onDisableVerificationRequirement(Nfc *nfc , NFC_StatusTypeDef status,PasswordType_t type){
 			(void)nfc; (void)status;(void)type;
 		}
 
+		/** called when EnablePermanentState completes
+		 * @see Nfc#EnablePermanentState */	
 		virtual void onEnablePermanentState(Nfc *nfc, NFC_StatusTypeDef status, PasswordType_t type){
 			(void)nfc; (void)status;(void)type;
 		}
 
+		/** called when DisablePermanentState completes
+		 * @see Nfc#DisablePermanentState */	
 		virtual void onDisablePermanentState(Nfc *nfc, NFC_StatusTypeDef status, PasswordType_t type){
 			(void)nfc; (void)status;(void)type;
 		}
 
+		/** called when ReadId completes
+		 * @see Nfc#ReadId */
 		virtual void onReadId(Nfc *nfc, NFC_StatusTypeDef status, uint8_t *id){
 					(void)nfc; (void)status;(void)id;
 		}
 
+		/** called when EnableReadPassword completes
+		 * @see Nfc#EnableReadPassword */
 		virtual void onEnableReadPassword(Nfc *nfc, NFC_StatusTypeDef status,const uint8_t *newPwd){
 			(void)nfc; (void)status;(void)newPwd;
 		}
 
+		/** called when EnableWritePassword completes
+		 * @see Nfc#EnableWritePassword */
 		virtual void onEnableWritePassword(Nfc *nfc, NFC_StatusTypeDef status,const uint8_t *newPwd){
 			(void)nfc; (void)status;(void)newPwd;
 		}
 
+		/** called when DisableReadPassword completes
+		 * @see Nfc#DisableReadPassword */
 		virtual void onDisableReadPassword(Nfc *nfc, NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
 
+		/** called when DisableWritePassword completes
+		 * @see Nfc#DisableWritePassword */
 		virtual void onDisableWritePassword(Nfc *nfc, NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
 
+		/** called when DisableAllPassword completes
+		 * @see Nfc#DisableAllPassword */
 		virtual void onDisableAllPassword(Nfc *nfc, NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
 
+
+		/** called when EnableReadOnly completes
+		 * @see Nfc#EnableReadOnly */
 		virtual void onEnableReadOnly(Nfc *nfc,NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
 
+		/** called when EnableWriteOnly completes
+		 * @see Nfc#EnableWriteOnly */
 		virtual void onEnableWriteOnly(Nfc *nfc,NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
 
+
+		/** called when DisableReadOnly completes
+		 * @see Nfc#DisableReadOnly */
 		virtual void onDisableReadOnly(Nfc *nfc,NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
 
+		/** called when DisableWriteOnly completes
+		 * @see Nfc#DisableWriteOnly */
 		virtual void onDisableWriteOnly(Nfc *nfc,NFC_StatusTypeDef status){
 			(void)nfc; (void)status;
 		}
@@ -555,7 +610,6 @@
 
 			/**
 			 * Build the chain of callbacks.
-			 * @param parent object where send the command
 			 */
 			ChangePasswordRequestStatusCallback():
 				mNewPwd(NULL),mType(I2CPwd),mEnable(false){}
@@ -605,7 +659,7 @@
 
 			/**
 			 * Remove the private callbacks and call the user callback.
-			 * @param nfc Object where the command is run.
+			 * @param nfc Object triggering the command.
 			 * @param status Command status.
 			 */
 			void onFinishCommand(Nfc *nfc,NFC_StatusTypeDef status){
@@ -662,7 +716,6 @@
 
 				/**
 				 * Build the chain of callbacks.
-				 * @param parent object where to send the command
 				 */
 				RemoveAllPasswordCallback():mI2CPwd(NULL){}
 
@@ -708,7 +761,7 @@
 
 				/**
 				 * Remove the private callback and call the onDisableAllPassword callback.
-				 * @param nfc Object where the command is run.
+				 * @param nfc Object triggering the command.
 				 * @param status Command status.
 				 */
 				void onFinishCommand(Nfc *nfc,NFC_StatusTypeDef status){
@@ -751,7 +804,6 @@
 
 				/**
 				 * Build the chain of callbacks.
-				 * @param parent object where to send the command
 				 */
 				ChangeAccessStateCallback():mType(WRITE),mEnable(false){}
 
@@ -799,7 +851,7 @@
 
 				/**
 				 * Remove the private callback and call the user callback.
-				 * @param nfc Object where the command is run.
+				 * @param nfc Object triggering the command.
 				 * @param status Command status.
 				 */
 				void onFinishCommand(Nfc *nfc,NFC_StatusTypeDef status){
--- a/m24sr/m24sr_class.cpp	Tue Feb 02 16:04:24 2016 +0000
+++ b/m24sr/m24sr_class.cpp	Wed Feb 03 08:52:54 2016 +0000
@@ -73,8 +73,8 @@
 
 /** value returned by the NFC chip when a command is successfully completed */
 #define NFC_COMMAND_SUCCESS 0x9000
-//TODO remove errchek from the async function
-/** call the fCall funtion and check that the return status is NFC_SUCCESS,
+
+/** call the fCall function and check that the return status is NFC_SUCCESS,
  *  otherwise return the error status*/
 #define errchk(fCall) {\
 	const NFC_StatusTypeDef status = (fCall); \
@@ -149,7 +149,7 @@
 }
 
 /**
- * @brief 		This functions creates an I block command according to the structures CommandStructure and data->command.
+ * @brief 		This functions creates an I block command according to the structures CommandStructure and Command.
  * @param	 	Command : structure which contains the field of the different parameters
  * @param	 	CommandStructure : structure of the command 
  * @param	 	NbByte : number of bytes of the command
--- a/m24sr/m24sr_class.h	Tue Feb 02 16:04:24 2016 +0000
+++ b/m24sr/m24sr_class.h	Wed Feb 03 08:52:54 2016 +0000
@@ -546,7 +546,7 @@
 
 		/**
 		 * Remove the private callback and call the user callback.
-		 * @param nfc Object where the command was send.
+		 * @param nfc Object where the command was send to.
 		 * @param status Command status.
 		 */
 		void onFinishCommand(Nfc *nfc,NFC_StatusTypeDef status){