siva surendar / mbed-dev

Fork of mbed-dev by mbed official

Committer:
sivasuren
Date:
Fri Nov 25 07:57:40 2016 +0000
Revision:
150:da61ba4e9755
Parent:
149:156823d33999
surendar changes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 149:156823d33999 1 /*
<> 149:156823d33999 2 * Copyright (c) 2015-2016, Freescale Semiconductor, Inc.
<> 149:156823d33999 3 * All rights reserved.
<> 149:156823d33999 4 *
<> 149:156823d33999 5 * Redistribution and use in source and binary forms, with or without modification,
<> 149:156823d33999 6 * are permitted provided that the following conditions are met:
<> 149:156823d33999 7 *
<> 149:156823d33999 8 * o Redistributions of source code must retain the above copyright notice, this list
<> 149:156823d33999 9 * of conditions and the following disclaimer.
<> 149:156823d33999 10 *
<> 149:156823d33999 11 * o Redistributions in binary form must reproduce the above copyright notice, this
<> 149:156823d33999 12 * list of conditions and the following disclaimer in the documentation and/or
<> 149:156823d33999 13 * other materials provided with the distribution.
<> 149:156823d33999 14 *
<> 149:156823d33999 15 * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
<> 149:156823d33999 16 * contributors may be used to endorse or promote products derived from this
<> 149:156823d33999 17 * software without specific prior written permission.
<> 149:156823d33999 18 *
<> 149:156823d33999 19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
<> 149:156823d33999 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
<> 149:156823d33999 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 149:156823d33999 22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
<> 149:156823d33999 23 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
<> 149:156823d33999 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
<> 149:156823d33999 25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
<> 149:156823d33999 26 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
<> 149:156823d33999 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
<> 149:156823d33999 28 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 149:156823d33999 29 */
<> 149:156823d33999 30
<> 149:156823d33999 31 #ifndef _FSL_SMARTCARD_PHY_EMVSIM_H_
<> 149:156823d33999 32 #define _FSL_SMARTCARD_PHY_EMVSIM_H_
<> 149:156823d33999 33
<> 149:156823d33999 34 #include "fsl_smartcard.h"
<> 149:156823d33999 35
<> 149:156823d33999 36 /*!
<> 149:156823d33999 37 * @addtogroup smartcard_phy_emvsim_driver
<> 149:156823d33999 38 * @{
<> 149:156823d33999 39 */
<> 149:156823d33999 40
<> 149:156823d33999 41
<> 149:156823d33999 42 /*******************************************************************************
<> 149:156823d33999 43 * Definitions
<> 149:156823d33999 44 ******************************************************************************/
<> 149:156823d33999 45
<> 149:156823d33999 46 /*! @brief Smart card define which specify adjustment number of clock cycles during which ATR string has to be received
<> 149:156823d33999 47 */
<> 149:156823d33999 48 #define SMARTCARD_ATR_DURATION_ADJUSTMENT (360u)
<> 149:156823d33999 49
<> 149:156823d33999 50 /*! @brief Smart card define which specify adjustment number of clock cycles until initial 'TS' character has to be
<> 149:156823d33999 51 * received */
<> 149:156823d33999 52 #define SMARTCARD_INIT_DELAY_CLOCK_CYCLES_ADJUSTMENT (4200u)
<> 149:156823d33999 53
<> 149:156823d33999 54 /*******************************************************************************
<> 149:156823d33999 55 * API
<> 149:156823d33999 56 ******************************************************************************/
<> 149:156823d33999 57
<> 149:156823d33999 58 #if defined(__cplusplus)
<> 149:156823d33999 59 extern "C" {
<> 149:156823d33999 60 #endif
<> 149:156823d33999 61
<> 149:156823d33999 62 /*!
<> 149:156823d33999 63 * @brief Fill in smartcardInterfaceConfig structure with default values.
<> 149:156823d33999 64 *
<> 149:156823d33999 65 * @param config The user configuration structure of type smartcard_interface_config_t.
<> 149:156823d33999 66 * Function fill in members:
<> 149:156823d33999 67 * clockToResetDelay = 42000,
<> 149:156823d33999 68 * vcc = kSmartcardVoltageClassB3_3V,
<> 149:156823d33999 69 * with default values.
<> 149:156823d33999 70 */
<> 149:156823d33999 71 void SMARTCARD_PHY_EMVSIM_GetDefaultConfig(smartcard_interface_config_t *config);
<> 149:156823d33999 72
<> 149:156823d33999 73 /*!
<> 149:156823d33999 74 * @brief Configures a Smart card interface for operation.
<> 149:156823d33999 75 *
<> 149:156823d33999 76 * @param base The Smart card peripheral module base address.
<> 149:156823d33999 77 * @param config The user configuration structure of type smartcard_interface_config_t. The user
<> 149:156823d33999 78 * is responsible to fill out the members of this structure and to pass the pointer of this structure
<> 149:156823d33999 79 * into this function or call SMARTCARD_PHY_EMVSIMInitUserConfigDefault to fill out structure with default values.
<> 149:156823d33999 80 * @param srcClock_Hz Smart card clock generation module source clock.
<> 149:156823d33999 81 *
<> 149:156823d33999 82 * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError in case of error.
<> 149:156823d33999 83 */
<> 149:156823d33999 84 status_t SMARTCARD_PHY_EMVSIM_Init(EMVSIM_Type *base, const smartcard_interface_config_t *config, uint32_t srcClock_Hz);
<> 149:156823d33999 85
<> 149:156823d33999 86 /*!
<> 149:156823d33999 87 * @brief De-initializes a Smart card interface. Stops Smart card clock and disable VCC.
<> 149:156823d33999 88 *
<> 149:156823d33999 89 * @param base Smart card peripheral module base address.
<> 149:156823d33999 90 * @param config Smart card configuration structure.
<> 149:156823d33999 91 */
<> 149:156823d33999 92 void SMARTCARD_PHY_EMVSIM_Deinit(EMVSIM_Type *base, const smartcard_interface_config_t *config);
<> 149:156823d33999 93
<> 149:156823d33999 94 /*!
<> 149:156823d33999 95 * @brief Activates the smart card IC.
<> 149:156823d33999 96 *
<> 149:156823d33999 97 * @param base The EMVSIM peripheral base address.
<> 149:156823d33999 98 * @param context A pointer to a Smart card driver context structure.
<> 149:156823d33999 99 * @param resetType type of reset to be performed, possible values
<> 149:156823d33999 100 * = kSmartcardColdReset, kSmartcardWarmReset
<> 149:156823d33999 101 *
<> 149:156823d33999 102 * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError in case of error.
<> 149:156823d33999 103 */
<> 149:156823d33999 104 status_t SMARTCARD_PHY_EMVSIM_Activate(EMVSIM_Type *base,
<> 149:156823d33999 105 smartcard_context_t *context,
<> 149:156823d33999 106 smartcard_reset_type_t resetType);
<> 149:156823d33999 107
<> 149:156823d33999 108 /*!
<> 149:156823d33999 109 * @brief De-activates the smart card IC.
<> 149:156823d33999 110 *
<> 149:156823d33999 111 * @param base The EMVSIM peripheral base address.
<> 149:156823d33999 112 * @param context A pointer to a Smart card driver context structure.
<> 149:156823d33999 113 *
<> 149:156823d33999 114 * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError in case of error.
<> 149:156823d33999 115 */
<> 149:156823d33999 116 status_t SMARTCARD_PHY_EMVSIM_Deactivate(EMVSIM_Type *base, smartcard_context_t *context);
<> 149:156823d33999 117
<> 149:156823d33999 118 /*!
<> 149:156823d33999 119 * @brief Controls Smart card interface IC.
<> 149:156823d33999 120 *
<> 149:156823d33999 121 * @param base The EMVSIM peripheral base address.
<> 149:156823d33999 122 * @param context A pointer to a Smart card driver context structure.
<> 149:156823d33999 123 * @param control A interface command type.
<> 149:156823d33999 124 * @param param Integer value specific to control type
<> 149:156823d33999 125 *
<> 149:156823d33999 126 * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError in case of error.
<> 149:156823d33999 127 */
<> 149:156823d33999 128 status_t SMARTCARD_PHY_EMVSIM_Control(EMVSIM_Type *base,
<> 149:156823d33999 129 smartcard_context_t *context,
<> 149:156823d33999 130 smartcard_interface_control_t control,
<> 149:156823d33999 131 uint32_t param);
<> 149:156823d33999 132 /*@}*/
<> 149:156823d33999 133
<> 149:156823d33999 134 #if defined(__cplusplus)
<> 149:156823d33999 135 }
<> 149:156823d33999 136 #endif
<> 149:156823d33999 137
<> 149:156823d33999 138 /*! @}*/
<> 149:156823d33999 139
<> 149:156823d33999 140 #endif /* _FSL_SMARTCARD_PHY_EMVSIM_H_*/