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
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
Diff: Interfaces/Nfc_class.h
- Revision:
- 25:caa16fd0e50b
- Parent:
- 24:9f98eafa2d39
--- 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){

X-NUCLEO-NFC01A1 Dynamic NFC Tag