/*
 * Copyright (C) 2010 NXP Semiconductors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*!
* =========================================================================== *
*                                                                             *
*                                                                             *
* \file  phHciNfc.h                                                           *
* \brief HCI Header for the Generic HCI Management.                           *
*                                                                             *
*                                                                             *
* Project: NFC-FRI-1.1                                                        *
*                                                                             *
* $Date: Mon Apr  5 14:37:06 2010 $                                           *
* $Author: ing04880 $                                                         *
* $Revision: 1.39 $                                                           *
* $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 $                    
*                                                                             *
* =========================================================================== *
*/


/*@{*/

#ifndef PHHCINFC_H
#define PHHCINFC_H

/*@}*/
/**
 *  \name HCI
 *
 * File: \ref phHciNfc.h
 *
 */
/*@{*/
#define PH_HCINFC_FILEREVISION "$Revision: 1.39 $" /**< \ingroup grp_file_attributes */
#define PH_HCINFC_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 */
/*@}*/

/*
################################################################################
***************************** Header File Inclusion ****************************
################################################################################
*/

#include <phNfcStatus.h>
#include <phNfcInterface.h>
#ifdef ANDROID
#include <string.h>
#endif

/*
################################################################################
****************************** Macro Definitions *******************************
################################################################################
*/


/*
################################################################################
******************** Enumeration and Structure Definition **********************
################################################################################
*/

typedef enum phHciNfc_Init
{
  HCI_SESSION = 0x00,
  HCI_SELF_TEST,
  HCI_CUSTOM_INIT
}phHciNfc_Init_t;

/** \ingroup  grp_hal_hci
 *
 * \if hal
 *  \brief HCI Tag Exchange Information
 * \else
 *  \brief HCI-Specific
 * \endif
 *
 *  The <em> Tag Exchange Info Structure </em> holds the exchange information to
 *  the connected tag .
 *
 *  \note All members of this structure are in parameters [in].
 *
 */

typedef struct phHciNfc_Tag_XchgInfo
{
    /** \internal RF Reader Command Type */
    uint8_t                     cmd_type;
    /** \internal Address Field required for only Mifare
     *  Family Proprietary Cards.
     *  The Address Size is Valid only upto 255 Blocks limit
     *  i:e for Mifare 4K
     */
    uint8_t                     addr;
}phHciNfc_Tag_XchgInfo_t;

/** \ingroup  grp_hal_hci
 *
 * \if hal
 *  \brief HCI NFC-IP Exchange Information
 * \else
 *  \brief HCI-Specific
 * \endif
 *
 *  The <em> NFC-IP Exchange Info Structure </em> holds the exchange information to
 *  the connected NFC-IP target .
 *
 *  \note All members of this structure are in parameters [in].
 *
 */

typedef struct phHciNfc_NfcIP_XchgInfo
{
    /** \internal NFC-IP DEP Meta Chining Information */
    uint8_t                     more_info;

}phHciNfc_NfcIP_XchgInfo_t;

/** \ingroup  grp_hal_hci
 *
 * \if hal
 *  \brief HCI Target Exchange Information
 * \else
 *  \brief HCI-Specific
 * \endif
 *
 *  The <em> Target Exchange Info Structure </em> holds all the exchange information to
 *  the connected target .
 *
 *  \note All members of this structure are in parameters [in].
 *
 */


typedef struct phHciNfc_XchgInfo
{
    /** \internal Exchange Data/NFC-IP DEP
     *   Exchange Buffer */
    uint8_t                     *tx_buffer;
    /** \internal Exchange Data/NFC-IP DEP
     *   Exchange Buffer Length*/
    uint16_t                     tx_length;

    union
    {
        phHciNfc_Tag_XchgInfo_t   tag_info;
        phHciNfc_NfcIP_XchgInfo_t nfc_info;
    }params;

}phHciNfc_XchgInfo_t;



/*
################################################################################
*********************** Function Prototype Declaration *************************
################################################################################
*/

/**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Initialise function initialises the HCI context and all other
 *  resources used in the HCI Layer for the corresponding interface link.
 *
 *  \param[in,out]  psHciHandle         psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  init_mode               init_mode specifies the kind of the
 *                                      Initialisation for the HCI layer .
 *  \param[in]  pHwConfig               pHwConfig is the Information required
 *                                      to configure the parameters of the
 *                                      NFC Device .
 *  \param[in]  pHalNotify              Upper layer Notification function
 *                                      pointer.
 *  \param[in]  psContext               psContext is the context of
 *                                      the Upper Layer.
 *  \param[in]  psHciLayerCfg           Pointer to the  HCI Layer configuration
 *                                      Structure.
 *
 *  \retval NFCSTATUS_PENDING           Initialisation of HCI Layer is in Progress.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 extern
 NFCSTATUS
 phHciNfc_Initialise (
                        void                            *psHciHandle,
                        void                            *pHwRef,
                        phHciNfc_Init_t                 init_mode,
                        phHal_sHwConfig_t               *pHwConfig,
                        pphNfcIF_Notification_CB_t       pHalNotify,
                        void                            *psContext,
                        phNfcLayer_sCfg_t               *psHciLayerCfg
                     );

/**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Release function releases all the resources used in the HCI
 *  Layer for the corresponding interface link, described by the HCI handle.
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  pHalReleaseCB           Upper layer release callback function
 *                                      pointer .
 *  \param[in]  psContext               psContext is the context of
 *                                      the Upper Layer.
 *
 *  \retval NFCSTATUS_PENDING           Releasing of HCI Resources are in Progress.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 extern
 NFCSTATUS
 phHciNfc_Release (
                    void                            *psHciHandle,
                    void                            *pHwRef,
                    pphNfcIF_Notification_CB_t      pHalReleaseCB,
                    void                            *psContext
                  );


extern
NFCSTATUS
phHciNfc_Config_Discovery (
                    void                            *psHciHandle,
                    void                            *pHwRef,
                    phHal_sADD_Cfg_t                *pPollConfig
                    );


/**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Restart_Discovery function restarts the Polling Wheel.
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  re_poll                 If True: Start re-polling of the target
 *                                      after the Target Device is de-activated
 *                                      or else - continue discovery with next
 *                                      technology.
 *  \retval NFCSTATUS_PENDING           The Discovery Wheel retarted.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 extern
 NFCSTATUS
 phHciNfc_Restart_Discovery (
                        void                            *psHciHandle,
                        void                            *pHwRef,
                        uint8_t                         repoll
                     );


 /**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Start_Discovery function Starts the Polling Wheel.
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \retval NFCSTATUS_PENDING           The Discovery Wheel Started.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 extern
 NFCSTATUS
 phHciNfc_Start_Discovery (
                        void                            *psHciHandle,
                        void                            *pHwRef
                     );


 /**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Stop_Discovery function Stops the Polling Wheel.
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \retval NFCSTATUS_PENDING           The Discovery Wheel Stopped.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 extern
 NFCSTATUS
 phHciNfc_Stop_Discovery (
                        void                            *psHciHandle,
                        void                            *pHwRef
                     );


 /**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Configure function Configures Configures the Polling Wheel to
 *  select the kind of Tags to be polled. This also allows to enable/disable
 *  the Tag Emulation. This also configures the Secure elements the UICC, WI and
 *  Target to Emulate the Tag or Target.
 *
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  config_type             config_type specifies the type of the
 *                                      Parameter configuration.
 *  \param[in]  pConfig                 pConfig is the Information for
 *                                      Configuring the Device.
 *  \retval NFCSTATUS_PENDING           The Emulation configuration pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 extern
 NFCSTATUS
 phHciNfc_Configure (
                        void                            *psHciHandle,
                        void                            *pHwRef,
                        phHal_eConfigType_t             config_type,
                        phHal_uConfig_t                 *pConfig
                     );

 /**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Switch_SmxMode function Switches the WI(S2C) interface
 *  from Wired/Virtual to vice versa.
 *
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  smx_mode                smx_mode specifies the type of the switch
 *                                      configuration.
 *  \param[in]  pPollConfig             pPollConfig is the Information for
 *                                      polling the SmartMX Device.
 *  \retval NFCSTATUS_PENDING           The SmartMX Mode Switch pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 NFCSTATUS
 phHciNfc_Switch_SmxMode (
                        void                            *psHciHandle,
                        void                            *pHwRef,
                        phHal_eSmartMX_Mode_t           smx_mode,
                        phHal_sADD_Cfg_t                *pPollConfig
                     );


 /**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Switch_SwpMode function Switches the SWP Link
 *  from On/Off to vice versa. 
 *  
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  swp_mode                swp_mode specifies to switch on/off the
 *                                      SWP Link.
 *  \retval NFCSTATUS_PENDING           The SWP Mode Switch pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 NFCSTATUS
 phHciNfc_Switch_SwpMode (
                        void                            *psHciHandle,
                        void                            *pHwRef,
                        phHal_eSWP_Mode_t               swp_mode /* ,
                        void                            *pSwpCfg */
                     );



/**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Connect function selects the discovered target to
 *  perform the transactions on it.
 *
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  p_remote_dev_info       p_remote_dev_info is the information
 *                                      of the Target Device to be connected .
 *  \retval NFCSTATUS_PENDING           To select the remote target pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 extern
 NFCSTATUS
 phHciNfc_Connect (
                    void                            *psHciHandle,
                    void                            *pHwRef,
                    phHal_sRemoteDevInformation_t   *p_remote_dev_info
                 );


/**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Reactiavte function reactivates the discovered target to
 *  and selects that target perform the transactions on it.
 *
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  p_remote_dev_info       p_remote_dev_info is the information
 *                                      of the Target Device to be reactivated .
 *  \retval NFCSTATUS_PENDING           To reactivate the remote target pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */


 extern
 NFCSTATUS
 phHciNfc_Reactivate (
                    void                            *psHciHandle,
                    void                            *pHwRef,
                    phHal_sRemoteDevInformation_t   *p_target_info
                 );


/**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Disconnect function de-selects the selected target and
 *  any ongoing transactions .
 *
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  re_poll                 If True: Start re-polling of the target
 *                                      after the Target Device is de-activated
 *                                      or else - continue discovery with next
 *                                      technology.
 *
 *  \retval NFCSTATUS_PENDING           To De-select the remote target pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 extern
 NFCSTATUS
 phHciNfc_Disconnect (
                    void                            *psHciHandle,
                    void                            *pHwRef,
                    uint8_t                         re_poll
                 );


/**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Presence_Check function checks for the presence of the target
 *  selected in the vicinity of the Reader's RF Field .
 *
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \retval NFCSTATUS_PENDING           Presence Check of the remote target
 *                                      pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

extern
NFCSTATUS
phHciNfc_Presence_Check (
                    void                            *psHciHandle,
                    void                            *pHwRef
                    );


/**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Select_Next_Target function selects and activates the
 *  next target present in the the Reader's RF Field .
 *
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the
 *                                      context of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \retval NFCSTATUS_PENDING           selection and activation of the next
 *                                      remote target pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

extern
NFCSTATUS
phHciNfc_Select_Next_Target (
                    void                            *psHciHandle,
                    void                            *pHwRef
                    );


 /**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Exchange_Data function exchanges the data 
 *  to/from the selected remote target device.
 *
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  p_remote_dev_info       p_remote_dev_info is the information of the
 *                                      selected target to which data 
 *                                      should be sent.
 *  \param[in]  p_xchg_info             The exchange info contains the command type,
 *                                      addr and data to be sent to the connected
 *                                      remote target device.
 *  \retval NFCSTATUS_PENDING           Data to remote target pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 extern
 NFCSTATUS
 phHciNfc_Exchange_Data (
                    void                            *psHciHandle,
                    void                            *pHwRef,
                    phHal_sRemoteDevInformation_t   *p_remote_dev_info,
                    phHciNfc_XchgInfo_t             *p_xchg_info
                );

 /**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_Send_Data function Sends the data provided
 *  to the appropriate remote target device.
 *
 *
 *  \param[in]  psHciHandle             psHciHandle is the handle or the context
 *                                      of the HCI Layer.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  p_remote_dev_info       p_remote_dev_info is the information 
 *                                      of the selected target to which data 
 *                                      should be sent.
 *  \param[in]  p_send_param            The send param contains the  
 *                                      data to be sent to the
 *                                      remote device.
 *  \retval NFCSTATUS_PENDING           Data to remote device pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

 extern
 NFCSTATUS
 phHciNfc_Send_Data (
                    void                            *psHciHandle,
                    void                            *pHwRef,
                    phHal_sRemoteDevInformation_t   *p_remote_dev_info,
                    phHciNfc_XchgInfo_t             *p_send_param
                 );

 /**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_System_Test function performs the System Management Tests 
 * provided by the NFC Peripheral device.
 *
 *  \param[in]  psContext               psContext is the pointer to HCI Layer
 *                                      context Structure.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  test_type               test_type is the type of the Self Test
 *                                      that needs to be performed on the device.
 *  \param[in]  test_param              test_param is the parameter for the Self Test
 *                                      that needs to be performed on the device.
 *
 *
 *  \retval NFCSTATUS_PENDING           System Test on the System Management 
 *                                      is pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */

extern
NFCSTATUS
phHciNfc_System_Test(
                    void                            *psContext,
                    void                            *pHwRef,
                    uint32_t                        test_type,
                    phNfc_sData_t                   *test_param
                 );

 /**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_System_Configure function performs the System Management 
 * Configuration with the value provided.
 *
 *  \param[in]  psContext               psContext is the pointer to HCI Layer
 *                                      context Structure.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  config_type             config_type is the type of the configuration
 *                                      that needs to be performed on the device.
 *  \param[in]  config_value            config_value is the value for the configuring
 *                                      that needs to be performed on the device.
 *
 *
 *  \retval NFCSTATUS_PENDING           Configuration of the provided information to
 *                                      the is pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */
extern
NFCSTATUS
phHciNfc_System_Configure (
                void                            *psHciHandle,
                void                            *pHwRef,
                uint32_t                        config_type,
                uint8_t                         config_value
                );

 /**
 * \ingroup grp_hci_nfc
 *
 *  The phHciNfc_System_Get_Info function obtains the System Management 
 * information from the address provided.
 *
 *  \param[in]  psContext               psContext is the pointer to HCI Layer
 *                                      context Structure.
 *  \param[in]  pHwRef                  pHwRef is the Information of
 *                                      the Device Interface Link .
 *  \param[in]  info_type               info_type is the type of the Information
 *                                      that needs to be obtained from the device.
 *  \param[in,out]  p_val               p_val is the pointer to which the 
 *                                      information need to be updated.
 *
 *
 *  \retval NFCSTATUS_PENDING           Get information from the NFC Device
 *                                      is pending.
 *  \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
 *                                      could not be interpreted properly.
 *  \retval Other errors                Errors related to the other layers
 *
 */
extern
NFCSTATUS
phHciNfc_System_Get_Info(
                void                            *psHciHandle,
                void                            *pHwRef,
                uint32_t                        info_type,
                uint8_t                         *p_val
                );

extern
NFCSTATUS
phHciNfc_PRBS_Test (
                void                            *psHciHandle,
                void                            *pHwRef,
                uint32_t                        test_type,
                phNfc_sData_t                   *test_param
                );

#if 0
 extern
 NFCSTATUS
 phHciNfc_Receive_Data (
                    void                            *psHciHandle,
                    void                            *pHwRef,
                    uint8_t                         *p_data,
                    uint8_t                         length
                 );

#endif


#endif

