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:
- 9:9f2e2e68d695
- Parent:
- 8:5e637c71cbb3
- Child:
- 12:d1f5eaa85deb
--- a/Interfaces/Nfc_class.h Mon Jan 11 13:06:23 2016 +0000
+++ b/Interfaces/Nfc_class.h Thu Jan 14 07:54:59 2016 +0000
@@ -2,7 +2,7 @@
******************************************************************************
* @file Nfc_class.h
* @author ST Central Labs
- * @version V0.0.1
+ * @version V1.0.0
* @date 13-April-2015
* @brief This file contains the abstract class describing the interface of a
* nfc component.
@@ -52,165 +52,167 @@
/* Classes ------------------------------------------------------------------*/
-/** An abstract class for Nfc components.
+/**
+ * An abstract class for Nfc components.
*/
class Nfc : public Component
{
public:
/**
- * possible password to set
+ * Possible password to set.
*/
typedef enum{
- ReadPwd=READ_PWD, //!< password to use before read the tag
- WritePwd=WRITE_PWD,//!< password to use before write the tag
- I2CPwd=I2C_PWD, //!< root password, used only thought nfc
+ ReadPwd=READ_PWD, //!< Password to use before read the tag
+ WritePwd=WRITE_PWD,//!< Password to use before write the tag
+ I2CPwd=I2C_PWD, //!< Root password, used only thought nfc
}PasswordType_t;
/**
- * open a i2c connection with the tag if an RF connection isn't already open
+ * Open a I2C connection with the tag if an RF connection isn't already open.
* @return operation status
*/
virtual NFC_StatusTypeDef GetSession(void) = 0;
+
/**
- * force to open an i2c connection , abort the RF connection
+ * Force to open an I2C connection , abort the RF connection.
* @return NFC_SUCCESS if the session is acquired
*/
virtual NFC_StatusTypeDef KillSession(void) = 0;
/**
- * close an i2c connection
+ * Close an I2C connection.
* @return NFC_SUCCESS if the session is release
*/
virtual NFC_StatusTypeDef Deselect(void) = 0;
/**
- * Select the application file
+ * Select the application file.
* @return NFC_SUCCESS if the application is selected
*/
virtual NFC_StatusTypeDef SelectApplication(void) = 0;
/**
- * select the CC file
- * @return NFC_SUCCESS if the cc file is selected
+ * Select the CC file.
+ * @return NFC_SUCCESS if the CC file is selected.
*/
virtual NFC_StatusTypeDef SelectCCfile(void) = 0;
/**
- * select the ndef file
- * @param NDEFfileId file id to open
+ * Select the ndef file.
+ * @param NDEFfileId File id to open.
* @return NFC_SUCCESS if the file is selected
*/
virtual NFC_StatusTypeDef SelectNDEFfile(uint16_t NDEFfileId) = 0;
/**
- * select the system file
+ * Select the system file.
* @return NFC_SUCCESS if the system file is selected
*/
virtual NFC_StatusTypeDef SelectSystemfile(void) = 0;
/**
- * read data from the tag
- * @param Offset offset where start to read
- * @param NbByteToRead number of byte to read
- * @param[out] pBufferRead buffer where store the read data
- * @return NFC_SUCCESS if no error happen
+ * Read data from the tag.
+ * @param Offset Read offset.
+ * @param NbByteToRead Number of bytes to read.
+ * @param[out] pBufferRead Buffer to store the read data into.
+ * @return NFC_SUCCESS if no errors
*/
virtual NFC_StatusTypeDef ReadBinary(uint16_t Offset, uint8_t NbByteToRead, uint8_t *pBufferRead) = 0;
/**
- * write data to the tag
- * @param Offset offset where start to write
- * @param NbByteToWrite number of byte to write
- * @param pDataToWrite buffer to write
- * @return NFC_SUCCESS if no error happen
+ * Write data to the tag.
+ * @param Offset Write offset.
+ * @param NbByteToWrite Number of bytes to write.
+ * @param pDataToWrite Buffer to write.
+ * @return NFC_SUCCESS if no errors
*/
virtual NFC_StatusTypeDef UpdateBinary(uint16_t Offset, uint8_t NbByteToWrite, uint8_t *pDataToWrite) = 0;
/**
- * check that the password is correct
- * @param uPwdId password type
- * @param NbPwdByte password size ( must be 0x10)
- * @param pPwd password buffer
- * @return NFC_SUCCESS if no error happen, and you have the permission to write/read
+ * Check that the password is correct.
+ * @param uPwdId Password type.
+ * @param NbPwdByte Password size ( must be 0x10).
+ * @param pPwd Password buffer.
+ * @return NFC_SUCCESS if no errors and write/read permission granted
*/
virtual NFC_StatusTypeDef Verify(PasswordType_t uPwdId, uint8_t NbPwdByte,const uint8_t *pPwd) = 0;
/**
- * replaces the read or write password related to the NDEF files previously selected.
- * @param uPwdId password to change
- * @param pPwd new password
- * @return NFC_SUCCESS if no error happen
+ * Replace the read or write password.
+ * @param uPwdId Password to change.
+ * @param pPwd New password.
+ * @return NFC_SUCCESS if no errors
*/
virtual NFC_StatusTypeDef ChangeReferenceData(PasswordType_t uPwdId,const uint8_t *pPwd) = 0;
/**
- * activates the protection by password of the NDEF file.
- * When this command is successful, the read or write access to the NDEF file is protected by a 128-bit password.
- * @param uReadOrWrite password to requeire
- * @return NFC_SUCCESS if no error happen
+ * Activate NDEF file password protection.
+ * When this command is successful, read or write access to the NDEF file is protected by a 128-bit password.
+ * @param uReadOrWrite Read or write password.
+ * @return NFC_SUCCESS if no errors
*/
virtual NFC_StatusTypeDef EnableVerificationRequirement(PasswordType_t uReadOrWrite) = 0;
/**
- * deactivates the protection by password of the NDEF file.
- * When this command is successful, the read or write access to the NDEF file is granted
- * without security requirements.
- * @param uReadOrWrite password to requeire
- * @return NFC_SUCCESS if no error happen
+ * Deactivate NDEF file password protection.
+ * When this command is successful, read or write access to the NDEF file is granted.
+ * with no security enforcement.
+ * @param uReadOrWrite Read or write password.
+ * @return NFC_SUCCESS if no errors
*/
virtual NFC_StatusTypeDef DisableVerificationRequirement(PasswordType_t uReadOrWrite) = 0;
/**
- * as {@link NFC#ReadBinary} but it doesn't give error if you read more byte than the ones
- * that are available
- * @param Offset offset where start to read
- * @param NbByteToRead number of byte to read
- * @param[out] pBufferRead buffer where store the read data
- * @return NFC_SUCCESS if no error happen
+ * Same as {@link NFC#ReadBinary}, however permitting to read more bytes than available.
+ * @param Offset read offset.
+ * @param NbByteToRead Number of bytes to read.
+ * @param[out] pBufferRead Buffer to store the read data into.
+ * @return NFC_SUCCESS if no errors
*/
virtual NFC_StatusTypeDef STReadBinary(uint16_t Offset, uint8_t NbByteToRead, uint8_t *pBufferRead) = 0;
/**
- * set the tag as read/write only and write it in the eeprom
- * @param uReadOrWrite ReadPwd if you need a write only, WritePwd if you need a read only
- * @return NFC_SUCCESS if no error happen
+ * Set the tag as read/write only, stored in the eeprom.
+ * @param uReadOrWrite ReadPwd if write only, WritePwd if read only.
+ * @return NFC_SUCCESS if no errors
*/
virtual NFC_StatusTypeDef EnablePermanentState(PasswordType_t uReadOrWrite) = 0;
+
/**
- * unset the tag as read/write only and write it in the eeprom
- * @param uReadOrWrite ReadPwd if you need a write only, WritePwd if you need a read only
- * @return NFC_SUCCESS if no error happen
- * @par you must be in i2csuper user state for call this function
+ * Unset the tag as read/write only, stored in the eeprom.
+ * @param uReadOrWrite ReadPwd if write only, WritePwd if read only.
+ * @return NFC_SUCCESS if no errors
+ * @par Caller must have I2Csuper user permissions to call this function.
*/
virtual NFC_StatusTypeDef DisablePermanentState(PasswordType_t uReadOrWrite) = 0;
/**
- * set the gpo output pin
- * @param uSetOrReset new pin status
- * @return NFC_SUCCESS if no error happen
+ * Set the gpo output pin.
+ * @param uSetOrReset New pin status.
+ * @return NFC_SUCCESS if no errors
*/
virtual NFC_StatusTypeDef StateControl(uint8_t uSetOrReset) = 0;
/**
- * @brief This function configure GPO purpose for I2C session
- * @param GPO_I2Cconfig: GPO configuration to set
- * @return NFC_SUCCESS if no error happen
+ * @brief This function configures GPO for I2C session.
+ * @param GPO_I2Cconfig GPO configuration to set.
+ * @return NFC_SUCCESS if no errors
*/
virtual NFC_StatusTypeDef ManageI2CGPO(uint8_t GPO_I2Cconfig) = 0;
/**
- * @brief This function configure GPO purpose for RF session
- * @param GPO_RFconfig: GPO configuration to set
- * @return NFC_SUCCESS if no error happen
+ * @brief This function configures GPO for RF session.
+ * @param GPO_RFconfig GPO configuration to set.
+ * @return NFC_SUCCESS if no errors
*/
virtual NFC_StatusTypeDef ManageRFGPO(uint8_t GPO_RFconfig) = 0;
/**
- * @brief This function enable or disable RF communication
- * @param OnOffChoice: GPO configuration to set
- * @return NFC_SUCCESS if no error happen
+ * @brief This function enables or disables the RF communication.
+ * @param OnOffChoice GPO configuration to set.
+ * @return NFC_SUCCESS if no errors
*/
virtual NFC_StatusTypeDef RFConfig(uint8_t OnOffChoice) = 0;

X-NUCLEO-NFC01A1 Dynamic NFC Tag