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.h 19 * \brief NFC FRI Main Header. 20 * 21 * Project: NFC-FRI 22 * 23 * $Date: Thu Feb 11 18:45:30 2010 $ 24 * $Author: ing04880 $ 25 * $Revision: 1.19 $ 26 * $Aliases: 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_H /* */ 31 #define PHFRINFC_H /* */ 32 #include <phNfcTypes.h> 33 #include <phOsalNfc.h> 34 35 #define PH_HAL4_ENABLE 36 37 #ifdef PH_HAL4_ENABLE 38 #include <phNfcConfig.h> 39 #define LOCK_BITS_CHECK_ENABLE 40 #endif 41 42 #ifdef DISABLE_MIFARE_MAPPING 43 #define PH_FRINFC_MAP_MIFAREUL_DISABLED 44 #define PH_FRINFC_MAP_MIFARESTD_DISABLED 45 #define PH_FRINFC_MAP_DESFIRE_DISABLED 46 #else 47 #define PH_NDEF_MIFARE_ULC 48 #endif 49 50 #ifdef DISABLE_FELICA_MAPPING 51 #define PH_FRINFC_MAP_FELICA_DISABLED 52 #endif 53 54 #ifdef DISABLE_JEWEL_MAPPING 55 #define PH_FRINFC_MAP_TOPAZ_DISABLED 56 #define PH_FRINFC_MAP_TOPAZ_DYNAMIC_DISABLED 57 #endif 58 59 60 #ifdef DISABLE_FORMAT 61 #define PH_FRINFC_FMT_DESFIRE_DISABLED 62 #define PH_FRINFC_FMT_MIFAREUL_DISABLED 63 #define PH_FRINFC_FMT_MIFARESTD_DISABLED 64 #endif /* #ifdef DISABLE_FORMAT */ 65 66 #define PH_FRINFC_FMT_TOPAZ_DISABLED 67 68 /*! 69 * \name NFC FRI Main Header 70 * 71 * File: \ref phFriNfc.h 72 * 73 */ 74 /*@{*/ 75 76 #define PH_FRINFC_FILEREVISION "$Revision: 1.19 $" /**< \ingroup grp_file_attributes */ 77 #define PH_FRINFC_FILEALIASES "$Aliases: 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 $" /**< \ingroup grp_file_attributes */ 78 79 /*@}*/ 80 81 82 /*! 83 * \ingroup grp_fri_nfc_common 84 * 85 * \brief \copydoc page_cb Completion Routine 86 * 87 * NFC-FRI components that work in an overlapped style need to provide a function that is compatible 88 * to this definition.\n\n 89 * It is \b mandatory to define such a routine for components that interact with other components up or 90 * down the stack. Moreover, such components shall provide a function within their API to enable the 91 * setting of the \b Completion \b Routine address and parameters. 92 * 93 * \par First Parameter: Context 94 * Set to the address of the called instance (component instance context structure). For instance, 95 * a component that needs to give control to a component up the stack needs to call the completion 96 * routine of the \b upper component. The value to assign to this parameter is the \b address of 97 * the context structure instance of the called component. Such a structure usually contains all 98 * variables, data or state information a component member needs for operation. The address of the 99 * upper instance must be known by the lower (completing) instance. The mechanism to ensure that this 100 * information is present involves the structure \ref phFriNfc_CplRt_t . See its documentation for 101 * further information. 102 * 103 * \par Second Parameter: Status Value 104 * The lower layer hands over the completion status via this parameter. The completion 105 * routine that has been called needs to process the status in a way that is comparable to what 106 * a regular function return value would require. 107 * 108 * \note The prototype of the component's \b Process(ing) functions has to be compatible to this 109 * function pointer declaration for components interacting with others. In other cases, where 110 * there is no interaction or asynchronous processing the definition of the \b Process(ing) 111 * function can be arbitrary, if present at all. 112 */ 113 114 typedef void (*pphFriNfc_Cr_t)(void*, NFCSTATUS); 115 116 117 /*! 118 * \ingroup grp_fri_nfc_common 119 * 120 * \brief Completion Routine structure 121 * 122 * This structure finds itself within each component that requires to report completion 123 * to an upper (calling) component.\n\n 124 * Depending on the actual implementation (static or dynamic completion information) the stack 125 * initialisation \b or the calling component needs to inform the initialised \b or called component 126 * about the completion path. This information is submitted via this structure. 127 * 128 */ 129 typedef struct phFriNfc_CplRt 130 { 131 pphFriNfc_Cr_t CompletionRoutine; /*!< Address of the upper Layer's \b Process(ing) function to call upon completion. 132 * The stack initialiser (or depending on the implementation: the calling component) 133 * needs to set this member to the address of the function that needs to be within 134 * the completion path: A calling component would give its own processing function 135 * address to the lower layer. 136 */ 137 void *Context; /*!< Instance address (context) parameter. 138 * The stack initialiser (or depending on the implementation: the calling component) 139 * needs to set this member to the address of the component context structure instance 140 * within the completion path: A calling component would give its own instance address 141 * to the lower layer. 142 */ 143 } phFriNfc_CplRt_t; 144 145 146 #define NFCSTATUS_INVALID_DEVICE_REQUEST (0x10F5) 147 148 149 #endif /* __PHFRINFC_H__ */ 150