Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Nucleo_L432KC_Quadrature_Decoder_with_ADC_and_DAC
Fork of mbed-dev by
targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K82F/drivers/fsl_smartcard_phy_tda8035.h@161:bd0311f1ad86, 2017-05-27 (annotated)
- Committer:
- tonnyleonard
- Date:
- Sat May 27 01:26:18 2017 +0000
- Revision:
- 161:bd0311f1ad86
- Parent:
- 154:37f96f9d4de2
Testing ADC with shunt
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| <> | 154:37f96f9d4de2 | 1 | /* |
| <> | 154:37f96f9d4de2 | 2 | * Copyright (c) 2015-2016, Freescale Semiconductor, Inc. |
| <> | 154:37f96f9d4de2 | 3 | * All rights reserved. |
| <> | 154:37f96f9d4de2 | 4 | * |
| <> | 154:37f96f9d4de2 | 5 | * Redistribution and use in source and binary forms, with or without modification, |
| <> | 154:37f96f9d4de2 | 6 | * are permitted provided that the following conditions are met: |
| <> | 154:37f96f9d4de2 | 7 | * |
| <> | 154:37f96f9d4de2 | 8 | * o Redistributions of source code must retain the above copyright notice, this list |
| <> | 154:37f96f9d4de2 | 9 | * of conditions and the following disclaimer. |
| <> | 154:37f96f9d4de2 | 10 | * |
| <> | 154:37f96f9d4de2 | 11 | * o Redistributions in binary form must reproduce the above copyright notice, this |
| <> | 154:37f96f9d4de2 | 12 | * list of conditions and the following disclaimer in the documentation and/or |
| <> | 154:37f96f9d4de2 | 13 | * other materials provided with the distribution. |
| <> | 154:37f96f9d4de2 | 14 | * |
| <> | 154:37f96f9d4de2 | 15 | * o Neither the name of Freescale Semiconductor, Inc. nor the names of its |
| <> | 154:37f96f9d4de2 | 16 | * contributors may be used to endorse or promote products derived from this |
| <> | 154:37f96f9d4de2 | 17 | * software without specific prior written permission. |
| <> | 154:37f96f9d4de2 | 18 | * |
| <> | 154:37f96f9d4de2 | 19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
| <> | 154:37f96f9d4de2 | 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
| <> | 154:37f96f9d4de2 | 21 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
| <> | 154:37f96f9d4de2 | 22 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR |
| <> | 154:37f96f9d4de2 | 23 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
| <> | 154:37f96f9d4de2 | 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| <> | 154:37f96f9d4de2 | 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON |
| <> | 154:37f96f9d4de2 | 26 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| <> | 154:37f96f9d4de2 | 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| <> | 154:37f96f9d4de2 | 28 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| <> | 154:37f96f9d4de2 | 29 | */ |
| <> | 154:37f96f9d4de2 | 30 | |
| <> | 154:37f96f9d4de2 | 31 | #ifndef _FSL_SMARTCARD_PHY_TDA8035_H_ |
| <> | 154:37f96f9d4de2 | 32 | #define _FSL_SMARTCARD_PHY_TDA8035_H_ |
| <> | 154:37f96f9d4de2 | 33 | |
| <> | 154:37f96f9d4de2 | 34 | #include "fsl_smartcard.h" |
| <> | 154:37f96f9d4de2 | 35 | |
| <> | 154:37f96f9d4de2 | 36 | /*! |
| <> | 154:37f96f9d4de2 | 37 | * @addtogroup smartcard_phy_tda8035_driver |
| <> | 154:37f96f9d4de2 | 38 | * @{ |
| <> | 154:37f96f9d4de2 | 39 | */ |
| <> | 154:37f96f9d4de2 | 40 | |
| <> | 154:37f96f9d4de2 | 41 | |
| <> | 154:37f96f9d4de2 | 42 | /******************************************************************************* |
| <> | 154:37f96f9d4de2 | 43 | * Definitions |
| <> | 154:37f96f9d4de2 | 44 | ******************************************************************************/ |
| <> | 154:37f96f9d4de2 | 45 | |
| <> | 154:37f96f9d4de2 | 46 | /*! @brief Smart card definition which specifies the adjustment number of clock cycles during which an ATR string has to be received. |
| <> | 154:37f96f9d4de2 | 47 | */ |
| <> | 154:37f96f9d4de2 | 48 | #define SMARTCARD_ATR_DURATION_ADJUSTMENT (360u) |
| <> | 154:37f96f9d4de2 | 49 | |
| <> | 154:37f96f9d4de2 | 50 | /*! @brief Smart card definition which specifies the adjustment number of clock cycles until an initial 'TS' character has to be |
| <> | 154:37f96f9d4de2 | 51 | * received. */ |
| <> | 154:37f96f9d4de2 | 52 | #define SMARTCARD_INIT_DELAY_CLOCK_CYCLES_ADJUSTMENT (4200u) |
| <> | 154:37f96f9d4de2 | 53 | |
| <> | 154:37f96f9d4de2 | 54 | /*! @brief Masks for TDA8035 status register */ |
| <> | 154:37f96f9d4de2 | 55 | #define SMARTCARD_TDA8035_STATUS_PRES (0x01u) /*!< Smart card PHY TDA8035 Smart card present status */ |
| <> | 154:37f96f9d4de2 | 56 | #define SMARTCARD_TDA8035_STATUS_ACTIVE (0x02u) /*!< Smart card PHY TDA8035 Smart card active status */ |
| <> | 154:37f96f9d4de2 | 57 | #define SMARTCARD_TDA8035_STATUS_FAULTY (0x04u) /*!< Smart card PHY TDA8035 Smart card faulty status */ |
| <> | 154:37f96f9d4de2 | 58 | #define SMARTCARD_TDA8035_STATUS_CARD_REMOVED (0x08u) /*!< Smart card PHY TDA8035 Smart card removed status */ |
| <> | 154:37f96f9d4de2 | 59 | #define SMARTCARD_TDA8035_STATUS_CARD_DEACTIVATED (0x10u) /*!< Smart card PHY TDA8035 Smart card deactivated status */ |
| <> | 154:37f96f9d4de2 | 60 | |
| <> | 154:37f96f9d4de2 | 61 | /******************************************************************************* |
| <> | 154:37f96f9d4de2 | 62 | * API |
| <> | 154:37f96f9d4de2 | 63 | ******************************************************************************/ |
| <> | 154:37f96f9d4de2 | 64 | |
| <> | 154:37f96f9d4de2 | 65 | #if defined(__cplusplus) |
| <> | 154:37f96f9d4de2 | 66 | extern "C" { |
| <> | 154:37f96f9d4de2 | 67 | #endif |
| <> | 154:37f96f9d4de2 | 68 | |
| <> | 154:37f96f9d4de2 | 69 | /*! |
| <> | 154:37f96f9d4de2 | 70 | * @brief Fills in the configuration structure with default values. |
| <> | 154:37f96f9d4de2 | 71 | * |
| <> | 154:37f96f9d4de2 | 72 | * @param config The Smart card user configuration structure which contains configuration structure of type |
| <> | 154:37f96f9d4de2 | 73 | * smartcard_interface_config_t. |
| <> | 154:37f96f9d4de2 | 74 | * Function fill in members: |
| <> | 154:37f96f9d4de2 | 75 | * clockToResetDelay = 42000, |
| <> | 154:37f96f9d4de2 | 76 | * vcc = kSmartcardVoltageClassB3_3V, |
| <> | 154:37f96f9d4de2 | 77 | * with default values. |
| <> | 154:37f96f9d4de2 | 78 | */ |
| <> | 154:37f96f9d4de2 | 79 | void SMARTCARD_PHY_TDA8035_GetDefaultConfig(smartcard_interface_config_t *config); |
| <> | 154:37f96f9d4de2 | 80 | |
| <> | 154:37f96f9d4de2 | 81 | /*! |
| <> | 154:37f96f9d4de2 | 82 | * @brief Initializes a Smart card interface instance. |
| <> | 154:37f96f9d4de2 | 83 | * |
| <> | 154:37f96f9d4de2 | 84 | * @param base The Smart card peripheral base address. |
| <> | 154:37f96f9d4de2 | 85 | * @param config The user configuration structure of type smartcard_interface_config_t. The user |
| <> | 154:37f96f9d4de2 | 86 | * can call to fill out configuration structure function SMARTCARD_PHY_TDA8035_GetDefaultConfig(). |
| <> | 154:37f96f9d4de2 | 87 | * @param srcClock_Hz Smart card clock generation module source clock. |
| <> | 154:37f96f9d4de2 | 88 | * |
| <> | 154:37f96f9d4de2 | 89 | * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError for an error. |
| <> | 154:37f96f9d4de2 | 90 | */ |
| <> | 154:37f96f9d4de2 | 91 | status_t SMARTCARD_PHY_TDA8035_Init(void *base, smartcard_interface_config_t const *config, uint32_t srcClock_Hz); |
| <> | 154:37f96f9d4de2 | 92 | |
| <> | 154:37f96f9d4de2 | 93 | /*! |
| <> | 154:37f96f9d4de2 | 94 | * @brief De-initializes a Smart card interface, stops the Smart card clock, and disables the VCC. |
| <> | 154:37f96f9d4de2 | 95 | * |
| <> | 154:37f96f9d4de2 | 96 | * @param base The Smart card peripheral module base address. |
| <> | 154:37f96f9d4de2 | 97 | * @param config The user configuration structure of type smartcard_interface_config_t. |
| <> | 154:37f96f9d4de2 | 98 | */ |
| <> | 154:37f96f9d4de2 | 99 | void SMARTCARD_PHY_TDA8035_Deinit(void *base, smartcard_interface_config_t *config); |
| <> | 154:37f96f9d4de2 | 100 | |
| <> | 154:37f96f9d4de2 | 101 | /*! |
| <> | 154:37f96f9d4de2 | 102 | * @brief Activates the Smart card IC. |
| <> | 154:37f96f9d4de2 | 103 | * |
| <> | 154:37f96f9d4de2 | 104 | * @param base The Smart card peripheral module base address. |
| <> | 154:37f96f9d4de2 | 105 | * @param context A pointer to a Smart card driver context structure. |
| <> | 154:37f96f9d4de2 | 106 | * @param resetType type of reset to be performed, possible values |
| <> | 154:37f96f9d4de2 | 107 | * = kSmartcardColdReset, kSmartcardWarmReset |
| <> | 154:37f96f9d4de2 | 108 | * |
| <> | 154:37f96f9d4de2 | 109 | * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError for an error. |
| <> | 154:37f96f9d4de2 | 110 | */ |
| <> | 154:37f96f9d4de2 | 111 | status_t SMARTCARD_PHY_TDA8035_Activate(void *base, smartcard_context_t *context, smartcard_reset_type_t resetType); |
| <> | 154:37f96f9d4de2 | 112 | |
| <> | 154:37f96f9d4de2 | 113 | /*! |
| <> | 154:37f96f9d4de2 | 114 | * @brief De-activates the Smart card IC. |
| <> | 154:37f96f9d4de2 | 115 | * |
| <> | 154:37f96f9d4de2 | 116 | * @param base The Smart card peripheral module base address. |
| <> | 154:37f96f9d4de2 | 117 | * @param context A pointer to a Smart card driver context structure. |
| <> | 154:37f96f9d4de2 | 118 | * |
| <> | 154:37f96f9d4de2 | 119 | * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError for an error. |
| <> | 154:37f96f9d4de2 | 120 | */ |
| <> | 154:37f96f9d4de2 | 121 | status_t SMARTCARD_PHY_TDA8035_Deactivate(void *base, smartcard_context_t *context); |
| <> | 154:37f96f9d4de2 | 122 | |
| <> | 154:37f96f9d4de2 | 123 | /*! |
| <> | 154:37f96f9d4de2 | 124 | * @brief Controls the Smart card interface IC. |
| <> | 154:37f96f9d4de2 | 125 | * |
| <> | 154:37f96f9d4de2 | 126 | * @param base The Smart card peripheral module base address. |
| <> | 154:37f96f9d4de2 | 127 | * @param context A pointer to a Smart card driver context structure. |
| <> | 154:37f96f9d4de2 | 128 | * @param control A interface command type. |
| <> | 154:37f96f9d4de2 | 129 | * @param param Integer value specific to control type |
| <> | 154:37f96f9d4de2 | 130 | * |
| <> | 154:37f96f9d4de2 | 131 | * @retval kStatus_SMARTCARD_Success or kStatus_SMARTCARD_OtherError for an error. |
| <> | 154:37f96f9d4de2 | 132 | */ |
| <> | 154:37f96f9d4de2 | 133 | status_t SMARTCARD_PHY_TDA8035_Control(void *base, |
| <> | 154:37f96f9d4de2 | 134 | smartcard_context_t *context, |
| <> | 154:37f96f9d4de2 | 135 | smartcard_interface_control_t control, |
| <> | 154:37f96f9d4de2 | 136 | uint32_t param); |
| <> | 154:37f96f9d4de2 | 137 | |
| <> | 154:37f96f9d4de2 | 138 | /*! |
| <> | 154:37f96f9d4de2 | 139 | * @brief Smart card interface IC IRQ ISR. |
| <> | 154:37f96f9d4de2 | 140 | * |
| <> | 154:37f96f9d4de2 | 141 | * @param base The Smart card peripheral module base address. |
| <> | 154:37f96f9d4de2 | 142 | * @param context The Smart card context pointer. |
| <> | 154:37f96f9d4de2 | 143 | */ |
| <> | 154:37f96f9d4de2 | 144 | void SMARTCARD_PHY_TDA8035_IRQHandler(void *base, smartcard_context_t *context); |
| <> | 154:37f96f9d4de2 | 145 | /*@}*/ |
| <> | 154:37f96f9d4de2 | 146 | |
| <> | 154:37f96f9d4de2 | 147 | #if defined(__cplusplus) |
| <> | 154:37f96f9d4de2 | 148 | } |
| <> | 154:37f96f9d4de2 | 149 | #endif |
| <> | 154:37f96f9d4de2 | 150 | |
| <> | 154:37f96f9d4de2 | 151 | /*! @}*/ |
| <> | 154:37f96f9d4de2 | 152 | |
| <> | 154:37f96f9d4de2 | 153 | #endif /* _FSL_SMARTCARD_TDA8035_H_*/ |
