Home | History | Annotate | Download | only in src
      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 * =========================================================================== *
     19 *                                                                             *
     20 *                                                                             *
     21 * \file  phHciNfc_CE_B.h                                             *
     22 * \brief HCI card emulation management routines.                              *
     23 *                                                                             *
     24 *                                                                             *
     25 * Project: NFC-FRI-1.1                                                        *
     26 *                                                                             *
     27 * $Date: Fri Aug 14 17:01:26 2009 $                                           *
     28 * $Author: ing04880 $                                                         *
     29 * $Revision: 1.4 $                                                            *
     30 * $Aliases: NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $                                                                *
     31 *                                                                             *
     32 * =========================================================================== *
     33 */
     34 
     35 
     36 #ifndef PHHCINFC_CE_B_H
     37 #define PHHCINFC_CE_B_H
     38 
     39 /*@}*/
     40 
     41 
     42 /**
     43 *  \name HCI
     44 *
     45 * File: \ref phHciNfc_CE_B.h
     46 *
     47 */
     48 /*@{*/
     49 #define PHHCINFC_CE_B_FILEREVISION "$Revision: 1.4 $" /**< \ingroup grp_file_attributes */
     50 #define PHHCINFC_CE_B_FILEALIASES  "$Aliases: NFC_FRI1.1_WK934_R31_1,NFC_FRI1.1_WK941_PREP1,NFC_FRI1.1_WK941_PREP2,NFC_FRI1.1_WK941_1,NFC_FRI1.1_WK943_R32_1,NFC_FRI1.1_WK949_PREP1,NFC_FRI1.1_WK943_R32_10,NFC_FRI1.1_WK943_R32_13,NFC_FRI1.1_WK943_R32_14,NFC_FRI1.1_WK1007_R33_1,NFC_FRI1.1_WK1007_R33_4,NFC_FRI1.1_WK1017_PREP1,NFC_FRI1.1_WK1017_R34_1,NFC_FRI1.1_WK1017_R34_2,NFC_FRI1.1_WK1023_R35_1 $"     /**< \ingroup grp_file_attributes */
     51 /*@}*/
     52 
     53 /*
     54 ***************************** Header File Inclusion ****************************
     55 */
     56 
     57 #include <phHciNfc_Generic.h>
     58 
     59 /*
     60 ****************************** Macro Definitions *******************************
     61 */
     62 #define HOST_CE_B_MODE_INDEX                (0x01U)
     63 #define HOST_CE_B_PUPI_INDEX                (0x02U)
     64 #define HOST_CE_B_AFI_INDEX                 (0x03U)
     65 #define HOST_CE_B_ATQB_INDEX                (0x04U)
     66 #define HOST_CE_B_HIGH_LAYER_RESP_INDEX     (0x05U)
     67 #define HOST_CE_B_DATA_RATE_MAX_INDEX       (0x05U)
     68 
     69 /*
     70 ******************** Enumeration and Structure Definition **********************
     71 */
     72 
     73 /* Sequence list */
     74 typedef enum phHciNfc_CE_B_Seq{
     75     HOST_CE_B_INVALID_SEQ,
     76     HOST_CE_B_PIPE_OPEN,
     77     HOST_CE_B_PUPI_SEQ,
     78     HOST_CE_B_ATQB_SEQ,
     79     HOST_CE_B_ENABLE_SEQ,
     80     HOST_CE_B_DISABLE_SEQ,
     81     HOST_CE_B_PIPE_CLOSE,
     82     HOST_CE_B_PIPE_DELETE
     83 }phHciNfc_CE_B_Seq_t;
     84 
     85 /* Information structure for the card emulation B gate */
     86 typedef struct phHciNfc_CE_B_Info{
     87     phHciNfc_CE_B_Seq_t         current_seq;
     88     phHciNfc_CE_B_Seq_t         next_seq;
     89     /* Pointer to the card emulation B pipe information */
     90     phHciNfc_Pipe_Info_t        *p_pipe_info;
     91     uint8_t                     pipe_id;
     92 
     93 } phHciNfc_CE_B_Info_t;
     94 
     95 /*
     96 *********************** Function Prototype Declaration *************************
     97 */
     98 
     99 /*!
    100  * \brief Allocates the resources of card emulation B management gate.
    101  *
    102  * This function Allocates the resources of the card emulation B management
    103  * gate Information Structure.
    104  *
    105  */
    106 extern
    107 NFCSTATUS
    108 phHciNfc_CE_B_Init_Resources(
    109                                 phHciNfc_sContext_t     *psHciContext
    110                          );
    111 
    112 /**
    113 * \ingroup grp_hci_nfc
    114 *
    115 *   The phHciNfc_CE_B_Get_PipeID function gives the pipe id of the card
    116 *   emulation B gate
    117 *
    118 *   \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
    119 *                                       context Structure.
    120 *   \param[in]  pHwRef                  pHwRef is the Information of
    121 *                                       the Device Interface Link
    122 *
    123 *   \retval NFCSTATUS_SUCCESS           Function execution is successful.
    124 *   \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
    125 *                                       could not be interpreted properly.
    126 *
    127 */
    128 extern
    129 NFCSTATUS
    130 phHciNfc_CE_B_Get_PipeID(
    131                             phHciNfc_sContext_t     *psHciContext,
    132                             uint8_t                 *ppipe_id
    133                             );
    134 
    135 /**
    136 * \ingroup grp_hci_nfc
    137 *
    138 *  The phHciNfc_CE_B_Update_PipeInfo function updates the pipe_id of the card
    139 *  emulation B gate management Structure.
    140 *
    141 *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
    142 *                                      context Structure.
    143 *  \param[in]  pipeID                  pipeID of the card emulation A gate
    144 *  \param[in]  pPipeInfo               Update the pipe Information of the reader
    145 *                                      A gate
    146 *
    147 *  \retval NFCSTATUS_SUCCESS           Function execution is successful.
    148 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
    149 *                                      could not be interpreted properly.
    150 *
    151 */
    152 
    153 extern
    154 NFCSTATUS
    155 phHciNfc_CE_B_Update_PipeInfo(
    156                                   phHciNfc_sContext_t     *psHciContext,
    157                                   uint8_t                 pipeID,
    158                                   phHciNfc_Pipe_Info_t    *pPipeInfo
    159                                   );
    160 
    161 /**
    162 * \ingroup grp_hci_nfc
    163 *
    164 *  The phHciNfc_CE_B_SendData_Event function sends data to the PN544
    165 *
    166 *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
    167 *                                      context Structure.
    168 *  \param[in]  pHwRef                  pHwRef is the Information of
    169 *                                      the Device Interface Link
    170 *  \param[in]  pipeID                  pipeID of the card emulation B gate
    171 *  \param[in]  pPipeInfo               Update the pipe Information of the card
    172 *                                      emulation B gate
    173 *
    174 *  \retval NFCSTATUS_SUCCESS           Function execution is successful.
    175 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
    176 *                                      could not be interpreted properly.
    177 *
    178 */
    179 #ifdef CE_B_SEND_EVENT
    180 extern
    181 NFCSTATUS
    182 phHciNfc_CE_B_SendData_Event(
    183                              void               *psContext,
    184                              void               *pHwRef,
    185                              uint8_t            *pEvent,
    186                              uint8_t            length
    187                        );
    188 #endif /* #ifdef CE_B_SEND_EVENT */
    189 
    190 /**
    191 * \ingroup grp_hci_nfc
    192 *
    193 *  The phHciNfc_CE_B_Mode function sends data to the set the card emulation mode
    194 *
    195 *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
    196 *                                      context Structure.
    197 *  \param[in]  pHwRef                  pHwRef is the Information of
    198 *                                      the Device Interface Link
    199 *  \param[in]  enable_type             type to enable
    200 *
    201 *  \retval NFCSTATUS_SUCCESS           Function execution is successful.
    202 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
    203 *                                      could not be interpreted properly.
    204 *
    205 */
    206 NFCSTATUS
    207 phHciNfc_CE_B_Mode(
    208                             void        *psHciHandle,
    209                             void        *pHwRef,
    210                             uint8_t     enable_type
    211                   );
    212 
    213 /**
    214 * \ingroup grp_hci_nfc
    215 *
    216 *  The phHciNfc_CE_B_Initialise function opens the CE B and set all the
    217 *   required parameters for CE B
    218 *
    219 *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
    220 *                                      context Structure.
    221 *  \param[in]  pHwRef                  pHwRef is the Information of
    222 *                                      the Device Interface Link
    223 *
    224 *  \retval NFCSTATUS_SUCCESS           Function execution is successful.
    225 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
    226 *                                      could not be interpreted properly.
    227 *
    228 */
    229 extern
    230 NFCSTATUS
    231 phHciNfc_CE_B_Initialise(
    232                         phHciNfc_sContext_t     *psHciContext,
    233                         void                    *pHwRef
    234                         );
    235 
    236 /**
    237 * \ingroup grp_hci_nfc
    238 *
    239 *  The phHciNfc_CE_B_Initialise function close the CE B and reset all the
    240 *   required parameters to default value of CE B
    241 *
    242 *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
    243 *                                      context Structure.
    244 *  \param[in]  pHwRef                  pHwRef is the Information of
    245 *                                      the Device Interface Link
    246 *
    247 *  \retval NFCSTATUS_SUCCESS           Function execution is successful.
    248 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
    249 *                                      could not be interpreted properly.
    250 *
    251 */
    252 extern
    253 NFCSTATUS
    254 phHciNfc_CE_B_Release(
    255                         phHciNfc_sContext_t     *psHciContext,
    256                         void                    *pHwRef
    257                         );
    258 
    259 /**
    260 * \ingroup grp_hci_nfc
    261 *
    262 *  The phHciNfc_CE_B_Update_Seq function to update CE B sequence depending on the
    263 *  specified \ref seq_type
    264 *
    265 *  \param[in]  psHciContext             psHciContext is the pointer to HCI Layer
    266 *                                       context Structure.
    267 *  \param[in]  seq_type                 sequence type specified in
    268 *                                       \ref phHciNfc_eSeqType_t
    269 *
    270 *  \retval NFCSTATUS_SUCCESS           Function execution is successful.
    271 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
    272 *                                      could not be interpreted properly.
    273 *
    274 */
    275 extern
    276 NFCSTATUS
    277 phHciNfc_CE_B_Update_Seq(
    278                         phHciNfc_sContext_t     *psHciContext,
    279                         phHciNfc_eSeqType_t     seq_type
    280                     );
    281 
    282 #endif /* PHHCINFC_CE_B_H */
    283 
    284 
    285