1 /* 2 * Copyright (C) 2010 NXP Semiconductors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /* 18 * \file phFriNfc_MapTools.h 19 * \brief NFC Internal Ndef Mapping File. 20 * 21 * Project: NFC-FRI 22 * 23 * $Date: Mon Sep 15 15:05:48 2008 $ 24 * $Author: ing08205 $ 25 * $Revision: 1.5 $ 26 * $Aliases: NFC_FRI1.1_WK838_R9_PREP2,NFC_FRI1.1_WK838_R9_1,NFC_FRI1.1_WK840_R10_PREP1,NFC_FRI1.1_WK840_R10_1,NFC_FRI1.1_WK842_R11_PREP1,NFC_FRI1.1_WK842_R11_PREP2,NFC_FRI1.1_WK842_R11_1,NFC_FRI1.1_WK844_PREP1,NFC_FRI1.1_WK844_R12_1,NFC_FRI1.1_WK846_PREP1,NFC_FRI1.1_WK846_R13_1,NFC_FRI1.1_WK848_PREP1,NFC_FRI1.1_WK848_R14_1,NFC_FRI1.1_WK850_PACK1,NFC_FRI1.1_WK851_PREP1,NFC_FRI1.1_WK850_R15_1,NFC_FRI1.1_WK902_PREP1,NFC_FRI1.1_WK902_R16_1,NFC_FRI1.1_WK904_PREP1,NFC_FRI1.1_WK904_R17_1,NFC_FRI1.1_WK906_R18_1,NFC_FRI1.1_WK908_PREP1,NFC_FRI1.1_WK908_R19_1,NFC_FRI1.1_WK910_PREP1,NFC_FRI1.1_WK910_R20_1,NFC_FRI1.1_WK912_PREP1,NFC_FRI1.1_WK912_R21_1,NFC_FRI1.1_WK914_PREP1,NFC_FRI1.1_WK914_R22_1,NFC_FRI1.1_WK914_R22_2,NFC_FRI1.1_WK916_R23_1,NFC_FRI1.1_WK918_R24_1,NFC_FRI1.1_WK920_PREP1,NFC_FRI1.1_WK920_R25_1,NFC_FRI1.1_WK922_PREP1,NFC_FRI1.1_WK922_R26_1,NFC_FRI1.1_WK924_PREP1,NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,NFC_FRI1.1_WK934_PREP_1,NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $ 27 * 28 */ 29 30 #ifndef PHFRINFC_MAPTOOLS_H 31 #define PHFRINFC_MAPTOOLS_H 32 33 #include <phFriNfc.h> 34 #if !defined PH_HAL4_ENABLE 35 #include <phHal4Nfc.h> 36 #endif 37 #include <phNfcTypes.h> 38 #include <phNfcStatus.h> 39 #include <phFriNfc_NdefMap.h> 40 41 /*! 42 * \name phFriNfc_MapTools.h 43 * This file has functions which are used common across all the 44 typ1/type2/type3/type4 tags. 45 * 46 */ 47 /*@{*/ 48 49 #define PH_FRINFC_NDEFMAP_TLVLEN_ZERO 0 50 51 /* NFC Device Major and Minor Version numbers*/ 52 /* !!CAUTION!! these needs to be updated periodically.Major and Minor version numbers 53 should be compatible to the version number of currently implemented mapping document. 54 Example : NFC Device version Number : 1.0 , specifies 55 Major VNo is 1, 56 Minor VNo is 0 */ 57 #define PH_NFCFRI_NDEFMAP_NFCDEV_MAJOR_VER_NUM 0x01 58 #define PH_NFCFRI_NDEFMAP_NFCDEV_MINOR_VER_NUM 0x00 59 60 /* Macros to find major and minor TAG : Ex:Type1/Type2/Type3/Type4 version numbers*/ 61 #define PH_NFCFRI_NDEFMAP_GET_MAJOR_TAG_VERNO(a) (((a) & (0xf0))>>(4)) 62 #define PH_NFCFRI_NDEFMAP_GET_MINOR_TAG_VERNO(a) ((a) & (0x0f)) 63 64 /* NFC Device Major and Minor Version numbers*/ 65 /* !!CAUTION!! these needs to be updated periodically.Major and Minor version numbers 66 should be compatible to the version number of currently implemented mapping document. 67 Example : NFC Device version Number : 1.0 , specifies 68 Major VNo is 1, 69 Minor VNo is 0 */ 70 #define PH_NFCFRI_MFSTDMAP_NFCDEV_MAJOR_VER_NUM 0x40 71 #define PH_NFCFRI_MFSTDMAP_NFCDEV_MINOR_VER_NUM 0x00 72 73 /* Macros to find major and minor TAG : Ex:Type1/Type2/Type3/Type4 version numbers*/ 74 #define PH_NFCFRI_MFSTDMAP_GET_MAJOR_TAG_VERNO(a) ((a) & (0x40)) // must be 0xC0 75 #define PH_NFCFRI_MFSTDMAP_GET_MINOR_TAG_VERNO(a) ((a) & (0x30)) 76 77 /*! 78 * \name NDEF Mapping - states of the Finite State machine 79 * 80 */ 81 /*@{*/ 82 83 84 NFCSTATUS phFriNfc_MapTool_ChkSpcVer( const phFriNfc_NdefMap_t *NdefMap, 85 uint8_t VersionIndex); 86 87 NFCSTATUS phFriNfc_MapTool_SetCardState(phFriNfc_NdefMap_t *NdefMap, 88 uint32_t Length); 89 90 #endif //PHFRINFC_MAPTOOLS_H 91