15d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/* 25d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Copyright (C) 2010 NXP Semiconductors 35d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 45d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Licensed under the Apache License, Version 2.0 (the "License"); 55d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * you may not use this file except in compliance with the License. 65d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * You may obtain a copy of the License at 75d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 85d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * http://www.apache.org/licenses/LICENSE-2.0 95d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Unless required by applicable law or agreed to in writing, software 115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * distributed under the License is distributed on an "AS IS" BASIS, 125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * See the License for the specific language governing permissions and 145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * limitations under the License. 155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \file phFriNfc_NdefMap.h 195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief NFC Ndef Mapping For Different Smart Cards. 205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Project: NFC-FRI 225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 23a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen * $Date: Mon Dec 13 14:14:14 2010 $ 245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * $Author: ing02260 $ 25a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen * $Revision: 1.25 $ 26794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * $Aliases: $ 275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PHFRINFC_NDEFMAP_H 315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_NDEFMAP_H 325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*include files*/ 355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phNfcTypes.h> 365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phNfcStatus.h> 375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phFriNfc.h> 38794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#ifdef PH_HAL4_ENABLE 39794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands #include <phHal4Nfc.h> 40794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#else 41794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands #include <phHalNfc.h> 425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif 435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 44794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phFriNfc_OvrHal.h> 465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_EXCLUDE_FROM_TESTFW /* */ 485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 49794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands/** 505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name NDEF Mapping 515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * File: \ref phFriNfc_NdefMap.h 535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/ 56a6243755a9b438bfbfe0be331ece55953f8cf9ebMartijn Coenen#define PH_FRINFC_NDEFMAP_FILEREVISION "$Revision: 1.25 $" /**< \ingroup grp_file_attributes */ 57794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#define PH_FRINFC_NDEFMAP_FILEALIASES "$Aliases: $" /**< \ingroup grp_file_attributes */ 585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/ 595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_EXCLUDE_FROM_TESTFW */ 615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \defgroup grp_fri_nfc_ndef_map NDEF Mapping Component 645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * This component implements the read/write/check NDEF functions for remote devices. 665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * NDEF data, as defined by the NFC Forum NDEF specification are written to or read from 675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * a remote device that can be a smart- or memory card. \n\n 685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Please notice that the NDEF mapping command sequence must 695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * be \b contiguous (after correct initialisation): \n 705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \b Examples: 715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * - Checking and Reading 725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * - \ref phFriNfc_NdefMap_ChkNdef 735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * - \ref phFriNfc_NdefMap_RdNdef 745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * . 755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * - Checking and Writing 765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * - \ref phFriNfc_NdefMap_ChkNdef 775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * - \ref phFriNfc_NdefMap_WrNdef 785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * . 795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * - Checking, Reading and Writing 805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * - \ref phFriNfc_NdefMap_ChkNdef 815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * - \ref phFriNfc_NdefMap_RdNdef 825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * - \ref phFriNfc_NdefMap_WrNdef 835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * . 845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * . 855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * There must be \b no \b other FRI or HAL call between these mapping commands. Exceptions to this 865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * rule are specific to the NDEF mapping of certain card / remote device types and separately noted, 875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * typically for true multi-activation capable devices. 885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name NDEF Mapping - specifies the different card types 93794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * These are the only recognised card types in this version. 945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/ 97794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 98794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#define DESFIRE_EV1 99794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 1005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MIFARE_UL_CARD 1 /**< \internal Mifare UL */ 1015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_ISO14443_4A_CARD 2 /**< \internal Iso 14443-4A */ 1025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MIFARE_STD_1K_CARD 3 /**< \internal Mifare Standard */ 1035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MIFARE_STD_4K_CARD 4 /**< \internal Mifare Standard */ 1045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_FELICA_SMART_CARD 5 /**< \internal Felica Smart Tag */ 1055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_TOPAZ_CARD 7 /**< \internal Felica Smart Tag */ 1065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_TOPAZ_DYNAMIC_CARD 8 /**< \internal Felica Smart Tag */ 107794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#ifdef DESFIRE_EV1 1085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_ISO14443_4A_CARD_EV1 9 /**< \internal Iso 14443-4A EV1 */ 109794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#endif /* #ifdef DESFIRE_EV1 */ 1105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 111a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen#define PH_FRINFC_NDEFMAP_ISO15693_CARD 10 /**< \internal ISO 15693 */ 112a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen 1135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef PH_NDEF_MIFARE_ULC 1155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MIFARE_ULC_CARD 8 /**< \internal Mifare UL */ 1165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* #ifdef PH_NDEF_MIFARE_ULC */ 1175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_EMPTY_NDEF_MSG {0xD0, 0x00, 0x00} /**< \internal Empty ndef message */ 1195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef PHFRINFC_OVRHAL_MOCKUP /* */ 1225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MOCKUP_CARD 6 /**< \internal Mocup*/ 1235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PHFRINFC_OVRHAL_MOCKUP */ 1245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/* Enum reperesents the different card state*/ 1285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef enum 1295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 1305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly PH_NDEFMAP_CARD_STATE_INITIALIZED, 1315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly PH_NDEFMAP_CARD_STATE_READ_ONLY, 1325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly PH_NDEFMAP_CARD_STATE_READ_WRITE, 1335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly PH_NDEFMAP_CARD_STATE_INVALID 1345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phNDEF_CARD_STATE; 1355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/ 1385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_MIFARESTD_DISABLED 1415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 1425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name NDEF Mapping - specifies the Compliant Blocks in the Mifare 1k and 4k card types 1435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 1455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/ 1465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MIFARESTD_1KNDEF_COMPBLOCK 45 /**< \internal Total Ndef Compliant blocks Mifare 1k */ 1475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MIFARESTD_4KNDEF_COMPBLOCK 210 /**< \internal Total Ndef Compliant blocks Mifare 4k */ 1485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MIFARESTD_RDWR_SIZE 16 /**< \internal Bytes read/write for one read/write operation*/ 1495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MIFARESTD_TOTALNO_BLK 40 /**< \internal Total number of sectors in Mifare 4k */ 1505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MIFARESTD_ST15_BYTES 15 /**< \internal To store 15 bytes after reading a block */ 1515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/ 1525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_MIFARESTD_DISABLED */ 1535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_TOPAZ_DISABLED 1555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 1565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name NDEF Mapping - specifies the Compliant Blocks in the Mifare 1k and 4k card types 1575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 1595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/ 1605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_TOPAZ_MAX_SIZE 256 /**< \internal Total Memory size = 96 bytes (newer version have mode) */ 1615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_TOPAZ_UID_SIZE 0x04 /**< \internal UID size returned by READID command = 4 bytes */ 1625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/ 1635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_TOPAZ_DISABLED */ 1645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_FELICA_DISABLED 1665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/* Felica Mapping - Constants */ 1675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_FELICA_BLOCK_SIZE 16 1685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_FELICA_ATTR_NDEF_DATA_LEN 3 1695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_FELICA_MANUF_ID_DATA_LEN 8 1705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_FELICA_DISABLED */ 1715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/* MifareUL/Type2 specific constants*/ 1735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_MIFAREUL_DISABLED 1745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef PH_NDEF_MIFARE_ULC 1765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MFUL_64BYTES_BUF 2048 /**< \internal To store 2048 bytes after reading entire card */ 1775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#else 1785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MFUL_64BYTES_BUF 64 /**< \internal To store 64 bytes after reading entire card */ 1795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /*#ifdef PH_NDEF_MIFARE_ULC */ 1805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MFUL_4BYTES_BUF 4 /**< \internal To store 4 bytes after write */ 1825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /*#ifndef PH_FRINFC_MAP_MIFAREUL_DISABLED*/ 1845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef PHFRINFC_OVRHAL_MOCKUP /* */ 1865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MOCKUP_4096BYTES_BUF 4096 /**< \internal To store 4 bytes after write */ 1885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /*#ifndef PH_FRINFC_MAP_MOCKUP_DISABLED*/ 1905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 1925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name Completion Routine Indices 1935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * These are the indices of the completion routine pointers within the component context. 1955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Completion routines belong to upper components. 1965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 1985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/ 1995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \ingroup grp_fri_nfc_ndef_map 2005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Completion Routine Index for \ref phFriNfc_NdefMap_ChkNdef */ 2015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_CR_CHK_NDEF 0 /* */ 2025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \ingroup grp_fri_nfc_ndef_map 2035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Completion Routine Index for \ref phFriNfc_NdefMap_RdNdef */ 204794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#define PH_FRINFC_NDEFMAP_CR_RD_NDEF 1 /* */ 2055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \ingroup grp_fri_nfc_ndef_map 2065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Completion Routine Index for \ref phFriNfc_NdefMap_WrNdef */ 207794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#define PH_FRINFC_NDEFMAP_CR_WR_NDEF 2 /* */ 2085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \ingroup grp_fri_nfc_ndef_map 2095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Completion Routine Index for \ref phFriNfc_NdefMap_EraseNdef */ 210794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#define PH_FRINFC_NDEFMAP_CR_ERASE_NDEF 3 /* */ 2115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \ingroup grp_fri_nfc_ndef_map Completion 2125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Routine Index for Unknown States/Operations */ 213794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#define PH_FRINFC_NDEFMAP_CR_INVALID_OPE 4 /* */ 2145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \ingroup grp_fri_nfc_ndef_map 2155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Number of completion routines that have to be initialised */ 216794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#define PH_FRINFC_NDEFMAP_CR 5 /* */ 2175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/ 2185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 2195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 2205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name File Offset Attributes 2215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 222794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * Following values are used to determine the offset value for Read/Write. This specifies whether 2235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * the Read/Write operation needs to be restarted/continued from the last offset set. 2245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 2255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 2265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/ 2275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \ingroup grp_fri_nfc_ndef_map 2285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Read/Write operation shall start from the last offset set */ 229794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#define PH_FRINFC_NDEFMAP_SEEK_CUR 0 /* */ 2305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \ingroup grp_fri_nfc_ndef_map 2315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Read/Write operation shall start from the begining of the file/card */ 232794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#define PH_FRINFC_NDEFMAP_SEEK_BEGIN 1 /* */ 2335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/ 2345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 2355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 2365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 2375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name Buffer Size Definitions 2385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 2395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 2405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/ 2415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \ingroup grp_fri_nfc_ndef_map Minimum size of the TRX buffer required */ 2425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MAX_SEND_RECV_BUF_SIZE 252 /* */ 2435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \internal The size of s MIFARE block */ 2445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_MF_READ_BLOCK_SIZE 16 /* */ 2455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 2465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 2475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_EXCLUDE_FROM_TESTFW /* */ 2485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 2495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 250a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen#ifndef PH_FRINFC_MAP_ISO15693_DISABLED 251a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen 252a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen#define ISO15693_MAX_DATA_TO_STORE 0x04U 2535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 254a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenentypedef struct phFriNfc_ISO15693Cont 255a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen{ 256a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen /**< \internal block number that is executed */ 257a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint16_t current_block; 258a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen /**< \internal The state of the operation */ 259a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint8_t state; 260a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen /**< \internal Completion routine index */ 261a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint8_t cr_index; 262a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen /**< \internal Execution sequence */ 263a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint8_t ndef_seq; 264a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen /**< \internal NDEF TLV size */ 265a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint16_t actual_ndef_size; 266a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen /**< \internal NDEF TLV size */ 267a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint16_t max_data_size; 268a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen /**< \internal NDEF TLV TYPE block number */ 269a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint16_t ndef_tlv_type_blk; 270a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen /**< \internal NDEF TLV TYPE byte number in the 271a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen "ndef_tlv_type_blk" */ 272a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint8_t ndef_tlv_type_byte; 273a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen /**< \internal Store the remaining bytes that can be used for 274a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen READ with continue option */ 275a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint8_t store_read_data[ISO15693_MAX_DATA_TO_STORE]; 276a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint8_t store_length; 277a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen /**< \internal Remaining size that can be read */ 278a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint16_t remaining_size_to_read; 279a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen uint8_t read_capabilities; 280a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen 281a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen 282a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen}phFriNfc_ISO15693Cont_t; 283a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen 284a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen#endif /* #ifndef PH_FRINFC_MAP_ISO15693_DISABLED */ 2855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 2865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 2875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 2885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_FELICA_DISABLED 2895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 2905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 2915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Felica Basic structure which details the different vaiables 2925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * used for Reading/writing. 2935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 2945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 2955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_Felica 2965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 2975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Current block being read or written*/ 2985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t CurBlockNo; 2995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< No. Of Written*/ 3015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t NoBlocksWritten; 3025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Following are different variables used for write operation*/ 3045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Wr_BytesRemained; /* No of bytes to pad*/ 3055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Buffer to store odd number of block data */ 3075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Wr_RemainedBytesBuff[PH_FRINFC_NDEFMAP_FELICA_BLOCK_SIZE]; 308794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 3095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Following are different variables used for read operation*/ 3105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Rd_NoBytesToCopy; /*specifies the extra number of read bytes */ 3115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< stores extra read data bytes*/ 3135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Rd_BytesToCopyBuff[PH_FRINFC_NDEFMAP_FELICA_BLOCK_SIZE]; 3145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Flag determines Intermediate Copy Operation*/ 3165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t IntermediateCpyFlag; 3175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Stores Intermediate Copy data len*/ 3195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t IntermediateCpyLen; 320794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 3215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Flag specifies Pad Byte Information*/ 3225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t PadByteFlag; 3235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Flag specifies Intermediate WR Information*/ 325794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands uint8_t IntermediateWrFlag; 3265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Flag specifies Intermediate Rd Information*/ 3285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t IntermediateRdFlag; 3295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Flag specifies Last Block Reached Information*/ 3315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t LastBlkReachedFlag; 3325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Specifies how many bytes read from the card*/ 3345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t CurrBytesRead; 3355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Flag specifies EOF card reached Information*/ 3375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t EofCardReachedFlag; 3385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Flag specifies different Operation Types*/ 3405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t OpFlag; 3415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Specifies Offset*/ 3435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Offset; 3445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< Specifies TrxLen Information*/ 3465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t TrxLen; 3475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_Felica_t; 3495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 3515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 3525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Felica structure which details the different vaiables 3535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * used to store the poll related information. 3545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 3555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 3565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_Felica_PollDetails 3575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 3585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phHal_sDevInputParam_t *DevInputParam; 3595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_HAL4_ENABLE 3605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phHal_eOpModes_t *OpMode; 3615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif 362794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /**< Temporary place holder to the Remote Device 3635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly Information, required to store the Felica 3645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly session opened information. */ 365794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands phHal_sRemoteDevInformation_t psTempRemoteDevInfo; 3665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_Felica_PollDetails_t; 3675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 3695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 3705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Felica structure which details the attribute related information. 3715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 3725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 3735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_Felica_AttrInfo 3745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 3755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Version of the Ndefmap document*/ 3765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Version; 3775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Nbr for check cmd*/ 3785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Nbr; 3795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Nbw for update cmd*/ 3805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Nbw; 3815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Maximum number of blocks to store Ndef data*/ 3825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t Nmaxb; 3835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Flag to indicate the status of the write operation*/ 3845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t WriteFlag; 3855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Flag to indicate the status of the read/write operation*/ 3865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t RdWrFlag; 3875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Represents the length of Ndef data : 3 bytes*/ 3885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t LenBytes[PH_FRINFC_NDEFMAP_FELICA_ATTR_NDEF_DATA_LEN]; 3895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the ERASE NDEF Message Operation */ 3905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t EraseMsgFlag; 3915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_Felica_AttrInfo_t; 3935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 3945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 3955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 3965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Felica structure which details the different vaiables 3975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * used to store the Card Manufacturer details. 3985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 3995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_Felica_ManufDetails 4005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 4015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Manufacture identifier*/ 4025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ManufID[PH_FRINFC_NDEFMAP_FELICA_MANUF_ID_DATA_LEN]; 4035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Manufacture Parameters*/ 4045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ManufParameter[PH_FRINFC_NDEFMAP_FELICA_MANUF_ID_DATA_LEN]; 4055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_Felica_ManufDetails_t; 4065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_FELICA_DISABLED */ 4075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 4085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_MIFARESTD_DISABLED 4095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_MifareStdCont 4105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 4115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Device input parameter for poll and connect after failed authentication */ 4125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phHal_sDevInputParam_t *DevInputParam; 413794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** to store bytes that will be used in the 4145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly next write/read operation, if any */ 4155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t internalBuf[PH_FRINFC_NDEFMAP_MIFARESTD_ST15_BYTES]; 4165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** to Store the length of the internalBuf */ 4175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t internalLength; 4185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** holds the block number which is presently been used */ 4195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t currentBlock; 4205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** the number of Ndef Compliant blocks written/read */ 4215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t NdefBlocks; 4225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Total Number of Ndef Complaint Blocks */ 4235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t NoOfNdefCompBlocks; 424794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** used in write ndef, to know that internal bytes 4255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly are accessed */ 4265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t internalBufFlag; 4275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** used in write ndef, to know that last 16 bytes 4285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly are used to write*/ 4295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t RemainingBufFlag; 430794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** indicates that Read has reached the end of the 4315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly card */ 4325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadWriteCompleteFlag; 433794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** indicates that Read has reached the end of the 4345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly card */ 4355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadCompleteFlag; 4365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** indicates that Write is possible or not */ 4375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t WriteFlag; 4385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** indicates that Write is possible or not */ 4395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadFlag; 4405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** indicates that Write is possible or not */ 4415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t RdBeforeWrFlag; 442794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** Authentication Flag indicating that a particular 4435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly sector is authenticated or not */ 4445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t AuthDone; 4455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** to store the last Sector ID in Check Ndef */ 4465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t SectorIndex; 4475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** to read the access bits of each sector */ 4485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadAcsBitFlag; 449c3a87316a08d782d8b336d2d9663b47a4ec37d21Sunil Jogi /** Flag to check if Acs bit was written in this call */ 450c3a87316a08d782d8b336d2d9663b47a4ec37d21Sunil Jogi uint8_t WriteAcsBitFlag; 4515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Buffer to store 16 bytes */ 4525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Buffer[PH_FRINFC_NDEFMAP_MIFARESTD_RDWR_SIZE]; 4535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** to store the AIDs of Mifare 1k or 4k */ 4545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t aid[PH_FRINFC_NDEFMAP_MIFARESTD_TOTALNO_BLK]; 4555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** flag to write with offset begin */ 4565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t WrNdefFlag; 4575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** flag to read with offset begin */ 4585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadNdefFlag; 4595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** flag to check with offset begin */ 4605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ChkNdefFlag; 4615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** To store the remaining size of the Mifare 1k or 4k card */ 4625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t remainingSize; 4635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** To update the remaining size when writing to the Mifare 1k or 4k card */ 4645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t remSizeUpdFlag; 465794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** The flag is to know that there is a different AID apart from 4665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly NFC forum sector AID */ 4675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t aidCompleteFlag; 468794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** The flag is to know that there is a a NFC forum sector exists 4695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly in the card */ 4705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t NFCforumSectFlag; 471794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** The flag is to know that the particular sector is a proprietary 4725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly NFC forum sector */ 4735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ProprforumSectFlag; 4745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** The flag is set after reading the MAD sectors */ 4755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ChkNdefCompleteFlag; 4765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Flag to store the current block */ 4775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t TempBlockNo; 4785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Completion routine index */ 4795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t CRIndex; 4805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Bytes remaining to write for one write procedure */ 4815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t WrLength; 4825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Flag to read after write */ 4835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t RdAfterWrFlag; 4845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Flag to say that poll is required before write ndef (authentication) */ 4855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t PollFlag; 486794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** Flag is to know that this is first time the read has been called. This 487794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands is required when read is called after write (especially for the card formatted 4885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly with the 2nd configuration) */ 4895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t FirstReadFlag; 490794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** Flag is to know that this is first time the write has been called. This 4915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly is required when the card formatted with the 3rd configuration */ 4925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t FirstWriteFlag; 49340734e7599249717860f7aeabda494e1bcd86ffeSunil Jogi /** Indicates the sector trailor id for which the convert 49440734e7599249717860f7aeabda494e1bcd86ffeSunil Jogi to read only is currently in progress*/ 49540734e7599249717860f7aeabda494e1bcd86ffeSunil Jogi uint8_t ReadOnlySectorIndex; 49640734e7599249717860f7aeabda494e1bcd86ffeSunil Jogi /** Indicates the total number of sectors on the card */ 49740734e7599249717860f7aeabda494e1bcd86ffeSunil Jogi uint8_t TotalNoSectors; 49840734e7599249717860f7aeabda494e1bcd86ffeSunil Jogi /** Indicates the block number of the sector trailor on the card */ 49940734e7599249717860f7aeabda494e1bcd86ffeSunil Jogi uint8_t SectorTrailerBlockNo; 50040734e7599249717860f7aeabda494e1bcd86ffeSunil Jogi /** Secret key B to given by the application */ 50140734e7599249717860f7aeabda494e1bcd86ffeSunil Jogi uint8_t UserScrtKeyB[6]; 5025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_MifareStdCont_t; 5035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/ 5045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_MIFARESTD_DISABLED */ 5055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 5065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_DESFIRE_DISABLED 5075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 5085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 5095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Capability Container. 5105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 5115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * The Capability Container structure required for smart card operations. 5125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 5135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 5145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_DesfireCapCont 5155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 5165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t DesfVersion; /**< \internal Desfire Version . */ 5175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t NdefMsgFid; /**< \internal Ndef Message file pointer*/ 5185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t NdefFileSize; /**< \internal Holds Desfire File Size */ 5195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadAccess; /**< \internal Read Access Information. */ 5205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t WriteAccess; /**< \internal Write Access Information. */ 5215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t MaxRespSize; /**< \internal Maximum expected response size. */ 5225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t MaxCmdSize; /**< \internal Maximum command size. */ 5235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t NdefDataLen; /**< \internal Holds actual NDEF Data Len.*/ 5245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t IsNlenPresentFlag; /**< \internal specifies NLEN presence .*/ 5255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t SkipNlenBytesFlag; /**< \internal sets on presence of NLEN.*/ 5265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly} phFriNfc_DesfireCapCont_t; 5275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_DESFIRE_DISABLED */ 5285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 5295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_MIFAREUL_DISABLED 5305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 5315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 5325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Mifare UL Basic structure which details the different vaiables 5335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * used for Reading/writing. 5345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 5355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 5365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_MifareULCont 537794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands{ 538794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** to store bytes that will be used in the 5395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly next write/read operation, if any */ 5405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t InternalBuf[PH_FRINFC_NDEFMAP_MFUL_4BYTES_BUF]; 5415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** to Store the length of the internalBuf */ 5425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t InternalLength; 5435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** holds the sector number which is presently been used */ 5445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t CurrentSector; 5455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** holds the block number which is presently been used */ 5465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t CurrentBlock; 5475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** to know the completion routine */ 5485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t CRindex; 5495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** This stores the free memory size left in the card */ 5505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t RemainingSize; 5515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Copy all the data(including non NDEF TLVs) from the card */ 5525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadBuf[PH_FRINFC_NDEFMAP_MFUL_64BYTES_BUF]; 5535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** index of the above buffer */ 5545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ReadBufIndex; 555794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** This variable stores the index of the "ReadBuf" from which actual 5565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly data has to be copied into the user buffer */ 5575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ByteNumber; 558794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** indicates that read/write has reached the end of the 5595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly card */ 5605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadWriteCompleteFlag; 5615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Buffer to store 4 bytes of data which is written to a block */ 5625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Buffer[PH_FRINFC_NDEFMAP_MFUL_4BYTES_BUF]; 5635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_MifareULCont_t; 5645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_MIFAREUL_DISABLED */ 5655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 5665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef PHFRINFC_OVRHAL_MOCKUP /* */ 5675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 5685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 5695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Mifare UL Basic structure which details the different vaiables 5705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * used for Reading/writing. 5715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 5725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 5735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_MockupCont 574794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands{ 575794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** to store bytes that will be used in the 5765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly next write/read operation, if any */ 5775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t *NdefData; 5785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** to Store the length of the internalBuf */ 5795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint32_t NdefActualSize; 5805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** to Store the length of the internalBuf */ 5815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint32_t NdefMaxSize; 5825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** to Store the length of the internalBuf */ 5835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint32_t CardSize; 5845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** holds the block number which is presently been used */ 5855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint32_t CurrentBlock; 5865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly} phFriNfc_MockupCont_t; 5875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PHFRINFC_OVRHAL_MOCKUP */ 5885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 5895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_EXCLUDE_FROM_TESTFW */ 5905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 5915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 5925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 5935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief NDEF TLV structure which details the different vaiables 5945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * used for TLV. 5955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 5965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 5975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_NDEFTLVCont 5985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 5995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Flag is to know that the TLV Type Found */ 6005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t NdefTLVFoundFlag; 6015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Sector number of the next/present available TLV */ 6025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t NdefTLVSector; 6035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Following two variables are used to store the 6045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly T byte and the Block number in which the T is 605794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands found in Tag */ 6065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Byte number of the next/present available TLV */ 6075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t NdefTLVByte; 6085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Block number of the next/present available TLV */ 6095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t NdefTLVBlock; 6105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Authentication flag for NDEF TLV Block */ 6115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t NdefTLVAuthFlag; 6125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** if the 16th byte of the last read is type (T) of TLV 6135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly and next read contains length (L) bytes of TLV. This flag 6145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly is set when the type (T) of TLV is found in the last read */ 6155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t TcheckedinTLVFlag; 6165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** if the 16th byte of the last read is Length (L) of TLV 6175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly and next read contains length (L) bytes of TLV. This flag 6185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly is set when the Length (L) of TLV is found in the last read */ 6195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t LcheckedinTLVFlag; 620794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** This flag is set, if Terminator TLV is already written 6215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly and next read contains value (V) bytes of TLV. This flag 6225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly is set when the value (V) of TLV is found in the last read */ 6235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t SetTermTLVFlag; 624794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** To know the number of Length (L) field is present in the 6255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly next block */ 6265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t NoLbytesinTLV; 627794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** The value of 3 bytes length(L) field in TLV. In 3 bytes 628794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands length field, 2 bytes are in one block and other 1 byte 629794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands is in the next block. To store the former block length 6305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly field value, this variable is used */ 6315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t prevLenByteValue; 6325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** The value of length(L) field in TLV. */ 6335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t BytesRemainLinTLV; 634794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** Actual size to read and write. This will be always equal to the 6355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly length (L) of TLV as there is only one NDEF TLV . */ 6365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ActualSize; 6375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Flag is to write the length (L) field of the TLV */ 6385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t WrLenFlag; 6395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Flag is to write the length (L) field of the TLV */ 6405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t NULLTLVCount; 6415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Buffer to store 4 bytes of data which is written to a block */ 6425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t NdefTLVBuffer[PH_FRINFC_NDEFMAP_MFUL_4BYTES_BUF]; 6435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Buffer to store 4 bytes of data which is written to a next block */ 6445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t NdefTLVBuffer1[PH_FRINFC_NDEFMAP_MFUL_4BYTES_BUF]; 6455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_NDEFTLVCont_t; 6465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 6485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 6495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Lock Control TLV structure which stores the Position, 650794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * Size and PageCntrl details. 6515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 6525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_LockCntrlTLVCont 6545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 6555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the Byte Position of the lock cntrl tlv 6565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly in the card memory*/ 6575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ByteAddr; 6585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 659794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** Specifies the Size of the lock area in terms of 6605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly bits/bytes*/ 6615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t Size; 6625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the Bytes per Page*/ 6645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t BytesPerPage; 6655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the BytesLockedPerLockBit */ 6675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t BytesLockedPerLockBit; 6685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the index of Lock cntrl TLV*/ 6705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t LockTlvBuffIdx; 6715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Store the content of Lock cntrl TLV*/ 6735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t LockTlvBuff[8]; 6745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the Block number Lock cntrl TLV*/ 6765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t BlkNum; 6775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the Byte Number position of Lock cntrl TLV*/ 6795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ByteNum; 6805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_LockCntrlTLVCont_t; 6835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 6865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 6875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Memeory Control TLV structure which stores the Position, 688794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * Size and PageCntrl details of the reserved byte area. 6895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 6905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 6915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_ResMemCntrlTLVCont 6925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 6935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the Byte Position of the lock cntrl tlv 6945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly in the card memory*/ 6955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ByteAddr; 6965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 697794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** Specifies the Size of the lock area in terms of 6985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly bits/bytes*/ 6995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t Size; 7005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Store the content of Memory cntrl TLV*/ 7025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t MemCntrlTlvBuff[8]; 7035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the Bytes per Page*/ 7055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t BytesPerPage; 7065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the index of Mem cntrl TLV*/ 7085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t MemTlvBuffIdx; 7095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the Block number Lock cntrl TLV*/ 7115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t BlkNum; 7125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Specifies the Byte Number position of Lock cntrl TLV*/ 7145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ByteNum; 7155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_ResMemCntrlTLVCont_t; 7195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#if !(defined(PH_FRINFC_MAP_TOPAZ_DISABLED ) || defined (PH_FRINFC_MAP_TOPAZ_DYNAMIC_DISABLED )) 7215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 7235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 7245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Topaz container structure which details the different vaiables 7255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * used for Topaz card mapping. 7265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 7275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 7285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_TopazCont 7295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 730794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** This stores the free memory size left in the card. In case of topaz, 7315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly this is updated only during check ndef */ 7325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t RemainingSize; 7335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Stores the current block number */ 7345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t CurrentBlock; 7355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Stores the current block number */ 7365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ByteNumber; 7375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** To know the completion routine call */ 7385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t CRIndex; 7395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadWriteCompleteFlag; 7415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** This state is used for write */ 7425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t InternalState; 7435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** This state is used for write */ 7445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t SkipLockBlkFlag; 7455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** To store the UID */ 7465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t UID[PH_FRINFC_NDEFMAP_TOPAZ_UID_SIZE]; 7475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** To CC bytes length */ 7485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t CCByteBuf[4]; 7495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Store the Buffer Index */ 7505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t Cur_RW_Index; 751794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 7525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /* No of bytes read or write*/ 7535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ByteRWFrmCard; 7545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /* Cuurent Segment */ 7565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t CurrentSeg; 7575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Store the read bytes */ 7595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadBuffer[PH_FRINFC_NDEFMAP_TOPAZ_MAX_SIZE]; 7605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 761794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** Size to know the exact data filled in the ReadBuffer. Useful, when the 7625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly offset = PH_FRINFC_NDEFMAP_SEEK_CUR */ 7635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadBufferSize; 7645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 765794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** NDEF TLV byte address, This stores the byte address of 7665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly TYPE field of the TLV */ 7675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t NdefTLVByteAddress; 7685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Expected sequence */ 7705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ExpectedSeq; 7715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Write sequence */ 7735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t WriteSeq; 7745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Actual NDEF message size */ 7765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ActualNDEFMsgSize; 7775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 778794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** NDEF Read Write size in the card, this excludes lock and reserved bytes, 7795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly mentioned in the LOCK and MEMORY control TLVs */ 7805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t NDEFRWSize; 7815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 782794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** Remaining read size in the card, after reading the card. 783794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands User has asked for the data less than " ActualNDEFMsgSize ", 7845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly then remaining read bytes are stored in this variable. 785794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands If the next read is with offset = PH_FRINFC_NDEFMAP_SEEK_CUR, 7865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly then this variable is used. 7875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 7885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t RemainingReadSize; 789a6243755a9b438bfbfe0be331ece55953f8cf9ebMartijn Coenen#ifdef FRINFC_READONLY_NDEF 790a6243755a9b438bfbfe0be331ece55953f8cf9ebMartijn Coenen uint8_t read_only_seq; 791a6243755a9b438bfbfe0be331ece55953f8cf9ebMartijn Coenen uint8_t lock_bytes_written; 792a6243755a9b438bfbfe0be331ece55953f8cf9ebMartijn Coenen#endif /* #ifdef FRINFC_READONLY_NDEF */ 7935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_TopazCont_t; 7955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 7965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_TOPAZ_DISABLED */ 7975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 7985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 7995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief NFC NDEF Mapping Component Context Structure 8005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 8015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * This structure is used to store the current context information of the instance. 8025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 8035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 8045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_NdefMap 8055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 8065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal The state of the operation. */ 807794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands uint8_t State; 808794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 8095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Completion Routine Context. */ 810794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands phFriNfc_CplRt_t CompletionRoutine[PH_FRINFC_NDEFMAP_CR]; 811794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 8125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Pointer to the lower (HAL) instance. */ 813794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands void *LowerDevice; 8145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**<\internal Holds the device additional informations*/ 8165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phHal_sDepAdditionalInfo_t psDepAdditionalInfo; 8175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**<\internal Holds the completion routine informations of the Map Layer*/ 8195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_CplRt_t MapCompletionInfo; 8205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Pointer to the Remote Device Information */ 822794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands phHal_sRemoteDevInformation_t *psRemoteDevInfo; 8235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**<\internal Holds the Command Type(read/write)*/ 8255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phHal_uCmdList_t Cmd; 826794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 8275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Pointer to a temporary buffer. Could be 8285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly used for read/write purposes */ 829794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands uint8_t *ApduBuffer; 830794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 8315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Size allocated to the ApduBuffer. */ 832794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands uint32_t ApduBufferSize; 8335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Index to the APDU Buffer. Used for internal calculations */ 8355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t ApduBuffIndex; 836794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 8375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Pointer to the user-provided Data Size to be written trough WrNdef function. */ 8385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint32_t *WrNdefPacketLength; 839794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 8405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Holds the length of the received data. */ 8425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t *SendRecvLength; 8435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**<\internal Holds the ack of some intial commands*/ 8455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t *SendRecvBuf; 8465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Holds the length of the data to be sent. */ 848794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands uint16_t SendLength; 8495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Data Byte Count, which gives the offset to the integration.*/ 851794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands uint16_t *DataCount; 8525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \ internal Holds the previous operation on the card*/ 8545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t PrevOperation; 8555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \ internal Holds the previous state on the card*/ 8575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t PrevState; 8585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Stores the type of the smart card. */ 860794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands uint8_t CardType; 8615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Stores the card state. */ 863794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands uint8_t CardState; 8645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**< \internal Stores the memory size of the card */ 8665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t CardMemSize; 8675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**<\internal to Store the page offset on the mifare ul card*/ 869794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands uint8_t Offset; 8705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal specifies the desfire operation to be performed*/ 872794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands uint8_t DespOpFlag; 873794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 874794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** \internal Used to remeber how many bytes were written, to update 8755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly the dataCount and the BufferIndex */ 8765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t NumOfBytesWritten; 8775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**\internal used to remember number of L byte Remaining to be written */ 879794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands uint16_t NumOfLReminWrite; 8805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 881794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** \internal Pointer Used to remeber and return how many bytes were read, 8825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly to update the PacketDataLength in case of Read operation */ 883794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /* Fix for 0000238: [gk] MAP: Number of bytes actually read out is 8845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly not returned. */ 8855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint32_t *NumOfBytesRead; 8865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 887794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands /** \internal Flag used to tell the process function that WRITE has 8885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly requested for an internal READ.*/ 8895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t ReadingForWriteOperation; 8905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal Buffer of 5 bytes used for the write operation for the 8925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly Mifare UL card.*/ 8935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t BufferForWriteOp[5]; 8945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal Temporary Receive Length to update the Receive Length 8965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly when every time the Overlapped HAL is called. */ 8975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t TempReceiveLength; 8985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 8995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t NoOfDevices ; 9005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal stores operating mode type of the felica smart tag */ 9025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /* phHal_eOpModes_t OpModeType[2]; */ 9035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal stores the type of the TLV found */ 9055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t TLVFoundFlag; 9065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal stores the TLV structure related informations */ 9085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_NDEFTLVCont_t TLVStruct; 9095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 910794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands 9115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal stores the Lock Contrl Tlv related informations */ 9125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_LockCntrlTLVCont_t LockTlv; 9135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal stores the Mem Contrl Tlv related informations */ 9155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_ResMemCntrlTLVCont_t MemTlv; 9165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** Capabilitity Containers: */ 9205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly #ifndef PH_FRINFC_EXCLUDE_FROM_TESTFW /* */ 9215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal Desfire capability Container Structure. */ 9225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_DESFIRE_DISABLED 923794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands phFriNfc_DesfireCapCont_t DesfireCapContainer; 9245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_DESFIRE_DISABLED */ 9255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_MIFARESTD_DISABLED 9275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal Pointer to the Mifare Standard capability Container Structure. */ 9285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_MifareStdCont_t StdMifareContainer; 9295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_MIFARESTD_DISABLED */ 9305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 931794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#ifndef PH_FRINFC_MAP_FELICA_DISABLED 9325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal Following are the Felica Smart tag related strucutre & variables */ 9335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_Felica_t Felica; 9345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal Struture Stores the dev i/p , opmode informations of smart tag */ 9365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_Felica_PollDetails_t FelicaPollDetails; 9375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal Struture Stores the different attribute informations of smart tag */ 9395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_Felica_AttrInfo_t FelicaAttrInfo; 9405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal Struture Stores the PMm,IDm informations of smart tag */ 9425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_Felica_ManufDetails_t FelicaManufDetails; 9435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_FELICA_DISABLED */ 9445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_MIFAREUL_DISABLED 9455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal Mifare UL capability container structure. */ 9465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_MifareULCont_t MifareULContainer; 9475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_MIFAREUL_DISABLED */ 9485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_MAP_TOPAZ_DISABLED 9495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** \internal Mifare UL capability container structure. */ 9505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_TopazCont_t TopazContainer; 9515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_MAP_TOPAZ_DISABLED */ 952a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen 953a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen#ifndef PH_FRINFC_MAP_ISO15693_DISABLED 954a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen phFriNfc_ISO15693Cont_t ISO15693Container; 955a6e012a748e70ab203655d4e1c0d0a77b6515fadMartijn Coenen#endif /* #ifndef PH_FRINFC_MAP_ISO15693_DISABLED */ 9565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef PHFRINFC_OVRHAL_MOCKUP 9585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_MockupCont_t MochupContainer; 9595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PHFRINFC_OVRHAL_MOCKUP */ 9605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly #endif /* PH_FRINFC_EXCLUDE_FROM_TESTFW */ 9625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly} phFriNfc_NdefMap_t; 9645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PH_FRINFC_EXCLUDE_FROM_TESTFW /* */ 9675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 9685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 9695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 9705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 9715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Ndef Mapping \b Reset function 9725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 973794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \copydoc page_reg Resets the component instance to the initial state and initialises the 9745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * internal variables. 9755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 9765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] NdefMap is a Pointer to a valid and initialised or uninitialised instance 9775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * of \ref phFriNfc_NdefMap_t . 9785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] LowerDevice Overlapped HAL reference, pointing at a valid instance of this 9795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * underlying component. 9805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] psRemoteDevInfo Points to the Remote Device Information structure encapsulating 9815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * the information about the device (Smart card, NFC device) to access. 9825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] psDevInputParam The Device input parameter, as used for the HAL POLL function. 9835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * This parameter is needed by the component in special cases, when an internal call 984794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * to POLL is required again, such as for FeliCa. The storage of the structure behind 9855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * the pointer must be retained by the calling software. The component itself only 9865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * keeps the reference. No change is applied to the structure's content. 9875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] TrxBuffer Pointer to an internally used buffer. The buffer has to be allocated by 9885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * the integrating software (not done by the component). The purpose of 9895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * this storage is to serve as an intermediate buffer for data frame 9905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * composition and analysis. 9915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * The size shall be at least \ref PH_FRINFC_NDEFMAP_MAX_SEND_RECV_BUF_SIZE . 992794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \param[in] TrxBufferSize The size of TrxBuffer: 9935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * The size shall be at least \ref PH_FRINFC_NDEFMAP_MAX_SEND_RECV_BUF_SIZE . 9945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] ReceiveBuffer Pointer to a buffer that the component uses internally use to 9955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * store the data received from the lower component. 9965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * The size shall be at least \ref PH_FRINFC_NDEFMAP_MAX_SEND_RECV_BUF_SIZE . 997794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \param[in] ReceiveLength The size of ReceiveBuffer. This specifies the actual length 9985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * of the data received from the lower component. 9995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * The size shall be at least \ref PH_FRINFC_NDEFMAP_MAX_SEND_RECV_BUF_SIZE . 10005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] DataCount Specifies the offset count during read/write operations. This can be 10015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * used by the integrating software to know about the total number of bytes read/written 10025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * from/to the card. The caller shall set the value behind the pointer to zero 10035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * before calling this function. 10045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_SUCCESS Operation successful. 10065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function is invalid. 10075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \note The DataCount variable is internally updated by the module and must not be changed by the 10095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * embedding software. 10105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \note This function has to be called at the beginning, after creating an instance of 10115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ref phFriNfc_NdefMap_t . Use this function to reset the instance and/or to switch 10125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * to a different underlying device (different NFC device or device mode). 10135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 10145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_NdefMap_Reset(phFriNfc_NdefMap_t *NdefMap, 10155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly void *LowerDevice, 10165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phHal_sRemoteDevInformation_t *psRemoteDevInfo, 10175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phHal_sDevInputParam_t *psDevInputParam, 10185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t *TrxBuffer, 10195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t TrxBufferSize, 10205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t *ReceiveBuffer, 10215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t *ReceiveLength, 10225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t *DataCount); 10235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 10245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 10255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 10265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 10275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Ndef Mapping \b Set \b Completion \b Routine function 10295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \copydoc page_reg Setting of the Completion Routine. 10315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * This function sets the Completion Routine for the specified function ID:\n 10335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * The completion routine is a function of an upper layer in the stack that needs to be notified 10345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * when the current instance has completed an I/O operation and data and/or an I/O status value 10355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * is available. The list of valid function IDs can be found under the section 10365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * "Completion Routine Indices", like e.g. \ref PH_FRINFC_NDEFMAP_CR_CHK_NDEF. 10375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1038794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \param[in] NdefMap Pointer to a valid instance of the \ref phFriNfc_NdefMap_t structure 10395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * serving as the component context. 10405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] FunctionID ID of the component API function to set a with a completion routine for. 10415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * A valid routine has to be assigned for each function ID. 10425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Use the "Completion Routine Indices", such as \ref PH_FRINFC_NDEFMAP_CR_CHK_NDEF . 10435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] CompletionRoutine Pointer to a completion routine (part of a component of the upper layer) 10445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * to be called when the non-blocking opertaion has finished. 10455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] CompletionRoutineContext Pointer to the context of the (upper) component where the 10465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * particular completion routine is located. 10475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_SUCCESS Operation successful. 10495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function is invalid. 10505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \note This function has to be called after \ref phFriNfc_NdefMap_Reset . 10525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 10535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_NdefMap_SetCompletionRoutine(phFriNfc_NdefMap_t *NdefMap, 10545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t FunctionID, 10555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly pphFriNfc_Cr_t CompletionRoutine, 10565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly void *CompletionRoutineContext); 10575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 10585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 10595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 10605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 10615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Ndef Mapping \b Read \b Ndef function 10635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \copydoc page_ovr Initiates Reading of NDEF information from the Remote Device. 10655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * The function initiates the reading of NDEF information from a Remote Device. 10675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * It performs a reset of the state and restarts the state machine. 10685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1069794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \param[in] NdefMap Pointer to a valid instance of the \ref phFriNfc_NdefMap_t 10705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * component context structure. 10715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in,out] PacketData Pointer to a location that shall receive the NDEF Packet. 10725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in,out] PacketDataLength Pointer to a variable that shall receive the length of the NDEF packet. 10735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * The caller has to provide the maximum length, the function fills 10745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * in the actual number of bytes received. 10755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] Offset Indicates whether the read operation shall start from the begining of the 10765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * file/card storage \b or continue from the last offset. The last Offset set is stored 10775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * within a context (Data Count) variable (must not be modified by the integration). 10785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * If the caller sets the value to \ref PH_FRINFC_NDEFMAP_SEEK_CUR, the component shall 10795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * start reading from the last offset set (continue where it has stopped before). 10805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * If set to \ref PH_FRINFC_NDEFMAP_SEEK_BEGIN, the component shall start reading 1081794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * from the begining of the card (restarted) 10825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_PENDING The action has been successfully triggered. 10845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_SUCCESS Operation Successful. 10855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function is invalid. 10875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_REMOTE_DEVICE Card Type is unsupported. 10885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_EOF_CARD_REACHED No Space in the File to read. 10895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_DEVICE The device has not been opened or has been disconnected 10905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * meanwhile. 10915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_CMD_ABORTED The caller/driver has aborted the request. 10925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_BUFFER_TOO_SMALL The buffer provided by the caller is too small. 10935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_RF_TIMEOUT No data has been received within the TIMEOUT period. 10945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 10955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 10965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_NdefMap_RdNdef(phFriNfc_NdefMap_t *NdefMap, 10975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t *PacketData, 10985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint32_t *PacketDataLength, 10995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Offset); 11005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 11015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 11025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 11035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 11045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 11055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Ndef Mapping \b Check \b Ndef function 11065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 11075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \copydoc page_ovr Initiates Writing of NDEF information to the Remote Device. 11085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 11095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * The function initiates the writing of NDEF information to a Remote Device. 11105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * It performs a reset of the state and starts the action (state machine). 11115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * A periodic call of the \ref phFriNfc_NdefMap_Process has to be done once the action 11125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * has been triggered. 11135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1114794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \param[in] NdefMap Pointer to a valid instance of the \ref phFriNfc_NdefMap_t 11155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * component context structure. 11165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] PacketData Pointer to a location that holds the prepared NDEF Packet. 11175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in,out] PacketDataLength Pointer to a variable that shall specify the length of the prepared NDEF packet. 11185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * The caller has to provide the length, the function fills 11195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * in the actual number of bytes received. 11205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] Offset Indicates whether the write operation shall start from the begining of the 11215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * file/card storage \b or continue from the last offset. The last Offset set is stored 11225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * within a context (Data Count) variable (must not be modified by the integration). 11235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * If the caller sets the value to \ref PH_FRINFC_NDEFMAP_SEEK_CUR, the component shall 11245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * start writing from the last offset set (continue where it has stopped before). 11255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * If set to \ref PH_FRINFC_NDEFMAP_SEEK_BEGIN, the component shall start writing 1126794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * from the begining of the card (restarted) 11275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 11285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_PENDING The action has been successfully triggered. 11295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_SUCCESS Operation Successful. 11305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 11315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function is invalid. 11325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_REMOTE_DEVICE Card Type is unsupported. 11335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_EOF_CARD_REACHED No Space in the File to write. 11345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_DEVICE The device has not been opened or has been disconnected 11355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * meanwhile. 11365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_CMD_ABORTED The caller/driver has aborted the request. 11375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_BUFFER_TOO_SMALL The buffer provided by the caller is too small. 11385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_RF_TIMEOUT No data has been received within the TIMEOUT period. 11395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 11405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 11415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 11425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellyextern NFCSTATUS phFriNfc_NdefMap_WrNdef(phFriNfc_NdefMap_t *NdefMap, 11435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t *PacketData, 11445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint32_t *PacketDataLength, 11455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t Offset); 11465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 11475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 11485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 11495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 11505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 11515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Ndef Mapping \b Check \b NDEF function 11525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 11535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \copydoc page_ovr Check whether a particular Remote Device is NDEF compliant. 11545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1155794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \param[in] NdefMap Pointer to a valid instance of the \ref phFriNfc_NdefMap_t 11565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * component context structure. 11575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 11585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_PENDING The action has been successfully triggered. 11595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function is invalid. 11605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_REMOTE_DEVICE Card Type is unsupported. 11615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_PARAMETER Completion Routine is NULL. 11625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_REMOTE_DEVICE OpModes invalid. 11635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_DEVICE The device has not been opened or has been disconnected 11645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * meanwhile. 11655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_CMD_ABORTED The caller/driver has aborted the request. 11665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_BUFFER_TOO_SMALL The buffer provided by the caller is too small. 11675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_RF_TIMEOUT No data has been received within the TIMEOUT period. 11685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 11695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 11705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_NdefMap_ChkNdef(phFriNfc_NdefMap_t *NdefMap); 11715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 117280ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen#ifdef FRINFC_READONLY_NDEF 117380ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen/*! 117480ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * \ingroup grp_fri_smart_card_formatting 117580ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * 117680ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * \brief Initiates the conversion of the already NDEF formatted tag to READ ONLY. 117780ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * 117880ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * \copydoc page_ovr The function initiates the conversion of the already NDEF formatted 117980ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * tag to READ ONLY.After this formation, remote card would be properly Ndef Compliant and READ ONLY. 118080ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * Depending upon the different card type, this function handles formatting procedure. 118180ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * This function supports only for the TOPAZ tags. 118280ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * 118380ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * \param[in] NdefMap Pointer to a valid instance of the \ref phFriNfc_NdefMap_t structure describing 118480ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * the component context. 118580ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * \retval NFCSTATUS_PENDING The action has been successfully triggered. 118680ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * \retval Other values An error has occurred. 118780ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen * 118880ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen */ 118980ee29b88ec489e2bbf6ae446692229d36755429Martijn CoenenNFCSTATUS 119080ee29b88ec489e2bbf6ae446692229d36755429Martijn CoenenphFriNfc_NdefMap_ConvertToReadOnly ( 119180ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen phFriNfc_NdefMap_t *NdefMap); 119280ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen 119380ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen#endif /* #ifdef FRINFC_READONLY_NDEF */ 119480ee29b88ec489e2bbf6ae446692229d36755429Martijn Coenen 11955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 11965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 11975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 11985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Ndef Mapping \b Erase \b NDEF function 11995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1200794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \copydoc page_ovr find the position of the existing NDEF TLV and overwrite with \b empty NDEF 12015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * message \b at that position. 12025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1203794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \param[in] NdefMap Pointer to a valid instance of the \ref phFriNfc_NdefMap_t 12045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * component context structure. 12055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_PENDING The action has been successfully triggered. 12075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function is invalid. 12085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_REMOTE_DEVICE Card Type is unsupported. 12095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_PARAMETER Completion Routine is NULL. 12105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_REMOTE_DEVICE OpModes invalid. 12115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_DEVICE The device has not been opened or has been disconnected 12125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * meanwhile. 12135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_CMD_ABORTED The caller/driver has aborted the request. 12145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_BUFFER_TOO_SMALL The buffer provided by the caller is too small. 12155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_RF_TIMEOUT No data has been received within the TIMEOUT period. 12165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 12185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_NdefMap_EraseNdef(phFriNfc_NdefMap_t *NdefMap); 12195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 12205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 12215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 12225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Ndef Mapping \b Get Container size function 12245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \copydoc page_ovr Returns the size of the NDEF data that the card can hold to the caller. 12265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1227794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \param[in] NdefMap Pointer to a valid instance of the \ref phFriNfc_NdefMap_t 12285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * component context structure. 12295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[out] size Pointer to a uint32_t variable, which receives the size of the NDEF data 12315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_SUCCESS The size has been successfully calculated. 12335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_PARAMETER At least one parameter of the function is invalid. 12345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_REMOTE_DEVICE Card Type is unsupported. 12355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 12375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 12385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_NdefMap_GetContainerSize(const phFriNfc_NdefMap_t *NdefMap,uint32_t *maxSize, uint32_t *actualSize); 12395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 12405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 12415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 12425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Ndef Mapping \b Completion \b Routine or \b Process function 12445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \copydoc page_cb Completion Routine: This function is called by the lower layer (OVR HAL) 12465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * when an I/O operation has finished. The internal state machine decides 12475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * whether to call into the lower device again or to complete the process 12485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * by calling into the upper layer's completion routine, stored within this 12495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * component's context (\ref phFriNfc_NdefMap_t). 12505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * The function call scheme is according to \ref grp_interact. No State reset is performed during 12525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * operation. 12535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] Context The context of the current (not the lower/upper) instance, as set by the lower, 12555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * calling layer, upon its completion. 12565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] Status The completion status of the lower layer (to be handled by the implementation of 12575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * the state machine of this function like a regular return value of an internally 12585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * called function). 12595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \note For general information about the completion routine interface please see \ref pphFriNfc_Cr_t . * The Different Status Values are as follows 12615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 12635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellyvoid phFriNfc_NdefMap_Process(void *Context, 12645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly NFCSTATUS Status); 12655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 12665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 12675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 12685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 12695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 12705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Ndef Mapping \b Check And Parse TLV Structure \b NDEF function 12725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \copydoc page_ovr Checks the presence of a valid TLV's(NDEF/Propritery). 12745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 1275794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \param[in] NdefMap Pointer to a valid instance of the \ref phFriNfc_NdefMap_t 12765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * component context structure. 12775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_INVALID_FORMAT No valid TLV Found. 12795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_SUCCESS Operation Successful. 12805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 12825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_ChkAndParseTLV(phFriNfc_NdefMap_t *NdefMap); 12835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 12845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 12855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef PHFRINFC_OVRHAL_MOCKUP /* */ 12865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1287794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands/** 12885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_ndef_map 12895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Set data NDEF in mockup mode 12915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] NdefMap Pointer to a valid instance of the \ref phFriNfc_NdefMap_t component context structure. 1293794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \param[in] NdefData Pointer to card mockup data 12945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] NdefActualSize The actual data length 12955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] NdefMaxSize The max data length 12965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \param[in] NdefCardSize The total card size 12975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 12985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \retval NFCSTATUS_SUCCESS The operation is ok. 12995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 13005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 13015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_NdefMap_MockupCardSetter(phFriNfc_NdefMap_t *NdefMap, uint8_t *NdefData, uint32_t NdefActualSize, uint32_t NdefMaxSize, uint32_t CardSize); 13025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_NdefMap_MockupNDefModeEn(uint8_t *pNdefCompliancy, uint8_t *pCardType, uint8_t Enable); 13035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /*#ifndef PH_FRINFC_MAP_MOCKUP_DISABLED*/ 13045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 13055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 13065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 1307794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands * \internal 13085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name States of the FSM. 13095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 13105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 13115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/ 13125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_STATE_RESET_INIT 0 /**< \internal Initial state */ 13135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_STATE_CR_REGISTERED 1 /**< \internal CR has been registered */ 13145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_STATE_EOF_CARD 2 /**< \internal EOF card reached */ 13155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/ 13165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1317794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands/* Following values specify the previous operation on the card. This value is assigned to 13185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly the context structure variable: PrevOperation. */ 13195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 13205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**< Previous operation is check*/ 1321794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#define PH_FRINFC_NDEFMAP_CHECK_OPE 1 13225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**< Previous operation is read*/ 1323794aa72f7bd1e5b1fb51efb957cb925c7cfed746Jan Brands#define PH_FRINFC_NDEFMAP_READ_OPE 2 13245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**< Previous operation is write */ 13255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_WRITE_OPE 3 13265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**< Previous operation is Actual size */ 13275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_NDEFMAP_GET_ACTSIZE_OPE 4 13285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 13295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/* This flag is set when there is a need of write operation on the odd positions 13305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly ex: 35,5 etc. This is used with MfUlOp Flag */ 13315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PH_FRINFC_MFUL_INTERNAL_READ 3 /**< \internal Read/Write control*/ 13325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 13335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 13345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PH_FRINFC_EXCLUDE_FROM_TESTFW */ 13355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 13365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PHFRINFC_NDEFMAP_H */ 1337