code update
[adaptation/devices/nfc-plugin-nxp.git] / inc / phNfcTypes.h
1 /*\r
2  * Copyright (C) 2010 NXP Semiconductors\r
3  *\r
4  * Licensed under the Apache License, Version 2.0 (the "License");\r
5  * you may not use this file except in compliance with the License.\r
6  * You may obtain a copy of the License at\r
7  *\r
8  *      http://www.apache.org/licenses/LICENSE-2.0\r
9  *\r
10  * Unless required by applicable law or agreed to in writing, software\r
11  * distributed under the License is distributed on an "AS IS" BASIS,\r
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
13  * See the License for the specific language governing permissions and\r
14  * limitations under the License.\r
15  */\r
16 \r
17 /*\r
18  * \file  phNfcTypes.h\r
19  * \brief Basic type definitions.\r
20  *\r
21  * Project: NFC MW / HAL\r
22  *\r
23  * $Date: Thu Jun 25 21:24:53 2009 $\r
24  * $Author: ing04880 $\r
25  * $Revision: 1.13 $\r
26  * $Aliases: 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 $\r
27  *\r
28  */\r
29 \r
30 #ifndef PHNFCTYPES /* */\r
31 #define PHNFCTYPES /* */\r
32 \r
33 /**\r
34  *  \name NFC Types\r
35  *\r
36  * File: \ref phNfcTypes.h\r
37  *\r
38  */\r
39 /*@{*/\r
40 #define PHNFCTYPES_FILEREVISION "$Revision: 1.13 $" /**< \ingroup grp_file_attributes */\r
41 #define PHNFCTYPES_FILEALIASES  "$Aliases: 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 $"     /**< \ingroup grp_file_attributes */\r
42 /*@}*/\r
43 \r
44 #ifndef _WIN32\r
45 #include <stdint.h>\r
46 #else\r
47 #include <Windows.h>\r
48 #include <stdio.h>\r
49 #define snprintf _snprintf\r
50 \r
51 #ifndef linux\r
52 /**\r
53  *  \name Basic Type Definitions\r
54  *\r
55  *  Constant-length-type definition ('C99).\r
56  *\r
57  */\r
58 /*@{*/\r
59 #ifndef __int8_t_defined /* */\r
60 #define __int8_t_defined /* */\r
61 typedef signed   char   int8_t;         /**<  \ingroup grp_nfc_common\r
62                                                8 bit signed integer */\r
63 #endif\r
64 \r
65 #ifndef __int16_t_defined /* */\r
66 #define __int16_t_defined /* */\r
67 typedef signed   short  int16_t;        /**< \ingroup grp_nfc_common\r
68                                              16 bit signed integer */\r
69 #endif\r
70 \r
71 #ifndef __stdint_h\r
72 #ifndef __int32_t_defined /* */\r
73 #define __int32_t_defined /* */\r
74 typedef signed   long   int32_t;        /**< \ingroup grp_nfc_common\r
75                                              32 bit signed integer */\r
76 #endif\r
77 #endif\r
78 \r
79 #ifndef __uint8_t_defined /* */\r
80 #define __uint8_t_defined /* */\r
81 typedef unsigned char   uint8_t;        /**<  \ingroup grp_nfc_common\r
82                                               8 bit unsigned integer */\r
83 #endif\r
84 \r
85 #ifndef __uint16_t_defined /* */\r
86 #define __uint16_t_defined /* */\r
87 typedef unsigned short  uint16_t;       /**< \ingroup grp_nfc_common\r
88                                              16 bit unsigned integer */\r
89 #endif\r
90 \r
91 #ifndef __stdint_h\r
92 #ifndef __uint32_t_defined /* */\r
93 #define __uint32_t_defined /* */\r
94 typedef unsigned long   uint32_t;       /**< \ingroup grp_nfc_common\r
95                                              32 bit unsigned integer */\r
96 #endif\r
97 #endif\r
98 \r
99 #endif /* linux */\r
100 \r
101 #endif /* _WIN32 */\r
102 \r
103 #ifndef TRUE\r
104 #define TRUE                    (0x01)                    /**< \ingroup grp_nfc_common\r
105                                               Logical True Value */\r
106 #endif\r
107 \r
108 #ifndef FALSE\r
109 #define FALSE                   (0x00)                    /**< \ingroup grp_nfc_common\r
110                                               Logical False Value */\r
111 #endif\r
112 \r
113 typedef uint8_t                 utf8_t;                 /**< \ingroup grp_nfc_common\r
114                                              UTF8 Character String */\r
115 \r
116 typedef uint8_t                 bool_t;                 /**< \ingroup grp_nfc_common\r
117                                                                                                 boolean data type */\r
118 \r
119 typedef uint16_t        NFCSTATUS;      /**< \ingroup grp_nfc_common\r
120                                              NFC return values \r
121                                          \ref phNfcStatus.h for different status\r
122                                           values */\r
123 \r
124 #ifndef NULL\r
125 #define NULL  ((void *)0)\r
126 #endif\r
127 \r
128 /* This Macro to be used to resolve Unused and unreference\r
129  * compiler warnings. \r
130  */\r
131 \r
132 #define PHNFC_UNUSED_VARIABLE(x) for((x)=(x);(x)!=(x);)\r
133 \r
134 /*@}*/\r
135 \r
136 /**\r
137  *\r
138  *  \name HAL Overall Definitions\r
139  *\r
140  *  Definitions applicable to a variety of purposes and functions/features.\r
141  *\r
142  */\r
143  /*@{*/\r
144 \r
145 #define PHHAL_COMMON_MAX_STRING_LENGTH  0x40U     /**< \ingroup grp_hal_common\r
146                                                      Maximum vendor name length in bytes. */\r
147 #define PHHAL_UNKNOWN_DEVICE_TYPE       0x00U   /**< \ingroup grp_hal_common\r
148                                                      Unknown device type. */\r
149 #define PHHAL_SERIAL_DEVICE             0x01U  /**< \ingroup grp_hal_common\r
150                                                      Serial device type.  */\r
151 #define PHHAL_USB_DEVICE                0x02U   /**< \ingroup grp_hal_common\r
152                                                      USB device type. */\r
153 #define PHHAL_I2C_DEVICE                0x03U   /**< \ingroup grp_hal_common\r
154                                                      I2C device type. */\r
155 #define PHHAL_SPI_DEVICE                0x04U   /**< \ingroup grp_hal_common\r
156                                                      SPI device type. */\r
157 #define PHHAL_PARALLEL_DEVICE           0x05U   /**< \ingroup grp_hal_common\r
158                                                      Parallel device type. */\r
159 #define PHHAL_NFCID_LENGTH              0x0AU  /**< \ingroup grp_hal_common\r
160                                                      Maximum length of NFCID 1..3. */\r
161 \r
162 #define PHHAL_MAX_DATASIZE              0xFBU       /* 256 * Maximum Data size sent\r
163                                                      * by the HAL\r
164                                                      */\r
165 \r
166 #define PHHAL_ATQA_LENGTH               0x02U       /**< ATQA length */\r
167 #define PHHAL_MAX_UID_LENGTH            0x0AU       /**< Maximum UID length expected */\r
168 #define PHHAL_MAX_ATR_LENGTH            0x30U       /**< Maximum ATR_RES (General Bytes) \r
169                                                      *   length expected */\r
170 \r
171 #define PHHAL_ATQB_LENGTH               0x0BU       /**< ATQB length */\r
172 \r
173 #define PHHAL_PUPI_LENGTH               0x04U       /**< PUPI length */\r
174 #define PHHAL_APP_DATA_B_LENGTH         0x04U       /**< Application Data length for Type B */\r
175 #define PHHAL_PROT_INFO_B_LENGTH        0x03U       /**< Protocol info length for Type B */\r
176 #define PHHAL_FEL_SYS_CODE_LEN          0x02U       /**< Felica System Code Length */\r
177 #define PHHAL_FEL_ID_LEN                0x08U       /**< Felica current ID Length */\r
178 #define PHHAL_FEL_PM_LEN                0x08U       /**< Felica current PM Length */\r
179 #define PHHAL_15693_UID_LENGTH          0x08U       /**< Length of the Inventory bytes for\r
180                                                          ISO15693 Tag */\r
181 \r
182 #define VENDOR_NAME_LEN                 0x14U\r
183 #define MAX_TRANSFER_UNIT               0x21U \r
184 #define SESSIONID_SIZE                  0x08U\r
185 #define MAX_AID_LEN                     0x10U\r
186 #define MAX_UICC_PARAM_LEN              0xFFU\r
187 \r
188 #define MIFARE_BITMASK                  0x08U\r
189 #define ISO_14443_BITMASK               0x20U\r
190 #define ISO_14443_DETECTED              0x20U\r
191 #define NFCIP_BITMASK                   0x40U\r
192 #define NFCIP_DETECTED                  0x40U\r
193 \r
194 #define MAX_TARGET_SUPPORTED            MAX_REMOTE_DEVICES\r
195 \r
196 #define NFC_HW_PN65N                    0x10U\r
197 \r
198 #define NXP_NFCIP_NFCID2_ID             0x01FEU\r
199 \r
200 #define NXP_FULL_VERSION_LEN            0x0BU\r
201 \r
202 \r
203 /*@}*/\r
204 \r
205 \r
206 /**\r
207  *  \name NFC specific Type Definitions\r
208  *\r
209  */\r
210 /*@{*/\r
211 \r
212 /**\r
213  * Data Buffer Structure to hold the Data Buffer\r
214  *\r
215  * This structure holds the Data in the Buffer of the specified \r
216  * size.\r
217  * \r
218  */\r
219 typedef struct phNfc_sData_t\r
220 {\r
221     uint8_t             *buffer;\r
222     uint32_t            length;\r
223 } phNfc_sData_t;\r
224 \r
225 /**\r
226  * \brief Possible Hardware Configuration exposed to upper layer.\r
227  * Typically this should be at least the communication link (Ex:"COM1","COM2")\r
228  * the controller is connected to.\r
229  */   \r
230 typedef struct phLibNfc_sConfig_t\r
231 {\r
232    /** Device node of the controller */\r
233    const char*               deviceNode;\r
234    /** The client ID (thread ID or message queue ID) */\r
235    unsigned int              nClientId;\r
236 } phLibNfc_sConfig_t, *pphLibNfc_sConfig_t;\r
237 \r
238 \r
239 /*!\r
240  * NFC Message structure contains message specific details like\r
241  * message type, message specific data block details, etc.\r
242  */\r
243 typedef struct phLibNfc_Message_t\r
244 {\r
245     uint32_t eMsgType;/**< Type of the message to be posted*/\r
246     void   * pMsgData;/**< Pointer to message specific data block in case any*/\r
247     uint32_t Size;/**< Size of the datablock*/\r
248 } phLibNfc_Message_t,*pphLibNfc_Message_t;\r
249 \r
250 \r
251 #ifdef WIN32\r
252 #define PH_LIBNFC_MESSAGE_BASE  (WM_USER+0x3FF)\r
253 #endif\r
254 /**\r
255  * Deferred message. This message type will be posted to the client application thread\r
256  * to notify that a deferred call must be invoked.\r
257  */\r
258 #define PH_LIBNFC_DEFERREDCALL_MSG                        (0x311)\r
259 \r
260 /**\r
261  *\brief Deferred call declaration.\r
262  * This type of API is called from ClientApplication ( main thread) to notify \r
263  * specific callback.\r
264  */\r
265 typedef  void (*pphLibNfc_DeferredCallback_t) (void*);\r
266 /**\r
267  *\brief Deferred parameter declaration.\r
268  * This type of data is passed as parameter from ClientApplication (main thread) to the \r
269  * callback.\r
270  */\r
271 typedef  void *pphLibNfc_DeferredParameter_t;\r
272 /**\r
273  *\brief Deferred message specific info declaration.\r
274  * This type of information is packed as message data when \ref PH_LIBNFC_DEFERREDCALL_MSG \r
275  * type message is posted to message handler thread.\r
276  */ \r
277 typedef struct phLibNfc_DeferredCall_t\r
278 {\r
279                 pphLibNfc_DeferredCallback_t  pCallback;/**< pointer to Deferred callback */\r
280                 pphLibNfc_DeferredParameter_t pParameter;/**< pointer to Deferred parameter */\r
281 } phLibNfc_DeferredCall_t;\r
282 \r
283 \r
284 /** \ingroup  grp_hal_common\r
285  *\r
286  *  \brief Protocol Support Information\r
287  *\r
288  *  The <em> Supported Protocols Structure </em> holds all protocol supported by the current NFC\r
289  *  device.\r
290  *\r
291  *  \note All members of this structure are output parameters [out].\r
292  *\r
293  */\r
294 typedef struct phNfc_sSupProtocol_t\r
295 {\r
296     unsigned int MifareUL    : 1;  /**< Protocol Mifare Ultra Light or \r
297                                    any NFC Forum Type-2 tags */\r
298     unsigned int MifareStd   : 1;  /**< Protocol Mifare Standard. */\r
299     unsigned int ISO14443_4A : 1;  /**< Protocol ISO14443-4 Type A.  */\r
300     unsigned int ISO14443_4B : 1;  /**< Protocol ISO14443-4 Type B.  */\r
301     unsigned int ISO15693    : 1;  /**< Protocol ISO15693 HiTag.  */\r
302     unsigned int Felica      : 1;  /**< Protocol Felica. */\r
303     unsigned int NFC         : 1;  /**< Protocol NFC. */\r
304     unsigned int Jewel       : 1;  /**< Protocol Innovision Jewel Tag. */\r
305     /*** TODO: Add SWP, ETSI HCI to this list **/\r
306 } phNfc_sSupProtocol_t;\r
307 \r
308 \r
309 /** \ingroup grp_hal_common\r
310  *\r
311  *\r
312  *  \brief Information related to the NFC Device\r
313  *\r
314  *  The <em> Device Information Structure </em> holds information\r
315  *  related to the NFC IC read during initialization time. \r
316  *  It allows the caller firware, hardware version, the model id,\r
317  *  HCI verison supported and vendor name. Refer to the NFC Device \r
318  *  User Manual on how to interpret each of the values. In addition\r
319  *  it also contains capabilities of the NFC Device such as the \r
320  *  protocols supported in Reader and emulation mode\r
321  *\r
322  */\r
323 typedef struct phNfc_sDeviceCapabilities_t\r
324 {\r
325     /* */\r
326     uint32_t                hal_version; /**< \ingroup grp_hal_common\r
327                                               HAL 4.0 Version Information. */\r
328     uint32_t                fw_version; /**< \ingroup grp_hal_common\r
329                                               Firmware Version Info. */\r
330     uint32_t                hw_version; /**< \ingroup grp_hal_common\r
331                                               Hardware Version Info. */\r
332     uint8_t                 model_id;   /**< \ingroup grp_hal_common\r
333                                               IC Variant . */\r
334     uint8_t                 hci_version; /**< \ingroup grp_hal_common\r
335                                               ETSI HCI Version Supported */\r
336     utf8_t                  vendor_name[VENDOR_NAME_LEN]; /**< \ingroup grp_hal_common\r
337                                               Vendor name (Null terminated string)*/\r
338     uint8_t                 full_version[NXP_FULL_VERSION_LEN];\r
339 \r
340     phNfc_sSupProtocol_t    ReaderSupProtocol; /**< Supported protocols \r
341                                                       (Bitmapped) in Reader mode. */\r
342     phNfc_sSupProtocol_t    EmulationSupProtocol;    /**< Supported protocols\r
343                                                        (Bitmapped) in Emulation \r
344                                                         mode. */\r
345     char                    firmware_update_info; /** */\r
346 } phNfc_sDeviceCapabilities_t;\r
347 \r
348 \r
349 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\r
350 \r
351 \r
352 /** \ingroup grp_hal_common\r
353  *\r
354  *  \brief Enumerated MIFARE Commands\r
355  *\r
356  *  The <em> Mifare Command List Enumerator </em> lists all available Mifare native commands.\r
357  *\r
358  * \note None.\r
359  *\r
360  */\r
361 typedef enum phNfc_eMifareCmdList_t\r
362 {\r
363     phNfc_eMifareRaw        = 0x00U,     /**< This command performs raw transcations .\r
364                                               Format of the phLibNfc_sTransceiveInfo_t \r
365                                               content in this case shall be as below: \r
366                                                 \95   cmd: filed shall set to  phHal_eMifareRaw . \r
367                                                 \95   addr : doesn't carry any significance.\r
368                                                 \95   sSendData : Shall contain formatted raw buffer \r
369                                                                 based on MIFARE commands type used. \r
370                                                                 Formatted buffer shall follow below \r
371                                                                 formating scheme.\r
372  \r
373                                               CmdType+ Block No + CommandSpecific data + 2 byte CRC\r
374                                               Ex: With  Write  4 byte command  on block 8  looks as \r
375                                               " 0xA2,0x08,0x01,0x02,0x03,0x04,CRC1,CRC2 \r
376                                               Note :  For MIFARE Std card we recommend use MIFARE \r
377                                                       commands directly.\r
378                                            */\r
379     phNfc_eMifareAuthentA   = 0x60U,     /**< Mifare Standard:\n\r
380                                               This command performs an authentication with KEY A for a sector.\n\r
381                                               Format of the phLibNfc_sTransceiveInfo_t content in this case is : \r
382                                                 \95       cmd: field shall set to  phHal_eMifareAuthentA . \r
383                                                 \95       addr : indicates MIFARE block address. \r
384                                                            Ex: 0x08 indicates block 8 needs to be authenticated.\r
385                                                 \95       sSendData : Shall contain authentication key values. \r
386                                                                     sSendData ,buffer shall contain authentication \r
387                                                                     key values 01 02 03 04 05 06 authenticates \r
388                                                                     block 08 with the key 0x01[..]06. If this \r
389                                                                     command fails, then  user needs to reactivate \r
390                                                                     the remote Mifare card.                                            \r
391                                           */\r
392     phNfc_eMifareAuthentB   = 0x61U,     /**< Mifare Standard:\n\r
393                                               This command performs an authentication with KEY B for a sector.\n\r
394                                               Format of the phLibNfc_sTransceiveInfo_t content in this case is : \r
395                                                 \95       cmd: field shall set to  phHal_eMifareAuthentB . \r
396                                                 \95       addr : indicates MIFARE block address. \r
397                                                            Ex: 0x08 indicates block 8 needs to be authenticated.\r
398                                                 \95       sSendData : Shall contain authentication key values. \r
399                                                                     sSendData ,buffer shall contain authentication \r
400                                                                     key values 01 02 03 04 05 06 authenticates \r
401                                                                     block 08 with the key 0x01[..]06. If this \r
402                                                                     command fails, then  user needs to reactivate \r
403                                                                     the remote Mifare card.   \r
404                                           */\r
405     phNfc_eMifareRead16     = 0x30U,     /**< Mifare Standard and Ultra Light:\n\r
406                                               Read 16 Bytes from a Mifare Standard block or 4 Mifare Ultra Light pages.\n\r
407                                               Format of the phLibNfc_sTransceiveInfo_t content in this case is : \r
408                                                 \95       cmd: field shall set to  phHal_eMifareRead16 . \r
409                                                 \95       addr : memory adress to read.   \r
410                                                 \95       sRecvData : Shall contain buffer of size 16 \r
411                                                                     to read the data into.                                                                  \r
412 \r
413                                               If this command fails, the user needs to reactivate the \r
414                                               the remote Mifare card\r
415                                           */\r
416     phNfc_eMifareRead       = 0x30U,\r
417     phNfc_eMifareWrite16    = 0xA0U,     /**< Mifare Standard and Ultra Light:\n\r
418                                               Write 16 Bytes to a Mifare Standard block or 4 Mifare Ultra Light pages.\n\r
419                                               Format of the phLibNfc_sTransceiveInfo_t content in this case is : \r
420                                                 \95       cmd: field shall set to  phHal_eMifareWrite16 . \r
421                                                 \95       addr : starting memory adress to write from.   \r
422                                                 \95       sSendData : Shall contain buffer of size 16 containing\r
423                                                                     the data bytes to be written.                                                                  \r
424                                              \r
425                                               If this command fails, the user needs to reactivate the \r
426                                               the remote Mifare card\r
427                                            */\r
428     phNfc_eMifareWrite4     = 0xA2U,     /**< Mifare Ultra Light:\n\r
429                                               Write 4 bytes.\n\r
430                                               Format of the phLibNfc_sTransceiveInfo_t content in this case is : \r
431                                                 \95       cmd: field shall set to  phHal_eMifareWrite4 . \r
432                                                 \95       addr : starting memory adress to write from.   \r
433                                                 \95       sSendData : Shall contain buffer of size 4 containing\r
434                                                                     the data bytes to be written.                                                                  \r
435 \r
436                                               If this command fails, the user needs to reactivate the \r
437                                               the remote Mifare card\r
438                                           */\r
439     phNfc_eMifareInc        = 0xC1U,     /**< Increment. */\r
440     phNfc_eMifareDec        = 0xC0U,     /**< Decrement. */\r
441     phNfc_eMifareTransfer   = 0xB0U,     /**< Tranfer.   */\r
442     phNfc_eMifareRestore    = 0xC2U,     /**< Restore.   */\r
443     phNfc_eMifareReadSector = 0x38U,     /**< Read Sector.   */\r
444     phNfc_eMifareWriteSector= 0xA8U,     /**< Write Sector.   */\r
445     phNfc_eMifareInvalidCmd = 0xFFU      /**< Invalid Command */\r
446 } phNfc_eMifareCmdList_t;\r
447 \r
448 \r
449 /** \ingroup grp_hal_common\r
450  *\r
451  *  The <em> T=Cl Command List Enumerator </em> lists all available T=Cl Commands.\r
452  *\r
453  * \note None.\r
454  *\r
455  */\r
456 typedef enum phNfc_eIso14443_4_CmdList_t\r
457 {\r
458     phNfc_eIso14443_4_Raw             = 0x00U /**< ISO 14443-4 Exchange command:\n\r
459                                                  - This command sends the data buffer directly \r
460                                                  to the remote device */\r
461 \r
462 } phNfc_eIso14443_4_CmdList_t;\r
463 \r
464 \r
465 /** \ingroup grp_hal_common\r
466  *\r
467  *  The <em> NFCIP1 Command List Enumerator </em> lists all available NFCIP1 Commands.\r
468  *\r
469  * \note None.\r
470  *\r
471  */\r
472 typedef enum phNfc_eNfcIP1CmdList_t\r
473 {\r
474        phNfc_eNfcIP1_Raw             = 0x00U /**< NfcIP Exchange command:\n\r
475                                                  - This command sends the data buffer directly \r
476                                                   to the remote device */\r
477 }phNfc_eNfcIP1CmdList_t;\r
478 \r
479 \r
480 /** \ingroup grp_hal_common\r
481  *\r
482  *  The <em> ISO15693 Command List Enumerator </em> lists all available ISO15693 Commands.\r
483  *\r
484  * \note None.\r
485  *\r
486  */\r
487 typedef enum phNfc_eIso15693_CmdList_t\r
488 {\r
489 #if 0\r
490     phNfc_eIso15693_Raw             = 0x00U, /**< ISO 15693 Exchange Raw command:\n\r
491                                                  - This command sends the data buffer directly \r
492                                                  to the remote device */\r
493 #endif\r
494     phNfc_eIso15693_Cmd             = 0x20U, /**< ISO 15693 Exchange command:\n\r
495                                                  - This command is used to access the card \r
496                                                  to the remote device */\r
497     phNfc_eIso15693_Invalid         = 0xFFU      /**< Invalid Command */\r
498 } phNfc_eIso15693_CmdList_t;\r
499 \r
500 \r
501 /** \ingroup grp_hal_common\r
502  *\r
503  *  The <em> Felica Command List Enumerator </em> lists all available Felica Commands.\r
504  *\r
505  * \note None.\r
506  *\r
507  */\r
508 typedef enum phNfc_eFelicaCmdList_t\r
509 {\r
510     phNfc_eFelica_Raw             = 0xF0U, /**< Felica Raw command:\n\r
511                                                  - This command sends the data buffer directly \r
512                                                  to the remote device */\r
513     phNfc_eFelica_Check           = 0x00, /**< Felica Check command:\n\r
514                                                  - This command checks the data from the Felica\r
515                                                   remote device */\r
516     phNfc_eFelica_Update          = 0x01, /**< Felica Update command:\n\r
517                                                  - This command updates the data onto the Felica\r
518                                                   remote device */\r
519     phNfc_eFelica_Invalid         = 0xFFU      /**< Invalid Command */\r
520 } phNfc_eFelicaCmdList_t;\r
521 \r
522 \r
523 /** \ingroup grp_hal_common\r
524  *\r
525  *  The <em> Jewel Command List Enumerator </em> lists all available Jewel Commands.\r
526  *\r
527  * \note None.\r
528  *\r
529  */\r
530 typedef enum phNfc_eJewelCmdList_t\r
531 {\r
532     phNfc_eJewel_Raw            = 0x00U, /**< Jewel command:\n\r
533                                                  - This command sends the data buffer directly \r
534                                                  to the remote device */\r
535     phNfc_eJewel_Invalid        = 0xFFU  /**< Invalid jewel command */\r
536 }phNfc_eJewelCmdList_t;\r
537 \r
538 \r
539 /** \ingroup grp_hal_nfci\r
540 *\r
541 *  \brief Remote Device Reader A RF Gate Information Container \r
542 *\r
543 *  The <em> Reader A structure </em> includes the available information\r
544 *  related to the discovered ISO14443A remote device. This information \r
545 *  is updated for every device discovery.\r
546 *  \note None.\r
547 *\r
548 */\r
549 typedef struct phNfc_sIso14443AInfo_t\r
550 {\r
551     uint8_t         Uid[PHHAL_MAX_UID_LENGTH];      /**< UID information of the TYPE A\r
552                                                        Tag Discovered */\r
553     uint8_t         UidLength;                      /**< UID information length, shall not be greater \r
554                                                     than PHHAL_MAX_UID_LENGTH i.e., 10 */\r
555     uint8_t         AppData[PHHAL_MAX_ATR_LENGTH]; /**< Application data information of the \r
556                                                         tag discovered (= Historical bytes for \r
557                                                         type A) */  \r
558     uint8_t         AppDataLength;                  /**< Application data length */\r
559     uint8_t         Sak;                            /**< SAK informationof the TYPE A\r
560                                                        Tag Discovered */\r
561     uint8_t         AtqA[PHHAL_ATQA_LENGTH];        /**< ATQA informationof the TYPE A\r
562                                                        Tag Discovered */\r
563     uint8_t         MaxDataRate;                    /**< Maximum data rate supported by the TYPE A\r
564                                                        Tag Discovered */\r
565     uint8_t         Fwi_Sfgt;                       /**< Frame waiting time and start up frame guard \r
566                                                     time as defined in ISO/IEC 14443-4[7] for \r
567                                                     type A */\r
568 } phNfc_sIso14443AInfo_t;\r
569 \r
570 \r
571 /** \ingroup grp_hal_nfci\r
572 *\r
573 *  \brief Remote Device Reader B RF Gate Information Container \r
574 *\r
575 *  The <em> Reader B structure </em> includes the available information\r
576 *  related to the discovered ISO14443B remote device. This information \r
577 *  is updated for every device discovery.\r
578 *  \note None.\r
579 *\r
580 */\r
581 typedef struct phNfc_sIso14443BInfo_t \r
582 {\r
583     union phNfc_uAtqBInfo\r
584     {\r
585         struct phNfc_sAtqBInfo\r
586         {\r
587             uint8_t         Pupi[PHHAL_PUPI_LENGTH];            /**< PUPI information  of the TYPE B\r
588                                                                     Tag Discovered */\r
589             uint8_t         AppData[PHHAL_APP_DATA_B_LENGTH];   /**< Application Data  of the TYPE B\r
590                                                                     Tag Discovered */\r
591             uint8_t         ProtInfo[PHHAL_PROT_INFO_B_LENGTH]; /**< Protocol Information  of the TYPE B\r
592                                                                     Tag Discovered */\r
593         } AtqResInfo;\r
594         uint8_t         AtqRes[PHHAL_ATQB_LENGTH];          /**< ATQB Response Information of TYPE B\r
595                                                                 Tag Discovered */\r
596     } AtqB;\r
597     uint8_t         HiLayerResp[PHHAL_MAX_ATR_LENGTH];  /**< Higher Layer Response information  \r
598                                                              in answer to ATRRIB Command for Type B */  \r
599     uint8_t         HiLayerRespLength;                  /**< Higher Layer Response length */\r
600     uint8_t         Afi;                                /**< Application Family Identifier of TYPE B\r
601                                                                 Tag Discovered */\r
602     uint8_t         MaxDataRate;                        /**< Maximum data rate supported by the TYPE B\r
603                                                              Tag Discovered */\r
604 } phNfc_sIso14443BInfo_t;\r
605 \r
606 \r
607 /** \ingroup grp_hal_nfci\r
608 *\r
609 *  \brief Remote Device Reader B prime RF Gate Information Container \r
610 *\r
611 */\r
612 typedef struct phNfc_sIso14443BPrimeInfo_t \r
613 {\r
614     /* TODO: This will be updated later */\r
615     void *BPrimeCtxt;\r
616 } phNfc_sIso14443BPrimeInfo_t;\r
617 \r
618 \r
619 /** \ingroup grp_hal_nfci\r
620 *\r
621 *  \brief Remote Device Jewel Reader RF Gate Information Container \r
622 *\r
623 *  The <em> Jewel Reader structure </em> includes the available information\r
624 *  related to the discovered Jewel remote device. This information \r
625 *  is updated for every device discovery.\r
626 *  \note None.\r
627 *\r
628 */\r
629 typedef struct phNfc_sJewelInfo_t \r
630 {\r
631     uint8_t         Uid[PHHAL_MAX_UID_LENGTH];      /**< UID information of the TYPE A\r
632                                                          Tag Discovered */\r
633     uint8_t         UidLength;                      /**< UID information length, shall not be greater \r
634                                                     than PHHAL_MAX_UID_LENGTH i.e., 10 */\r
635     uint8_t         HeaderRom0; /**< Header Rom byte zero */\r
636     uint8_t         HeaderRom1; /**< Header Rom byte one */\r
637 \r
638 } phNfc_sJewelInfo_t;\r
639 \r
640 \r
641 /** \ingroup grp_hal_nfci\r
642 *\r
643 *  \brief Remote Device Felica Reader RF Gate Information Container \r
644 *\r
645 *  The <em> Felica Reader structure </em> includes the available information\r
646 *  related to the discovered Felica remote device. This information \r
647 *  is updated for every device discovery.\r
648 *  \note None.\r
649 *\r
650 */\r
651 typedef struct phNfc_sFelicaInfo_t\r
652 {\r
653     uint8_t     IDm[(PHHAL_FEL_ID_LEN + 2)];              /**< Current ID of Felica tag */\r
654     uint8_t     IDmLength;                          /**< IDm length, shall not be greater \r
655                                                     than PHHAL_FEL_ID_LEN i.e., 8 */\r
656     uint8_t     PMm[PHHAL_FEL_PM_LEN];              /**< Current PM of Felica tag */\r
657     uint8_t     SystemCode[PHHAL_FEL_SYS_CODE_LEN]; /**< System code of Felica tag */\r
658 } phNfc_sFelicaInfo_t;\r
659 \r
660 \r
661 /** \ingroup grp_hal_nfci\r
662 *\r
663 *  \brief Remote Device Reader 15693 RF Gate Information Container \r
664 *\r
665 *  The <em> Reader A structure </em> includes the available information\r
666 *  related to the discovered ISO15693 remote device. This information \r
667 *  is updated for every device discovery.\r
668 *  \note None.\r
669 *\r
670 */\r
671 \r
672 typedef struct phNfc_sIso15693Info_t\r
673 {\r
674     uint8_t         Uid[PHHAL_15693_UID_LENGTH];      /**< UID information of the 15693\r
675                                                        Tag Discovered */\r
676     uint8_t         UidLength;                      /**< UID information length, shall not be greater \r
677                                                     than PHHAL_15693_UID_LENGTH i.e., 8 */\r
678     uint8_t         Dsfid;                          /**< DSF information of the 15693\r
679                                                        Tag Discovered */\r
680     uint8_t         Flags;                          /**< Information about the Flags\r
681                                                         in the 15693 Tag Discovered */\r
682     uint8_t         Afi;                            /**< Application Family Identifier of\r
683                                                           15693 Tag Discovered */\r
684 } phNfc_sIso15693Info_t;\r
685 \r
686 \r
687 /** \ingroup grp_hal_nfci\r
688 *\r
689 *  \brief NFC Data Rate Supported between the Reader and the Target\r
690 *\r
691 *  The <em> \ref phHalNfc_eDataRate enum </em> lists all the Data Rate \r
692 *  values to be used to determine the rate at which the data is transmitted\r
693 *  to the target.\r
694 *\r
695 *  \note None.\r
696 */\r
697 \r
698 \r
699 /** \ingroup grp_hal_nfci\r
700 *\r
701 *  \brief NFCIP1 Data rates \r
702 *\r
703 */\r
704 typedef enum phNfc_eDataRate_t{\r
705     phNfc_eDataRate_106    = 0x00U, \r
706     phNfc_eDataRate_212, \r
707     phNfc_eDataRate_424, \r
708     /* phNfc_eDataRate_848, \r
709     phNfc_eDataRate_1696, \r
710     phNfc_eDataRate_3392, \r
711     phNfc_eDataRate_6784,*/\r
712     phNfc_eDataRate_RFU \r
713 } phNfc_eDataRate_t;\r
714 \r
715 \r
716 /** \ingroup grp_hal_nfci\r
717 *\r
718 *  \brief NFCIP1 Gate Information Container \r
719 *\r
720 *  The <em> NFCIP1 structure </em> includes the available information\r
721 *  related to the discovered NFCIP1 remote device. This information \r
722 *  is updated for every device discovery.\r
723 *  \note None.\r
724 *\r
725 */\r
726 typedef struct phNfc_sNfcIPInfo_t \r
727 {\r
728     /* Contains the random NFCID3I conveyed with the ATR_REQ. \r
729         always 10 bytes length \r
730         or contains the random NFCID3T conveyed with the ATR_RES.\r
731         always 10 bytes length */\r
732     uint8_t         NFCID[PHHAL_MAX_UID_LENGTH];    \r
733     uint8_t         NFCID_Length;\r
734     /* ATR_RES = General bytes length, Max length = 48 bytes */\r
735     uint8_t         ATRInfo[PHHAL_MAX_ATR_LENGTH];  \r
736     uint8_t         ATRInfo_Length;\r
737     /**< SAK information of the tag discovered */\r
738     uint8_t         SelRes;\r
739     /**< ATQA information of the tag discovered */\r
740     uint8_t         SenseRes[PHHAL_ATQA_LENGTH];\r
741     /**< Is Detection Mode of the NFCIP Target Active */\r
742     uint8_t         Nfcip_Active;\r
743     /**< Maximum frame length supported by the NFCIP device */  \r
744     uint16_t        MaxFrameLength;\r
745     /**< Data rate supported by the NFCIP device */\r
746     phNfc_eDataRate_t         Nfcip_Datarate;\r
747 \r
748 } phNfc_sNfcIPInfo_t;\r
749 \r
750 \r
751 /** \ingroup grp_hal_nfci\r
752 *\r
753 *  \brief Remote Device Specific Information Container\r
754 *\r
755 *  The <em> Remote Device Information Union </em> includes the available Remote Device Information\r
756 *  structures. Following the device detected, the corresponding data structure is used.\r
757 *\r
758 *  \note None.\r
759 *\r
760 */\r
761 typedef union phNfc_uRemoteDevInfo_t\r
762 {\r
763     phNfc_sIso14443AInfo_t          Iso14443A_Info;\r
764     phNfc_sIso14443BInfo_t          Iso14443B_Info;\r
765     phNfc_sIso14443BPrimeInfo_t     Iso14443BPrime_Info;\r
766     phNfc_sNfcIPInfo_t              NfcIP_Info;\r
767     phNfc_sFelicaInfo_t             Felica_Info;\r
768     phNfc_sJewelInfo_t              Jewel_Info;\r
769     phNfc_sIso15693Info_t           Iso15693_Info;\r
770 } phNfc_uRemoteDevInfo_t;\r
771 \r
772 \r
773 /** \ingroup grp_hal_nfci\r
774 *\r
775 *  \brief RF Device Type Listing\r
776 *\r
777 *  The <em> RF Device Type List </em> is used to identify the type of\r
778 *  remote device that is discovered/connected. There seperate\r
779 *  types to identify a Remote Reader (denoted by _PCD) and \r
780 *  Remote Tag (denoted by _PICC)\r
781 *  \note None.\r
782 *\r
783 */\r
784 typedef enum phNfc_eRFDevType_t\r
785 {\r
786     phNfc_eUnknown_DevType        = 0x00U,\r
787 \r
788     /* Specific PCD Devices */\r
789     phNfc_eISO14443_A_PCD,\r
790     phNfc_eISO14443_B_PCD,\r
791     phNfc_eISO14443_BPrime_PCD,\r
792     phNfc_eFelica_PCD,\r
793     phNfc_eJewel_PCD,\r
794     phNfc_eISO15693_PCD,\r
795     /* Generic PCD Type */\r
796     phNfc_ePCD_DevType,\r
797 \r
798     /* Generic PICC Type */\r
799     phNfc_ePICC_DevType,\r
800     /* Specific PICC Devices */\r
801     phNfc_eISO14443_A_PICC,\r
802     phNfc_eISO14443_4A_PICC,\r
803     phNfc_eISO14443_3A_PICC,\r
804     phNfc_eMifare_PICC,\r
805     phNfc_eISO14443_B_PICC,\r
806     phNfc_eISO14443_4B_PICC,\r
807     phNfc_eISO14443_BPrime_PICC,\r
808     phNfc_eFelica_PICC,\r
809     phNfc_eJewel_PICC,\r
810     phNfc_eISO15693_PICC,\r
811 \r
812     /* NFC-IP1 Device Types */\r
813     phNfc_eNfcIP1_Target, \r
814     phNfc_eNfcIP1_Initiator, \r
815 \r
816     /* Other Sources */\r
817     phNfc_eInvalid_DevType\r
818 \r
819 } phNfc_eRFDevType_t;\r
820 \r
821 \r
822 /** \ingroup grp_hal_nfci\r
823 *\r
824 *  \brief Remote Device Type Listing\r
825 *\r
826 *  The <em> Remote Device Type List </em> is used to identify the type of\r
827 *  remote device that is discovered/connected\r
828 *  \note This is same as RF Device Type List.\r
829 *\r
830 */\r
831 typedef phNfc_eRFDevType_t phNfc_eRemDevType_t;\r
832 \r
833 \r
834 /** \ingroup grp_hal_common\r
835  *\r
836  *\r
837  *  \brief Common Command Attribute\r
838  *\r
839  *  The <em> Hal Command Union </em> includes each available type of Commands.\r
840  *\r
841  * \note None.\r
842  *\r
843  */\r
844 typedef union phNfc_uCommand_t\r
845 {\r
846   phNfc_eMifareCmdList_t         MfCmd;         /**< Mifare command structure.  */\r
847   phNfc_eIso14443_4_CmdList_t    Iso144434Cmd;  /**< ISO 14443-4 command structure.  */\r
848   phNfc_eFelicaCmdList_t         FelCmd;        /**< Felica command structure.  */\r
849   phNfc_eJewelCmdList_t          JewelCmd;      /**< Jewel command structure.  */\r
850   phNfc_eIso15693_CmdList_t      Iso15693Cmd;   /**< ISO 15693 command structure.  */\r
851   phNfc_eNfcIP1CmdList_t         NfcIP1Cmd;     /**< ISO 18092 (NFCIP1) command structure */\r
852 } phNfc_uCmdList_t;\r
853 \r
854 \r
855 /** \ingroup grp_hal_nfci\r
856  *\r
857  *  \brief Remote Device Information Structure\r
858  *\r
859  *  The <em> Remote Device Information Structure </em> holds information about one single Remote\r
860  *  Device detected by the polling function .\n\r
861  *  It lists parameters common to all supported remote devices.\r
862  *\r
863  *  \note \r
864  *\r
865  *  \sa \ref phHal4Nfc_ConfigureDiscovery and \ref phHal4Nfc_Connect\r
866  *\r
867  */\r
868 typedef struct phNfc_sRemoteDevInformation_t\r
869 {\r
870     uint8_t                    SessionOpened;       /**< [out] Boolean \r
871                                                      *   Flag indicating the validity of\r
872                                                      *   the handle of the remote device. */\r
873     phNfc_eRemDevType_t        RemDevType;          /**< [out] Remote device type which says that remote \r
874                                                     is Reader A or Reader B or NFCIP or Felica or \r
875                                                     Reader B Prime or Jewel*/\r
876     phNfc_uRemoteDevInfo_t     RemoteDevInfo;       /**< Union of available Remote Device.\r
877                                                      *   \ref phNfc_uRemoteDevInfo_t Information.  */\r
878 } phNfc_sRemoteDevInformation_t;\r
879 \r
880 \r
881 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\r
882 /*    TARGET STRUCTURES */\r
883 \r
884 \r
885 /** \ingroup  grp_hal_common\r
886  *\r
887  *  \brief Transceive Information Data Structure for sending commands/response \r
888  *         to the remote device\r
889  *\r
890  *  The <em> Transceive Information Data Structure </em> is used to pass the \r
891  *  Command, Address (only required for MIFARE) and the send and receive data\r
892  *  data structure (buffer and length) for communication with remote device\r
893  *\r
894  *\r
895  */\r
896 typedef struct phNfc_sTransceiveInfo_t\r
897 {\r
898     phNfc_uCmdList_t                cmd;\r
899 \r
900     /** \internal Address Field required for only Mifare\r
901      *  Family Proprietary Cards.\r
902      *  The Address Size is Valid only upto 255 Blocks limit\r
903      *  i:e for Mifare 4K\r
904      */\r
905     uint8_t                         addr;\r
906     phNfc_sData_t                   sSendData;\r
907     phNfc_sData_t                   sRecvData;\r
908 } phNfc_sTransceiveInfo_t;\r
909 \r
910 \r
911 /** \ingroup grp_hal_nfci\r
912 *\r
913 *  \brief Poll Device Information for conifiguring the discovery wheel\r
914           Reader and Card Emulation Phases\r
915 *\r
916 *  The <em> \ref phNfc_sPollDevInfo_t enum </em> is used to enable/disable \r
917 *  phases of the discovery wheel related to specific reader types and \r
918 *  card emulation phase\r
919 *  \note Enabling specific Reader technology when NFCIP1 speed is set in the\r
920 *        phNfc_sADD_Cfg_t is implicitly done in HAL. Use this structure to only\r
921 *        enable/disable Card Reader Functionality\r
922 */\r
923 typedef struct phNfc_sPollDevInfo_t\r
924 {\r
925     unsigned                    EnableIso14443A : 1;      /**< Flag to enable \r
926                                                         Reader A discovery */\r
927     unsigned                    EnableIso14443B : 1;      /**< Flag to enable \r
928                                                         Reader B discovery */\r
929     unsigned                    EnableFelica212 : 1;   /**< Flag to enable\r
930                                                         Felica 212 discovery */\r
931     unsigned                    EnableFelica424 : 1;   /**< Flag to enable\r
932                                                         Felica 424 discovery */\r
933     unsigned                    EnableIso15693 : 1;     /**< Flag to enable \r
934                                                         ISO 15693 discovery */\r
935     unsigned                    EnableNfcActive : 1; /**< Flag to enable \r
936                                                         Active Mode of NFC-IP discovery. \r
937                                                         This is updated internally \r
938                                                         based on the NFC-IP speed.\r
939                                                         */\r
940     unsigned                    RFU : 1;                /**< Reserved for future use */\r
941     unsigned                    DisableCardEmulation : 1;    /**< Flag to \r
942                                                             disable the card emulation */\r
943 } phNfc_sPollDevInfo_t;\r
944 \r
945 \r
946 /** \ingroup grp_hal_nfci\r
947 *\r
948 *  \brief P2P speed for the Initiator\r
949 *\r
950 *  The <em> \ref phNfc_eP2PMode_t enum </em> lists all the NFCIP1 speeds \r
951 *  to be used for configuring the NFCIP1 discovery\r
952 *\r
953 *  \note None.\r
954 */\r
955 typedef enum phNfc_eP2PMode_t\r
956 {\r
957     phNfc_eDefaultP2PMode  = 0x00U,\r
958     phNfc_ePassive106 = 0x01U,\r
959     phNfc_ePassive212 = 0x02U,\r
960     phNfc_ePassive424 = 0x04U,\r
961     phNfc_eActive106 = 0x08U,\r
962     phNfc_eActive212 = 0x10U,\r
963     phNfc_eActive424 = 0x20U,\r
964     phNfc_eP2P_ALL   = 0x27U,  /* All Passive and 424 Active */\r
965     phNfc_eInvalidP2PMode = 0xFFU\r
966 } phNfc_eP2PMode_t;\r
967 \r
968 \r
969 /** \ingroup grp_hal_common\r
970 *\r
971 *  \brief Identities the type of Notification\r
972 *\r
973 *  This enumeration is used to specify the type of notification notified\r
974 *  to the upper layer. This classifies the notification into two types\r
975 *  one for the discovery notifications and the other for all the remaining\r
976 *  event notifications\r
977 *  \note None.\r
978 */\r
979 typedef enum phNfc_eNotificationType_t\r
980 {\r
981     INVALID_NFC_NOTIFICATION    = 0x00U, /* Invalid Notification */\r
982     NFC_DISCOVERY_NOTIFICATION,         /* Remote Device Discovery Notification */\r
983     NFC_EVENT_NOTIFICATION              /* Event Notification from the other hosts */\r
984 } phNfc_eNotificationType_t;\r
985 \r
986 \r
987 /** \ingroup grp_hal_common\r
988 *\r
989 *  \brief \r
990 *\r
991 *  \note None.\r
992 */\r
993 typedef struct phNfc_sUiccInfo_t\r
994 {\r
995     /* AID and Parameter Information is obtained if the\r
996      * eventType is NFC_EVT_TRANSACTION.\r
997      */\r
998     phNfc_sData_t           aid;\r
999     phNfc_sData_t           param;\r
1000 \r
1001 } phNfc_sUiccInfo_t;\r
1002 \r
1003 \r
1004 /** \ingroup grp_hal_nfci\r
1005 *\r
1006 *  \brief P2P Information for the Initiator\r
1007 *\r
1008 *  The <em> \ref phNfc_sNfcIPCfg_t </em> holds the P2P related information\r
1009 *  use by the NFC Device during P2P Discovery and connection\r
1010 *\r
1011 *  \note None.\r
1012 */\r
1013 typedef struct phNfc_sNfcIPCfg_t \r
1014 {\r
1015     /* ATR_RES = General bytes length, Max length = 48 bytes */\r
1016     uint8_t         generalBytesLength;\r
1017     uint8_t         generalBytes[PHHAL_MAX_ATR_LENGTH];  \r
1018 \r
1019     /* TODO: This will be updated later for any additional params*/\r
1020 } phNfc_sNfcIPCfg_t;\r
1021 \r
1022 \r
1023 /** \ingroup grp_hal_common\r
1024 *\r
1025 *  \brief Discovery Configuration Mode\r
1026 *\r
1027 *  This enumeration is used to choose the Discovery Configuration\r
1028 *  Mode :- Configure and Start, Stop or Start with last set \r
1029 *  configuration\r
1030 *  \note None.\r
1031 */\r
1032 typedef enum phNfc_eDiscoveryConfigMode_t\r
1033 {\r
1034     NFC_DISCOVERY_CONFIG  = 0x00U,/**< Configure discovery with values \r
1035                                        in phNfc_sADD_Cfg_t and start \r
1036                                        discovery */\r
1037     NFC_DISCOVERY_START,         /**< Start Discovery with previously set\r
1038                                       configuration */\r
1039     NFC_DISCOVERY_STOP,          /**< Stop the Discovery */\r
1040     NFC_DISCOVERY_RESUME       /**< Resume the Discovery with previously \r
1041                                    *  set configuration.\r
1042                                    *  This is valid only when the Target\r
1043                                    *  is not connected.\r
1044                                    */\r
1045 }phNfc_eDiscoveryConfigMode_t;\r
1046 \r
1047 /** \ingroup grp_hal_common\r
1048 *\r
1049 *  \brief Target or Tag Release Mode\r
1050 *\r
1051 *  This enumeration defines various modes of releasing an acquired target \r
1052 *  or tag.\r
1053 *  \note None.\r
1054 */\r
1055 typedef enum phNfc_eReleaseType_t\r
1056 {\r
1057     NFC_INVALID_RELEASE_TYPE    =0x00U,/**<Invalid release type */\r
1058     NFC_DISCOVERY_RESTART,      /**< Release current target and \r
1059                                      restart discovery within same technology*/\r
1060     NFC_DISCOVERY_CONTINUE,    /**< Release current target and continue\r
1061                                     discovery with next technology in the wheel */\r
1062     NFC_SMARTMX_RELEASE    /**< Release SmartMX from wired mode to previous mode\r
1063                                 (Virtual or Off) */\r
1064 } phNfc_eReleaseType_t;\r
1065 \r
1066 /** \ingroup  grp_hal_common\r
1067 *\r
1068 *  \brief Poll configuration structure\r
1069 *\r
1070 *  The <em> Poll configuration structure </em> holds information about the \r
1071 *  enabling the the type of discovery required by the application. This \r
1072 *  structure is the input parameter for the discovery call\r
1073 *\r
1074 *  \note All members of this structure are input parameters [out].\r
1075 *\r
1076 *  \sa \ref phNfc_eP2PMode_t\r
1077 *\r
1078 */\r
1079 typedef struct phNfc_sADD_Cfg_t\r
1080 {\r
1081     union \r
1082     {\r
1083         phNfc_sPollDevInfo_t        PollCfgInfo;        /**<  Enable/Disable Specific \r
1084                                                               Reader Functionality and \r
1085                                                               Card Emulation */ \r
1086         unsigned                    PollEnabled;     /** Can be used to set polling 'Off'\r
1087                                                       by setting PollEnabled to zero */\r
1088 \r
1089     } PollDevInfo;\r
1090     uint32_t                    Duration;           /**< Duration of virtual or idle \r
1091                                                     period in microseconds in the step size\r
1092                                                     of 48 microseconds.If duration is set less\r
1093                                                     than  48 microseconds then default value is\r
1094                                                     used.For more details please refer PN 544 \r
1095                                                     user manual*/\r
1096     uint8_t                     NfcIP_Mode ;      /**< Select the P2P\r
1097                                                     speeds using phNfc_eP2PMode_t type.\r
1098                                                     This is used to enable NFC-IP Discovery \r
1099                                                     The related Reader Type will be implicitly\r
1100                                                     selected */\r
1101     uint8_t                     NfcIP_Tgt_Disable;   /**< Flag to \r
1102                                                    disable the NFCIP1 TARGET */\r
1103 } phNfc_sADD_Cfg_t;\r
1104 \r
1105 /*@}*/\r
1106 \r
1107 #endif /* PHNFCTYPES */\r
1108 \r