![](/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_tda8035.h@0:8fdf9a60065b, 2018-10-10 (annotated)
- Committer:
- kadonotakashi
- Date:
- Wed Oct 10 00:33:53 2018 +0000
- Revision:
- 0:8fdf9a60065b
how to make mbed librry
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_TDA8035_H_ |
kadonotakashi | 0:8fdf9a60065b | 32 | #define _FSL_SMARTCARD_PHY_TDA8035_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_tda8035_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 definition 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 definition 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 | /*! @brief Masks for TDA8035 status register */ |
kadonotakashi | 0:8fdf9a60065b | 55 | #define SMARTCARD_TDA8035_STATUS_PRES (0x01u) /*!< Smart card PHY TDA8035 Smart card present status */ |
kadonotakashi | 0:8fdf9a60065b | 56 | #define SMARTCARD_TDA8035_STATUS_ACTIVE (0x02u) /*!< Smart card PHY TDA8035 Smart card active status */ |
kadonotakashi | 0:8fdf9a60065b | 57 | #define SMARTCARD_TDA8035_STATUS_FAULTY (0x04u) /*!< Smart card PHY TDA8035 Smart card faulty status */ |
kadonotakashi | 0:8fdf9a60065b | 58 | #define SMARTCARD_TDA8035_STATUS_CARD_REMOVED (0x08u) /*!< Smart card PHY TDA8035 Smart card removed status */ |
kadonotakashi | 0:8fdf9a60065b | 59 | #define SMARTCARD_TDA8035_STATUS_CARD_DEACTIVATED (0x10u) /*!< Smart card PHY TDA8035 Smart card deactivated status */ |
kadonotakashi | 0:8fdf9a60065b | 60 | |
kadonotakashi | 0:8fdf9a60065b | 61 | /******************************************************************************* |
kadonotakashi | 0:8fdf9a60065b | 62 | * API |
kadonotakashi | 0:8fdf9a60065b | 63 | ******************************************************************************/ |
kadonotakashi | 0:8fdf9a60065b | 64 | |
kadonotakashi | 0:8fdf9a60065b | 65 | #if defined(__cplusplus) |
kadonotakashi | 0:8fdf9a60065b | 66 | extern "C" { |
kadonotakashi | 0:8fdf9a60065b | 67 | #endif |
kadonotakashi | 0:8fdf9a60065b | 68 | |
kadonotakashi | 0:8fdf9a60065b | 69 | /*! |
kadonotakashi | 0:8fdf9a60065b | 70 | * @brief Fills in the configuration structure with default values. |
kadonotakashi | 0:8fdf9a60065b | 71 | * |
kadonotakashi | 0:8fdf9a60065b | 72 | * @param config The Smart card user configuration structure which contains configuration structure of type |
kadonotakashi | 0:8fdf9a60065b | 73 | * smartcard_interface_config_t. |
kadonotakashi | 0:8fdf9a60065b | 74 | * Function fill in members: |
kadonotakashi | 0:8fdf9a60065b | 75 | * clockToResetDelay = 42000, |
kadonotakashi | 0:8fdf9a60065b | 76 | * vcc = kSmartcardVoltageClassB3_3V, |
kadonotakashi | 0:8fdf9a60065b | 77 | * with default values. |
kadonotakashi | 0:8fdf9a60065b | 78 | */ |
kadonotakashi | 0:8fdf9a60065b | 79 | void SMARTCARD_PHY_TDA8035_GetDefaultConfig(smartcard_interface_config_t *config); |
kadonotakashi | 0:8fdf9a60065b | 80 | |
kadonotakashi | 0:8fdf9a60065b | 81 | /*! |
kadonotakashi | 0:8fdf9a60065b | 82 | * @brief Initializes a Smart card interface instance. |
kadonotakashi | 0:8fdf9a60065b | 83 | * |
kadonotakashi | 0:8fdf9a60065b | 84 | * @param base The Smart card peripheral base address. |
kadonotakashi | 0:8fdf9a60065b | 85 | * @param config The user configuration structure of type smartcard_interface_config_t. The user |
kadonotakashi | 0:8fdf9a60065b | 86 | * can call to fill out configuration structure function SMARTCARD_PHY_TDA8035_GetDefaultConfig(). |
kadonotakashi | 0:8fdf9a60065b | 87 | * @param srcClock_Hz Smart card clock generation module source clock. |
kadonotakashi | 0:8fdf9a60065b | 88 | * |
kadonotakashi | 0:8fdf9a60065b | 89 | * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError for an error. |
kadonotakashi | 0:8fdf9a60065b | 90 | */ |
kadonotakashi | 0:8fdf9a60065b | 91 | status_t SMARTCARD_PHY_TDA8035_Init(void *base, smartcard_interface_config_t const *config, uint32_t srcClock_Hz); |
kadonotakashi | 0:8fdf9a60065b | 92 | |
kadonotakashi | 0:8fdf9a60065b | 93 | /*! |
kadonotakashi | 0:8fdf9a60065b | 94 | * @brief De-initializes a Smart card interface, stops the Smart card clock, and disables the VCC. |
kadonotakashi | 0:8fdf9a60065b | 95 | * |
kadonotakashi | 0:8fdf9a60065b | 96 | * @param base The Smart card peripheral module base address. |
kadonotakashi | 0:8fdf9a60065b | 97 | * @param config The user configuration structure of type smartcard_interface_config_t. |
kadonotakashi | 0:8fdf9a60065b | 98 | */ |
kadonotakashi | 0:8fdf9a60065b | 99 | void SMARTCARD_PHY_TDA8035_Deinit(void *base, smartcard_interface_config_t *config); |
kadonotakashi | 0:8fdf9a60065b | 100 | |
kadonotakashi | 0:8fdf9a60065b | 101 | /*! |
kadonotakashi | 0:8fdf9a60065b | 102 | * @brief Activates the Smart card IC. |
kadonotakashi | 0:8fdf9a60065b | 103 | * |
kadonotakashi | 0:8fdf9a60065b | 104 | * @param base The Smart card peripheral module base address. |
kadonotakashi | 0:8fdf9a60065b | 105 | * @param context A pointer to a Smart card driver context structure. |
kadonotakashi | 0:8fdf9a60065b | 106 | * @param resetType type of reset to be performed, possible values |
kadonotakashi | 0:8fdf9a60065b | 107 | * = kSmartcardColdReset, kSmartcardWarmReset |
kadonotakashi | 0:8fdf9a60065b | 108 | * |
kadonotakashi | 0:8fdf9a60065b | 109 | * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError for an error. |
kadonotakashi | 0:8fdf9a60065b | 110 | */ |
kadonotakashi | 0:8fdf9a60065b | 111 | status_t SMARTCARD_PHY_TDA8035_Activate(void *base, smartcard_context_t *context, smartcard_reset_type_t resetType); |
kadonotakashi | 0:8fdf9a60065b | 112 | |
kadonotakashi | 0:8fdf9a60065b | 113 | /*! |
kadonotakashi | 0:8fdf9a60065b | 114 | * @brief De-activates the Smart card IC. |
kadonotakashi | 0:8fdf9a60065b | 115 | * |
kadonotakashi | 0:8fdf9a60065b | 116 | * @param base The Smart card peripheral module base address. |
kadonotakashi | 0:8fdf9a60065b | 117 | * @param context A pointer to a Smart card driver context structure. |
kadonotakashi | 0:8fdf9a60065b | 118 | * |
kadonotakashi | 0:8fdf9a60065b | 119 | * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError for an error. |
kadonotakashi | 0:8fdf9a60065b | 120 | */ |
kadonotakashi | 0:8fdf9a60065b | 121 | status_t SMARTCARD_PHY_TDA8035_Deactivate(void *base, smartcard_context_t *context); |
kadonotakashi | 0:8fdf9a60065b | 122 | |
kadonotakashi | 0:8fdf9a60065b | 123 | /*! |
kadonotakashi | 0:8fdf9a60065b | 124 | * @brief Controls the Smart card interface IC. |
kadonotakashi | 0:8fdf9a60065b | 125 | * |
kadonotakashi | 0:8fdf9a60065b | 126 | * @param base The Smart card peripheral module base address. |
kadonotakashi | 0:8fdf9a60065b | 127 | * @param context A pointer to a Smart card driver context structure. |
kadonotakashi | 0:8fdf9a60065b | 128 | * @param control A interface command type. |
kadonotakashi | 0:8fdf9a60065b | 129 | * @param param Integer value specific to control type |
kadonotakashi | 0:8fdf9a60065b | 130 | * |
kadonotakashi | 0:8fdf9a60065b | 131 | * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError for an error. |
kadonotakashi | 0:8fdf9a60065b | 132 | */ |
kadonotakashi | 0:8fdf9a60065b | 133 | status_t SMARTCARD_PHY_TDA8035_Control(void *base, |
kadonotakashi | 0:8fdf9a60065b | 134 | smartcard_context_t *context, |
kadonotakashi | 0:8fdf9a60065b | 135 | smartcard_interface_control_t control, |
kadonotakashi | 0:8fdf9a60065b | 136 | uint32_t param); |
kadonotakashi | 0:8fdf9a60065b | 137 | |
kadonotakashi | 0:8fdf9a60065b | 138 | /*! |
kadonotakashi | 0:8fdf9a60065b | 139 | * @brief Smart card interface IC IRQ ISR. |
kadonotakashi | 0:8fdf9a60065b | 140 | * |
kadonotakashi | 0:8fdf9a60065b | 141 | * @param base The Smart card peripheral module base address. |
kadonotakashi | 0:8fdf9a60065b | 142 | * @param context The Smart card context pointer. |
kadonotakashi | 0:8fdf9a60065b | 143 | */ |
kadonotakashi | 0:8fdf9a60065b | 144 | void SMARTCARD_PHY_TDA8035_IRQHandler(void *base, smartcard_context_t *context); |
kadonotakashi | 0:8fdf9a60065b | 145 | /*@}*/ |
kadonotakashi | 0:8fdf9a60065b | 146 | |
kadonotakashi | 0:8fdf9a60065b | 147 | #if defined(__cplusplus) |
kadonotakashi | 0:8fdf9a60065b | 148 | } |
kadonotakashi | 0:8fdf9a60065b | 149 | #endif |
kadonotakashi | 0:8fdf9a60065b | 150 | |
kadonotakashi | 0:8fdf9a60065b | 151 | /*! @}*/ |
kadonotakashi | 0:8fdf9a60065b | 152 | |
kadonotakashi | 0:8fdf9a60065b | 153 | #endif /* _FSL_SMARTCARD_TDA8035_H_*/ |