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_PollingLoop.h                                               *
     22 * \brief HCI Header for the Polling loop Management.                              *
     23 *                                                                             *
     24 *                                                                             *
     25 * Project: NFC-FRI-1.1                                                        *
     26 *                                                                             *
     27 * $Date: Mon Mar 29 17:34:49 2010 $                                           *
     28 * $Author: ing04880 $                                                         *
     29 * $Revision: 1.6 $                                                            *
     30 * $Aliases: 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_POLLINGLOOP_H
     37 #define PHHCINFC_POLLINGLOOP_H
     38 
     39 /*@}*/
     40 
     41 
     42 /**
     43  *  \name HCI
     44  *
     45  * File: \ref phHciNfc_PollingLoop.h
     46  *
     47  */
     48 /*@{*/
     49 #define PHHCINFC_POLLINGLOOP_FILEREVISION "$Revision: 1.6 $" /**< \ingroup grp_file_attributes */
     50 #define PHHCINFC_POLLINGLOOP_FILEALIASES  "$Aliases: 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 PL_DURATION             0x00U
     63 #define PL_RD_PHASES            0x01U
     64 #define PL_DISABLE_TARGET       0x02U
     65 
     66 
     67 
     68 #define PL_RD_PHASES_DISABLE    0x80U
     69 
     70 /*
     71 ******************** Enumeration and Structure Definition **********************
     72 */
     73 
     74 /** \defgroup grp_hci_nfc HCI Component
     75  *
     76  *
     77  */
     78 
     79 
     80 /*
     81 *********************** Function Prototype Declaration *************************
     82 */
     83 
     84 /**
     85  * \ingroup grp_hci_nfc
     86  *
     87  *  The phHciNfc_PollLoop_Initialise function Initialises the polling loop and opens the
     88  *  polling loop pipe
     89  *
     90  *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
     91  *                                      context Structure.
     92  *  \param[in]  pHwRef                  pHwRef is the Information of
     93  *                                      the Device Interface Link .
     94  *
     95  *  \retval NFCSTATUS_PENDING           Polling loop gate Initialisation is pending.
     96  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
     97  *                                      could not be interpreted properly.
     98  *  \retval Other errors                Errors related to the other layers
     99  *
    100  */
    101 
    102 extern
    103 NFCSTATUS
    104 phHciNfc_PollLoop_Initialise(
    105                                 phHciNfc_sContext_t     *psHciContext,
    106                                 void                    *pHwRef
    107                          );
    108 
    109 /**
    110  * \ingroup grp_hci_nfc
    111  *
    112  *  The phHciNfc_PollLoop_Release function closes the polling loop gate pipe
    113  *  between the Host Controller Device and the NFC Device.
    114  *
    115  *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
    116  *                                      context Structure.
    117  *  \param[in]  pHwRef                  pHwRef is the Information of
    118  *                                      the Device Interface Link .
    119  *
    120  *  \retval NFCSTATUS_PENDING           Release of the Polling loop gate resources are
    121  *                                      pending.
    122  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
    123  *                                      could not be interpreted properly.
    124  *  \retval Other errors                Errors related to the other layers
    125  *
    126  */
    127 
    128 extern
    129 NFCSTATUS
    130 phHciNfc_PollLoop_Release(
    131                                 phHciNfc_sContext_t     *psHciContext,
    132                                 void                    *pHwRef
    133                      );
    134 
    135 
    136 /**
    137  * \ingroup grp_hci_nfc
    138  *
    139  *  The phHciNfc_PollLoop_Update_PipeInfo function updates the pipe_id of the polling
    140  *  loop gate Managment Struction.
    141  *
    142  *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
    143  *                                      context Structure.
    144  *  \param[in]  pHwRef                  pHwRef is the Information of
    145  *                                      the Device Interface Link
    146  *  \param[in]  cfg_type                Poll configuration type
    147  *
    148  *  \param[in]  pcfg_info               Poll configuration info.
    149  *
    150  *  \retval NFCSTATUS_SUCCESS           Polling loop gate Response received Successfully.
    151  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
    152  *                                      could not be interpreted properly.
    153  *
    154  */
    155 extern
    156 NFCSTATUS
    157 phHciNfc_PollLoop_Cfg (
    158                        void             *psHciHandle,
    159                        void             *pHwRef,
    160                        uint8_t          cfg_type,
    161                        void             *pcfg_info
    162                        );
    163 
    164 /**
    165  * \ingroup grp_hci_nfc
    166  *
    167  *  The phHciNfc_PollLoop_Update_PipeInfo function updates the pipe_id of the polling
    168  *  loop gate management structure. This function is used by the pipe management to
    169  *  update the pipe id
    170  *
    171  *  \param[in]  psHciContext            psHciContext is the pointer to HCI Layer
    172  *                                      context Structure.
    173  *  \param[in]  pipeID                  pipeID of the polling loop gate
    174  *  \param[in]  pPipeInfo               Update the pipe Information of the polling loop
    175  *                                      gate.
    176  *
    177  *  \retval NFCSTATUS_SUCCESS           Polling loop gate Response received Successfully.
    178  *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
    179  *                                      could not be interpreted properly.
    180  *
    181  */
    182 
    183 extern
    184 NFCSTATUS
    185 phHciNfc_PollLoop_Update_PipeInfo(
    186                                 phHciNfc_sContext_t     *psHciContext,
    187                                 uint8_t                 pipeID,
    188                                 phHciNfc_Pipe_Info_t    *pPipeInfo
    189                                 );
    190 
    191 
    192 /*!
    193  * \brief Allocates the resources of Polling loop Managment Gate.
    194  *
    195  * This function Allocates the resources of the Polling loop management
    196  * gate Information Structure.
    197  *
    198  */
    199 extern
    200 NFCSTATUS
    201 phHciNfc_PollLoop_Init_Resources(
    202                                 phHciNfc_sContext_t     *psHciContext
    203                              );
    204 
    205 
    206 /*!
    207  * \brief Get the pipe_id of Polling loop managment Gate.
    208  *
    209  * This function Get the pipe_id of Polling loop managment Gate.
    210  *
    211  */
    212 
    213 extern
    214 NFCSTATUS
    215 phHciNfc_PollLoop_Get_PipeID(
    216                                 phHciNfc_sContext_t     *psHciContext,
    217                                 uint8_t                 *ppipe_id
    218                            );
    219 
    220 #endif /* PHHCINFC_POLLINGLOOP_H */
    221 
    222 
    223