2 * Copyright (C) 2010 NXP Semiconductors
\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
8 * http://www.apache.org/licenses/LICENSE-2.0
\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
18 * \file phNfcHalTypes.h
\r
19 * \brief Structure declarations/type definitions belonging to the HAL subsystem.
\r
21 * Project: NFC MW / HAL
\r
23 * $Date: Thu Apr 8 17:11:39 2010 $
\r
24 * $Author: ing04880 $
\r
25 * $Revision: 1.106 $
\r
26 * $Aliases: NFC_FRI1.1_WK1007_SDK,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $
\r
31 #ifndef PHNFCHALTYPES_H /* */
\r
32 #define PHNFCHALTYPES_H /* */
\r
37 * File: \ref phNfcHalTypes.h
\r
42 #define PHNFCHALTYPES_FILEREVISION "$Revision: 1.106 $" /**< \ingroup grp_file_attributes */
\r
43 #define PHNFCHALTYPES_FILEALIASES "$Aliases: NFC_FRI1.1_WK1007_SDK,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
46 #include <phNfcTypes.h>
\r
47 #include <phNfcCompId.h>
\r
48 #include <phNfcConfig.h>
\r
50 #ifndef NXP_HAL_MEM_INFO_SIZE
\r
51 #define NXP_HAL_MEM_INFO_SIZE 0x01U
\r
54 #if (NXP_HAL_MEM_INFO_SIZE > 0x01)
\r
55 #define NXP_FW_UPLOAD_PROGRESS 0x965AU
\r
56 #define NXP_FW_UPLOAD_SUCCESS 0x0000U
\r
58 #define NXP_FW_UPLOAD_PROGRESS 0x5AU
\r
59 #define NXP_FW_UPLOAD_SUCCESS 0x00U
\r
63 typedef struct phHal_sMemInfo
\r
67 uint32_t hal_version;
\r
71 /** \ingroup grp_hal_common
\r
74 * \brief Protocol Support Information
\r
76 * \brief HAL-Specific
\r
79 * The <em> Supported Protocols Structure </em> holds all protocol supported by the current NFC
\r
82 * \note All members of this structure are output parameters [out].
\r
85 typedef phNfc_sSupProtocol_t phHal_sSupProtocol_t;
\r
88 /** \ingroup grp_hal_common
\r
92 * \brief Information related to the NFC Device
\r
94 * \brief HAL-Specific
\r
97 * The <em> Device Information Structure </em> holds information
\r
98 * related to the NFC IC read during initialization time.
\r
99 * It allows the caller firware, hardware version, the model id,
\r
100 * HCI verison supported and vendor name. Refer to the NFC Device
\r
101 * User Manual on how to interpret each of the values. In addition
\r
102 * it also contains capabilities of the NFC Device such as the
\r
103 * protocols supported in Reader and emulation mode
\r
107 typedef phNfc_sDeviceCapabilities_t phHal_sDeviceCapabilities_t;
\r
111 * \ingroup grp_hal_common
\r
114 * \brief Hardware Reference - The Peripheral Representation
\r
116 * \brief HAL-Specific
\r
119 * The Hardware Reference structure is filled as part of the open function and
\r
120 * contains information regarding connected peripheral NFC device. It also
\r
121 * stores the refernce to the communication driver passed by the HAL client
\r
122 * for usage during communication with the NFC Device
\r
124 * \note The caller can consider this structure atomic, no interpretation is required
\r
125 * for HAL operation.
\r
127 * \sa phHal4Nfc_Open .
\r
132 * \ingroup grp_hal_common
\r
134 * \brief Hardware Reference - The Peripheral Representation
\r
136 * The Hardware Reference structure is filled as part of the open function and
\r
137 * contains information regarding connected peripheral NFC device. It also
\r
138 * stores the refernce to the communication driver passed by the HAL client
\r
139 * for usage during communication with the NFC Device
\r
141 * \note The caller can consider this structure atomic, no interpretation is required
\r
142 * for HAL operation.
\r
145 typedef struct phHal_sHwReference
\r
147 /**< Will be usable/valid after the Open function. */
\r
148 void *p_board_driver;
\r
149 /**< Session Identifier for the established session */
\r
150 uint8_t session_id[SESSIONID_SIZE];
\r
151 /**< SMX Connected TRUE/FALSE */
\r
152 uint8_t smx_connected;
\r
153 /**< UICC Connected TRUE/FALSE */
\r
154 uint8_t uicc_connected;
\r
155 /**< UICC Reader Mode is Active TRUE/FALSE */
\r
156 uint8_t uicc_rdr_active;
\r
157 /**< Device information. */
\r
158 phNfc_sDeviceCapabilities_t device_info;
\r
159 /**< Context of the HAL Layer */
\r
161 /**< Context of the DAL Layer */
\r
163 } phHal_sHwReference_t;
\r
166 /** \ingroup grp_hal_common
\r
169 * \brief Hardware configuration - Configuration Parameters for the NFC Device
\r
171 * \brief HAL-Specific
\r
174 * The parameters used to configure the device during the initialisation.
\r
175 * This structure is used internally by the HAL implementation and is filled
\r
176 * up based on various configuration parameters from the config file
\r
181 typedef struct phHal_sHwConfig
\r
184 uint8_t session_id[SESSIONID_SIZE]; /**< Session Identifier for
\r
185 the established session */
\r
187 uint8_t clk_req; /**< Clock Request Setting */
\r
189 uint8_t input_clk; /**< Input Clock Setting */
\r
191 } phHal_sHwConfig_t;
\r
195 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
\r
197 /* This data structure is not used anymore and will be removed in subsequent
\r
199 typedef struct phHal_sDepFlags
\r
201 unsigned int MetaChaining : 1;
\r
202 unsigned int NADPresent : 1;
\r
203 } phHal_sDepFlags_t;
\r
205 /* This data structure is not used anymore and will be removed in subsequent
\r
208 typedef struct phHal_sDepAdditionalInfo
\r
210 phHal_sDepFlags_t DepFlags;
\r
212 } phHal_sDepAdditionalInfo_t;
\r
215 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
\r
219 /** \ingroup grp_hal_common
\r
222 * \brief Enumerated MIFARE Commands
\r
224 * \brief HAL-Specific
\r
227 * The <em> Mifare Command List Enumerator </em> lists all available Mifare native commands.
\r
233 typedef phNfc_eMifareCmdList_t phHal_eMifareCmdList_t;
\r
235 #define phHal_eMifareRaw phNfc_eMifareRaw
\r
236 #define phHal_eMifareAuthentA phNfc_eMifareAuthentA
\r
237 #define phHal_eMifareAuthentB phNfc_eMifareAuthentB
\r
238 #define phHal_eMifareRead16 phNfc_eMifareRead16
\r
239 #define phHal_eMifareRead phNfc_eMifareRead
\r
240 #define phHal_eMifareWrite16 phNfc_eMifareWrite16
\r
241 #define phHal_eMifareWrite4 phNfc_eMifareWrite4
\r
242 #define phHal_eMifareInc phNfc_eMifareInc
\r
243 #define phHal_eMifareDec phNfc_eMifareDec
\r
244 #define phHal_eMifareTransfer phNfc_eMifareTransfer
\r
245 #define phHal_eMifareRestore phNfc_eMifareRestore
\r
246 #define phHal_eMifareReadSector phNfc_eMifareReadSector
\r
247 #define phHal_eMifareWriteSector phNfc_eMifareWriteSector
\r
248 #define phHal_eMifareInvalidCmd phNfc_eMifareInvalidCmd
\r
251 /** \ingroup grp_hal_common
\r
253 * The <em> T=Cl Command List Enumerator </em> lists all available T=Cl Commands.
\r
258 typedef phNfc_eIso14443_4_CmdList_t phHal_eIso14443_4_CmdList_t;
\r
260 #define phHal_eIso14443_4_Raw phNfc_eIso14443_4_Raw
\r
263 /** \ingroup grp_hal_common
\r
265 * The <em> NFCIP1 Command List Enumerator </em> lists all available NFCIP1 Commands.
\r
270 typedef phNfc_eNfcIP1CmdList_t phHal_eNfcIP1CmdList_t;
\r
272 #define phHal_eNfcIP1_Raw phNfc_eNfcIP1_Raw
\r
275 /** \ingroup grp_hal_common
\r
277 * The <em> ISO15693 Command List Enumerator </em> lists all available ISO15693 Commands.
\r
283 typedef phNfc_eIso15693_CmdList_t phHal_eIso15693_CmdList_t;
\r
286 #define phHal_eIso15693_Raw phNfc_eIso15693_Raw
\r
288 #define phHal_eIso15693_Cmd phNfc_eIso15693_Cmd
\r
289 #define phHal_eIso15693_Invalid phNfc_eIso15693_Invalid
\r
291 /** \ingroup grp_hal_common
\r
293 * The <em> Felica Command List Enumerator </em> lists all available Felica Commands.
\r
299 typedef enum phHal_eFelicaCmdList
\r
301 phHal_eFelica_Raw = 0xF0U, /**< Felica Raw command:\n
\r
302 - This command sends the data buffer directly
\r
303 to the remote device */
\r
304 phHal_eFelica_Check = 0x00, /**< Felica Check command:\n
\r
305 - This command checks the data from the Felica
\r
307 phHal_eFelica_Update = 0x01, /**< Felica Update command:\n
\r
308 - This command updates the data onto the Felica
\r
310 phHal_eFelica_Invalid = 0xFFU /**< Invalid Command */
\r
311 } phHal_eFelicaCmdList_t;
\r
314 typedef enum phHal_eJewelCmdList
\r
316 phHal_eJewel_Raw = 0x00U, /**< Jewel command:\n
\r
317 - This command sends the data buffer directly
\r
318 to the remote device */
\r
319 phHal_eJewel_Invalid = 0xFFU /**< Invalid jewel command */
\r
320 }phHal_eJewelCmdList_t;
\r
324 /** \ingroup grp_hal_nfci
\r
327 * \brief Remote Device Reader A RF Gate Information Container
\r
329 * \brief HAL-Specific
\r
332 * The <em> Reader A structure </em> includes the available information
\r
333 * related to the discovered ISO14443A remote device. This information
\r
334 * is updated for every device discovery.
\r
338 typedef phNfc_sIso14443AInfo_t phHal_sIso14443AInfo_t;
\r
340 /** \ingroup grp_hal_nfci
\r
343 * \brief Remote Device Reader B RF Gate Information Container
\r
345 * \brief HAL-Specific
\r
348 * The <em> Reader B structure </em> includes the available information
\r
349 * related to the discovered ISO14443B remote device. This information
\r
350 * is updated for every device discovery.
\r
355 typedef phNfc_sIso14443BInfo_t phHal_sIso14443BInfo_t;
\r
357 typedef phNfc_sIso14443BPrimeInfo_t phHal_sIso14443BPrimeInfo;
\r
360 /** \ingroup grp_hal_nfci
\r
363 * \brief Remote Device Jewel Reader RF Gate Information Container
\r
365 * \brief HAL-Specific
\r
368 * The <em> Jewel Reader structure </em> includes the available information
\r
369 * related to the discovered Jewel remote device. This information
\r
370 * is updated for every device discovery.
\r
376 typedef phNfc_sJewelInfo_t phHal_sJewelInfo_t;
\r
378 /** \ingroup grp_hal_nfci
\r
381 * \brief Remote Device Felica Reader RF Gate Information Container
\r
383 * \brief HAL-Specific
\r
386 * The <em> Felica Reader structure </em> includes the available information
\r
387 * related to the discovered Felica remote device. This information
\r
388 * is updated for every device discovery.
\r
393 typedef phNfc_sFelicaInfo_t phHal_sFelicaInfo_t;
\r
396 /** \ingroup grp_hal_nfci
\r
399 * \brief Remote Device Reader 15693 RF Gate Information Container
\r
401 * \brief HAL-Specific
\r
404 * The <em> Reader A structure </em> includes the available information
\r
405 * related to the discovered ISO15693 remote device. This information
\r
406 * is updated for every device discovery.
\r
411 typedef phNfc_sIso15693Info_t phHal_sIso15693Info_t;
\r
414 /** \ingroup grp_hal_nfci
\r
417 * \brief NFC Data Rate Supported between the Reader and the Target
\r
419 * \brief HAL-Specific
\r
422 * The <em> \ref phHalNfc_eDataRate enum </em> lists all the Data Rate
\r
423 * values to be used to determine the rate at which the data is transmitted
\r
430 typedef phNfc_eDataRate_t phHalNfc_eDataRate_t;
\r
433 /** \ingroup grp_hal_nfci
\r
436 * \brief NFCIP1 Gate Information Container
\r
438 * \brief HAL-Specific
\r
441 * The <em> NFCIP1 structure </em> includes the available information
\r
442 * related to the discovered NFCIP1 remote device. This information
\r
443 * is updated for every device discovery.
\r
448 typedef phNfc_sNfcIPInfo_t phHal_sNfcIPInfo_t;
\r
451 /** \ingroup grp_hal_nfci
\r
454 * \brief Remote Device Specific Information Container
\r
456 * \brief HAL-Specific
\r
459 * The <em> Remote Device Information Union </em> includes the available Remote Device Information
\r
460 * structures. Following the device detected, the corresponding data structure is used.
\r
466 typedef phNfc_uRemoteDevInfo_t phHal_uRemoteDevInfo_t;
\r
468 /** \ingroup grp_hal_nfci
\r
471 * \brief RF Device Type Listing
\r
473 * \brief HAL-Specific
\r
476 * The <em> RF Device Type List </em> is used to identify the type of
\r
477 * remote device that is discovered/connected. There seperate
\r
478 * types to identify a Remote Reader (denoted by _PCD) and
\r
479 * Remote Tag (denoted by _PICC)
\r
484 typedef phNfc_eRFDevType_t phHal_eRFDevType_t;
\r
486 #define phHal_eUnknown_DevType phNfc_eUnknown_DevType
\r
488 /* Specific PCD Devices */
\r
489 #define phHal_eISO14443_A_PCD phNfc_eISO14443_A_PCD
\r
490 #define phHal_eISO14443_B_PCD phNfc_eISO14443_B_PCD
\r
491 #define phHal_eISO14443_BPrime_PCD phNfc_eISO14443_BPrime_PCD
\r
492 #define phHal_eFelica_PCD phNfc_eFelica_PCD
\r
493 #define phHal_eJewel_PCD phNfc_eJewel_PCD
\r
494 #define phHal_eISO15693_PCD phNfc_eISO15693_PCD
\r
495 /* Generic PCD Type */
\r
496 #define phHal_ePCD_DevType phNfc_ePCD_DevType
\r
498 /* Generic PICC Type */
\r
499 #define phHal_ePICC_DevType phNfc_ePICC_DevType
\r
500 /* Specific PICC Devices */
\r
501 #define phHal_eISO14443_A_PICC phNfc_eISO14443_A_PICC
\r
502 #define phHal_eISO14443_4A_PICC phNfc_eISO14443_4A_PICC
\r
503 #define phHal_eISO14443_3A_PICC phNfc_eISO14443_3A_PICC
\r
504 #define phHal_eMifare_PICC phNfc_eMifare_PICC
\r
505 #define phHal_eISO14443_B_PICC phNfc_eISO14443_B_PICC
\r
506 #define phHal_eISO14443_4B_PICC phNfc_eISO14443_4B_PICC
\r
507 #define phHal_eISO14443_BPrime_PICC phNfc_eISO14443_BPrime_PICC
\r
508 #define phHal_eFelica_PICC phNfc_eFelica_PICC
\r
509 #define phHal_eJewel_PICC phNfc_eJewel_PICC
\r
510 #define phHal_eISO15693_PICC phNfc_eISO15693_PICC
\r
512 /* NFC-IP1 Device Types */
\r
513 #define phHal_eNfcIP1_Target phNfc_eNfcIP1_Target
\r
514 #define phHal_eNfcIP1_Initiator phNfc_eNfcIP1_Initiator
\r
516 /* Other Sources */
\r
517 #define phHal_eInvalid_DevType phNfc_eInvalid_DevType
\r
519 /** \ingroup grp_hal_nfci
\r
522 * \brief Remote Device Type Listing
\r
524 * \brief HAL-Specific
\r
527 * The <em> Remote Device Type List </em> is used to identify the type of
\r
528 * remote device that is discovered/connected
\r
529 * \note This is same as RF Device Type List.
\r
532 typedef phNfc_eRemDevType_t phHal_eRemDevType_t;
\r
534 /** \ingroup grp_hal_common
\r
538 * \brief Common Command Attribute
\r
540 * \brief HAL-Specific
\r
543 * The <em> Hal Command Union </em> includes each available type of Commands.
\r
549 typedef phNfc_uCmdList_t phHal_uCmdList_t;
\r
552 /** \ingroup grp_hal_nfci
\r
555 * \brief Remote Device Information Structure
\r
557 * \brief HAL-Specific
\r
560 * The <em> Remote Device Information Structure </em> holds information about one single Remote
\r
561 * Device detected by the polling function .\n
\r
562 * It lists parameters common to all supported remote devices.
\r
567 * \sa \ref phHal4Nfc_ConfigureDiscovery and \ref phHal4Nfc_Connect
\r
574 typedef phNfc_sRemoteDevInformation_t phHal_sRemoteDevInformation_t;
\r
578 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
\r
580 /* This data structure is not used anymore and will be removed in subsequent
\r
583 typedef struct phHal_sDevInputParam
\r
585 uint8_t FelicaPollPayload[5];
\r
588 uint8_t NfcPollPayload[5];
\r
591 uint8_t NFCIDAuto;
\r
594 uint8_t NFCID3i[PHHAL_NFCID_LENGTH];
\r
602 uint8_t NfcNADiUsed;
\r
604 /*+ MantisId : 31 - JP - 09-01-2006 */
\r
605 /*uint8_t TClNADiUsed; */
\r
607 /*- MantisId : 31 - JP - 09-01-2006 */
\r
608 uint8_t GeneralByte[48];
\r
611 uint8_t GeneralByteLength;
\r
614 uint8_t ISO14443_4B_AFI;
\r
616 } phHal_sDevInputParam_t;
\r
621 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
\r
624 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
\r
625 /* TARGET STRUCTURES */
\r
628 /** \ingroup grp_hal_common
\r
631 * \brief Transceive Information Data Structure for sending commands/response
\r
632 * to the remote device
\r
634 * \brief HAL-Specific
\r
637 * The <em> Transceive Information Data Structure </em> is used to pass the
\r
638 * Command, Address (only required for MIFARE) and the send and receive data
\r
639 * data structure (buffer and length) for communication with remote device
\r
644 typedef phNfc_sTransceiveInfo_t phHal_sTransceiveInfo_t;
\r
647 /** \ingroup grp_hal_nfci
\r
650 * \brief Input information for the Type A tags
\r
652 * \brief HAL-Specific
\r
655 * The <em> \ref phHal_sIso14443ACfg structure </em> holds the information
\r
656 * required for the NFC device to be used during ISO14443A target discovery
\r
660 typedef struct phHal_sIso14443ACfg
\r
662 uint8_t Auto_Activation; /**< Enable Auto Activation for
\r
664 If set to 0, the activation procedure will stop
\r
665 after Select (SAK has been received).
\r
666 The host could evaluate SAK value and then decide:
\r
667 - to start communicating with the remote card
\r
668 using proprietary commands (see NXP_MIFARE_RAW
\r
669 and NXP_MIFARE_CMD)
\r
671 - to activate the remote card up to ISO14443-4
\r
672 level (RATS and PPS) using
\r
673 CONTINUE ACTIVATION command
\r
674 If set to 1, activation follows the flow described in
\r
675 ETSI HCI specification (restrict detection to
\r
676 ISO14443-4 compliant cards).
\r
678 }phHal_sIso14443ACfg_t;
\r
681 /** \ingroup grp_hal_nfci
\r
684 * \brief Input information for the Type B tags
\r
686 * \brief HAL-Specific
\r
689 * The <em> \ref phHal_sIso14443BCfg structure </em> holds the information
\r
690 * required for the NFC device to be used during ISO14443B target discovery
\r
694 typedef struct phHal_sIso14443BCfg
\r
696 uint8_t AppFamily_ID; /**< Application Family Identifier for
\r
697 Technology B, 0x00 means all application */
\r
698 }phHal_sIso14443BCfg_t;
\r
700 /** \ingroup grp_hal_nfci
\r
703 * \brief Input information for the Felica tags
\r
705 * \brief HAL-Specific
\r
708 * The <em> \ref phHal_sFelicaCfg_t structure </em> holds the information
\r
709 * required for the NFC device to be used during Felica target discovery
\r
714 typedef struct phHal_sFelicaCfg
\r
716 uint8_t SystemCode[PHHAL_FEL_SYS_CODE_LEN]; /**< System code for Felica tags */
\r
718 }phHal_sFelicaCfg_t;
\r
721 /** \ingroup grp_hal_nfci
\r
724 * \brief Poll Device Information for conifiguring the discovery wheel
\r
725 Reader and Card Emulation Phases
\r
727 * \brief HAL-Specific
\r
730 * The <em> \ref phHal_sPollDevInfo_t enum </em> is used to enable/disable
\r
731 * phases of the discovery wheel related to specific reader types and
\r
732 * card emulation phase
\r
733 * \note Enabling specific Reader technology when NFCIP1 speed is set in the
\r
734 * phNfc_sADD_Cfg_t is implicitly done in HAL. Use this structure to only
\r
735 * enable/disable Card Reader Functionality
\r
737 typedef phNfc_sPollDevInfo_t phHal_sPollDevInfo_t;
\r
740 /** \ingroup grp_hal_common
\r
743 * \brief Identifies Type of Host
\r
745 * \brief HAL-Specific
\r
748 * This enumeration is used to identify the type of the host providing the
\r
749 * information or the notification to the Terminal host.
\r
753 typedef enum phHal_HostType {
\r
755 * This type identifies the host controller
\r
756 * in the NFC device
\r
758 phHal_eHostController = 0x00U,
\r
760 * This type identifies the Host Device
\r
761 * controlling the NFC device.
\r
763 phHal_eTerminalHost = 0x01U,
\r
765 * This type identifies the uicc host
\r
766 * connnected to the NFC device
\r
768 phHal_eUICCHost = 0x02U,
\r
769 /* Host type is unknown */
\r
770 phHal_eUnknownHost = 0xFFU
\r
774 /** \ingroup grp_hal_nfci
\r
777 * \brief P2P speed for the Initiator
\r
779 * \brief HAL-Specific
\r
782 * The <em> \ref phHal_eP2PMode enum </em> lists all the NFCIP1 speeds
\r
783 * to be used for configuring the NFCIP1 discovery
\r
788 #define phHal_eDefaultP2PMode phNfc_eDefaultP2PMode
\r
789 #define phHal_ePassive106 phNfc_ePassive106
\r
790 #define phHal_ePassive212 phNfc_ePassive212
\r
791 #define phHal_ePassive424 phNfc_ePassive424
\r
792 #define phHal_eActive phNfc_eActive
\r
793 #define phHal_eP2P_ALL phNfc_eP2P_ALL
\r
794 #define phHal_eInvalidP2PMode phNfc_eInvalidP2PMode
\r
797 /** \ingroup grp_hal_common
\r
800 * \brief Identities the type of Notification
\r
802 * \brief HAL-Specific
\r
805 * This enumeration is used to specify the type of notification notified
\r
806 * to the upper layer. This classifies the notification into two types
\r
807 * one for the discovery notifications and the other for all the remaining
\r
808 * event notifications
\r
813 typedef phNfc_eNotificationType_t phHal_eNotificationType_t;
\r
816 /** \ingroup grp_hal_common
\r
819 * \brief Identifies the type of event notification
\r
821 * \brief HAL-Specific
\r
824 * This enumeration is used to identify the type of the event notified
\r
825 * to the Terminal host.
\r
829 typedef enum phHal_Event {
\r
832 /* Transaction Events */
\r
833 NFC_EVT_END_OF_TRANSACTION = 0x11U ,
\r
834 NFC_EVT_TRANSACTION = 0x12U ,
\r
835 NFC_EVT_START_OF_TRANSACTION = 0x20U ,
\r
838 NFC_EVT_FIELD_ON = 0x31U,
\r
839 NFC_EVT_FIELD_OFF = 0x34U,
\r
841 /* Card/Target Activation Events */
\r
842 NFC_EVT_ACTIVATED = 0x33U,
\r
843 NFC_EVT_DEACTIVATED = 0x32U,
\r
845 NFC_EVT_PROTECTED = 0x24U ,
\r
847 /* Reader Phases configuration request by UICC */
\r
848 NFC_UICC_RDPHASES_ACTIVATE_REQ = 0x43U,
\r
849 NFC_UICC_RDPHASES_DEACTIVATE_REQ = 0x44U,
\r
851 /* Connectivity and Triggering Events - Future Use */
\r
852 NFC_EVT_CONNECTIVITY = 0x10U ,
\r
853 NFC_EVT_OPERATION_ENDED = 0x13U ,
\r
855 /* NXP Specific System Information Events */
\r
856 NFC_INFO_TXLDO_OVERCUR = 0x71U,
\r
857 NFC_INFO_MEM_VIOLATION = 0x73U,
\r
858 NFC_INFO_TEMP_OVERHEAT = 0x74U,
\r
859 NFC_INFO_LLC_ERROR = 0x75U,
\r
862 NFC_EVT_MIFARE_ACCESS = 0x35,
\r
863 NFC_EVT_APDU_RECEIVED = 0x36,
\r
864 NFC_EVT_EMV_CARD_REMOVAL = 0x37
\r
868 typedef phNfc_sUiccInfo_t phHal_sUiccInfo_t;
\r
870 /** \ingroup grp_hal_common
\r
873 * \brief Event notification Information
\r
875 * \brief HAL-Specific
\r
878 * This structure provides the information about the event notified
\r
879 * to the terminal host.
\r
883 typedef struct phHal_sEventInfo
\r
885 /* Type of the host issuing the event */
\r
886 phHal_HostType_t eventHost;
\r
887 /* Type of the source issuing the event */
\r
888 phHal_eRFDevType_t eventSource;
\r
889 /* Type of the source issuing the event */
\r
890 phHal_Event_t eventType;
\r
893 /* Parameter information Information is obtained if the eventType is
\r
894 * NFC_EVT_TRANSACTION for UICC.
\r
896 phHal_sUiccInfo_t uicc_info;
\r
897 /* AID Information is obtained if the eventType is
\r
898 * NFC_EVT_TRANSACTION.
\r
901 /* Overheat Status Information is obtained if the eventType is
\r
902 * NFC_INFO_TEMP_OVERHEAT.
\r
904 uint8_t overheat_status;
\r
905 /* rd_phases Information is obtained if the eventType is
\r
906 * NFC_UICC_RDPHASES_ACTIVATE_REQ.
\r
909 /* Remote Device Information is obtained if the eventType is
\r
910 * NFC_EVT_ACTIVATED.
\r
912 phHal_sRemoteDevInformation_t *pRemoteDevInfo;
\r
914 }phHal_sEventInfo_t;
\r
917 /** \ingroup grp_hal_common
\r
920 * \brief Information for the Host/Uicc Emulation Support
\r
922 * \brief HAL-Specific
\r
925 * The <em> \ref phHal_sEmuSupport structure </em> holds the type
\r
926 * of the target emulation supported.
\r
931 typedef struct phHal_sEmuSupport
\r
933 unsigned int TypeA:1;
\r
934 unsigned int TypeB:1;
\r
935 unsigned int TypeBPrime:1;
\r
936 unsigned int TypeFelica:1;
\r
937 unsigned int TypeMifare:1;
\r
938 unsigned int TypeNfcIP1:1;
\r
939 unsigned int RFU:2;
\r
941 }phHal_sEmuSupport_t;
\r
944 /** \ingroup grp_hal_nfci
\r
947 * \brief P2P Information for the Initiator
\r
949 * \brief HAL-Specific
\r
952 * The <em> \ref phHal_sNfcIPCfg </em> holds the P2P related information
\r
953 * use by the NFC Device during P2P Discovery and connection
\r
958 typedef phNfc_sNfcIPCfg_t phHal_sNfcIPCfg_t;
\r
960 /** \ingroup grp_hal_common
\r
963 * \brief Enumeration used to choose which type of parameters
\r
964 * are to be configured
\r
966 * \brief HAL-Specific
\r
972 typedef enum phHal_eConfigType
\r
974 NFC_INVALID_CONFIG = 0x00U, /**< Invalid Configuration */
\r
975 NFC_RF_READER_CONFIG, /**< Reader Parmaeters */
\r
976 NFC_P2P_CONFIG, /**< NFCIP1 Parameters */
\r
977 NFC_SE_PROTECTION_CONFIG, /**< Secure Element
\r
978 Protection Cofiguration */
\r
979 NFC_EMULATION_CONFIG /**< Emulation Parameters */
\r
980 }phHal_eConfigType_t;
\r
982 /** \ingroup grp_hal_common
\r
985 * \brief Discovery Configuration Mode
\r
987 * \brief HAL-Specific
\r
990 * This enumeration is used to choose the Discovery Configuration
\r
991 * Mode :- Configure and Start, Stop or Start with last set
\r
996 typedef phNfc_eDiscoveryConfigMode_t phHal_eDiscoveryConfigMode_t;
\r
999 /** \ingroup grp_hal_common
\r
1002 * \brief Target or Tag Release Mode
\r
1004 * \brief HAL-Specific
\r
1007 * This enumeration defines various modes of releasing an acquired target
\r
1011 typedef phNfc_eReleaseType_t phHal_eReleaseType_t;
\r
1014 /** \ingroup grp_hal_common
\r
1017 * \brief Configuration of specific Emulation Feature
\r
1019 * \brief HAL-Specific
\r
1022 * This enumeration is used to choose configuration for a specific
\r
1023 * emulation feature.
\r
1027 typedef enum phHal_eEmulationType
\r
1029 NFC_UNKNOWN_EMULATION = 0x00U, /**< Invalid Configuration */
\r
1030 NFC_HOST_CE_A_EMULATION = 0x01U, /**< Configure parameters for Type A
\r
1031 card emulation from host */
\r
1032 NFC_HOST_CE_B_EMULATION = 0x02U, /**< Configure parameters for Type B
\r
1033 card emulation from host */
\r
1034 NFC_B_PRIME_EMULATION = 0x03U, /**< Configure parameters for Type B'
\r
1035 card emulation from host */
\r
1036 NFC_FELICA_EMULATION = 0x04U, /**< Configure parameters for Type F
\r
1037 card emulation from host */
\r
1038 NFC_MIFARE_EMULATION = 0x06U, /**< Configure parameters for MIFARE
\r
1039 card emulation - For Future Use */
\r
1040 NFC_SMARTMX_EMULATION = 0x07U, /**< Configure parameters for SmartMX
\r
1042 NFC_UICC_EMULATION = 0x08U /**< Configure parameters for UICC
\r
1044 }phHal_eEmulationType_t;
\r
1047 /** \ingroup grp_hal_nfct
\r
1050 * \brief Information for Target Mode Start-Up
\r
1052 * \brief HAL-Specific
\r
1055 * The <em> Target Information Structure </em> required to start Target mode.
\r
1056 * It contains all the information for the Target mode.
\r
1062 typedef struct phHal_sTargetInfo
\r
1064 uint8_t enableEmulation;
\r
1065 phHal_sNfcIPCfg_t targetConfig;
\r
1066 } phHal_sTargetInfo_t;
\r
1070 /** \ingroup grp_hal_common
\r
1073 * \brief Mode of operation for SmartMX
\r
1075 * \brief HAL-Specific
\r
1078 * This enumeration is used to choose the mode of operation for the SmartMx Module.
\r
1079 * Default static configuration at initialization time.
\r
1083 typedef enum phHal_eSmartMX_Mode{
\r
1084 eSmartMx_Wired = 0x00U, /* SmartMX is in Wired Mode */
\r
1085 eSmartMx_Default, /* SmartMX is in Default Configuration Mode */
\r
1086 eSmartMx_Virtual, /* SmartMx in the Virutal Mode */
\r
1087 eSmartMx_Off /* SmartMx Feature is Switched off */
\r
1088 } phHal_eSmartMX_Mode_t;
\r
1091 /** \ingroup grp_hal_common
\r
1094 * \brief Mode of operation for SWP
\r
1096 * \brief HAL-Specific
\r
1099 * This enumeration is used to choose the mode of operation for the SWP Link
\r
1100 * for UICC Module. Default static configuration at initialization time.
\r
1104 typedef enum phHal_eSWP_Mode{
\r
1105 eSWP_Switch_Off = 0x00U, /* SWP Link is Switched off */
\r
1106 eSWP_Switch_Default, /* SWP is in Default Configuration Mode */
\r
1107 eSWP_Switch_On /* SWP Link is Switched on */
\r
1108 } phHal_eSWP_Mode_t;
\r
1111 /** \ingroup grp_hal_common
\r
1114 * \brief Information for the Configuring the SmartMX
\r
1116 * \brief HAL-Specific
\r
1119 * The <em> \ref phHal_sSmartMX_Cfg structure </em> holds the information
\r
1120 * to configure the SmartMX Module in the NFC Device.
\r
1126 typedef struct phHal_sSmartMX_Cfg
\r
1128 uint8_t enableEmulation;
\r
1129 uint8_t lowPowerMode;
\r
1130 phHal_eSmartMX_Mode_t smxMode;
\r
1131 }phHal_sSmartMX_Cfg_t;
\r
1134 /** \ingroup grp_hal_common
\r
1137 * \brief Information for the Configuring the UICC
\r
1139 * \brief HAL-Specific
\r
1142 * The <em> \ref phHal_sUiccEmuCfg structure </em> holds the information
\r
1143 * to configure the UICC Host.
\r
1149 typedef struct phHal_sUiccEmuCfg
\r
1151 uint8_t enableUicc;
\r
1152 uint8_t uiccEmuSupport;
\r
1153 uint8_t uiccReaderSupport;
\r
1154 uint8_t lowPowerMode;
\r
1155 /* TODO: This will be updated later */
\r
1156 }phHal_sUiccEmuCfg_t;
\r
1158 /** \ingroup grp_hal_common
\r
1161 * \brief Information for the Configuring the Type A Host Emulation Feature
\r
1163 * \brief HAL-Specific
\r
1166 * The <em> \ref phHal_sHostEmuCfg_A structure </em> holds the information
\r
1167 * to configure the Host Emulation for Type A.
\r
1172 typedef struct phHal_sHostEmuCfg_A
\r
1174 uint8_t enableEmulation;
\r
1175 phNfc_sIso14443AInfo_t hostEmuCfgInfo;
\r
1176 uint8_t enableCID;
\r
1177 }phHal_sHostEmuCfg_A_t;
\r
1180 /** \ingroup grp_hal_common
\r
1183 * \brief Information for the Configuring the Type B Host Emulation Feature
\r
1185 * \brief HAL-Specific
\r
1188 * The <em> \ref phHal_sHostEmuCfg_B structure </em> holds the information
\r
1189 * to configure the Host Emulation for Type B.
\r
1194 typedef struct phHal_sHostEmuCfg_B
\r
1196 uint8_t enableEmulation;
\r
1197 phNfc_sIso14443BInfo_t hostEmuCfgInfo;
\r
1198 }phHal_sHostEmuCfg_B_t;
\r
1200 /** \ingroup grp_hal_common
\r
1203 * \brief Information for the Configuring the Felica Host Emulation Feature
\r
1205 * \brief HAL-Specific
\r
1208 * The <em> \ref phHal_sHostEmuCfg_F structure </em> holds the information
\r
1209 * to configure the Felica Host Emulation.
\r
1215 typedef struct phHal_sHostEmuCfg_F
\r
1217 uint8_t enableEmulation;
\r
1218 }phHal_sHostEmuCfg_F_t;
\r
1221 /** \ingroup grp_hal_common
\r
1224 * \brief Information for the Configuring the Emulation
\r
1226 * \brief HAL-Specific
\r
1229 * The <em> \ref phHal_sEmulationCfg structure </em> holds the information
\r
1230 * required for the device to act as a Tag or NFCIP1 Target.
\r
1232 * \note phHal_sHostEmuCfg_F_t Type F emulation is not presently supported
\r
1233 * is reserved for future use.
\r
1236 typedef struct phHal_sEmulationCfg
\r
1238 phHal_HostType_t hostType;
\r
1239 phHal_eEmulationType_t emuType;
\r
1240 union phHal_uEmuConfig
\r
1242 phHal_sSmartMX_Cfg_t smartMxCfg;
\r
1243 phHal_sHostEmuCfg_A_t hostEmuCfg_A;
\r
1244 phHal_sHostEmuCfg_B_t hostEmuCfg_B;
\r
1245 phHal_sHostEmuCfg_F_t hostEmuCfg_F;
\r
1246 phHal_sUiccEmuCfg_t uiccEmuCfg;
\r
1248 }phHal_sEmulationCfg_t;
\r
1250 /** \ingroup grp_hal_common
\r
1253 * \brief Information for the Configuring the Reader parameters
\r
1255 * \brief HAL-Specific
\r
1258 * The <em> \ref phHal_sReaderCfg structure </em> holds the information
\r
1259 * to configure the Reader A or Reader B parameters.
\r
1264 typedef struct phHal_sReaderCfg
\r
1266 phHal_eRFDevType_t readerType;
\r
1267 union phHal_uReaderCfg
\r
1269 phHal_sIso14443ACfg_t Iso14443ACfg;
\r
1270 phHal_sIso14443BCfg_t Iso14443BCfg;
\r
1272 }phHal_sReaderCfg_t;
\r
1275 /** \ingroup grp_hal_common
\r
1278 * \brief Information for Configuring the Protected Mode for
\r
1279 * the Secure Elements.
\r
1281 * \brief HAL-Specific
\r
1284 * The <em> \ref phHal_sSEProtectionCfg structure </em> holds the
\r
1285 * information to configure the Secure Element Protection configuration.
\r
1290 typedef struct phHal_sSEProtectionCfg
\r
1293 }phHal_sSEProtectionCfg_t;
\r
1296 /** \ingroup grp_hal_common
\r
1299 * \brief Poll configuration structure
\r
1301 * \brief HAL-Specific
\r
1304 * The <em> Poll configuration structure </em> holds information about the
\r
1305 * enabling the the type of discovery required by the application. This
\r
1306 * structure is the input parameter for the discovery call
\r
1308 * \note All members of this structure are input parameters [out].
\r
1311 * \sa \ref phHal4Nfc_Connect, \ref phHal4Nfc_ConfigParameters,
\r
1312 * \ref phHal_eP2PMode_t and \ref phHal4Nfc_Disconnect.
\r
1317 typedef phNfc_sADD_Cfg_t phHal_sADD_Cfg_t;
\r
1320 /** \ingroup grp_hal_common
\r
1323 * \brief Configuration information.
\r
1325 * \brief HAL-Specific
\r
1328 * The <em> \ref phHal_uConfig structure </em> holds the information
\r
1329 * required for Configuring the Device.
\r
1335 typedef union phHal_uConfig
\r
1337 phHal_sEmulationCfg_t emuConfig;
\r
1338 phHal_sNfcIPCfg_t nfcIPConfig; /**< Gives the information about
\r
1339 * the General Bytes for NFC-IP
\r
1342 phHal_sReaderCfg_t readerConfig;
\r
1343 phHal_sSEProtectionCfg_t protectionConfig;
\r