This application provides a set of demos with X-NUCLEO-NFC01A1 expansion board.
Dependencies: NDefLib X_NUCLEO_NFC01A1 mbed
Fork of X-MBED-NFC1 by
This application provides a set of demos with X-NUCLEO-NFC01A1 expansion board.
The available demos are:
- SAMPLE_WRITE_URL: write a tag with the ST home page URL
- SAMPLE_COUNT_CLICK: create a custom tag to count and report the user button clicks.
- SAMPLE_WRITE_AND_CHANGE_ALL: write a tag with all the supported records and update the tag contents when the user button is pressed.
- SAMPLE_LOCK_TAG_CONTENT: use the M24SR component API to set the NFC tag as read-only.
To enable the different demos comment/uncomment the SAMPLE_* macros provided in main.cpp .
Interfaces/Nfc_class.h@0:674813bd5ec9, 2015-11-19 (annotated)
- Committer:
- giovannivisentini
- Date:
- Thu Nov 19 08:50:18 2015 +0000
- Revision:
- 0:674813bd5ec9
- Child:
- 1:6d202b62ed68
first commit,
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| giovannivisentini | 0:674813bd5ec9 | 1 | /** |
| giovannivisentini | 0:674813bd5ec9 | 2 | ****************************************************************************** |
| giovannivisentini | 0:674813bd5ec9 | 3 | * @file Nfc_class.h |
| giovannivisentini | 0:674813bd5ec9 | 4 | * @author AST / EST |
| giovannivisentini | 0:674813bd5ec9 | 5 | * @version V0.0.1 |
| giovannivisentini | 0:674813bd5ec9 | 6 | * @date 13-April-2015 |
| giovannivisentini | 0:674813bd5ec9 | 7 | * @brief This file contains the abstract class describing the interface of a |
| giovannivisentini | 0:674813bd5ec9 | 8 | * nfc component. |
| giovannivisentini | 0:674813bd5ec9 | 9 | ****************************************************************************** |
| giovannivisentini | 0:674813bd5ec9 | 10 | * @attention |
| giovannivisentini | 0:674813bd5ec9 | 11 | * |
| giovannivisentini | 0:674813bd5ec9 | 12 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
| giovannivisentini | 0:674813bd5ec9 | 13 | * |
| giovannivisentini | 0:674813bd5ec9 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
| giovannivisentini | 0:674813bd5ec9 | 15 | * are permitted provided that the following conditions are met: |
| giovannivisentini | 0:674813bd5ec9 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
| giovannivisentini | 0:674813bd5ec9 | 17 | * this list of conditions and the following disclaimer. |
| giovannivisentini | 0:674813bd5ec9 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
| giovannivisentini | 0:674813bd5ec9 | 19 | * this list of conditions and the following disclaimer in the documentation |
| giovannivisentini | 0:674813bd5ec9 | 20 | * and/or other materials provided with the distribution. |
| giovannivisentini | 0:674813bd5ec9 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
| giovannivisentini | 0:674813bd5ec9 | 22 | * may be used to endorse or promote products derived from this software |
| giovannivisentini | 0:674813bd5ec9 | 23 | * without specific prior written permission. |
| giovannivisentini | 0:674813bd5ec9 | 24 | * |
| giovannivisentini | 0:674813bd5ec9 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| giovannivisentini | 0:674813bd5ec9 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| giovannivisentini | 0:674813bd5ec9 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| giovannivisentini | 0:674813bd5ec9 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
| giovannivisentini | 0:674813bd5ec9 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
| giovannivisentini | 0:674813bd5ec9 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
| giovannivisentini | 0:674813bd5ec9 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| giovannivisentini | 0:674813bd5ec9 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| giovannivisentini | 0:674813bd5ec9 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| giovannivisentini | 0:674813bd5ec9 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| giovannivisentini | 0:674813bd5ec9 | 35 | * |
| giovannivisentini | 0:674813bd5ec9 | 36 | ****************************************************************************** |
| giovannivisentini | 0:674813bd5ec9 | 37 | */ |
| giovannivisentini | 0:674813bd5ec9 | 38 | |
| giovannivisentini | 0:674813bd5ec9 | 39 | |
| giovannivisentini | 0:674813bd5ec9 | 40 | /* Generated with Stm32CubeTOO -----------------------------------------------*/ |
| giovannivisentini | 0:674813bd5ec9 | 41 | |
| giovannivisentini | 0:674813bd5ec9 | 42 | |
| giovannivisentini | 0:674813bd5ec9 | 43 | /* Revision ------------------------------------------------------------------*/ |
| giovannivisentini | 0:674813bd5ec9 | 44 | /* |
| giovannivisentini | 0:674813bd5ec9 | 45 | Repository: http://svn.x-nucleodev.codex.cro.st.com/svnroot/X-NucleoDev |
| giovannivisentini | 0:674813bd5ec9 | 46 | Branch/Trunk/Tag: trunk |
| giovannivisentini | 0:674813bd5ec9 | 47 | Based on: X-CUBE-MEMS1/trunk/Drivers/BSP/Components/Common/nfc.h |
| giovannivisentini | 0:674813bd5ec9 | 48 | Revision: 385 |
| giovannivisentini | 0:674813bd5ec9 | 49 | */ |
| giovannivisentini | 0:674813bd5ec9 | 50 | |
| giovannivisentini | 0:674813bd5ec9 | 51 | |
| giovannivisentini | 0:674813bd5ec9 | 52 | /* Define to prevent from recursive inclusion --------------------------------*/ |
| giovannivisentini | 0:674813bd5ec9 | 53 | |
| giovannivisentini | 0:674813bd5ec9 | 54 | #ifndef __NFC_CLASS_H |
| giovannivisentini | 0:674813bd5ec9 | 55 | #define __NFC_CLASS_H |
| giovannivisentini | 0:674813bd5ec9 | 56 | |
| giovannivisentini | 0:674813bd5ec9 | 57 | |
| giovannivisentini | 0:674813bd5ec9 | 58 | /* Includes ------------------------------------------------------------------*/ |
| giovannivisentini | 0:674813bd5ec9 | 59 | |
| giovannivisentini | 0:674813bd5ec9 | 60 | #include "Component_class.h" |
| giovannivisentini | 0:674813bd5ec9 | 61 | |
| giovannivisentini | 0:674813bd5ec9 | 62 | |
| giovannivisentini | 0:674813bd5ec9 | 63 | /* Classes ------------------------------------------------------------------*/ |
| giovannivisentini | 0:674813bd5ec9 | 64 | |
| giovannivisentini | 0:674813bd5ec9 | 65 | /** An abstract class for Nfc components. |
| giovannivisentini | 0:674813bd5ec9 | 66 | */ |
| giovannivisentini | 0:674813bd5ec9 | 67 | class Nfc : public Component |
| giovannivisentini | 0:674813bd5ec9 | 68 | { |
| giovannivisentini | 0:674813bd5ec9 | 69 | public: |
| giovannivisentini | 0:674813bd5ec9 | 70 | /* ACTION 1 --------------------------------------------------------------* |
| giovannivisentini | 0:674813bd5ec9 | 71 | * Declare here the interface's methods. * |
| giovannivisentini | 0:674813bd5ec9 | 72 | * They should be: * |
| giovannivisentini | 0:674813bd5ec9 | 73 | * + Methods with the same name of the C component's virtual table * |
| giovannivisentini | 0:674813bd5ec9 | 74 | * (and extended virtual table, if any)'s functions, provided that * |
| giovannivisentini | 0:674813bd5ec9 | 75 | * the component's driver implements them (i.e.: the corresponding * |
| giovannivisentini | 0:674813bd5ec9 | 76 | * pointer to function is not "0"). * |
| giovannivisentini | 0:674813bd5ec9 | 77 | * * |
| giovannivisentini | 0:674813bd5ec9 | 78 | * Example: * |
| giovannivisentini | 0:674813bd5ec9 | 79 | * virtual int GetValue(float *pfData) = 0; * |
| giovannivisentini | 0:674813bd5ec9 | 80 | *------------------------------------------------------------------------*/ |
| giovannivisentini | 0:674813bd5ec9 | 81 | virtual NFC_StatusTypeDef GetSession(void) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 82 | virtual NFC_StatusTypeDef KillSession(void) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 83 | virtual NFC_StatusTypeDef Deselect(void) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 84 | virtual NFC_StatusTypeDef SelectApplication(void) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 85 | virtual NFC_StatusTypeDef SelectCCfile(void) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 86 | virtual NFC_StatusTypeDef SelectNDEFfile(uint16_t NDEFfileId) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 87 | virtual NFC_StatusTypeDef SelectSystemfile(void) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 88 | virtual NFC_StatusTypeDef ReadBinary(uint16_t Offset, uint8_t NbByteToRead, uint8_t *pBufferRead) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 89 | virtual NFC_StatusTypeDef UpdateBinary(uint16_t Offset, uint8_t NbByteToWrite, uint8_t *pDataToWrite) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 90 | virtual NFC_StatusTypeDef Verify(uint16_t uPwdId, uint8_t NbPwdByte, uint8_t *pPwd) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 91 | virtual NFC_StatusTypeDef ChangeReferenceData(uint16_t uPwdId, uint8_t *pPwd) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 92 | virtual NFC_StatusTypeDef EnableVerificationRequirement(uint16_t uReadOrWrite) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 93 | virtual NFC_StatusTypeDef DisableVerificationRequirement(uint16_t uReadOrWrite) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 94 | virtual NFC_StatusTypeDef STReadBinary(uint16_t Offset, uint8_t NbByteToRead, uint8_t *pBufferRead) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 95 | virtual NFC_StatusTypeDef EnablePermanentState(uint16_t uReadOrWrite) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 96 | virtual NFC_StatusTypeDef DisablePermanentState(uint16_t uReadOrWrite) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 97 | virtual NFC_StatusTypeDef StateControl(uint8_t uSetOrReset) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 98 | virtual NFC_StatusTypeDef ManageI2CGPO(uint8_t GPO_I2Cconfig) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 99 | virtual NFC_StatusTypeDef ManageRFGPO(uint8_t GPO_RFconfig) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 100 | virtual NFC_StatusTypeDef RFConfig(uint8_t OnOffChoice) = 0; |
| giovannivisentini | 0:674813bd5ec9 | 101 | |
| giovannivisentini | 0:674813bd5ec9 | 102 | virtual ~Nfc(){}; |
| giovannivisentini | 0:674813bd5ec9 | 103 | }; |
| giovannivisentini | 0:674813bd5ec9 | 104 | |
| giovannivisentini | 0:674813bd5ec9 | 105 | #endif /* __NFC_CLASS_H */ |
| giovannivisentini | 0:674813bd5ec9 | 106 | |
| giovannivisentini | 0:674813bd5ec9 | 107 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
| giovannivisentini | 0:674813bd5ec9 | 108 |
