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