Home | History | Annotate | Download | only in inc
      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 
     51 /** \ingroup  grp_hal_common
     52  *
     53  * \if hal
     54  *  \brief Protocol Support Information
     55  * \else
     56  *  \brief HAL-Specific
     57  * \endif
     58  *
     59  *  The <em> Supported Protocols Structure </em> holds all protocol supported by the current NFC
     60  *  device.
     61  *
     62  *  \note All members of this structure are output parameters [out].
     63  *
     64  */
     65 typedef phNfc_sSupProtocol_t phHal_sSupProtocol_t;
     66 
     67 
     68 /** \ingroup grp_hal_common
     69  *
     70  *
     71  * \if hal
     72  *  \brief Information related to the NFC Device
     73  * \else
     74  *  \brief HAL-Specific
     75  * \endif
     76  *
     77  *  The <em> Device Information Structure </em> holds information
     78  *  related to the NFC IC read during initialization time.
     79  *  It allows the caller firware, hardware version, the model id,
     80  *  HCI verison supported and vendor name. Refer to the NFC Device
     81  *  User Manual on how to interpret each of the values. In addition
     82  *  it also contains capabilities of the NFC Device such as the
     83  *  protocols supported in Reader and emulation mode
     84  *
     85  */
     86 
     87 typedef phNfc_sDeviceCapabilities_t phHal_sDeviceCapabilities_t;
     88 
     89 
     90 /**
     91  * \ingroup grp_hal_common
     92  *
     93  * \if hal
     94  *  \brief Hardware Reference - The Peripheral Representation
     95  * \else
     96  *  \brief HAL-Specific
     97  * \endif
     98  *
     99  *  The Hardware Reference structure is filled as part of the open function and
    100  *  contains information regarding connected peripheral NFC device. It also
    101  *  stores the refernce to the communication driver passed by the HAL client
    102  *  for usage during communication with the NFC Device
    103  *
    104  * \note The caller can consider this structure atomic, no interpretation is required
    105  *       for HAL operation.
    106  *
    107  * \sa phHal4Nfc_Open .
    108  *
    109  */
    110 
    111 /**
    112  * \ingroup grp_hal_common
    113  *
    114  *  \brief Hardware Reference - The Peripheral Representation
    115  *
    116  *  The Hardware Reference structure is filled as part of the open function and
    117  *  contains information regarding connected peripheral NFC device. It also
    118  *  stores the refernce to the communication driver passed by the HAL client
    119  *  for usage during communication with the NFC Device
    120  *
    121  * \note The caller can consider this structure atomic, no interpretation is required
    122  *       for HAL operation.
    123  *
    124  */
    125 typedef struct phHal_sHwReference
    126 {
    127     /**<  Will be usable/valid after the Open function. */
    128     void                            *p_board_driver;
    129     /**<  Session Identifier for the established session */
    130     uint8_t                         session_id[SESSIONID_SIZE];
    131     /**<  SMX  Connected TRUE/FALSE */
    132     uint8_t                         smx_connected;
    133     /**<  UICC  Connected TRUE/FALSE */
    134     uint8_t                         uicc_connected;
    135     /**<  UICC  Reader Mode is Active TRUE/FALSE */
    136     uint8_t                         uicc_rdr_active;
    137     /**<  Device information. */
    138     phNfc_sDeviceCapabilities_t     device_info;
    139     /**<  Context of the HAL Layer */
    140     void                            *hal_context;
    141     /**<  Context of the DAL Layer */
    142     void                            *dal_context;
    143 } phHal_sHwReference_t;
    144 
    145 
    146 /** \ingroup grp_hal_common
    147  *
    148  * \if hal
    149  * \brief Hardware configuration - Configuration Parameters for the NFC Device
    150  * \else
    151  * \brief HAL-Specific
    152  * \endif
    153  *
    154  *  The parameters used to configure the device during the initialisation.
    155  *  This structure is used internally by the HAL implementation and is filled
    156  *  up based on various configuration parameters from the config file
    157  * \note None.
    158  *
    159  */
    160 
    161 typedef struct phHal_sHwConfig
    162 {
    163 
    164     uint8_t             session_id[SESSIONID_SIZE]; /**<  Session Identifier for
    165                                                      the established session */
    166 
    167     uint8_t             clk_req; /**<  Clock Request Setting */
    168 
    169     uint8_t             input_clk; /**<  Input Clock Setting */
    170 
    171 } phHal_sHwConfig_t;
    172 
    173 
    174 
    175 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
    176 
    177 /* This data structure is not used anymore and will be removed in subsequent
    178    release */
    179 typedef struct phHal_sDepFlags
    180 {
    181    unsigned int MetaChaining : 1;
    182    unsigned int NADPresent   : 1;
    183 } phHal_sDepFlags_t;
    184 
    185 /* This data structure is not used anymore and will be removed in subsequent
    186    release */
    187 
    188 typedef struct phHal_sDepAdditionalInfo
    189 {
    190     phHal_sDepFlags_t DepFlags;
    191     uint8_t NAD;
    192 } phHal_sDepAdditionalInfo_t;
    193 
    194 
    195 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
    196 
    197 
    198 
    199 /** \ingroup grp_hal_common
    200  *
    201  * \if hal
    202  *  \brief Enumerated MIFARE Commands
    203  * \else
    204  *  \brief HAL-Specific
    205  * \endif
    206  *
    207  *  The <em> Mifare Command List Enumerator </em> lists all available Mifare native commands.
    208  *
    209  * \note None.
    210  *
    211  */
    212 
    213 typedef phNfc_eMifareCmdList_t phHal_eMifareCmdList_t;
    214 
    215 #define    phHal_eMifareRaw        phNfc_eMifareRaw
    216 #define    phHal_eMifareAuthentA   phNfc_eMifareAuthentA
    217 #define    phHal_eMifareAuthentB   phNfc_eMifareAuthentB
    218 #define    phHal_eMifareRead16     phNfc_eMifareRead16
    219 #define    phHal_eMifareRead       phNfc_eMifareRead
    220 #define    phHal_eMifareWrite16    phNfc_eMifareWrite16
    221 #define    phHal_eMifareWrite4     phNfc_eMifareWrite4
    222 #define    phHal_eMifareInc        phNfc_eMifareInc
    223 #define    phHal_eMifareDec        phNfc_eMifareDec
    224 #define    phHal_eMifareTransfer   phNfc_eMifareTransfer
    225 #define    phHal_eMifareRestore    phNfc_eMifareRestore
    226 #define    phHal_eMifareReadSector phNfc_eMifareReadSector
    227 #define    phHal_eMifareWriteSector phNfc_eMifareWriteSector
    228 #define    phHal_eMifareInvalidCmd phNfc_eMifareInvalidCmd
    229 
    230 
    231 /** \ingroup grp_hal_common
    232  *
    233  *  The <em> T=Cl Command List Enumerator </em> lists all available T=Cl Commands.
    234  *
    235  * \note None.
    236  *
    237  */
    238 typedef phNfc_eIso14443_4_CmdList_t phHal_eIso14443_4_CmdList_t;
    239 
    240 #define    phHal_eIso14443_4_Raw    phNfc_eIso14443_4_Raw
    241 
    242 
    243 /** \ingroup grp_hal_common
    244  *
    245  *  The <em> NFCIP1 Command List Enumerator </em> lists all available NFCIP1 Commands.
    246  *
    247  * \note None.
    248  *
    249  */
    250 typedef phNfc_eNfcIP1CmdList_t phHal_eNfcIP1CmdList_t;
    251 
    252 #define       phHal_eNfcIP1_Raw             phNfc_eNfcIP1_Raw
    253 
    254 
    255 /** \ingroup grp_hal_common
    256  *
    257  *  The <em> ISO15693 Command List Enumerator </em> lists all available ISO15693 Commands.
    258  *
    259  * \note None.
    260  *
    261  */
    262 
    263 typedef phNfc_eIso15693_CmdList_t phHal_eIso15693_CmdList_t;
    264 
    265 #if 0
    266 #define    phHal_eIso15693_Raw             phNfc_eIso15693_Raw
    267 #endif
    268 #define    phHal_eIso15693_Cmd             phNfc_eIso15693_Cmd
    269 #define    phHal_eIso15693_Invalid         phNfc_eIso15693_Invalid
    270 
    271 /** \ingroup grp_hal_common
    272  *
    273  *  The <em> Felica Command List Enumerator </em> lists all available Felica Commands.
    274  *
    275  * \note None.
    276  *
    277  */
    278 
    279 typedef enum phHal_eFelicaCmdList
    280 {
    281     phHal_eFelica_Raw             = 0xF0U, /**< Felica Raw command:\n
    282                                                  - This command sends the data buffer directly
    283                                                  to the remote device */
    284     phHal_eFelica_Check           = 0x00, /**< Felica Check command:\n
    285                                                  - This command checks the data from the Felica
    286                                                   remote device */
    287     phHal_eFelica_Update          = 0x01, /**< Felica Update command:\n
    288                                                  - This command updates the data onto the Felica
    289                                                   remote device */
    290     phHal_eFelica_Invalid         = 0xFFU      /**< Invalid Command */
    291 } phHal_eFelicaCmdList_t;
    292 
    293 
    294 typedef enum phHal_eJewelCmdList
    295 {
    296     phHal_eJewel_Raw            = 0x00U, /**< Jewel command:\n
    297                                                  - This command sends the data buffer directly
    298                                                  to the remote device */
    299     phHal_eJewel_Invalid        = 0xFFU  /**< Invalid jewel command */
    300 }phHal_eJewelCmdList_t;
    301 
    302 
    303 
    304 /** \ingroup grp_hal_nfci
    305 *
    306 * \if hal
    307 *  \brief Remote Device Reader A RF Gate Information Container
    308 * \else
    309 *  \brief HAL-Specific
    310 * \endif
    311 *
    312 *  The <em> Reader A structure </em> includes the available information
    313 *  related to the discovered ISO14443A remote device. This information
    314 *  is updated for every device discovery.
    315 *  \note None.
    316 *
    317 */
    318 typedef phNfc_sIso14443AInfo_t phHal_sIso14443AInfo_t;
    319 
    320 /** \ingroup grp_hal_nfci
    321 *
    322 * \if hal
    323 *  \brief Remote Device Reader B RF Gate Information Container
    324 * \else
    325 *  \brief HAL-Specific
    326 * \endif
    327 *
    328 *  The <em> Reader B structure </em> includes the available information
    329 *  related to the discovered ISO14443B remote device. This information
    330 *  is updated for every device discovery.
    331 *  \note None.
    332 *
    333 */
    334 
    335 typedef phNfc_sIso14443BInfo_t phHal_sIso14443BInfo_t;
    336 
    337 typedef phNfc_sIso14443BPrimeInfo_t phHal_sIso14443BPrimeInfo;
    338 
    339 
    340 /** \ingroup grp_hal_nfci
    341 *
    342 * \if hal
    343 *  \brief Remote Device Jewel Reader RF Gate Information Container
    344 * \else
    345 *  \brief HAL-Specific
    346 * \endif
    347 *
    348 *  The <em> Jewel Reader structure </em> includes the available information
    349 *  related to the discovered Jewel remote device. This information
    350 *  is updated for every device discovery.
    351 *  \note None.
    352 *
    353 */
    354 
    355 
    356 typedef phNfc_sJewelInfo_t phHal_sJewelInfo_t;
    357 
    358 /** \ingroup grp_hal_nfci
    359 *
    360 * \if hal
    361 *  \brief Remote Device Felica Reader RF Gate Information Container
    362 * \else
    363 *  \brief HAL-Specific
    364 * \endif
    365 *
    366 *  The <em> Felica Reader structure </em> includes the available information
    367 *  related to the discovered Felica remote device. This information
    368 *  is updated for every device discovery.
    369 *  \note None.
    370 *
    371 */
    372 
    373 typedef phNfc_sFelicaInfo_t phHal_sFelicaInfo_t;
    374 
    375 
    376 /** \ingroup grp_hal_nfci
    377 *
    378 * \if hal
    379 *  \brief Remote Device Reader 15693 RF Gate Information Container
    380 * \else
    381 *  \brief HAL-Specific
    382 * \endif
    383 *
    384 *  The <em> Reader A structure </em> includes the available information
    385 *  related to the discovered ISO15693 remote device. This information
    386 *  is updated for every device discovery.
    387 *  \note None.
    388 *
    389 */
    390 
    391 typedef phNfc_sIso15693Info_t phHal_sIso15693Info_t;
    392 
    393 
    394 /** \ingroup grp_hal_nfci
    395 *
    396 * \if hal
    397 *  \brief NFC Data Rate Supported between the Reader and the Target
    398 * \else
    399 *  \brief HAL-Specific
    400 * \endif
    401 *
    402 *  The <em> \ref phHalNfc_eDataRate enum </em> lists all the Data Rate
    403 *  values to be used to determine the rate at which the data is transmitted
    404 *  to the target.
    405 *
    406 *  \note None.
    407 */
    408 
    409 
    410 typedef phNfc_eDataRate_t phHalNfc_eDataRate_t;
    411 
    412 
    413 /** \ingroup grp_hal_nfci
    414 *
    415 * \if hal
    416 *  \brief NFCIP1 Gate Information Container
    417 * \else
    418 *  \brief HAL-Specific
    419 * \endif
    420 *
    421 *  The <em> NFCIP1 structure </em> includes the available information
    422 *  related to the discovered NFCIP1 remote device. This information
    423 *  is updated for every device discovery.
    424 *  \note None.
    425 *
    426 */
    427 
    428 typedef phNfc_sNfcIPInfo_t phHal_sNfcIPInfo_t;
    429 
    430 
    431 /** \ingroup grp_hal_nfci
    432 *
    433 * \if hal
    434 *  \brief Remote Device Specific Information Container
    435 * \else
    436 *  \brief HAL-Specific
    437 * \endif
    438 *
    439 *  The <em> Remote Device Information Union </em> includes the available Remote Device Information
    440 *  structures. Following the device detected, the corresponding data structure is used.
    441 *
    442 *  \note None.
    443 *
    444 */
    445 
    446 typedef phNfc_uRemoteDevInfo_t phHal_uRemoteDevInfo_t;
    447 
    448 /** \ingroup grp_hal_nfci
    449 *
    450 * \if hal
    451 *  \brief RF Device Type Listing
    452 * \else
    453 *  \brief HAL-Specific
    454 * \endif
    455 *
    456 *  The <em> RF Device Type List </em> is used to identify the type of
    457 *  remote device that is discovered/connected. There seperate
    458 *  types to identify a Remote Reader (denoted by _PCD) and
    459 *  Remote Tag (denoted by _PICC)
    460 *  \note None.
    461 *
    462 */
    463 
    464 typedef phNfc_eRFDevType_t phHal_eRFDevType_t;
    465 
    466 #define    phHal_eUnknown_DevType phNfc_eUnknown_DevType
    467 
    468     /* Specific PCD Devices */
    469 #define    phHal_eISO14443_A_PCD phNfc_eISO14443_A_PCD
    470 #define    phHal_eISO14443_B_PCD phNfc_eISO14443_B_PCD
    471 #define    phHal_eISO14443_BPrime_PCD phNfc_eISO14443_BPrime_PCD
    472 #define    phHal_eFelica_PCD phNfc_eFelica_PCD
    473 #define    phHal_eJewel_PCD phNfc_eJewel_PCD
    474 #define    phHal_eISO15693_PCD phNfc_eISO15693_PCD
    475     /* Generic PCD Type */
    476 #define    phHal_ePCD_DevType phNfc_ePCD_DevType
    477 
    478     /* Generic PICC Type */
    479 #define    phHal_ePICC_DevType phNfc_ePICC_DevType
    480     /* Specific PICC Devices */
    481 #define    phHal_eISO14443_A_PICC phNfc_eISO14443_A_PICC
    482 #define    phHal_eISO14443_4A_PICC phNfc_eISO14443_4A_PICC
    483 #define    phHal_eISO14443_3A_PICC phNfc_eISO14443_3A_PICC
    484 #define    phHal_eMifare_PICC phNfc_eMifare_PICC
    485 #define    phHal_eISO14443_B_PICC phNfc_eISO14443_B_PICC
    486 #define    phHal_eISO14443_4B_PICC phNfc_eISO14443_4B_PICC
    487 #define    phHal_eISO14443_BPrime_PICC phNfc_eISO14443_BPrime_PICC
    488 #define    phHal_eFelica_PICC phNfc_eFelica_PICC
    489 #define    phHal_eJewel_PICC phNfc_eJewel_PICC
    490 #define    phHal_eISO15693_PICC phNfc_eISO15693_PICC
    491 
    492     /* NFC-IP1 Device Types */
    493 #define    phHal_eNfcIP1_Target phNfc_eNfcIP1_Target
    494 #define    phHal_eNfcIP1_Initiator phNfc_eNfcIP1_Initiator
    495 
    496     /* Other Sources */
    497 #define    phHal_eInvalid_DevType phNfc_eInvalid_DevType
    498 
    499 /** \ingroup grp_hal_nfci
    500 *
    501 * \if hal
    502 *  \brief Remote Device Type Listing
    503 * \else
    504 *  \brief HAL-Specific
    505 * \endif
    506 *
    507 *  The <em> Remote Device Type List </em> is used to identify the type of
    508 *  remote device that is discovered/connected
    509 *  \note This is same as RF Device Type List.
    510 *
    511 */
    512 typedef phNfc_eRemDevType_t phHal_eRemDevType_t;
    513 
    514 /** \ingroup grp_hal_common
    515  *
    516  *
    517  * \if hal
    518  *  \brief Common Command Attribute
    519  * \else
    520  *  \brief HAL-Specific
    521  * \endif
    522  *
    523  *  The <em> Hal Command Union </em> includes each available type of Commands.
    524  *
    525  * \note None.
    526  *
    527  */
    528 
    529 typedef phNfc_uCmdList_t phHal_uCmdList_t;
    530 
    531 
    532 /** \ingroup grp_hal_nfci
    533  *
    534  * \if hal
    535  *  \brief Remote Device Information Structure
    536  * \else
    537  *  \brief HAL-Specific
    538  * \endif
    539  *
    540  *  The <em> Remote Device Information Structure </em> holds information about one single Remote
    541  *  Device detected by the polling function .\n
    542  *  It lists parameters common to all supported remote devices.
    543  *
    544  *  \note
    545  *
    546  *  \if hal
    547  *   \sa \ref phHal4Nfc_ConfigureDiscovery and \ref phHal4Nfc_Connect
    548  *  \else
    549  *   \sa
    550  *  \endif
    551  *
    552  */
    553 
    554 typedef phNfc_sRemoteDevInformation_t phHal_sRemoteDevInformation_t;
    555 
    556 
    557 
    558 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
    559 
    560 /* This data structure is not used anymore and will be removed in subsequent
    561    release */
    562 
    563 typedef struct phHal_sDevInputParam
    564 {
    565     uint8_t FelicaPollPayload[5];
    566 
    567 
    568     uint8_t NfcPollPayload[5];
    569 
    570 
    571     uint8_t NFCIDAuto;
    572 
    573 
    574     uint8_t NFCID3i[PHHAL_NFCID_LENGTH];
    575 
    576 
    577 
    578     uint8_t DIDiUsed;
    579 
    580     uint8_t CIDiUsed;
    581 
    582     uint8_t NfcNADiUsed;
    583 
    584     /*+ MantisId : 31 - JP - 09-01-2006 */
    585         /*uint8_t TClNADiUsed; */
    586 
    587     /*- MantisId : 31 - JP - 09-01-2006 */
    588     uint8_t GeneralByte[48];
    589 
    590 
    591     uint8_t GeneralByteLength;
    592 
    593 
    594     uint8_t ISO14443_4B_AFI;
    595 
    596 } phHal_sDevInputParam_t;
    597 
    598 
    599 
    600 
    601 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
    602 
    603 
    604 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
    605 /*    TARGET STRUCTURES */
    606 
    607 
    608 /** \ingroup  grp_hal_common
    609  *
    610  * \if hal
    611  *  \brief Transceive Information Data Structure for sending commands/response
    612  *         to the remote device
    613  * \else
    614  *  \brief HAL-Specific
    615  * \endif
    616  *
    617  *  The <em> Transceive Information Data Structure </em> is used to pass the
    618  *  Command, Address (only required for MIFARE) and the send and receive data
    619  *  data structure (buffer and length) for communication with remote device
    620  *
    621  *
    622  */
    623 
    624 typedef phNfc_sTransceiveInfo_t phHal_sTransceiveInfo_t;
    625 
    626 
    627 /** \ingroup grp_hal_nfci
    628 *
    629 * \if hal
    630 *  \brief Input information for the Type A tags
    631 * \else
    632 *  \brief HAL-Specific
    633 * \endif
    634 *
    635 *  The <em> \ref phHal_sIso14443ACfg structure </em> holds the information
    636 *  required for the NFC device to be used during ISO14443A target discovery
    637 *
    638 *  \note None.
    639 */
    640 typedef struct phHal_sIso14443ACfg
    641 {
    642     uint8_t     Auto_Activation;       /**< Enable Auto Activation for
    643                                     Technology A \n
    644                                     If set to 0, the activation procedure will stop
    645                                     after Select (SAK has been received).
    646                                     The host could evaluate SAK value and then decide:
    647                                         - to start communicating with the remote card
    648                                           using proprietary commands (see NXP_MIFARE_RAW
    649                                           and NXP_MIFARE_CMD)
    650                                     or
    651                                         - to activate the remote card up to ISO14443-4
    652                                           level (RATS and PPS) using
    653                                           CONTINUE ACTIVATION command
    654                                     If set to 1, activation follows the flow described in
    655                                     ETSI HCI specification (restrict detection to
    656                                     ISO14443-4 compliant cards).
    657                                     */
    658 }phHal_sIso14443ACfg_t;
    659 
    660 
    661 /** \ingroup grp_hal_nfci
    662 *
    663 * \if hal
    664 *  \brief Input information for the Type B tags
    665 * \else
    666 *  \brief HAL-Specific
    667 * \endif
    668 *
    669 *  The <em> \ref phHal_sIso14443BCfg structure </em> holds the information
    670 *  required for the NFC device to be used during ISO14443B target discovery
    671 *
    672 *  \note None.
    673 */
    674 typedef struct phHal_sIso14443BCfg
    675 {
    676     uint8_t     AppFamily_ID;       /**< Application Family Identifier for
    677                                     Technology B, 0x00 means all application */
    678 }phHal_sIso14443BCfg_t;
    679 
    680 /** \ingroup grp_hal_nfci
    681 *
    682 * \if hal
    683 *  \brief Input information for the Felica tags
    684 * \else
    685 *  \brief HAL-Specific
    686 * \endif
    687 *
    688 *  The <em> \ref phHal_sFelicaCfg_t structure </em> holds the information
    689 *  required for the NFC device to be used during Felica target discovery
    690 *
    691 *  \note None.
    692 */
    693 
    694 typedef struct phHal_sFelicaCfg
    695 {
    696     uint8_t     SystemCode[PHHAL_FEL_SYS_CODE_LEN];     /**< System code for Felica tags */
    697 
    698 }phHal_sFelicaCfg_t;
    699 
    700 
    701 /** \ingroup grp_hal_nfci
    702 *
    703 * \if hal
    704 *  \brief Poll Device Information for conifiguring the discovery wheel
    705           Reader and Card Emulation Phases
    706 * \else
    707 *  \brief HAL-Specific
    708 * \endif
    709 *
    710 *  The <em> \ref phHal_sPollDevInfo_t enum </em> is used to enable/disable
    711 *  phases of the discovery wheel related to specific reader types and
    712 *  card emulation phase
    713 *  \note Enabling specific Reader technology when NFCIP1 speed is set in the
    714 *        phNfc_sADD_Cfg_t is implicitly done in HAL. Use this structure to only
    715 *        enable/disable Card Reader Functionality
    716 */
    717 typedef phNfc_sPollDevInfo_t phHal_sPollDevInfo_t;
    718 
    719 
    720 /** \ingroup grp_hal_common
    721 *
    722 * \if hal
    723 *  \brief Identifies Type of Host
    724 * \else
    725 *  \brief HAL-Specific
    726 * \endif
    727 *
    728 *  This enumeration is used to identify the type of the host providing the
    729 *  information or the notification to the Terminal host.
    730 *  \note None.
    731 */
    732 
    733 typedef enum phHal_HostType {
    734     /*
    735      * This type identifies the host controller
    736      * in the NFC device
    737      */
    738     phHal_eHostController       = 0x00U,
    739     /*
    740      * This type identifies the Host Device
    741      * controlling the NFC device.
    742      */
    743     phHal_eTerminalHost         = 0x01U,
    744     /*
    745      * This type identifies the uicc host
    746      * connnected to the NFC device
    747      */
    748     phHal_eUICCHost             = 0x02U,
    749     /* Host type is unknown */
    750     phHal_eUnknownHost          = 0xFFU
    751 }phHal_HostType_t;
    752 
    753 
    754 /** \ingroup grp_hal_nfci
    755 *
    756 * \if hal
    757 *  \brief P2P speed for the Initiator
    758 * \else
    759 *  \brief HAL-Specific
    760 * \endif
    761 *
    762 *  The <em> \ref phHal_eP2PMode enum </em> lists all the NFCIP1 speeds
    763 *  to be used for configuring the NFCIP1 discovery
    764 *
    765 *  \note None.
    766 */
    767 
    768 #define    phHal_eDefaultP2PMode  phNfc_eDefaultP2PMode
    769 #define    phHal_ePassive106 phNfc_ePassive106
    770 #define    phHal_ePassive212 phNfc_ePassive212
    771 #define    phHal_ePassive424 phNfc_ePassive424
    772 #define    phHal_eActive  phNfc_eActive
    773 #define    phHal_eP2P_ALL    phNfc_eP2P_ALL
    774 #define    phHal_eInvalidP2PMode phNfc_eInvalidP2PMode
    775 
    776 
    777 /** \ingroup grp_hal_common
    778 *
    779 * \if hal
    780 *  \brief Identities the type of Notification
    781 * \else
    782 *  \brief HAL-Specific
    783 * \endif
    784 *
    785 *  This enumeration is used to specify the type of notification notified
    786 *  to the upper layer. This classifies the notification into two types
    787 *  one for the discovery notifications and the other for all the remaining
    788 *  event notifications
    789 *  \note None.
    790 */
    791 
    792 
    793 typedef phNfc_eNotificationType_t phHal_eNotificationType_t;
    794 
    795 
    796 /** \ingroup grp_hal_common
    797 *
    798 * \if hal
    799 *  \brief Identifies the type of event notification
    800 * \else
    801 *  \brief HAL-Specific
    802 * \endif
    803 *
    804 *  This enumeration is used to identify the type of the event notified
    805 *  to the Terminal host.
    806 *  \note None.
    807 */
    808 
    809 typedef enum phHal_Event {
    810 
    811 
    812     /* Transaction Events */
    813     NFC_EVT_END_OF_TRANSACTION   = 0x11U ,
    814     NFC_EVT_TRANSACTION          = 0x12U ,
    815     NFC_EVT_START_OF_TRANSACTION = 0x20U ,
    816 
    817     /* Field Events */
    818     NFC_EVT_FIELD_ON             = 0x31U,
    819     NFC_EVT_FIELD_OFF            = 0x34U,
    820 
    821     /* Card/Target Activation Events */
    822     NFC_EVT_ACTIVATED           = 0x33U,
    823     NFC_EVT_DEACTIVATED         = 0x32U,
    824 
    825     NFC_EVT_PROTECTED           = 0x24U ,
    826 
    827     /* Reader Phases configuration request by UICC */
    828     NFC_UICC_RDPHASES_ACTIVATE_REQ = 0x43U,
    829     NFC_UICC_RDPHASES_DEACTIVATE_REQ = 0x44U,
    830 
    831     /* Connectivity and Triggering Events - Future Use */
    832     NFC_EVT_CONNECTIVITY         = 0x10U ,
    833     NFC_EVT_OPERATION_ENDED      = 0x13U ,
    834 
    835     /* NXP Specific System Information Events */
    836     NFC_INFO_TXLDO_OVERCUR       = 0x71U,
    837     NFC_INFO_MEM_VIOLATION       = 0x73U,
    838     NFC_INFO_TEMP_OVERHEAT       = 0x74U
    839 
    840 }phHal_Event_t;
    841 
    842 typedef phNfc_sUiccInfo_t phHal_sUiccInfo_t;
    843 
    844 /** \ingroup grp_hal_common
    845 *
    846 * \if hal
    847 *  \brief Event notification Information
    848 * \else
    849 *  \brief HAL-Specific
    850 * \endif
    851 *
    852 *  This structure provides the information about the event notified
    853 *  to the terminal host.
    854 *  \note None.
    855 */
    856 
    857 typedef struct phHal_sEventInfo
    858 {
    859     /* Type of the host issuing the event */
    860     phHal_HostType_t    eventHost;
    861     /* Type of the source issuing the event */
    862     phHal_eRFDevType_t  eventSource;
    863     /* Type of the source issuing the event */
    864     phHal_Event_t       eventType;
    865     union   uEventInfo
    866     {
    867         /* Parameter information Information is obtained if the eventType is
    868          * NFC_EVT_TRANSACTION for UICC.
    869          */
    870         phHal_sUiccInfo_t       uicc_info;
    871         /* AID Information is obtained if the eventType is
    872          * NFC_EVT_TRANSACTION.
    873          */
    874         phNfc_sData_t           aid;
    875         /* Overheat Status Information is obtained if the eventType is
    876          * NFC_INFO_TEMP_OVERHEAT.
    877          */
    878         uint8_t                 overheat_status;
    879         /* rd_phases Information is obtained if the eventType is
    880          * NFC_UICC_RDPHASES_ACTIVATE_REQ.
    881          */
    882         uint8_t                 rd_phases;
    883         /* Remote Device Information is obtained if the eventType is
    884          * NFC_EVT_ACTIVATED.
    885          */
    886         phHal_sRemoteDevInformation_t *pRemoteDevInfo;
    887     }eventInfo;
    888 }phHal_sEventInfo_t;
    889 
    890 
    891 /** \ingroup grp_hal_common
    892 *
    893 * \if hal
    894 *  \brief Information for the Host/Uicc Emulation Support
    895 * \else
    896 *  \brief HAL-Specific
    897 * \endif
    898 *
    899 *  The <em> \ref phHal_sEmuSupport structure </em> holds the type
    900 *   of the target emulation supported.
    901 *
    902 *  \note None.
    903 */
    904 
    905 typedef struct phHal_sEmuSupport
    906 {
    907     unsigned int TypeA:1;
    908     unsigned int TypeB:1;
    909     unsigned int TypeBPrime:1;
    910     unsigned int TypeFelica:1;
    911     unsigned int TypeMifare:1;
    912     unsigned int TypeNfcIP1:1;
    913     unsigned int RFU:2;
    914 
    915 }phHal_sEmuSupport_t;
    916 
    917 
    918 /** \ingroup grp_hal_nfci
    919 *
    920 * \if hal
    921 *  \brief P2P Information for the Initiator
    922 * \else
    923 *  \brief HAL-Specific
    924 * \endif
    925 *
    926 *  The <em> \ref phHal_sNfcIPCfg </em> holds the P2P related information
    927 *  use by the NFC Device during P2P Discovery and connection
    928 *
    929 *  \note None.
    930 */
    931 
    932 typedef phNfc_sNfcIPCfg_t phHal_sNfcIPCfg_t;
    933 
    934 /** \ingroup grp_hal_common
    935 *
    936 * \if hal
    937 *  \brief Enumeration used to choose which type of parameters
    938 *         are to be configured
    939 * \else
    940 *  \brief HAL-Specific
    941 * \endif
    942 *
    943 *
    944 *  \note None.
    945 */
    946 typedef enum phHal_eConfigType
    947 {
    948     NFC_INVALID_CONFIG  =   0x00U, /**< Invalid Configuration */
    949     NFC_RF_READER_CONFIG, /**< Reader Parmaeters */
    950     NFC_P2P_CONFIG,       /**< NFCIP1 Parameters */
    951     NFC_SE_PROTECTION_CONFIG, /**< Secure Element
    952                                    Protection Cofiguration */
    953     NFC_EMULATION_CONFIG  /**< Emulation Parameters */
    954 }phHal_eConfigType_t;
    955 
    956 /** \ingroup grp_hal_common
    957 *
    958 * \if hal
    959 *  \brief Discovery Configuration Mode
    960 * \else
    961 *  \brief HAL-Specific
    962 * \endif
    963 *
    964 *  This enumeration is used to choose the Discovery Configuration
    965 *  Mode :- Configure and Start, Stop or Start with last set
    966 *  configuration
    967 *  \note None.
    968 */
    969 
    970 typedef phNfc_eDiscoveryConfigMode_t phHal_eDiscoveryConfigMode_t;
    971 
    972 
    973 /** \ingroup grp_hal_common
    974 *
    975 * \if hal
    976 *  \brief Target or Tag Release Mode
    977 * \else
    978 *  \brief HAL-Specific
    979 * \endif
    980 *
    981 *  This enumeration defines various modes of releasing an acquired target
    982 *  or tag.
    983 *  \note None.
    984 */
    985 typedef phNfc_eReleaseType_t phHal_eReleaseType_t;
    986 
    987 
    988 /** \ingroup grp_hal_common
    989 *
    990 * \if hal
    991 *  \brief Configuration of specific Emulation Feature
    992 * \else
    993 *  \brief HAL-Specific
    994 * \endif
    995 *
    996 *  This enumeration is used to choose configuration for a specific
    997 *  emulation feature.
    998 *  \note None.
    999 */
   1000 
   1001 typedef enum phHal_eEmulationType
   1002 {
   1003     NFC_UNKNOWN_EMULATION       = 0x00U, /**< Invalid Configuration */
   1004     NFC_HOST_CE_A_EMULATION     = 0x01U, /**< Configure parameters for Type A
   1005                                               card emulation from host */
   1006     NFC_HOST_CE_B_EMULATION     = 0x02U, /**< Configure parameters for Type B
   1007                                               card emulation from host */
   1008     NFC_B_PRIME_EMULATION       = 0x03U, /**< Configure parameters for Type B'
   1009                                               card emulation from host */
   1010     NFC_FELICA_EMULATION        = 0x04U, /**< Configure parameters for Type F
   1011                                               card emulation from host */
   1012     NFC_MIFARE_EMULATION        = 0x06U, /**< Configure parameters for MIFARE
   1013                                               card emulation - For Future Use */
   1014     NFC_SMARTMX_EMULATION       = 0x07U, /**< Configure parameters for SmartMX
   1015                                             */
   1016     NFC_UICC_EMULATION          = 0x08U  /**< Configure parameters for UICC
   1017                                             emulation */
   1018 }phHal_eEmulationType_t;
   1019 
   1020 #if 0
   1021 /** \ingroup grp_hal_nfct
   1022  *
   1023  * \if hal
   1024  *  \brief Information for Target Mode Start-Up
   1025  * \else
   1026  *  \brief HAL-Specific
   1027  * \endif
   1028  *
   1029  *  The <em> Target Information Structure </em> required to start Target mode.
   1030  *  It contains all the information for the Target mode.
   1031  *
   1032  *  \note None.
   1033  *
   1034  */
   1035 
   1036 typedef struct phHal_sTargetInfo
   1037 {
   1038     uint8_t                 enableEmulation;
   1039     phHal_sNfcIPCfg_t       targetConfig;
   1040 } phHal_sTargetInfo_t;
   1041 #endif
   1042 
   1043 
   1044 /** \ingroup grp_hal_common
   1045 *
   1046 * \if hal
   1047 *  \brief Mode of operation for SmartMX
   1048 * \else
   1049 *  \brief HAL-Specific
   1050 * \endif
   1051 *
   1052 *  This enumeration is used to choose the mode of operation for the SmartMx Module.
   1053 *  Default static configuration at initialization time.
   1054 *  \note None.
   1055 */
   1056 
   1057 typedef enum phHal_eSmartMX_Mode{
   1058     eSmartMx_Wired      = 0x00U, /* SmartMX is in Wired Mode */
   1059     eSmartMx_Default,            /* SmartMX is in Default Configuration Mode */
   1060     eSmartMx_Virtual,            /* SmartMx in the Virutal Mode */
   1061     eSmartMx_Off                 /* SmartMx Feature is Switched off */
   1062 } phHal_eSmartMX_Mode_t;
   1063 
   1064 
   1065 /** \ingroup grp_hal_common
   1066 *
   1067 * \if hal
   1068 *  \brief Mode of operation for SWP
   1069 * \else
   1070 *  \brief HAL-Specific
   1071 * \endif
   1072 *
   1073 *  This enumeration is used to choose the mode of operation for the SWP Link
   1074 *  for UICC Module. Default static configuration at initialization time.
   1075 *  \note None.
   1076 */
   1077 
   1078 typedef enum phHal_eSWP_Mode{
   1079     eSWP_Switch_Off      = 0x00U,   /* SWP Link is Switched off */
   1080     eSWP_Switch_Default,            /* SWP is in Default Configuration Mode */
   1081     eSWP_Switch_On                  /* SWP Link is Switched on */
   1082 } phHal_eSWP_Mode_t;
   1083 
   1084 
   1085 /** \ingroup grp_hal_common
   1086 *
   1087 * \if hal
   1088 *  \brief Information for the Configuring the SmartMX
   1089 * \else
   1090 *  \brief HAL-Specific
   1091 * \endif
   1092 *
   1093 *  The <em> \ref phHal_sSmartMX_Cfg structure </em> holds the information
   1094 *   to configure the SmartMX Module in the NFC Device.
   1095 *
   1096 *  \note None.
   1097 */
   1098 
   1099 
   1100 typedef struct phHal_sSmartMX_Cfg
   1101 {
   1102     uint8_t                 enableEmulation;
   1103     uint8_t                 lowPowerMode;
   1104     phHal_eSmartMX_Mode_t   smxMode;
   1105 }phHal_sSmartMX_Cfg_t;
   1106 
   1107 
   1108 /** \ingroup grp_hal_common
   1109 *
   1110 * \if hal
   1111 *  \brief Information for the Configuring the UICC
   1112 * \else
   1113 *  \brief HAL-Specific
   1114 * \endif
   1115 *
   1116 *  The <em> \ref phHal_sUiccEmuCfg structure </em> holds the information
   1117 *   to configure the UICC Host.
   1118 *
   1119 *  \note None.
   1120 */
   1121 
   1122 
   1123 typedef struct phHal_sUiccEmuCfg
   1124 {
   1125     uint8_t             enableUicc;
   1126     uint8_t             uiccEmuSupport;
   1127     uint8_t             uiccReaderSupport;
   1128     uint8_t             lowPowerMode;
   1129     /* TODO: This will be updated later */
   1130 }phHal_sUiccEmuCfg_t;
   1131 
   1132 /** \ingroup grp_hal_common
   1133 *
   1134 * \if hal
   1135 *  \brief Information for the Configuring the Type A Host Emulation Feature
   1136 * \else
   1137 *  \brief HAL-Specific
   1138 * \endif
   1139 *
   1140 *  The <em> \ref phHal_sHostEmuCfg_A structure </em> holds the information
   1141 *   to configure the Host Emulation for Type A.
   1142 *
   1143 *  \note None.
   1144 */
   1145 
   1146 typedef struct phHal_sHostEmuCfg_A
   1147 {
   1148     uint8_t                 enableEmulation;
   1149     phNfc_sIso14443AInfo_t  hostEmuCfgInfo;
   1150     uint8_t                 enableCID;
   1151 }phHal_sHostEmuCfg_A_t;
   1152 
   1153 
   1154 /** \ingroup grp_hal_common
   1155 *
   1156 * \if hal
   1157 *  \brief Information for the Configuring the Type B Host Emulation Feature
   1158 * \else
   1159 *  \brief HAL-Specific
   1160 * \endif
   1161 *
   1162 *  The <em> \ref phHal_sHostEmuCfg_B structure </em> holds the information
   1163 *   to configure the Host Emulation for Type B.
   1164 *
   1165 *  \note None.
   1166 */
   1167 
   1168 typedef struct phHal_sHostEmuCfg_B
   1169 {
   1170     uint8_t                 enableEmulation;
   1171     phNfc_sIso14443BInfo_t  hostEmuCfgInfo;
   1172 }phHal_sHostEmuCfg_B_t;
   1173 
   1174 /** \ingroup grp_hal_common
   1175 *
   1176 * \if hal
   1177 *  \brief Information for the Configuring the Felica Host Emulation Feature
   1178 * \else
   1179 *  \brief HAL-Specific
   1180 * \endif
   1181 *
   1182 *  The <em> \ref phHal_sHostEmuCfg_F structure </em> holds the information
   1183 *   to configure the Felica Host Emulation.
   1184 *
   1185 *  \note None.
   1186 */
   1187 
   1188 
   1189 typedef struct phHal_sHostEmuCfg_F
   1190 {
   1191     uint8_t                 enableEmulation;
   1192 }phHal_sHostEmuCfg_F_t;
   1193 
   1194 
   1195 /** \ingroup grp_hal_common
   1196 *
   1197 * \if hal
   1198 *  \brief Information for the Configuring the Emulation
   1199 * \else
   1200 *  \brief HAL-Specific
   1201 * \endif
   1202 *
   1203 *  The <em> \ref phHal_sEmulationCfg structure </em> holds the information
   1204 *   required for the device to act as a Tag or NFCIP1 Target.
   1205 *
   1206 *  \note phHal_sHostEmuCfg_F_t Type F emulation is not presently supported
   1207 *  is reserved for future use.
   1208 */
   1209 
   1210 typedef struct phHal_sEmulationCfg
   1211 {
   1212     phHal_HostType_t        hostType;
   1213     phHal_eEmulationType_t  emuType;
   1214     union phHal_uEmuConfig
   1215     {
   1216         phHal_sSmartMX_Cfg_t    smartMxCfg;
   1217         phHal_sHostEmuCfg_A_t   hostEmuCfg_A;
   1218         phHal_sHostEmuCfg_B_t   hostEmuCfg_B;
   1219         phHal_sHostEmuCfg_F_t   hostEmuCfg_F;
   1220         phHal_sUiccEmuCfg_t     uiccEmuCfg;
   1221     }config;
   1222 }phHal_sEmulationCfg_t;
   1223 
   1224 /** \ingroup grp_hal_common
   1225 *
   1226 * \if hal
   1227 *  \brief Information for the Configuring the Reader parameters
   1228 * \else
   1229 *  \brief HAL-Specific
   1230 * \endif
   1231 *
   1232 *  The <em> \ref phHal_sReaderCfg structure </em> holds the information
   1233 *   to configure the Reader A or Reader B parameters.
   1234 *
   1235 *  \note None.
   1236 */
   1237 
   1238 typedef struct phHal_sReaderCfg
   1239 {
   1240     phHal_eRFDevType_t    readerType;
   1241     union phHal_uReaderCfg
   1242     {
   1243         phHal_sIso14443ACfg_t       Iso14443ACfg;
   1244         phHal_sIso14443BCfg_t       Iso14443BCfg;
   1245     }config;
   1246 }phHal_sReaderCfg_t;
   1247 
   1248 
   1249 /** \ingroup grp_hal_common
   1250 *
   1251 * \if hal
   1252 *  \brief Information for Configuring the Protected Mode for
   1253 *  the Secure Elements.
   1254 * \else
   1255 *  \brief HAL-Specific
   1256 * \endif
   1257 *
   1258 *  The <em> \ref phHal_sSEProtectionCfg structure </em> holds the
   1259 *  information to configure the Secure Element Protection configuration.
   1260 *
   1261 *  \note None.
   1262 */
   1263 
   1264 typedef struct phHal_sSEProtectionCfg
   1265 {
   1266     uint8_t         mode;
   1267 }phHal_sSEProtectionCfg_t;
   1268 
   1269 
   1270 /** \ingroup  grp_hal_common
   1271 *
   1272 * \if hal
   1273 *  \brief Poll configuration structure
   1274 * \else
   1275 *  \brief HAL-Specific
   1276 * \endif
   1277 *
   1278 *  The <em> Poll configuration structure </em> holds information about the
   1279 *  enabling the the type of discovery required by the application. This
   1280 *  structure is the input parameter for the discovery call
   1281 *
   1282 *  \note All members of this structure are input parameters [out].
   1283 *
   1284 *  \if hal
   1285 *   \sa \ref phHal4Nfc_Connect, \ref phHal4Nfc_ConfigParameters,
   1286 *            \ref phHal_eP2PMode_t and \ref phHal4Nfc_Disconnect.
   1287 *  \endif
   1288 *
   1289 */
   1290 
   1291 typedef phNfc_sADD_Cfg_t phHal_sADD_Cfg_t;
   1292 
   1293 
   1294 /** \ingroup grp_hal_common
   1295 *
   1296 * \if hal
   1297 *  \brief Configuration information.
   1298 * \else
   1299 *  \brief HAL-Specific
   1300 * \endif
   1301 *
   1302 *  The <em> \ref phHal_uConfig structure </em> holds the information
   1303 *   required for Configuring the Device.
   1304 *
   1305 *  \note None.
   1306 */
   1307 
   1308 
   1309 typedef union phHal_uConfig
   1310 {
   1311     phHal_sEmulationCfg_t emuConfig;
   1312     phHal_sNfcIPCfg_t     nfcIPConfig;    /**< Gives the information about
   1313                                            *  the General Bytes for NFC-IP
   1314                                            *  Communication.
   1315                                            */
   1316     phHal_sReaderCfg_t       readerConfig;
   1317     phHal_sSEProtectionCfg_t protectionConfig;
   1318 }phHal_uConfig_t;
   1319 
   1320 
   1321 #endif
   1322 
   1323 /* EOF */
   1324