Fork of the GitHub
rfal_nfcv.h@0:75fc82583a41, 2019-11-14 (annotated)
- Committer:
- DiegoOstuni
- Date:
- Thu Nov 14 14:34:50 2019 +0000
- Revision:
- 0:75fc82583a41
Add files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DiegoOstuni | 0:75fc82583a41 | 1 | |
DiegoOstuni | 0:75fc82583a41 | 2 | /****************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 3 | * @attention |
DiegoOstuni | 0:75fc82583a41 | 4 | * |
DiegoOstuni | 0:75fc82583a41 | 5 | * <h2><center>© COPYRIGHT 2016 STMicroelectronics</center></h2> |
DiegoOstuni | 0:75fc82583a41 | 6 | * |
DiegoOstuni | 0:75fc82583a41 | 7 | * Licensed under ST MYLIBERTY SOFTWARE LICENSE AGREEMENT (the "License"); |
DiegoOstuni | 0:75fc82583a41 | 8 | * You may not use this file except in compliance with the License. |
DiegoOstuni | 0:75fc82583a41 | 9 | * You may obtain a copy of the License at: |
DiegoOstuni | 0:75fc82583a41 | 10 | * |
DiegoOstuni | 0:75fc82583a41 | 11 | * http://www.st.com/myliberty |
DiegoOstuni | 0:75fc82583a41 | 12 | * |
DiegoOstuni | 0:75fc82583a41 | 13 | * Unless required by applicable law or agreed to in writing, software |
DiegoOstuni | 0:75fc82583a41 | 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
DiegoOstuni | 0:75fc82583a41 | 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, |
DiegoOstuni | 0:75fc82583a41 | 16 | * AND SPECIFICALLY DISCLAIMING THE IMPLIED WARRANTIES OF MERCHANTABILITY, |
DiegoOstuni | 0:75fc82583a41 | 17 | * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. |
DiegoOstuni | 0:75fc82583a41 | 18 | * See the License for the specific language governing permissions and |
DiegoOstuni | 0:75fc82583a41 | 19 | * limitations under the License. |
DiegoOstuni | 0:75fc82583a41 | 20 | * |
DiegoOstuni | 0:75fc82583a41 | 21 | ******************************************************************************/ |
DiegoOstuni | 0:75fc82583a41 | 22 | |
DiegoOstuni | 0:75fc82583a41 | 23 | /* |
DiegoOstuni | 0:75fc82583a41 | 24 | * PROJECT: ST25R391x firmware |
DiegoOstuni | 0:75fc82583a41 | 25 | * $Revision: $ |
DiegoOstuni | 0:75fc82583a41 | 26 | * LANGUAGE: ISO C99 |
DiegoOstuni | 0:75fc82583a41 | 27 | */ |
DiegoOstuni | 0:75fc82583a41 | 28 | |
DiegoOstuni | 0:75fc82583a41 | 29 | /*! \file rfal_nfcv.h |
DiegoOstuni | 0:75fc82583a41 | 30 | * |
DiegoOstuni | 0:75fc82583a41 | 31 | * \author Gustavo Patricio |
DiegoOstuni | 0:75fc82583a41 | 32 | * |
DiegoOstuni | 0:75fc82583a41 | 33 | * \brief Implementation of NFC-V Poller (ISO15693) device |
DiegoOstuni | 0:75fc82583a41 | 34 | * |
DiegoOstuni | 0:75fc82583a41 | 35 | * The definitions and helpers methods provided by this module |
DiegoOstuni | 0:75fc82583a41 | 36 | * are aligned with NFC-V Digital 2.0 (Candidate) |
DiegoOstuni | 0:75fc82583a41 | 37 | * |
DiegoOstuni | 0:75fc82583a41 | 38 | * |
DiegoOstuni | 0:75fc82583a41 | 39 | * @addtogroup RFAL |
DiegoOstuni | 0:75fc82583a41 | 40 | * @{ |
DiegoOstuni | 0:75fc82583a41 | 41 | * |
DiegoOstuni | 0:75fc82583a41 | 42 | * @addtogroup RFAL-AL |
DiegoOstuni | 0:75fc82583a41 | 43 | * @brief RFAL Abstraction Layer |
DiegoOstuni | 0:75fc82583a41 | 44 | * @{ |
DiegoOstuni | 0:75fc82583a41 | 45 | * |
DiegoOstuni | 0:75fc82583a41 | 46 | * @addtogroup NFC-V |
DiegoOstuni | 0:75fc82583a41 | 47 | * @brief RFAL NFC-V Module |
DiegoOstuni | 0:75fc82583a41 | 48 | * @{ |
DiegoOstuni | 0:75fc82583a41 | 49 | * |
DiegoOstuni | 0:75fc82583a41 | 50 | */ |
DiegoOstuni | 0:75fc82583a41 | 51 | |
DiegoOstuni | 0:75fc82583a41 | 52 | #ifndef RFAL_NFCV_H |
DiegoOstuni | 0:75fc82583a41 | 53 | #define RFAL_NFCV_H |
DiegoOstuni | 0:75fc82583a41 | 54 | |
DiegoOstuni | 0:75fc82583a41 | 55 | /* |
DiegoOstuni | 0:75fc82583a41 | 56 | ****************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 57 | * INCLUDES |
DiegoOstuni | 0:75fc82583a41 | 58 | ****************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 59 | */ |
DiegoOstuni | 0:75fc82583a41 | 60 | #include "platform1.h" |
DiegoOstuni | 0:75fc82583a41 | 61 | #include "st_errno.h" |
DiegoOstuni | 0:75fc82583a41 | 62 | #include "rfal_rf.h" |
DiegoOstuni | 0:75fc82583a41 | 63 | |
DiegoOstuni | 0:75fc82583a41 | 64 | /* |
DiegoOstuni | 0:75fc82583a41 | 65 | ****************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 66 | * GLOBAL DEFINES |
DiegoOstuni | 0:75fc82583a41 | 67 | ****************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 68 | */ |
DiegoOstuni | 0:75fc82583a41 | 69 | #define RFAL_NFCV_UID_LEN 8 /*!< NFC-V UID length */ |
DiegoOstuni | 0:75fc82583a41 | 70 | #define RFAL_NFCV_MAX_BLOCK_LEN 32 /*!< Max Block size: can be of up to 256 bits ISO 15693 2000 5 */ |
DiegoOstuni | 0:75fc82583a41 | 71 | |
DiegoOstuni | 0:75fc82583a41 | 72 | |
DiegoOstuni | 0:75fc82583a41 | 73 | |
DiegoOstuni | 0:75fc82583a41 | 74 | /*! NFC-V RequestFlags ISO15693 2000 7.3.1 */ |
DiegoOstuni | 0:75fc82583a41 | 75 | enum{ |
DiegoOstuni | 0:75fc82583a41 | 76 | RFAL_NFCV_REQ_FLAG_DEFAULT = 0x02, /*!< Default Request Flags */ |
DiegoOstuni | 0:75fc82583a41 | 77 | RFAL_NFCV_REQ_FLAG_SUB_CARRIER = 0x01, /*!< Sub Carrier flag */ |
DiegoOstuni | 0:75fc82583a41 | 78 | RFAL_NFCV_REQ_FLAG_DATA_RATE = 0x02, /*!< Data Rate flag */ |
DiegoOstuni | 0:75fc82583a41 | 79 | RFAL_NFCV_REQ_FLAG_INVENTORY = 0x04, /*!< Inventory flag */ |
DiegoOstuni | 0:75fc82583a41 | 80 | RFAL_NFCV_REQ_FLAG_PROTOCOL_EXT = 0x08, /*!< Protocol Extension flag */ |
DiegoOstuni | 0:75fc82583a41 | 81 | RFAL_NFCV_REQ_FLAG_SELECT = 0x10, /*!< Select flag */ |
DiegoOstuni | 0:75fc82583a41 | 82 | RFAL_NFCV_REQ_FLAG_ADDRESS = 0x20, /*!< Address flag */ |
DiegoOstuni | 0:75fc82583a41 | 83 | RFAL_NFCV_REQ_FLAG_OPTION = 0x40, /*!< Option flag */ |
DiegoOstuni | 0:75fc82583a41 | 84 | RFAL_NFCV_REQ_FLAG_RFU = 0x80, /*!< RFU flag */ |
DiegoOstuni | 0:75fc82583a41 | 85 | RFAL_NFCV_REQ_FLAG_AFI = 0x10, /*!< AFI flag */ |
DiegoOstuni | 0:75fc82583a41 | 86 | RFAL_NFCV_REQ_FLAG_NB_SLOTS = 0x20, /*!< Number of Slots flag */ |
DiegoOstuni | 0:75fc82583a41 | 87 | }; |
DiegoOstuni | 0:75fc82583a41 | 88 | |
DiegoOstuni | 0:75fc82583a41 | 89 | /*! NFC-V Response Flags ISO15693 2000 7.4.1 */ |
DiegoOstuni | 0:75fc82583a41 | 90 | enum{ |
DiegoOstuni | 0:75fc82583a41 | 91 | RFAL_NFCV_RES_FLAG_ERROR = 0x01, /*!< Error flag */ |
DiegoOstuni | 0:75fc82583a41 | 92 | RFAL_NFCV_RES_FLAG_RFU1 = 0x02, /*!< RFU flag */ |
DiegoOstuni | 0:75fc82583a41 | 93 | RFAL_NFCV_RES_FLAG_RFU2 = 0x04, /*!< RFU flag */ |
DiegoOstuni | 0:75fc82583a41 | 94 | RFAL_NFCV_RES_FLAG_EXTENSION = 0x08, /*!< Extension flag */ |
DiegoOstuni | 0:75fc82583a41 | 95 | RFAL_NFCV_RES_FLAG_RFU3 = 0x10, /*!< RFU flag */ |
DiegoOstuni | 0:75fc82583a41 | 96 | RFAL_NFCV_RES_FLAG_RFU4 = 0x20, /*!< RFU flag */ |
DiegoOstuni | 0:75fc82583a41 | 97 | RFAL_NFCV_RES_FLAG_RFU5 = 0x40, /*!< RFU flag */ |
DiegoOstuni | 0:75fc82583a41 | 98 | RFAL_NFCV_RES_FLAG_RFU6 = 0x80, /*!< RFU flag */ |
DiegoOstuni | 0:75fc82583a41 | 99 | }; |
DiegoOstuni | 0:75fc82583a41 | 100 | |
DiegoOstuni | 0:75fc82583a41 | 101 | /*! NFC-V Error code ISO15693 2000 7.4.2 */ |
DiegoOstuni | 0:75fc82583a41 | 102 | enum{ |
DiegoOstuni | 0:75fc82583a41 | 103 | RFAL_NFCV_ERROR_CMD_NOT_SUPPORTED = 0x01, /*!< The command is not supported, code is not recognised */ |
DiegoOstuni | 0:75fc82583a41 | 104 | RFAL_NFCV_ERROR_CMD_NOT_RECOGNIZED = 0x02, /*!< The command is not recognised, format error occurred */ |
DiegoOstuni | 0:75fc82583a41 | 105 | RFAL_NFCV_ERROR_OPTION_NOT_SUPPORTED = 0x03, /*!< The option is not supported */ |
DiegoOstuni | 0:75fc82583a41 | 106 | RFAL_NFCV_ERROR_UNKNOWN = 0x0F, /*!< Unknown error */ |
DiegoOstuni | 0:75fc82583a41 | 107 | RFAL_NFCV_ERROR_BLOCK_NOT_AVALIABLE = 0x10, /*!< The specified block is not available */ |
DiegoOstuni | 0:75fc82583a41 | 108 | RFAL_NFCV_ERROR_BLOCK_ALREDY_LOCKED = 0x11, /*!< The specified block is already locked */ |
DiegoOstuni | 0:75fc82583a41 | 109 | RFAL_NFCV_ERROR_BLOCK_LOCKED = 0x12, /*!< The specified block is locked */ |
DiegoOstuni | 0:75fc82583a41 | 110 | RFAL_NFCV_ERROR_WRITE_FAILED = 0x13, /*!< The specified block was not successfully programmed */ |
DiegoOstuni | 0:75fc82583a41 | 111 | RFAL_NFCV_ERROR_BLOCK_FAILED = 0x14, /*!< The specified block was not successfully locked */ |
DiegoOstuni | 0:75fc82583a41 | 112 | }; |
DiegoOstuni | 0:75fc82583a41 | 113 | |
DiegoOstuni | 0:75fc82583a41 | 114 | |
DiegoOstuni | 0:75fc82583a41 | 115 | /*! NFC-V command set ISO15693 2000 9.1 */ |
DiegoOstuni | 0:75fc82583a41 | 116 | enum |
DiegoOstuni | 0:75fc82583a41 | 117 | { |
DiegoOstuni | 0:75fc82583a41 | 118 | RFAL_NFCF_CMD_INVENTORY = 0x01, /*!< INVENTORY_REQ (Inventory) command */ |
DiegoOstuni | 0:75fc82583a41 | 119 | RFAL_NFCF_CMD_SLPV = 0x02, /*!< SLPV_REQ (Stay quiet) command */ |
DiegoOstuni | 0:75fc82583a41 | 120 | RFAL_NFCF_CMD_READ_SINGLE_BLOCK = 0x20, /*!< Read single block command */ |
DiegoOstuni | 0:75fc82583a41 | 121 | RFAL_NFCF_CMD_WRITE_SINGLE_BLOCK = 0x21, /*!< Write single block command */ |
DiegoOstuni | 0:75fc82583a41 | 122 | RFAL_NFCF_CMD_LOCK_BLOCK = 0x22, /*!< Lock block command */ |
DiegoOstuni | 0:75fc82583a41 | 123 | RFAL_NFCF_CMD_READ_MULTIPLE_BLOCKS = 0x23, /*!< Read multiple blocks command */ |
DiegoOstuni | 0:75fc82583a41 | 124 | RFAL_NFCF_CMD_WRITE_MULTIPLE_BLOCKS = 0x24, /*!< Write multiple blocks command */ |
DiegoOstuni | 0:75fc82583a41 | 125 | RFAL_NFCF_CMD_SELECT = 0x25, /*!< Select command */ |
DiegoOstuni | 0:75fc82583a41 | 126 | RFAL_NFCF_CMD_RESET_TO_READY = 0x26, /*!< Reset To Ready command */ |
DiegoOstuni | 0:75fc82583a41 | 127 | RFAL_NFCF_CMD_GET_SYS_INFO = 0x2B, /*!< Get System Information command */ |
DiegoOstuni | 0:75fc82583a41 | 128 | RFAL_NFCF_CMD_EXTENDED_GET_SYS_INFO = 0x2B /*!< Extended Get System Information command (ST Proprietary) */ |
DiegoOstuni | 0:75fc82583a41 | 129 | }; |
DiegoOstuni | 0:75fc82583a41 | 130 | |
DiegoOstuni | 0:75fc82583a41 | 131 | /* |
DiegoOstuni | 0:75fc82583a41 | 132 | ****************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 133 | * GLOBAL MACROS |
DiegoOstuni | 0:75fc82583a41 | 134 | ****************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 135 | */ |
DiegoOstuni | 0:75fc82583a41 | 136 | |
DiegoOstuni | 0:75fc82583a41 | 137 | |
DiegoOstuni | 0:75fc82583a41 | 138 | /* |
DiegoOstuni | 0:75fc82583a41 | 139 | ****************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 140 | * GLOBAL TYPES |
DiegoOstuni | 0:75fc82583a41 | 141 | ****************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 142 | */ |
DiegoOstuni | 0:75fc82583a41 | 143 | |
DiegoOstuni | 0:75fc82583a41 | 144 | /*! NFC-V Number of slots Digital 2.0 9.6.1 */ |
DiegoOstuni | 0:75fc82583a41 | 145 | typedef enum |
DiegoOstuni | 0:75fc82583a41 | 146 | { |
DiegoOstuni | 0:75fc82583a41 | 147 | RFAL_NFCV_NUM_SLOTS_1 = 0x20, /*!< Number of slots: 1 */ |
DiegoOstuni | 0:75fc82583a41 | 148 | RFAL_NFCV_NUM_SLOTS_16 = 0x00, /*!< Number of slots: 16 */ |
DiegoOstuni | 0:75fc82583a41 | 149 | } rfalNfcvNumSlots; |
DiegoOstuni | 0:75fc82583a41 | 150 | |
DiegoOstuni | 0:75fc82583a41 | 151 | |
DiegoOstuni | 0:75fc82583a41 | 152 | /*! NFC-V INVENTORY_RES format Digital 2.0 9.6.2 */ |
DiegoOstuni | 0:75fc82583a41 | 153 | typedef struct |
DiegoOstuni | 0:75fc82583a41 | 154 | { |
DiegoOstuni | 0:75fc82583a41 | 155 | uint8_t RES_FLAG; /*!< Response Flags */ |
DiegoOstuni | 0:75fc82583a41 | 156 | uint8_t DSFID; /*!< Data Storage Format Identifier */ |
DiegoOstuni | 0:75fc82583a41 | 157 | uint8_t UID[RFAL_NFCV_UID_LEN]; /*!< NFC-V device UID */ |
DiegoOstuni | 0:75fc82583a41 | 158 | uint8_t crc[RFAL_CRC_LEN]; /*!< CRC */ |
DiegoOstuni | 0:75fc82583a41 | 159 | } rfalNfcvInventoryRes; |
DiegoOstuni | 0:75fc82583a41 | 160 | |
DiegoOstuni | 0:75fc82583a41 | 161 | |
DiegoOstuni | 0:75fc82583a41 | 162 | /*! NFC-V listener device (VICC) struct */ |
DiegoOstuni | 0:75fc82583a41 | 163 | typedef struct |
DiegoOstuni | 0:75fc82583a41 | 164 | { |
DiegoOstuni | 0:75fc82583a41 | 165 | rfalNfcvInventoryRes InvRes; /*!< INVENTORY_RES */ |
DiegoOstuni | 0:75fc82583a41 | 166 | bool isSleep; /*!< Device sleeping flag */ |
DiegoOstuni | 0:75fc82583a41 | 167 | } rfalNfcvListenDevice; |
DiegoOstuni | 0:75fc82583a41 | 168 | |
DiegoOstuni | 0:75fc82583a41 | 169 | |
DiegoOstuni | 0:75fc82583a41 | 170 | /* |
DiegoOstuni | 0:75fc82583a41 | 171 | ****************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 172 | * GLOBAL FUNCTION PROTOTYPES |
DiegoOstuni | 0:75fc82583a41 | 173 | ****************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 174 | */ |
DiegoOstuni | 0:75fc82583a41 | 175 | |
DiegoOstuni | 0:75fc82583a41 | 176 | /*! |
DiegoOstuni | 0:75fc82583a41 | 177 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 178 | * \brief Initialize NFC-V Poller mode |
DiegoOstuni | 0:75fc82583a41 | 179 | * |
DiegoOstuni | 0:75fc82583a41 | 180 | * This methods configures RFAL RF layer to perform as a |
DiegoOstuni | 0:75fc82583a41 | 181 | * NFC-F Poller/RW (ISO15693) including all default timings |
DiegoOstuni | 0:75fc82583a41 | 182 | * |
DiegoOstuni | 0:75fc82583a41 | 183 | * \return ERR_WRONG_STATE : RFAL not initialized or mode not set |
DiegoOstuni | 0:75fc82583a41 | 184 | * \return ERR_PARAM : Incorrect bitrate |
DiegoOstuni | 0:75fc82583a41 | 185 | * \return ERR_NONE : No error |
DiegoOstuni | 0:75fc82583a41 | 186 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 187 | */ |
DiegoOstuni | 0:75fc82583a41 | 188 | ReturnCode rfalNfcvPollerInitialize( SPI* mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 ); |
DiegoOstuni | 0:75fc82583a41 | 189 | |
DiegoOstuni | 0:75fc82583a41 | 190 | /*! |
DiegoOstuni | 0:75fc82583a41 | 191 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 192 | * \brief NFC-V Poller Check Presence |
DiegoOstuni | 0:75fc82583a41 | 193 | * |
DiegoOstuni | 0:75fc82583a41 | 194 | * This method checks if a NFC-V Listen device (VICC) is present on the field |
DiegoOstuni | 0:75fc82583a41 | 195 | * by sending an Inventory (INVENTORY_REQ) |
DiegoOstuni | 0:75fc82583a41 | 196 | * |
DiegoOstuni | 0:75fc82583a41 | 197 | * \param[out] invRes : If received, the INVENTORY_RES |
DiegoOstuni | 0:75fc82583a41 | 198 | * |
DiegoOstuni | 0:75fc82583a41 | 199 | * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode |
DiegoOstuni | 0:75fc82583a41 | 200 | * \return ERR_PARAM : Invalid parameters |
DiegoOstuni | 0:75fc82583a41 | 201 | * \return ERR_IO : Generic internal error |
DiegoOstuni | 0:75fc82583a41 | 202 | * \return ERR_TIMEOUT : Timeout error, no listener device detectedd |
DiegoOstuni | 0:75fc82583a41 | 203 | * \return ERR_NONE : No error, one or more device in the field |
DiegoOstuni | 0:75fc82583a41 | 204 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 205 | */ |
DiegoOstuni | 0:75fc82583a41 | 206 | ReturnCode rfalNfcvPollerCheckPresence( rfalNfcvInventoryRes *invRes, SPI* mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 ); |
DiegoOstuni | 0:75fc82583a41 | 207 | |
DiegoOstuni | 0:75fc82583a41 | 208 | /*! |
DiegoOstuni | 0:75fc82583a41 | 209 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 210 | * \brief NFC-F Poller Poll |
DiegoOstuni | 0:75fc82583a41 | 211 | * |
DiegoOstuni | 0:75fc82583a41 | 212 | * This function sends to all VICCs in field the INVENTORY command with the |
DiegoOstuni | 0:75fc82583a41 | 213 | * given number of slots |
DiegoOstuni | 0:75fc82583a41 | 214 | * |
DiegoOstuni | 0:75fc82583a41 | 215 | * If more than one slot is used the following EOF need to be handled |
DiegoOstuni | 0:75fc82583a41 | 216 | * by the caller using rfalISO15693TransceiveAnticollisionEOF() |
DiegoOstuni | 0:75fc82583a41 | 217 | * |
DiegoOstuni | 0:75fc82583a41 | 218 | * \param[in] nSlots : Number of Slots to be sent (1 or 16) |
DiegoOstuni | 0:75fc82583a41 | 219 | * \param[in] maskLen : Number bits on the Mask value |
DiegoOstuni | 0:75fc82583a41 | 220 | * \param[in] maskVal : location of the Mask value |
DiegoOstuni | 0:75fc82583a41 | 221 | * \param[out] invRes : location to place the INVENTORY_RES |
DiegoOstuni | 0:75fc82583a41 | 222 | * \param[out] rcvdLen : number of bits received (without collision) |
DiegoOstuni | 0:75fc82583a41 | 223 | * |
DiegoOstuni | 0:75fc82583a41 | 224 | * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode |
DiegoOstuni | 0:75fc82583a41 | 225 | * \return ERR_PARAM : Invalid parameters |
DiegoOstuni | 0:75fc82583a41 | 226 | * \return ERR_IO : Generic internal error |
DiegoOstuni | 0:75fc82583a41 | 227 | * \return ERR_RF_COLLISION : Collision detected |
DiegoOstuni | 0:75fc82583a41 | 228 | * \return ERR_CRC : CRC error detected |
DiegoOstuni | 0:75fc82583a41 | 229 | * \return ERR_PROTO : Protocol error detected |
DiegoOstuni | 0:75fc82583a41 | 230 | * \return ERR_NONE : No error |
DiegoOstuni | 0:75fc82583a41 | 231 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 232 | */ |
DiegoOstuni | 0:75fc82583a41 | 233 | ReturnCode rfalNfcvPollerInventory( rfalNfcvNumSlots nSlots, uint8_t maskLen, uint8_t *maskVal, rfalNfcvInventoryRes *invRes, uint16_t* rcvdLen, SPI* mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 ); |
DiegoOstuni | 0:75fc82583a41 | 234 | |
DiegoOstuni | 0:75fc82583a41 | 235 | /*! |
DiegoOstuni | 0:75fc82583a41 | 236 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 237 | * \brief NFC-V Poller Full Collision Resolution |
DiegoOstuni | 0:75fc82583a41 | 238 | * |
DiegoOstuni | 0:75fc82583a41 | 239 | * Performs a full Collision resolution as defined in Activity 2.0 9.3.7 |
DiegoOstuni | 0:75fc82583a41 | 240 | * Once done, the devCnt will indicate how many (if any) devices have |
DiegoOstuni | 0:75fc82583a41 | 241 | * been identified and their details are contained on nfcvDevList |
DiegoOstuni | 0:75fc82583a41 | 242 | * |
DiegoOstuni | 0:75fc82583a41 | 243 | * \param[in] devLimit : device limit value, and size nfcaDevList |
DiegoOstuni | 0:75fc82583a41 | 244 | * \param[out] nfcvDevList : NFC-v listener devices list |
DiegoOstuni | 0:75fc82583a41 | 245 | * \param[out] devCnt : Devices found counter |
DiegoOstuni | 0:75fc82583a41 | 246 | * \param[out] colPending : It indicates if collsion(s) are still pending |
DiegoOstuni | 0:75fc82583a41 | 247 | * |
DiegoOstuni | 0:75fc82583a41 | 248 | * \return ERR_WRONG_STATE : RFAL not initialized or mode not set |
DiegoOstuni | 0:75fc82583a41 | 249 | * \return ERR_PARAM : Invalid parameters |
DiegoOstuni | 0:75fc82583a41 | 250 | * \return ERR_IO : Generic internal error |
DiegoOstuni | 0:75fc82583a41 | 251 | * \return ERR_NONE : No error |
DiegoOstuni | 0:75fc82583a41 | 252 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 253 | */ |
DiegoOstuni | 0:75fc82583a41 | 254 | ReturnCode rfalNfcvPollerCollisionResolution( uint8_t devLimit, rfalNfcvListenDevice *nfcvDevList, uint8_t *devCnt, SPI* mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 ); |
DiegoOstuni | 0:75fc82583a41 | 255 | |
DiegoOstuni | 0:75fc82583a41 | 256 | /*! |
DiegoOstuni | 0:75fc82583a41 | 257 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 258 | * \brief NFC-V Poller Sleep |
DiegoOstuni | 0:75fc82583a41 | 259 | * |
DiegoOstuni | 0:75fc82583a41 | 260 | * This function is used to send the SLPV_REQ (Stay Quiet) command to put the VICC |
DiegoOstuni | 0:75fc82583a41 | 261 | * with the given UID to state QUIET so that they do not reply to more Inventory |
DiegoOstuni | 0:75fc82583a41 | 262 | * |
DiegoOstuni | 0:75fc82583a41 | 263 | * \param[in] uid : UID of the device to be put to Sleep |
DiegoOstuni | 0:75fc82583a41 | 264 | * |
DiegoOstuni | 0:75fc82583a41 | 265 | * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode |
DiegoOstuni | 0:75fc82583a41 | 266 | * \return ERR_PARAM : Invalid parameters |
DiegoOstuni | 0:75fc82583a41 | 267 | * \return ERR_IO : Generic internal error |
DiegoOstuni | 0:75fc82583a41 | 268 | * \return ERR_NONE : No error |
DiegoOstuni | 0:75fc82583a41 | 269 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 270 | */ |
DiegoOstuni | 0:75fc82583a41 | 271 | ReturnCode rfalNfvPollerSleep( uint8_t flags, uint8_t* uid, SPI* mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 ); |
DiegoOstuni | 0:75fc82583a41 | 272 | |
DiegoOstuni | 0:75fc82583a41 | 273 | /*! |
DiegoOstuni | 0:75fc82583a41 | 274 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 275 | * \brief NFC-V Poller Select |
DiegoOstuni | 0:75fc82583a41 | 276 | * |
DiegoOstuni | 0:75fc82583a41 | 277 | * Selects a device (VICC) by its UID |
DiegoOstuni | 0:75fc82583a41 | 278 | * |
DiegoOstuni | 0:75fc82583a41 | 279 | * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option |
DiegoOstuni | 0:75fc82583a41 | 280 | * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT |
DiegoOstuni | 0:75fc82583a41 | 281 | * \param[in] uid : UID of the device to be put to be Selected |
DiegoOstuni | 0:75fc82583a41 | 282 | * |
DiegoOstuni | 0:75fc82583a41 | 283 | * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode |
DiegoOstuni | 0:75fc82583a41 | 284 | * \return ERR_PARAM : Invalid parameters |
DiegoOstuni | 0:75fc82583a41 | 285 | * \return ERR_IO : Generic internal error |
DiegoOstuni | 0:75fc82583a41 | 286 | * \return ERR_CRC : CRC error detected |
DiegoOstuni | 0:75fc82583a41 | 287 | * \return ERR_FRAMING : Framing error detected |
DiegoOstuni | 0:75fc82583a41 | 288 | * \return ERR_PROTO : Protocol error detected |
DiegoOstuni | 0:75fc82583a41 | 289 | * \return ERR_TIMEOUT : Timeout error |
DiegoOstuni | 0:75fc82583a41 | 290 | * \return ERR_NONE : No error |
DiegoOstuni | 0:75fc82583a41 | 291 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 292 | */ |
DiegoOstuni | 0:75fc82583a41 | 293 | ReturnCode rfalNfvPollerSelect( uint8_t flags, uint8_t* uid ); |
DiegoOstuni | 0:75fc82583a41 | 294 | |
DiegoOstuni | 0:75fc82583a41 | 295 | /*! |
DiegoOstuni | 0:75fc82583a41 | 296 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 297 | * \brief NFC-V Poller Read Single Block |
DiegoOstuni | 0:75fc82583a41 | 298 | * |
DiegoOstuni | 0:75fc82583a41 | 299 | * Reads a Single Block from a device (VICC) |
DiegoOstuni | 0:75fc82583a41 | 300 | * |
DiegoOstuni | 0:75fc82583a41 | 301 | * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option |
DiegoOstuni | 0:75fc82583a41 | 302 | * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT |
DiegoOstuni | 0:75fc82583a41 | 303 | * \param[in] uid : UID of the device to be put to be read |
DiegoOstuni | 0:75fc82583a41 | 304 | * if not provided Select mode will be used |
DiegoOstuni | 0:75fc82583a41 | 305 | * \param[in] blockNum : Number of the block to read |
DiegoOstuni | 0:75fc82583a41 | 306 | * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) |
DiegoOstuni | 0:75fc82583a41 | 307 | * \param[in] rxBufLen : length of rxBuf |
DiegoOstuni | 0:75fc82583a41 | 308 | * \param[out] rcvLen : number of bytes received |
DiegoOstuni | 0:75fc82583a41 | 309 | * |
DiegoOstuni | 0:75fc82583a41 | 310 | * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode |
DiegoOstuni | 0:75fc82583a41 | 311 | * \return ERR_PARAM : Invalid parameters |
DiegoOstuni | 0:75fc82583a41 | 312 | * \return ERR_IO : Generic internal error |
DiegoOstuni | 0:75fc82583a41 | 313 | * \return ERR_CRC : CRC error detected |
DiegoOstuni | 0:75fc82583a41 | 314 | * \return ERR_FRAMING : Framing error detected |
DiegoOstuni | 0:75fc82583a41 | 315 | * \return ERR_PROTO : Protocol error detected |
DiegoOstuni | 0:75fc82583a41 | 316 | * \return ERR_TIMEOUT : Timeout error |
DiegoOstuni | 0:75fc82583a41 | 317 | * \return ERR_NONE : No error |
DiegoOstuni | 0:75fc82583a41 | 318 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 319 | */ |
DiegoOstuni | 0:75fc82583a41 | 320 | ReturnCode rfalNfvPollerReadSingleBlock( uint8_t flags, uint8_t* uid, uint8_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen ); |
DiegoOstuni | 0:75fc82583a41 | 321 | |
DiegoOstuni | 0:75fc82583a41 | 322 | /*! |
DiegoOstuni | 0:75fc82583a41 | 323 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 324 | * \brief NFC-V Poller Write Single Block |
DiegoOstuni | 0:75fc82583a41 | 325 | * |
DiegoOstuni | 0:75fc82583a41 | 326 | * Writes a Single Block from a device (VICC) |
DiegoOstuni | 0:75fc82583a41 | 327 | * |
DiegoOstuni | 0:75fc82583a41 | 328 | * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option |
DiegoOstuni | 0:75fc82583a41 | 329 | * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT |
DiegoOstuni | 0:75fc82583a41 | 330 | * \param[in] uid : UID of the device to be put to be read |
DiegoOstuni | 0:75fc82583a41 | 331 | * if not provided Select mode will be used |
DiegoOstuni | 0:75fc82583a41 | 332 | * \param[in] blockNum : Number of the block to read |
DiegoOstuni | 0:75fc82583a41 | 333 | * \param[in] wrData : data to be written on the given block |
DiegoOstuni | 0:75fc82583a41 | 334 | * \param[in] blockLen : number of bytes of a block |
DiegoOstuni | 0:75fc82583a41 | 335 | * |
DiegoOstuni | 0:75fc82583a41 | 336 | * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode |
DiegoOstuni | 0:75fc82583a41 | 337 | * \return ERR_PARAM : Invalid parameters |
DiegoOstuni | 0:75fc82583a41 | 338 | * \return ERR_IO : Generic internal error |
DiegoOstuni | 0:75fc82583a41 | 339 | * \return ERR_CRC : CRC error detected |
DiegoOstuni | 0:75fc82583a41 | 340 | * \return ERR_FRAMING : Framing error detected |
DiegoOstuni | 0:75fc82583a41 | 341 | * \return ERR_PROTO : Protocol error detected |
DiegoOstuni | 0:75fc82583a41 | 342 | * \return ERR_TIMEOUT : Timeout error |
DiegoOstuni | 0:75fc82583a41 | 343 | * \return ERR_NONE : No error |
DiegoOstuni | 0:75fc82583a41 | 344 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 345 | */ |
DiegoOstuni | 0:75fc82583a41 | 346 | ReturnCode rfalNfvPollerWriteSingleBlock( uint8_t flags, uint8_t* uid, uint8_t blockNum, uint8_t* wrData, uint8_t blockLen ); |
DiegoOstuni | 0:75fc82583a41 | 347 | |
DiegoOstuni | 0:75fc82583a41 | 348 | /*! |
DiegoOstuni | 0:75fc82583a41 | 349 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 350 | * \brief NFC-V Poller Read Multiple Blocks |
DiegoOstuni | 0:75fc82583a41 | 351 | * |
DiegoOstuni | 0:75fc82583a41 | 352 | * Reads Multiple Blocks from a device (VICC) |
DiegoOstuni | 0:75fc82583a41 | 353 | * |
DiegoOstuni | 0:75fc82583a41 | 354 | * \param[in] flags : Flags to be used: Sub-carrier; Data_rate; Option |
DiegoOstuni | 0:75fc82583a41 | 355 | * for NFC-Forum use: RFAL_NFCV_REQ_FLAG_DEFAULT |
DiegoOstuni | 0:75fc82583a41 | 356 | * \param[in] uid : UID of the device to be put to be read |
DiegoOstuni | 0:75fc82583a41 | 357 | * if not provided Select mode will be used |
DiegoOstuni | 0:75fc82583a41 | 358 | * \param[in] firstBlockNum : first block to be read |
DiegoOstuni | 0:75fc82583a41 | 359 | * \param[out] rxBuf : buffer to store response (also with RES_FLAGS) |
DiegoOstuni | 0:75fc82583a41 | 360 | * \param[in] rxBufLen : length of rxBuf |
DiegoOstuni | 0:75fc82583a41 | 361 | * \param[out] rcvLen : number of bytes received |
DiegoOstuni | 0:75fc82583a41 | 362 | * |
DiegoOstuni | 0:75fc82583a41 | 363 | * \return ERR_WRONG_STATE : RFAL not initialized or incorrect mode |
DiegoOstuni | 0:75fc82583a41 | 364 | * \return ERR_PARAM : Invalid parameters |
DiegoOstuni | 0:75fc82583a41 | 365 | * \return ERR_IO : Generic internal error |
DiegoOstuni | 0:75fc82583a41 | 366 | * \return ERR_CRC : CRC error detected |
DiegoOstuni | 0:75fc82583a41 | 367 | * \return ERR_FRAMING : Framing error detected |
DiegoOstuni | 0:75fc82583a41 | 368 | * \return ERR_PROTO : Protocol error detected |
DiegoOstuni | 0:75fc82583a41 | 369 | * \return ERR_TIMEOUT : Timeout error |
DiegoOstuni | 0:75fc82583a41 | 370 | * \return ERR_NONE : No error |
DiegoOstuni | 0:75fc82583a41 | 371 | ***************************************************************************** |
DiegoOstuni | 0:75fc82583a41 | 372 | */ |
DiegoOstuni | 0:75fc82583a41 | 373 | ReturnCode rfalNfvPollerReadMultipleBlocks( uint8_t flags, uint8_t* uid, uint8_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen, SPI* mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 ); |
DiegoOstuni | 0:75fc82583a41 | 374 | |
DiegoOstuni | 0:75fc82583a41 | 375 | ReturnCode rfalNfvSelect( uint8_t flags, uint8_t* uid, SPI* mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 ); |
DiegoOstuni | 0:75fc82583a41 | 376 | ReturnCode rfalNfvReadSingleBlock( uint8_t flags, uint8_t* uid, uint8_t blockNum, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen, SPI* mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 ); |
DiegoOstuni | 0:75fc82583a41 | 377 | ReturnCode rfalNfvWriteSingleBlock( uint8_t flags, uint8_t* uid, uint8_t blockNum, uint8_t* wrData, uint8_t blockLen, SPI* mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 ); |
DiegoOstuni | 0:75fc82583a41 | 378 | ReturnCode rfalNfvReadMultipleBlocks( uint8_t flags, uint8_t* uid, uint8_t firstBlockNum, uint8_t numOfBlocks, uint8_t* rxBuf, uint16_t rxBufLen, uint16_t *rcvLen, SPI* mspiChannel, ST25R3911* mST25, DigitalOut* gpio_cs, InterruptIn* IRQ, DigitalOut* fieldLED_01, DigitalOut* fieldLED_02, DigitalOut* fieldLED_03, DigitalOut* fieldLED_04, DigitalOut* fieldLED_05, DigitalOut* fieldLED_06 ); |
DiegoOstuni | 0:75fc82583a41 | 379 | #endif /* RFAL_NFCV_H */ |
DiegoOstuni | 0:75fc82583a41 | 380 | |
DiegoOstuni | 0:75fc82583a41 | 381 | /** |
DiegoOstuni | 0:75fc82583a41 | 382 | * @} |
DiegoOstuni | 0:75fc82583a41 | 383 | * |
DiegoOstuni | 0:75fc82583a41 | 384 | * @} |
DiegoOstuni | 0:75fc82583a41 | 385 | * |
DiegoOstuni | 0:75fc82583a41 | 386 | * @} |
DiegoOstuni | 0:75fc82583a41 | 387 | */ |
DiegoOstuni | 0:75fc82583a41 | 388 |