SPKT
targets/cmsis/TARGET_STM/TARGET_STM32F7/stm32f7xx_hal_smartcard_ex.h@0:e87aa4c49e95, 2019-06-04 (annotated)
- Committer:
- phungductung
- Date:
- Tue Jun 04 21:51:46 2019 +0000
- Revision:
- 0:e87aa4c49e95
libray
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
phungductung | 0:e87aa4c49e95 | 1 | /** |
phungductung | 0:e87aa4c49e95 | 2 | ****************************************************************************** |
phungductung | 0:e87aa4c49e95 | 3 | * @file stm32f7xx_hal_smartcard_ex.h |
phungductung | 0:e87aa4c49e95 | 4 | * @author MCD Application Team |
phungductung | 0:e87aa4c49e95 | 5 | * @version V1.0.4 |
phungductung | 0:e87aa4c49e95 | 6 | * @date 09-December-2015 |
phungductung | 0:e87aa4c49e95 | 7 | * @brief Header file of SMARTCARD HAL module. |
phungductung | 0:e87aa4c49e95 | 8 | ****************************************************************************** |
phungductung | 0:e87aa4c49e95 | 9 | * @attention |
phungductung | 0:e87aa4c49e95 | 10 | * |
phungductung | 0:e87aa4c49e95 | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
phungductung | 0:e87aa4c49e95 | 12 | * |
phungductung | 0:e87aa4c49e95 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
phungductung | 0:e87aa4c49e95 | 14 | * are permitted provided that the following conditions are met: |
phungductung | 0:e87aa4c49e95 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
phungductung | 0:e87aa4c49e95 | 16 | * this list of conditions and the following disclaimer. |
phungductung | 0:e87aa4c49e95 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
phungductung | 0:e87aa4c49e95 | 18 | * this list of conditions and the following disclaimer in the documentation |
phungductung | 0:e87aa4c49e95 | 19 | * and/or other materials provided with the distribution. |
phungductung | 0:e87aa4c49e95 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
phungductung | 0:e87aa4c49e95 | 21 | * may be used to endorse or promote products derived from this software |
phungductung | 0:e87aa4c49e95 | 22 | * without specific prior written permission. |
phungductung | 0:e87aa4c49e95 | 23 | * |
phungductung | 0:e87aa4c49e95 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
phungductung | 0:e87aa4c49e95 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
phungductung | 0:e87aa4c49e95 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
phungductung | 0:e87aa4c49e95 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
phungductung | 0:e87aa4c49e95 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
phungductung | 0:e87aa4c49e95 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
phungductung | 0:e87aa4c49e95 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
phungductung | 0:e87aa4c49e95 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
phungductung | 0:e87aa4c49e95 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
phungductung | 0:e87aa4c49e95 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
phungductung | 0:e87aa4c49e95 | 34 | * |
phungductung | 0:e87aa4c49e95 | 35 | ****************************************************************************** |
phungductung | 0:e87aa4c49e95 | 36 | */ |
phungductung | 0:e87aa4c49e95 | 37 | |
phungductung | 0:e87aa4c49e95 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
phungductung | 0:e87aa4c49e95 | 39 | #ifndef __STM32F7xx_HAL_SMARTCARD_EX_H |
phungductung | 0:e87aa4c49e95 | 40 | #define __STM32F7xx_HAL_SMARTCARD_EX_H |
phungductung | 0:e87aa4c49e95 | 41 | |
phungductung | 0:e87aa4c49e95 | 42 | #ifdef __cplusplus |
phungductung | 0:e87aa4c49e95 | 43 | extern "C" { |
phungductung | 0:e87aa4c49e95 | 44 | #endif |
phungductung | 0:e87aa4c49e95 | 45 | |
phungductung | 0:e87aa4c49e95 | 46 | /* Includes ------------------------------------------------------------------*/ |
phungductung | 0:e87aa4c49e95 | 47 | #include "stm32f7xx_hal_def.h" |
phungductung | 0:e87aa4c49e95 | 48 | |
phungductung | 0:e87aa4c49e95 | 49 | /** @addtogroup STM32F7xx_HAL_Driver |
phungductung | 0:e87aa4c49e95 | 50 | * @{ |
phungductung | 0:e87aa4c49e95 | 51 | */ |
phungductung | 0:e87aa4c49e95 | 52 | |
phungductung | 0:e87aa4c49e95 | 53 | /** @addtogroup SMARTCARDEx |
phungductung | 0:e87aa4c49e95 | 54 | * @{ |
phungductung | 0:e87aa4c49e95 | 55 | */ |
phungductung | 0:e87aa4c49e95 | 56 | |
phungductung | 0:e87aa4c49e95 | 57 | /* Exported types ------------------------------------------------------------*/ |
phungductung | 0:e87aa4c49e95 | 58 | /* Exported constants --------------------------------------------------------*/ |
phungductung | 0:e87aa4c49e95 | 59 | /* Exported macro ------------------------------------------------------------*/ |
phungductung | 0:e87aa4c49e95 | 60 | |
phungductung | 0:e87aa4c49e95 | 61 | /** @brief Reports the SMARTCARD clock source. |
phungductung | 0:e87aa4c49e95 | 62 | * @param __HANDLE__: specifies the USART Handle |
phungductung | 0:e87aa4c49e95 | 63 | * @param __CLOCKSOURCE__ : output variable |
phungductung | 0:e87aa4c49e95 | 64 | * @retval the USART clocking source, written in __CLOCKSOURCE__. |
phungductung | 0:e87aa4c49e95 | 65 | */ |
phungductung | 0:e87aa4c49e95 | 66 | #define SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ |
phungductung | 0:e87aa4c49e95 | 67 | do { \ |
phungductung | 0:e87aa4c49e95 | 68 | if((__HANDLE__)->Instance == USART1) \ |
phungductung | 0:e87aa4c49e95 | 69 | { \ |
phungductung | 0:e87aa4c49e95 | 70 | switch(__HAL_RCC_GET_USART1_SOURCE()) \ |
phungductung | 0:e87aa4c49e95 | 71 | { \ |
phungductung | 0:e87aa4c49e95 | 72 | case RCC_USART1CLKSOURCE_PCLK2: \ |
phungductung | 0:e87aa4c49e95 | 73 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK2; \ |
phungductung | 0:e87aa4c49e95 | 74 | break; \ |
phungductung | 0:e87aa4c49e95 | 75 | case RCC_USART1CLKSOURCE_HSI: \ |
phungductung | 0:e87aa4c49e95 | 76 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
phungductung | 0:e87aa4c49e95 | 77 | break; \ |
phungductung | 0:e87aa4c49e95 | 78 | case RCC_USART1CLKSOURCE_SYSCLK: \ |
phungductung | 0:e87aa4c49e95 | 79 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
phungductung | 0:e87aa4c49e95 | 80 | break; \ |
phungductung | 0:e87aa4c49e95 | 81 | case RCC_USART1CLKSOURCE_LSE: \ |
phungductung | 0:e87aa4c49e95 | 82 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
phungductung | 0:e87aa4c49e95 | 83 | break; \ |
phungductung | 0:e87aa4c49e95 | 84 | default: \ |
phungductung | 0:e87aa4c49e95 | 85 | break; \ |
phungductung | 0:e87aa4c49e95 | 86 | } \ |
phungductung | 0:e87aa4c49e95 | 87 | } \ |
phungductung | 0:e87aa4c49e95 | 88 | else if((__HANDLE__)->Instance == USART2) \ |
phungductung | 0:e87aa4c49e95 | 89 | { \ |
phungductung | 0:e87aa4c49e95 | 90 | switch(__HAL_RCC_GET_USART2_SOURCE()) \ |
phungductung | 0:e87aa4c49e95 | 91 | { \ |
phungductung | 0:e87aa4c49e95 | 92 | case RCC_USART2CLKSOURCE_PCLK1: \ |
phungductung | 0:e87aa4c49e95 | 93 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
phungductung | 0:e87aa4c49e95 | 94 | break; \ |
phungductung | 0:e87aa4c49e95 | 95 | case RCC_USART2CLKSOURCE_HSI: \ |
phungductung | 0:e87aa4c49e95 | 96 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
phungductung | 0:e87aa4c49e95 | 97 | break; \ |
phungductung | 0:e87aa4c49e95 | 98 | case RCC_USART2CLKSOURCE_SYSCLK: \ |
phungductung | 0:e87aa4c49e95 | 99 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
phungductung | 0:e87aa4c49e95 | 100 | break; \ |
phungductung | 0:e87aa4c49e95 | 101 | case RCC_USART2CLKSOURCE_LSE: \ |
phungductung | 0:e87aa4c49e95 | 102 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
phungductung | 0:e87aa4c49e95 | 103 | break; \ |
phungductung | 0:e87aa4c49e95 | 104 | default: \ |
phungductung | 0:e87aa4c49e95 | 105 | break; \ |
phungductung | 0:e87aa4c49e95 | 106 | } \ |
phungductung | 0:e87aa4c49e95 | 107 | } \ |
phungductung | 0:e87aa4c49e95 | 108 | else if((__HANDLE__)->Instance == USART3) \ |
phungductung | 0:e87aa4c49e95 | 109 | { \ |
phungductung | 0:e87aa4c49e95 | 110 | switch(__HAL_RCC_GET_USART3_SOURCE()) \ |
phungductung | 0:e87aa4c49e95 | 111 | { \ |
phungductung | 0:e87aa4c49e95 | 112 | case RCC_USART3CLKSOURCE_PCLK1: \ |
phungductung | 0:e87aa4c49e95 | 113 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
phungductung | 0:e87aa4c49e95 | 114 | break; \ |
phungductung | 0:e87aa4c49e95 | 115 | case RCC_USART3CLKSOURCE_HSI: \ |
phungductung | 0:e87aa4c49e95 | 116 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
phungductung | 0:e87aa4c49e95 | 117 | break; \ |
phungductung | 0:e87aa4c49e95 | 118 | case RCC_USART3CLKSOURCE_SYSCLK: \ |
phungductung | 0:e87aa4c49e95 | 119 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
phungductung | 0:e87aa4c49e95 | 120 | break; \ |
phungductung | 0:e87aa4c49e95 | 121 | case RCC_USART3CLKSOURCE_LSE: \ |
phungductung | 0:e87aa4c49e95 | 122 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
phungductung | 0:e87aa4c49e95 | 123 | break; \ |
phungductung | 0:e87aa4c49e95 | 124 | default: \ |
phungductung | 0:e87aa4c49e95 | 125 | break; \ |
phungductung | 0:e87aa4c49e95 | 126 | } \ |
phungductung | 0:e87aa4c49e95 | 127 | } \ |
phungductung | 0:e87aa4c49e95 | 128 | else if((__HANDLE__)->Instance == USART6) \ |
phungductung | 0:e87aa4c49e95 | 129 | { \ |
phungductung | 0:e87aa4c49e95 | 130 | switch(__HAL_RCC_GET_USART6_SOURCE()) \ |
phungductung | 0:e87aa4c49e95 | 131 | { \ |
phungductung | 0:e87aa4c49e95 | 132 | case RCC_USART6CLKSOURCE_PCLK2: \ |
phungductung | 0:e87aa4c49e95 | 133 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK2; \ |
phungductung | 0:e87aa4c49e95 | 134 | break; \ |
phungductung | 0:e87aa4c49e95 | 135 | case RCC_USART6CLKSOURCE_HSI: \ |
phungductung | 0:e87aa4c49e95 | 136 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
phungductung | 0:e87aa4c49e95 | 137 | break; \ |
phungductung | 0:e87aa4c49e95 | 138 | case RCC_USART6CLKSOURCE_SYSCLK: \ |
phungductung | 0:e87aa4c49e95 | 139 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
phungductung | 0:e87aa4c49e95 | 140 | break; \ |
phungductung | 0:e87aa4c49e95 | 141 | case RCC_USART6CLKSOURCE_LSE: \ |
phungductung | 0:e87aa4c49e95 | 142 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
phungductung | 0:e87aa4c49e95 | 143 | break; \ |
phungductung | 0:e87aa4c49e95 | 144 | default: \ |
phungductung | 0:e87aa4c49e95 | 145 | break; \ |
phungductung | 0:e87aa4c49e95 | 146 | } \ |
phungductung | 0:e87aa4c49e95 | 147 | } \ |
phungductung | 0:e87aa4c49e95 | 148 | } while(0) |
phungductung | 0:e87aa4c49e95 | 149 | |
phungductung | 0:e87aa4c49e95 | 150 | /* Exported functions --------------------------------------------------------*/ |
phungductung | 0:e87aa4c49e95 | 151 | /* Initialization and de-initialization functions ****************************/ |
phungductung | 0:e87aa4c49e95 | 152 | /* IO operation functions *****************************************************/ |
phungductung | 0:e87aa4c49e95 | 153 | /* Peripheral Control functions ***********************************************/ |
phungductung | 0:e87aa4c49e95 | 154 | void HAL_SMARTCARDEx_BlockLength_Config(SMARTCARD_HandleTypeDef *hsc, uint8_t BlockLength); |
phungductung | 0:e87aa4c49e95 | 155 | void HAL_SMARTCARDEx_TimeOut_Config(SMARTCARD_HandleTypeDef *hsc, uint32_t TimeOutValue); |
phungductung | 0:e87aa4c49e95 | 156 | HAL_StatusTypeDef HAL_SMARTCARDEx_EnableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsc); |
phungductung | 0:e87aa4c49e95 | 157 | HAL_StatusTypeDef HAL_SMARTCARDEx_DisableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsc); |
phungductung | 0:e87aa4c49e95 | 158 | |
phungductung | 0:e87aa4c49e95 | 159 | /* Peripheral State and Error functions ***************************************/ |
phungductung | 0:e87aa4c49e95 | 160 | |
phungductung | 0:e87aa4c49e95 | 161 | /** |
phungductung | 0:e87aa4c49e95 | 162 | * @} |
phungductung | 0:e87aa4c49e95 | 163 | */ |
phungductung | 0:e87aa4c49e95 | 164 | |
phungductung | 0:e87aa4c49e95 | 165 | /** |
phungductung | 0:e87aa4c49e95 | 166 | * @} |
phungductung | 0:e87aa4c49e95 | 167 | */ |
phungductung | 0:e87aa4c49e95 | 168 | |
phungductung | 0:e87aa4c49e95 | 169 | #ifdef __cplusplus |
phungductung | 0:e87aa4c49e95 | 170 | } |
phungductung | 0:e87aa4c49e95 | 171 | #endif |
phungductung | 0:e87aa4c49e95 | 172 | |
phungductung | 0:e87aa4c49e95 | 173 | #endif /* __STM32F7xx_HAL_SMARTCARD_EX_H */ |
phungductung | 0:e87aa4c49e95 | 174 | |
phungductung | 0:e87aa4c49e95 | 175 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |