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