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  * \file  phFriNfc_OvrHalCmd.h
     19  * \brief Overlapped HAL
     20  *
     21  * Project: NFC-FRI
     22  *
     23  * $Date: Fri Oct  5 10:09:57 2007 $
     24  * $Author: frq05303 $
     25  * $Revision: 1.1 $
     26  * $Aliases: NFC_FRI1.1_WK826_PREP1,NFC_FRI1.1_WK826_R1,NFC_FRI1.1_WK826_R2,NFC_FRI1.1_WK830_PREP1,NFC_FRI1.1_WK830_PREP2,NFC_FRI1.1_WK830_R5_1,NFC_FRI1.1_WK830_R5_2,NFC_FRI1.1_WK830_R5_3,NFC_FRI1.1_WK832_PREP1,NFC_FRI1.1_WK832_PRE2,NFC_FRI1.1_WK832_PREP2,NFC_FRI1.1_WK832_PREP3,NFC_FRI1.1_WK832_R5_1,NFC_FRI1.1_WK832_R6_1,NFC_FRI1.1_WK834_PREP1,NFC_FRI1.1_WK834_PREP2,NFC_FRI1.1_WK834_R7_1,NFC_FRI1.1_WK836_PREP1,NFC_FRI1.1_WK836_R8_1,NFC_FRI1.1_WK838_PREP1,NFC_FRI1.1_WK838_R9_PREP2,NFC_FRI1.1_WK838_R9_1,NFC_FRI1.1_WK840_R10_PREP1,NFC_FRI1.1_WK840_R10_1,NFC_FRI1.1_WK842_R11_PREP1,NFC_FRI1.1_WK842_R11_PREP2,NFC_FRI1.1_WK842_R11_1,NFC_FRI1.1_WK844_PREP1,NFC_FRI1.1_WK844_R12_1,NFC_FRI1.1_WK846_PREP1,NFC_FRI1.1_WK846_R13_1,NFC_FRI1.1_WK848_PREP1,NFC_FRI1.1_WK848_R14_1,NFC_FRI1.1_WK850_PACK1,NFC_FRI1.1_WK851_PREP1,NFC_FRI1.1_WK850_R15_1,NFC_FRI1.1_WK902_PREP1,NFC_FRI1.1_WK902_R16_1,NFC_FRI1.1_WK904_PREP1,NFC_FRI1.1_WK904_R17_1,NFC_FRI1.1_WK906_R18_1,NFC_FRI1.1_WK908_PREP1,NFC_FRI1.1_WK908_R19_1,NFC_FRI1.1_WK910_PREP1,NFC_FRI1.1_WK910_R20_1,NFC_FRI1.1_WK912_PREP1,NFC_FRI1.1_WK912_R21_1,NFC_FRI1.1_WK914_PREP1,NFC_FRI1.1_WK914_R22_1,NFC_FRI1.1_WK914_R22_2,NFC_FRI1.1_WK916_R23_1,NFC_FRI1.1_WK918_R24_1,NFC_FRI1.1_WK920_PREP1,NFC_FRI1.1_WK920_R25_1,NFC_FRI1.1_WK922_PREP1,NFC_FRI1.1_WK922_R26_1,NFC_FRI1.1_WK924_PREP1,NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,NFC_FRI1.1_WK934_PREP_1,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 $
     27  *
     28  */
     29 
     30 #ifndef PHFRINFC_OVRHALCMD_H
     31 #define PHFRINFC_OVRHALCMD_H
     32 
     33 #include <phNfcHalTypes.h>
     34 
     35 /**
     36  *  \name Overlapped HAL
     37  *
     38  * File: \ref phFriNfc_OvrHalCmd.h
     39  *
     40  */
     41 /*@{*/
     42 #define PH_FRINFC_OVRHALCMD_FILEREVISION "$Revision: 1.1 $" /** \ingroup grp_file_attributes */
     43 #define PH_FRINFC_OVRHALCMD_FILEALIASES  "$Aliases: NFC_FRI1.1_WK826_PREP1,NFC_FRI1.1_WK826_R1,NFC_FRI1.1_WK826_R2,NFC_FRI1.1_WK830_PREP1,NFC_FRI1.1_WK830_PREP2,NFC_FRI1.1_WK830_R5_1,NFC_FRI1.1_WK830_R5_2,NFC_FRI1.1_WK830_R5_3,NFC_FRI1.1_WK832_PREP1,NFC_FRI1.1_WK832_PRE2,NFC_FRI1.1_WK832_PREP2,NFC_FRI1.1_WK832_PREP3,NFC_FRI1.1_WK832_R5_1,NFC_FRI1.1_WK832_R6_1,NFC_FRI1.1_WK834_PREP1,NFC_FRI1.1_WK834_PREP2,NFC_FRI1.1_WK834_R7_1,NFC_FRI1.1_WK836_PREP1,NFC_FRI1.1_WK836_R8_1,NFC_FRI1.1_WK838_PREP1,NFC_FRI1.1_WK838_R9_PREP2,NFC_FRI1.1_WK838_R9_1,NFC_FRI1.1_WK840_R10_PREP1,NFC_FRI1.1_WK840_R10_1,NFC_FRI1.1_WK842_R11_PREP1,NFC_FRI1.1_WK842_R11_PREP2,NFC_FRI1.1_WK842_R11_1,NFC_FRI1.1_WK844_PREP1,NFC_FRI1.1_WK844_R12_1,NFC_FRI1.1_WK846_PREP1,NFC_FRI1.1_WK846_R13_1,NFC_FRI1.1_WK848_PREP1,NFC_FRI1.1_WK848_R14_1,NFC_FRI1.1_WK850_PACK1,NFC_FRI1.1_WK851_PREP1,NFC_FRI1.1_WK850_R15_1,NFC_FRI1.1_WK902_PREP1,NFC_FRI1.1_WK902_R16_1,NFC_FRI1.1_WK904_PREP1,NFC_FRI1.1_WK904_R17_1,NFC_FRI1.1_WK906_R18_1,NFC_FRI1.1_WK908_PREP1,NFC_FRI1.1_WK908_R19_1,NFC_FRI1.1_WK910_PREP1,NFC_FRI1.1_WK910_R20_1,NFC_FRI1.1_WK912_PREP1,NFC_FRI1.1_WK912_R21_1,NFC_FRI1.1_WK914_PREP1,NFC_FRI1.1_WK914_R22_1,NFC_FRI1.1_WK914_R22_2,NFC_FRI1.1_WK916_R23_1,NFC_FRI1.1_WK918_R24_1,NFC_FRI1.1_WK920_PREP1,NFC_FRI1.1_WK920_R25_1,NFC_FRI1.1_WK922_PREP1,NFC_FRI1.1_WK922_R26_1,NFC_FRI1.1_WK924_PREP1,NFC_FRI1.1_WK924_R27_1,NFC_FRI1.1_WK926_R28_1,NFC_FRI1.1_WK928_R29_1,NFC_FRI1.1_WK930_R30_1,NFC_FRI1.1_WK934_PREP_1,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 $"      /** \ingroup grp_file_attributes */
     44 /*@}*/
     45 
     46 /** \defgroup grp_ovr_hal_cmd Overlapped HAL Command List
     47  *  \ingroup grp_fri_nfc_ovr_hal
     48  *  These are the command definitions for the Overlapped HAL. They are used internally by the
     49  *  implementation of the component.
     50  */
     51 /*@{*/
     52 #define PH_FRINFC_OVRHALCMD_NUL             (0)     /**< \brief We're in NO command */
     53 
     54 #define PH_FRINFC_OVRHALCMD_ENU             (1)     /**< \brief Enumerate */
     55 #define PH_FRINFC_OVRHALCMD_OPE             (2)     /**< \brief Open */
     56 #define PH_FRINFC_OVRHALCMD_CLO             (3)     /**< \brief Close */
     57 #define PH_FRINFC_OVRHALCMD_GDC             (4)     /**< \brief Get Dev Caps */
     58 #define PH_FRINFC_OVRHALCMD_POL             (5)     /**< \brief Poll */
     59 #define PH_FRINFC_OVRHALCMD_CON             (6)     /**< \brief Connect */
     60 #define PH_FRINFC_OVRHALCMD_DIS             (7)     /**< \brief Disconnect */
     61 #define PH_FRINFC_OVRHALCMD_TRX             (8)     /**< \brief Transceive */
     62 #define PH_FRINFC_OVRHALCMD_STM             (9)     /**< \brief Start Target Mode */
     63 #define PH_FRINFC_OVRHALCMD_SND             (10)     /**< \brief Send */
     64 #define PH_FRINFC_OVRHALCMD_RCV             (11)    /**< \brief Receive */
     65 #define PH_FRINFC_OVRHALCMD_IOC             (12)    /**< \brief IOCTL */
     66 
     67 #define PH_FRINFC_OVRHALCMD_TST             (255)   /**< \brief OVR HAL test-related command */
     68 
     69 
     70 /** \brief Parameter compound internally used for testing purpose
     71  *
     72  */
     73 typedef struct phFriNfc_OvrHalCmdVoid
     74 {
     75     void      *Div;
     76     NFCSTATUS  Status;
     77     uint32_t   Delay;
     78 } phFriNfc_OvrHalCmdVoid_t;
     79 
     80 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_Enumerate
     81  *
     82  */
     83 typedef struct phFriNfc_OvrHalCmdEnu
     84 {
     85     phHal_sHwReference_t           *HwReference;
     86     uint8_t                        *pNbrOfDevDetected;
     87 } phFriNfc_OvrHalCmdEnu_t;
     88 
     89 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_Open
     90  *
     91  */
     92 typedef struct phFriNfc_OvrHalCmdOpe
     93 {
     94     phHal_sHwReference_t *psHwReference;
     95 } phFriNfc_OvrHalCmdOpe_t;
     96 
     97 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_Close
     98  *
     99  */
    100 typedef struct phFriNfc_OvrHalCmdClo
    101 {
    102     phHal_sHwReference_t *psHwReference;
    103 } phFriNfc_OvrHalCmdClo_t;
    104 
    105 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_GetDeviceCapabilities
    106  *
    107  */
    108 typedef struct phFriNfc_OvrHalCmdGdc
    109 {
    110     phHal_sHwReference_t            *psHwReference;
    111     phHal_sDeviceCapabilities_t     *psDevCapabilities;
    112 } phFriNfc_OvrHalCmdGdc_t;
    113 
    114 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_Poll
    115  *
    116  */
    117 typedef struct phFriNfc_OvrHalCmdPol
    118 {
    119     phHal_sHwReference_t           *psHwReference;
    120     phHal_eOpModes_t               *OpModes;
    121     phHal_sRemoteDevInformation_t  *psRemoteDevInfoList;
    122     uint8_t                        *NbrOfRemoteDev;
    123     phHal_sDevInputParam_t         *psDevInputParam;
    124 } phFriNfc_OvrHalCmdPol_t;
    125 
    126 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_Connect
    127  *
    128  */
    129 typedef struct phFriNfc_OvrHalCmdCon
    130 {
    131     phHal_sHwReference_t          *psHwReference;
    132     phHal_eOpModes_t               OpMode;
    133     phHal_sRemoteDevInformation_t *psRemoteDevInfo;
    134     phHal_sDevInputParam_t        *psDevInputParam;
    135 } phFriNfc_OvrHalCmdCon_t;
    136 
    137 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_Disconnect
    138  *
    139  */
    140 typedef struct phFriNfc_OvrHalCmdDis
    141 {
    142     phHal_sHwReference_t            *psHwReference;
    143     phHal_sRemoteDevInformation_t   *psRemoteDevInfo;
    144 } phFriNfc_OvrHalCmdDis_t;
    145 
    146 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_Transceive
    147  *
    148  */
    149 typedef struct phFriNfc_OvrHalCmdTrx
    150 {
    151     phHal_sHwReference_t           *psHwReference;
    152     phHal_sRemoteDevInformation_t  *psRemoteDevInfo;
    153     phHal_uCmdList_t                Cmd;
    154     phHal_sDepAdditionalInfo_t     *psDepAdditionalInfo;
    155     uint8_t                        *pSendBuf;
    156     uint16_t                        SendLength;
    157     uint8_t                        *pRecvBuf;
    158     uint16_t                       *pRecvLength;
    159 } phFriNfc_OvrHalCmdTrx_t;
    160 
    161 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_StartTargetMode
    162  *
    163  */
    164 typedef struct phFriNfc_OvrHalCmdStm
    165 {
    166     phHal_sHwReference_t       *psHwReference;
    167     phHal_sTargetInfo_t        *pTgInfo;
    168     phHal_eOpModes_t           *OpModes;
    169     uint8_t                    *pConnectionReq;
    170     uint8_t                    *pConnectionReqBufLength;
    171 } phFriNfc_OvrHalCmdStm_t;
    172 
    173 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_Receive
    174  *
    175  */
    176 typedef struct phFriNfc_OvrHalCmdRcv
    177 {
    178     phHal_sHwReference_t        *psHwReference;
    179     phHal_sDepAdditionalInfo_t  *psDepAdditionalInfo;
    180     uint8_t                     *pRecvBuf;
    181     uint16_t                    *pRecvLength;
    182 } phFriNfc_OvrHalCmdRcv_t;
    183 
    184 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_Send
    185  *
    186  */
    187 typedef struct phFriNfc_OvrHalCmdSnd
    188 {
    189     phHal_sHwReference_t        *psHwReference;
    190     phHal_sDepAdditionalInfo_t  *psDepAdditionalInfo;
    191     uint8_t                     *pSendBuf;
    192     uint16_t                     SendLength;
    193 } phFriNfc_OvrHalCmdSnd_t;
    194 
    195 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_Ioctl
    196  *
    197  */
    198 typedef struct phFriNfc_OvrHalCmdIoc
    199 {
    200     phHal_sHwReference_t     *psHwReference;
    201     uint16_t                  IoctlCode;
    202     uint8_t                  *pInBuf;
    203     uint16_t                  InLength;
    204     uint8_t                  *pOutBuf;
    205     uint16_t                 *pOutLength;
    206 } phFriNfc_OvrHalCmdIoc_t;
    207 
    208 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHal_Test
    209  *
    210  */
    211 typedef struct phFriNfc_OvrHalCmdTst
    212 {
    213     phHal_sHwReference_t     *psHwReference;
    214     void                     *pTestParam;
    215 } phFriNfc_OvrHalCmdTst_t;
    216 
    217 
    218 #ifdef PHFRINFC_OVRHAL_MOCKUP  /* */
    219 /** \brief Parameter compound internally used by \ref phFriNfc_OvrHalCmdMockup_t
    220  *
    221  */
    222 typedef struct phFriNfc_OvrHalCmdMockup
    223 {
    224     phHal_sHwReference_t     *psHwReference;
    225     uint16_t                  IoctlCode;
    226     uint8_t                  *pInBuf;
    227     uint16_t                  InLength;
    228     uint8_t                  *pOutBuf;
    229     uint16_t                 *pOutLength;
    230 } phFriNfc_OvrHalCmdMockup_t;
    231 #endif /* PHFRINFC_OVRHAL_MOCKUP */
    232 
    233 /** \brief Placeholder for all parameter structures
    234  *
    235  */
    236 typedef union phFriNfc_OvrHalCmd
    237 {
    238     phFriNfc_OvrHalCmdVoid_t    CmdVoid;
    239 
    240     phFriNfc_OvrHalCmdEnu_t     CmdEnu;
    241     phFriNfc_OvrHalCmdOpe_t     CmdOpe;
    242     phFriNfc_OvrHalCmdClo_t     CmdClo;
    243     phFriNfc_OvrHalCmdGdc_t     CmdGdc;
    244     phFriNfc_OvrHalCmdPol_t     CmdPol;
    245     phFriNfc_OvrHalCmdCon_t     CmdCon;
    246     phFriNfc_OvrHalCmdDis_t     CmdDis;
    247     phFriNfc_OvrHalCmdTrx_t     CmdTrx;
    248     phFriNfc_OvrHalCmdIoc_t     CmdIoc;
    249     phFriNfc_OvrHalCmdStm_t     CmdStm;
    250     phFriNfc_OvrHalCmdSnd_t     CmdSnd;
    251     phFriNfc_OvrHalCmdRcv_t     CmdRcv;
    252     phFriNfc_OvrHalCmdTst_t     CmdTst;
    253 } phFriNfc_OvrHalCmd_t;
    254 
    255 
    256 /*@}*/
    257 #endif /* PHFRINFC_OVRHALCMD_H */
    258