1 /* 2 * Copyright (C) 2010 NXP Semiconductors 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /** 18 * \file phNfcHalTypes.h 19 * \brief Structure declarations/type definitions belonging to the HAL subsystem. 20 * 21 * Project: NFC MW / HAL 22 * 23 * $Date: Thu Apr 8 17:11:39 2010 $ 24 * $Author: ing04880 $ 25 * $Revision: 1.106 $ 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 $ 27 * 28 */ 29 30 31 #ifndef PHNFCHALTYPES_H /* */ 32 #define PHNFCHALTYPES_H /* */ 33 34 /** 35 * \name HAL Types 36 * 37 * File: \ref phNfcHalTypes.h 38 * 39 */ 40 41 /*@{*/ 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 */ 44 /*@}*/ 45 46 #include <phNfcTypes.h> 47 #include <phNfcCompId.h> 48 #include <phNfcConfig.h> 49 50 #ifndef NXP_HAL_MEM_INFO_SIZE 51 #define NXP_HAL_MEM_INFO_SIZE 0x01U 52 #endif 53 54 #if (NXP_HAL_MEM_INFO_SIZE > 0x01) 55 #define NXP_FW_UPLOAD_PROGRESS 0x965AU 56 #define NXP_FW_UPLOAD_SUCCESS 0x0000U 57 #else 58 #define NXP_FW_UPLOAD_PROGRESS 0x5AU 59 #define NXP_FW_UPLOAD_SUCCESS 0x00U 60 #endif 61 62 63 typedef struct phHal_sMemInfo 64 { 65 uint16_t fw_magic; 66 uint16_t fw_rfu; 67 uint32_t hal_version; 68 }phHal_sMemInfo_t; 69 70 71 /** \ingroup grp_hal_common 72 * 73 * \if hal 74 * \brief Protocol Support Information 75 * \else 76 * \brief HAL-Specific 77 * \endif 78 * 79 * The <em> Supported Protocols Structure </em> holds all protocol supported by the current NFC 80 * device. 81 * 82 * \note All members of this structure are output parameters [out]. 83 * 84 */ 85 typedef phNfc_sSupProtocol_t phHal_sSupProtocol_t; 86 87 88 /** \ingroup grp_hal_common 89 * 90 * 91 * \if hal 92 * \brief Information related to the NFC Device 93 * \else 94 * \brief HAL-Specific 95 * \endif 96 * 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 104 * 105 */ 106 107 typedef phNfc_sDeviceCapabilities_t phHal_sDeviceCapabilities_t; 108 109 110 /** 111 * \ingroup grp_hal_common 112 * 113 * \if hal 114 * \brief Hardware Reference - The Peripheral Representation 115 * \else 116 * \brief HAL-Specific 117 * \endif 118 * 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 123 * 124 * \note The caller can consider this structure atomic, no interpretation is required 125 * for HAL operation. 126 * 127 * \sa phHal4Nfc_Open . 128 * 129 */ 130 131 /** 132 * \ingroup grp_hal_common 133 * 134 * \brief Hardware Reference - The Peripheral Representation 135 * 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 140 * 141 * \note The caller can consider this structure atomic, no interpretation is required 142 * for HAL operation. 143 * 144 */ 145 typedef struct phHal_sHwReference 146 { 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 */ 160 void *hal_context; 161 /**< Context of the DAL Layer */ 162 void *dal_context; 163 } phHal_sHwReference_t; 164 165 166 /** \ingroup grp_hal_common 167 * 168 * \if hal 169 * \brief Hardware configuration - Configuration Parameters for the NFC Device 170 * \else 171 * \brief HAL-Specific 172 * \endif 173 * 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 177 * \note None. 178 * 179 */ 180 181 typedef struct phHal_sHwConfig 182 { 183 184 uint8_t session_id[SESSIONID_SIZE]; /**< Session Identifier for 185 the established session */ 186 187 uint8_t clk_req; /**< Clock Request Setting */ 188 189 uint8_t input_clk; /**< Input Clock Setting */ 190 191 } phHal_sHwConfig_t; 192 193 194 195 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 196 197 /* This data structure is not used anymore and will be removed in subsequent 198 release */ 199 typedef struct phHal_sDepFlags 200 { 201 unsigned int MetaChaining : 1; 202 unsigned int NADPresent : 1; 203 } phHal_sDepFlags_t; 204 205 /* This data structure is not used anymore and will be removed in subsequent 206 release */ 207 208 typedef struct phHal_sDepAdditionalInfo 209 { 210 phHal_sDepFlags_t DepFlags; 211 uint8_t NAD; 212 } phHal_sDepAdditionalInfo_t; 213 214 215 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 216 217 218 219 /** \ingroup grp_hal_common 220 * 221 * \if hal 222 * \brief Enumerated MIFARE Commands 223 * \else 224 * \brief HAL-Specific 225 * \endif 226 * 227 * The <em> Mifare Command List Enumerator </em> lists all available Mifare native commands. 228 * 229 * \note None. 230 * 231 */ 232 233 typedef phNfc_eMifareCmdList_t phHal_eMifareCmdList_t; 234 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 249 250 251 /** \ingroup grp_hal_common 252 * 253 * The <em> T=Cl Command List Enumerator </em> lists all available T=Cl Commands. 254 * 255 * \note None. 256 * 257 */ 258 typedef phNfc_eIso14443_4_CmdList_t phHal_eIso14443_4_CmdList_t; 259 260 #define phHal_eIso14443_4_Raw phNfc_eIso14443_4_Raw 261 262 263 /** \ingroup grp_hal_common 264 * 265 * The <em> NFCIP1 Command List Enumerator </em> lists all available NFCIP1 Commands. 266 * 267 * \note None. 268 * 269 */ 270 typedef phNfc_eNfcIP1CmdList_t phHal_eNfcIP1CmdList_t; 271 272 #define phHal_eNfcIP1_Raw phNfc_eNfcIP1_Raw 273 274 275 /** \ingroup grp_hal_common 276 * 277 * The <em> ISO15693 Command List Enumerator </em> lists all available ISO15693 Commands. 278 * 279 * \note None. 280 * 281 */ 282 283 typedef phNfc_eIso15693_CmdList_t phHal_eIso15693_CmdList_t; 284 285 #if 0 286 #define phHal_eIso15693_Raw phNfc_eIso15693_Raw 287 #endif 288 #define phHal_eIso15693_Cmd phNfc_eIso15693_Cmd 289 #define phHal_eIso15693_Invalid phNfc_eIso15693_Invalid 290 291 /** \ingroup grp_hal_common 292 * 293 * The <em> Felica Command List Enumerator </em> lists all available Felica Commands. 294 * 295 * \note None. 296 * 297 */ 298 299 typedef enum phHal_eFelicaCmdList 300 { 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 306 remote device */ 307 phHal_eFelica_Update = 0x01, /**< Felica Update command:\n 308 - This command updates the data onto the Felica 309 remote device */ 310 phHal_eFelica_Invalid = 0xFFU /**< Invalid Command */ 311 } phHal_eFelicaCmdList_t; 312 313 314 typedef enum phHal_eJewelCmdList 315 { 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; 321 322 323 324 /** \ingroup grp_hal_nfci 325 * 326 * \if hal 327 * \brief Remote Device Reader A RF Gate Information Container 328 * \else 329 * \brief HAL-Specific 330 * \endif 331 * 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. 335 * \note None. 336 * 337 */ 338 typedef phNfc_sIso14443AInfo_t phHal_sIso14443AInfo_t; 339 340 /** \ingroup grp_hal_nfci 341 * 342 * \if hal 343 * \brief Remote Device Reader B RF Gate Information Container 344 * \else 345 * \brief HAL-Specific 346 * \endif 347 * 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. 351 * \note None. 352 * 353 */ 354 355 typedef phNfc_sIso14443BInfo_t phHal_sIso14443BInfo_t; 356 357 typedef phNfc_sIso14443BPrimeInfo_t phHal_sIso14443BPrimeInfo; 358 359 360 /** \ingroup grp_hal_nfci 361 * 362 * \if hal 363 * \brief Remote Device Jewel Reader RF Gate Information Container 364 * \else 365 * \brief HAL-Specific 366 * \endif 367 * 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. 371 * \note None. 372 * 373 */ 374 375 376 typedef phNfc_sJewelInfo_t phHal_sJewelInfo_t; 377 378 /** \ingroup grp_hal_nfci 379 * 380 * \if hal 381 * \brief Remote Device Felica Reader RF Gate Information Container 382 * \else 383 * \brief HAL-Specific 384 * \endif 385 * 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. 389 * \note None. 390 * 391 */ 392 393 typedef phNfc_sFelicaInfo_t phHal_sFelicaInfo_t; 394 395 396 /** \ingroup grp_hal_nfci 397 * 398 * \if hal 399 * \brief Remote Device Reader 15693 RF Gate Information Container 400 * \else 401 * \brief HAL-Specific 402 * \endif 403 * 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. 407 * \note None. 408 * 409 */ 410 411 typedef phNfc_sIso15693Info_t phHal_sIso15693Info_t; 412 413 414 /** \ingroup grp_hal_nfci 415 * 416 * \if hal 417 * \brief NFC Data Rate Supported between the Reader and the Target 418 * \else 419 * \brief HAL-Specific 420 * \endif 421 * 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 424 * to the target. 425 * 426 * \note None. 427 */ 428 429 430 typedef phNfc_eDataRate_t phHalNfc_eDataRate_t; 431 432 433 /** \ingroup grp_hal_nfci 434 * 435 * \if hal 436 * \brief NFCIP1 Gate Information Container 437 * \else 438 * \brief HAL-Specific 439 * \endif 440 * 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. 444 * \note None. 445 * 446 */ 447 448 typedef phNfc_sNfcIPInfo_t phHal_sNfcIPInfo_t; 449 450 451 /** \ingroup grp_hal_nfci 452 * 453 * \if hal 454 * \brief Remote Device Specific Information Container 455 * \else 456 * \brief HAL-Specific 457 * \endif 458 * 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. 461 * 462 * \note None. 463 * 464 */ 465 466 typedef phNfc_uRemoteDevInfo_t phHal_uRemoteDevInfo_t; 467 468 /** \ingroup grp_hal_nfci 469 * 470 * \if hal 471 * \brief RF Device Type Listing 472 * \else 473 * \brief HAL-Specific 474 * \endif 475 * 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) 480 * \note None. 481 * 482 */ 483 484 typedef phNfc_eRFDevType_t phHal_eRFDevType_t; 485 486 #define phHal_eUnknown_DevType phNfc_eUnknown_DevType 487 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 497 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 511 512 /* NFC-IP1 Device Types */ 513 #define phHal_eNfcIP1_Target phNfc_eNfcIP1_Target 514 #define phHal_eNfcIP1_Initiator phNfc_eNfcIP1_Initiator 515 516 /* Other Sources */ 517 #define phHal_eInvalid_DevType phNfc_eInvalid_DevType 518 519 /** \ingroup grp_hal_nfci 520 * 521 * \if hal 522 * \brief Remote Device Type Listing 523 * \else 524 * \brief HAL-Specific 525 * \endif 526 * 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. 530 * 531 */ 532 typedef phNfc_eRemDevType_t phHal_eRemDevType_t; 533 534 /** \ingroup grp_hal_common 535 * 536 * 537 * \if hal 538 * \brief Common Command Attribute 539 * \else 540 * \brief HAL-Specific 541 * \endif 542 * 543 * The <em> Hal Command Union </em> includes each available type of Commands. 544 * 545 * \note None. 546 * 547 */ 548 549 typedef phNfc_uCmdList_t phHal_uCmdList_t; 550 551 552 /** \ingroup grp_hal_nfci 553 * 554 * \if hal 555 * \brief Remote Device Information Structure 556 * \else 557 * \brief HAL-Specific 558 * \endif 559 * 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. 563 * 564 * \note 565 * 566 * \if hal 567 * \sa \ref phHal4Nfc_ConfigureDiscovery and \ref phHal4Nfc_Connect 568 * \else 569 * \sa 570 * \endif 571 * 572 */ 573 574 typedef phNfc_sRemoteDevInformation_t phHal_sRemoteDevInformation_t; 575 576 577 578 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 579 580 /* This data structure is not used anymore and will be removed in subsequent 581 release */ 582 583 typedef struct phHal_sDevInputParam 584 { 585 uint8_t FelicaPollPayload[5]; 586 587 588 uint8_t NfcPollPayload[5]; 589 590 591 uint8_t NFCIDAuto; 592 593 594 uint8_t NFCID3i[PHHAL_NFCID_LENGTH]; 595 596 597 598 uint8_t DIDiUsed; 599 600 uint8_t CIDiUsed; 601 602 uint8_t NfcNADiUsed; 603 604 /*+ MantisId : 31 - JP - 09-01-2006 */ 605 /*uint8_t TClNADiUsed; */ 606 607 /*- MantisId : 31 - JP - 09-01-2006 */ 608 uint8_t GeneralByte[48]; 609 610 611 uint8_t GeneralByteLength; 612 613 614 uint8_t ISO14443_4B_AFI; 615 616 } phHal_sDevInputParam_t; 617 618 619 620 621 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 622 623 624 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ 625 /* TARGET STRUCTURES */ 626 627 628 /** \ingroup grp_hal_common 629 * 630 * \if hal 631 * \brief Transceive Information Data Structure for sending commands/response 632 * to the remote device 633 * \else 634 * \brief HAL-Specific 635 * \endif 636 * 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 640 * 641 * 642 */ 643 644 typedef phNfc_sTransceiveInfo_t phHal_sTransceiveInfo_t; 645 646 647 /** \ingroup grp_hal_nfci 648 * 649 * \if hal 650 * \brief Input information for the Type A tags 651 * \else 652 * \brief HAL-Specific 653 * \endif 654 * 655 * The <em> \ref phHal_sIso14443ACfg structure </em> holds the information 656 * required for the NFC device to be used during ISO14443A target discovery 657 * 658 * \note None. 659 */ 660 typedef struct phHal_sIso14443ACfg 661 { 662 uint8_t Auto_Activation; /**< Enable Auto Activation for 663 Technology A \n 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 669 and NXP_MIFARE_CMD) 670 or 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). 677 */ 678 }phHal_sIso14443ACfg_t; 679 680 681 /** \ingroup grp_hal_nfci 682 * 683 * \if hal 684 * \brief Input information for the Type B tags 685 * \else 686 * \brief HAL-Specific 687 * \endif 688 * 689 * The <em> \ref phHal_sIso14443BCfg structure </em> holds the information 690 * required for the NFC device to be used during ISO14443B target discovery 691 * 692 * \note None. 693 */ 694 typedef struct phHal_sIso14443BCfg 695 { 696 uint8_t AppFamily_ID; /**< Application Family Identifier for 697 Technology B, 0x00 means all application */ 698 }phHal_sIso14443BCfg_t; 699 700 /** \ingroup grp_hal_nfci 701 * 702 * \if hal 703 * \brief Input information for the Felica tags 704 * \else 705 * \brief HAL-Specific 706 * \endif 707 * 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 710 * 711 * \note None. 712 */ 713 714 typedef struct phHal_sFelicaCfg 715 { 716 uint8_t SystemCode[PHHAL_FEL_SYS_CODE_LEN]; /**< System code for Felica tags */ 717 718 }phHal_sFelicaCfg_t; 719 720 721 /** \ingroup grp_hal_nfci 722 * 723 * \if hal 724 * \brief Poll Device Information for conifiguring the discovery wheel 725 Reader and Card Emulation Phases 726 * \else 727 * \brief HAL-Specific 728 * \endif 729 * 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 736 */ 737 typedef phNfc_sPollDevInfo_t phHal_sPollDevInfo_t; 738 739 740 /** \ingroup grp_hal_common 741 * 742 * \if hal 743 * \brief Identifies Type of Host 744 * \else 745 * \brief HAL-Specific 746 * \endif 747 * 748 * This enumeration is used to identify the type of the host providing the 749 * information or the notification to the Terminal host. 750 * \note None. 751 */ 752 753 typedef enum phHal_HostType { 754 /* 755 * This type identifies the host controller 756 * in the NFC device 757 */ 758 phHal_eHostController = 0x00U, 759 /* 760 * This type identifies the Host Device 761 * controlling the NFC device. 762 */ 763 phHal_eTerminalHost = 0x01U, 764 /* 765 * This type identifies the uicc host 766 * connnected to the NFC device 767 */ 768 phHal_eUICCHost = 0x02U, 769 /* Host type is unknown */ 770 phHal_eUnknownHost = 0xFFU 771 }phHal_HostType_t; 772 773 774 /** \ingroup grp_hal_nfci 775 * 776 * \if hal 777 * \brief P2P speed for the Initiator 778 * \else 779 * \brief HAL-Specific 780 * \endif 781 * 782 * The <em> \ref phHal_eP2PMode enum </em> lists all the NFCIP1 speeds 783 * to be used for configuring the NFCIP1 discovery 784 * 785 * \note None. 786 */ 787 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 795 796 797 /** \ingroup grp_hal_common 798 * 799 * \if hal 800 * \brief Identities the type of Notification 801 * \else 802 * \brief HAL-Specific 803 * \endif 804 * 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 809 * \note None. 810 */ 811 812 813 typedef phNfc_eNotificationType_t phHal_eNotificationType_t; 814 815 816 /** \ingroup grp_hal_common 817 * 818 * \if hal 819 * \brief Identifies the type of event notification 820 * \else 821 * \brief HAL-Specific 822 * \endif 823 * 824 * This enumeration is used to identify the type of the event notified 825 * to the Terminal host. 826 * \note None. 827 */ 828 829 typedef enum phHal_Event { 830 831 832 /* Transaction Events */ 833 NFC_EVT_END_OF_TRANSACTION = 0x11U , 834 NFC_EVT_TRANSACTION = 0x12U , 835 NFC_EVT_START_OF_TRANSACTION = 0x20U , 836 837 /* Field Events */ 838 NFC_EVT_FIELD_ON = 0x31U, 839 NFC_EVT_FIELD_OFF = 0x34U, 840 841 /* Card/Target Activation Events */ 842 NFC_EVT_ACTIVATED = 0x33U, 843 NFC_EVT_DEACTIVATED = 0x32U, 844 845 NFC_EVT_PROTECTED = 0x24U , 846 847 /* Reader Phases configuration request by UICC */ 848 NFC_UICC_RDPHASES_ACTIVATE_REQ = 0x43U, 849 NFC_UICC_RDPHASES_DEACTIVATE_REQ = 0x44U, 850 851 /* Connectivity and Triggering Events - Future Use */ 852 NFC_EVT_CONNECTIVITY = 0x10U , 853 NFC_EVT_OPERATION_ENDED = 0x13U , 854 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, 860 861 /* NXP EVENTS */ 862 NFC_EVT_MIFARE_ACCESS = 0x35, 863 NFC_EVT_APDU_RECEIVED = 0x36, 864 NFC_EVT_EMV_CARD_REMOVAL = 0x37 865 866 }phHal_Event_t; 867 868 typedef phNfc_sUiccInfo_t phHal_sUiccInfo_t; 869 870 /** \ingroup grp_hal_common 871 * 872 * \if hal 873 * \brief Event notification Information 874 * \else 875 * \brief HAL-Specific 876 * \endif 877 * 878 * This structure provides the information about the event notified 879 * to the terminal host. 880 * \note None. 881 */ 882 883 typedef struct phHal_sEventInfo 884 { 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; 891 union uEventInfo 892 { 893 /* Parameter information Information is obtained if the eventType is 894 * NFC_EVT_TRANSACTION for UICC. 895 */ 896 phHal_sUiccInfo_t uicc_info; 897 /* AID Information is obtained if the eventType is 898 * NFC_EVT_TRANSACTION. 899 */ 900 phNfc_sData_t aid; 901 /* Overheat Status Information is obtained if the eventType is 902 * NFC_INFO_TEMP_OVERHEAT. 903 */ 904 uint8_t overheat_status; 905 /* rd_phases Information is obtained if the eventType is 906 * NFC_UICC_RDPHASES_ACTIVATE_REQ. 907 */ 908 uint8_t rd_phases; 909 /* Remote Device Information is obtained if the eventType is 910 * NFC_EVT_ACTIVATED. 911 */ 912 phHal_sRemoteDevInformation_t *pRemoteDevInfo; 913 }eventInfo; 914 }phHal_sEventInfo_t; 915 916 917 /** \ingroup grp_hal_common 918 * 919 * \if hal 920 * \brief Information for the Host/Uicc Emulation Support 921 * \else 922 * \brief HAL-Specific 923 * \endif 924 * 925 * The <em> \ref phHal_sEmuSupport structure </em> holds the type 926 * of the target emulation supported. 927 * 928 * \note None. 929 */ 930 931 typedef struct phHal_sEmuSupport 932 { 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; 939 unsigned int RFU:2; 940 941 }phHal_sEmuSupport_t; 942 943 944 /** \ingroup grp_hal_nfci 945 * 946 * \if hal 947 * \brief P2P Information for the Initiator 948 * \else 949 * \brief HAL-Specific 950 * \endif 951 * 952 * The <em> \ref phHal_sNfcIPCfg </em> holds the P2P related information 953 * use by the NFC Device during P2P Discovery and connection 954 * 955 * \note None. 956 */ 957 958 typedef phNfc_sNfcIPCfg_t phHal_sNfcIPCfg_t; 959 960 /** \ingroup grp_hal_common 961 * 962 * \if hal 963 * \brief Enumeration used to choose which type of parameters 964 * are to be configured 965 * \else 966 * \brief HAL-Specific 967 * \endif 968 * 969 * 970 * \note None. 971 */ 972 typedef enum phHal_eConfigType 973 { 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; 981 982 /** \ingroup grp_hal_common 983 * 984 * \if hal 985 * \brief Discovery Configuration Mode 986 * \else 987 * \brief HAL-Specific 988 * \endif 989 * 990 * This enumeration is used to choose the Discovery Configuration 991 * Mode :- Configure and Start, Stop or Start with last set 992 * configuration 993 * \note None. 994 */ 995 996 typedef phNfc_eDiscoveryConfigMode_t phHal_eDiscoveryConfigMode_t; 997 998 999 /** \ingroup grp_hal_common 1000 * 1001 * \if hal 1002 * \brief Target or Tag Release Mode 1003 * \else 1004 * \brief HAL-Specific 1005 * \endif 1006 * 1007 * This enumeration defines various modes of releasing an acquired target 1008 * or tag. 1009 * \note None. 1010 */ 1011 typedef phNfc_eReleaseType_t phHal_eReleaseType_t; 1012 1013 1014 /** \ingroup grp_hal_common 1015 * 1016 * \if hal 1017 * \brief Configuration of specific Emulation Feature 1018 * \else 1019 * \brief HAL-Specific 1020 * \endif 1021 * 1022 * This enumeration is used to choose configuration for a specific 1023 * emulation feature. 1024 * \note None. 1025 */ 1026 1027 typedef enum phHal_eEmulationType 1028 { 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 1041 */ 1042 NFC_UICC_EMULATION = 0x08U /**< Configure parameters for UICC 1043 emulation */ 1044 }phHal_eEmulationType_t; 1045 1046 #if 0 1047 /** \ingroup grp_hal_nfct 1048 * 1049 * \if hal 1050 * \brief Information for Target Mode Start-Up 1051 * \else 1052 * \brief HAL-Specific 1053 * \endif 1054 * 1055 * The <em> Target Information Structure </em> required to start Target mode. 1056 * It contains all the information for the Target mode. 1057 * 1058 * \note None. 1059 * 1060 */ 1061 1062 typedef struct phHal_sTargetInfo 1063 { 1064 uint8_t enableEmulation; 1065 phHal_sNfcIPCfg_t targetConfig; 1066 } phHal_sTargetInfo_t; 1067 #endif 1068 1069 1070 /** \ingroup grp_hal_common 1071 * 1072 * \if hal 1073 * \brief Mode of operation for SmartMX 1074 * \else 1075 * \brief HAL-Specific 1076 * \endif 1077 * 1078 * This enumeration is used to choose the mode of operation for the SmartMx Module. 1079 * Default static configuration at initialization time. 1080 * \note None. 1081 */ 1082 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; 1089 1090 1091 /** \ingroup grp_hal_common 1092 * 1093 * \if hal 1094 * \brief Mode of operation for SWP 1095 * \else 1096 * \brief HAL-Specific 1097 * \endif 1098 * 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. 1101 * \note None. 1102 */ 1103 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; 1109 1110 1111 /** \ingroup grp_hal_common 1112 * 1113 * \if hal 1114 * \brief Information for the Configuring the SmartMX 1115 * \else 1116 * \brief HAL-Specific 1117 * \endif 1118 * 1119 * The <em> \ref phHal_sSmartMX_Cfg structure </em> holds the information 1120 * to configure the SmartMX Module in the NFC Device. 1121 * 1122 * \note None. 1123 */ 1124 1125 1126 typedef struct phHal_sSmartMX_Cfg 1127 { 1128 uint8_t enableEmulation; 1129 uint8_t lowPowerMode; 1130 phHal_eSmartMX_Mode_t smxMode; 1131 }phHal_sSmartMX_Cfg_t; 1132 1133 1134 /** \ingroup grp_hal_common 1135 * 1136 * \if hal 1137 * \brief Information for the Configuring the UICC 1138 * \else 1139 * \brief HAL-Specific 1140 * \endif 1141 * 1142 * The <em> \ref phHal_sUiccEmuCfg structure </em> holds the information 1143 * to configure the UICC Host. 1144 * 1145 * \note None. 1146 */ 1147 1148 1149 typedef struct phHal_sUiccEmuCfg 1150 { 1151 uint8_t enableUicc; 1152 uint8_t uiccEmuSupport; 1153 uint8_t uiccReaderSupport; 1154 uint8_t lowPowerMode; 1155 /* TODO: This will be updated later */ 1156 }phHal_sUiccEmuCfg_t; 1157 1158 /** \ingroup grp_hal_common 1159 * 1160 * \if hal 1161 * \brief Information for the Configuring the Type A Host Emulation Feature 1162 * \else 1163 * \brief HAL-Specific 1164 * \endif 1165 * 1166 * The <em> \ref phHal_sHostEmuCfg_A structure </em> holds the information 1167 * to configure the Host Emulation for Type A. 1168 * 1169 * \note None. 1170 */ 1171 1172 typedef struct phHal_sHostEmuCfg_A 1173 { 1174 uint8_t enableEmulation; 1175 phNfc_sIso14443AInfo_t hostEmuCfgInfo; 1176 uint8_t enableCID; 1177 }phHal_sHostEmuCfg_A_t; 1178 1179 1180 /** \ingroup grp_hal_common 1181 * 1182 * \if hal 1183 * \brief Information for the Configuring the Type B Host Emulation Feature 1184 * \else 1185 * \brief HAL-Specific 1186 * \endif 1187 * 1188 * The <em> \ref phHal_sHostEmuCfg_B structure </em> holds the information 1189 * to configure the Host Emulation for Type B. 1190 * 1191 * \note None. 1192 */ 1193 1194 typedef struct phHal_sHostEmuCfg_B 1195 { 1196 uint8_t enableEmulation; 1197 phNfc_sIso14443BInfo_t hostEmuCfgInfo; 1198 }phHal_sHostEmuCfg_B_t; 1199 1200 /** \ingroup grp_hal_common 1201 * 1202 * \if hal 1203 * \brief Information for the Configuring the Felica Host Emulation Feature 1204 * \else 1205 * \brief HAL-Specific 1206 * \endif 1207 * 1208 * The <em> \ref phHal_sHostEmuCfg_F structure </em> holds the information 1209 * to configure the Felica Host Emulation. 1210 * 1211 * \note None. 1212 */ 1213 1214 1215 typedef struct phHal_sHostEmuCfg_F 1216 { 1217 uint8_t enableEmulation; 1218 }phHal_sHostEmuCfg_F_t; 1219 1220 1221 /** \ingroup grp_hal_common 1222 * 1223 * \if hal 1224 * \brief Information for the Configuring the Emulation 1225 * \else 1226 * \brief HAL-Specific 1227 * \endif 1228 * 1229 * The <em> \ref phHal_sEmulationCfg structure </em> holds the information 1230 * required for the device to act as a Tag or NFCIP1 Target. 1231 * 1232 * \note phHal_sHostEmuCfg_F_t Type F emulation is not presently supported 1233 * is reserved for future use. 1234 */ 1235 1236 typedef struct phHal_sEmulationCfg 1237 { 1238 phHal_HostType_t hostType; 1239 phHal_eEmulationType_t emuType; 1240 union phHal_uEmuConfig 1241 { 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; 1247 }config; 1248 }phHal_sEmulationCfg_t; 1249 1250 /** \ingroup grp_hal_common 1251 * 1252 * \if hal 1253 * \brief Information for the Configuring the Reader parameters 1254 * \else 1255 * \brief HAL-Specific 1256 * \endif 1257 * 1258 * The <em> \ref phHal_sReaderCfg structure </em> holds the information 1259 * to configure the Reader A or Reader B parameters. 1260 * 1261 * \note None. 1262 */ 1263 1264 typedef struct phHal_sReaderCfg 1265 { 1266 phHal_eRFDevType_t readerType; 1267 union phHal_uReaderCfg 1268 { 1269 phHal_sIso14443ACfg_t Iso14443ACfg; 1270 phHal_sIso14443BCfg_t Iso14443BCfg; 1271 }config; 1272 }phHal_sReaderCfg_t; 1273 1274 1275 /** \ingroup grp_hal_common 1276 * 1277 * \if hal 1278 * \brief Information for Configuring the Protected Mode for 1279 * the Secure Elements. 1280 * \else 1281 * \brief HAL-Specific 1282 * \endif 1283 * 1284 * The <em> \ref phHal_sSEProtectionCfg structure </em> holds the 1285 * information to configure the Secure Element Protection configuration. 1286 * 1287 * \note None. 1288 */ 1289 1290 typedef struct phHal_sSEProtectionCfg 1291 { 1292 uint8_t mode; 1293 }phHal_sSEProtectionCfg_t; 1294 1295 1296 /** \ingroup grp_hal_common 1297 * 1298 * \if hal 1299 * \brief Poll configuration structure 1300 * \else 1301 * \brief HAL-Specific 1302 * \endif 1303 * 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 1307 * 1308 * \note All members of this structure are input parameters [out]. 1309 * 1310 * \if hal 1311 * \sa \ref phHal4Nfc_Connect, \ref phHal4Nfc_ConfigParameters, 1312 * \ref phHal_eP2PMode_t and \ref phHal4Nfc_Disconnect. 1313 * \endif 1314 * 1315 */ 1316 1317 typedef phNfc_sADD_Cfg_t phHal_sADD_Cfg_t; 1318 1319 1320 /** \ingroup grp_hal_common 1321 * 1322 * \if hal 1323 * \brief Configuration information. 1324 * \else 1325 * \brief HAL-Specific 1326 * \endif 1327 * 1328 * The <em> \ref phHal_uConfig structure </em> holds the information 1329 * required for Configuring the Device. 1330 * 1331 * \note None. 1332 */ 1333 1334 1335 typedef union phHal_uConfig 1336 { 1337 phHal_sEmulationCfg_t emuConfig; 1338 phHal_sNfcIPCfg_t nfcIPConfig; /**< Gives the information about 1339 * the General Bytes for NFC-IP 1340 * Communication. 1341 */ 1342 phHal_sReaderCfg_t readerConfig; 1343 phHal_sSEProtectionCfg_t protectionConfig; 1344 }phHal_uConfig_t; 1345 1346 1347 #endif 1348 1349 /* EOF */ 1350