Dataloger
TARGET_NUCLEO_F072RB/stm32f0xx_hal_smartcard_ex.h@0:666850d06c9f, 2015-08-20 (annotated)
- Committer:
- jhon309
- Date:
- Thu Aug 20 00:37:14 2015 +0000
- Revision:
- 0:666850d06c9f
ok
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jhon309 | 0:666850d06c9f | 1 | /** |
jhon309 | 0:666850d06c9f | 2 | ****************************************************************************** |
jhon309 | 0:666850d06c9f | 3 | * @file stm32f0xx_hal_smartcard_ex.h |
jhon309 | 0:666850d06c9f | 4 | * @author MCD Application Team |
jhon309 | 0:666850d06c9f | 5 | * @version V1.2.0 |
jhon309 | 0:666850d06c9f | 6 | * @date 11-December-2014 |
jhon309 | 0:666850d06c9f | 7 | * @brief Header file of SMARTCARD HAL module. |
jhon309 | 0:666850d06c9f | 8 | ****************************************************************************** |
jhon309 | 0:666850d06c9f | 9 | * @attention |
jhon309 | 0:666850d06c9f | 10 | * |
jhon309 | 0:666850d06c9f | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
jhon309 | 0:666850d06c9f | 12 | * |
jhon309 | 0:666850d06c9f | 13 | * Redistribution and use in source and binary forms, with or without modification, |
jhon309 | 0:666850d06c9f | 14 | * are permitted provided that the following conditions are met: |
jhon309 | 0:666850d06c9f | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
jhon309 | 0:666850d06c9f | 16 | * this list of conditions and the following disclaimer. |
jhon309 | 0:666850d06c9f | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
jhon309 | 0:666850d06c9f | 18 | * this list of conditions and the following disclaimer in the documentation |
jhon309 | 0:666850d06c9f | 19 | * and/or other materials provided with the distribution. |
jhon309 | 0:666850d06c9f | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
jhon309 | 0:666850d06c9f | 21 | * may be used to endorse or promote products derived from this software |
jhon309 | 0:666850d06c9f | 22 | * without specific prior written permission. |
jhon309 | 0:666850d06c9f | 23 | * |
jhon309 | 0:666850d06c9f | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
jhon309 | 0:666850d06c9f | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
jhon309 | 0:666850d06c9f | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
jhon309 | 0:666850d06c9f | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
jhon309 | 0:666850d06c9f | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
jhon309 | 0:666850d06c9f | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
jhon309 | 0:666850d06c9f | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
jhon309 | 0:666850d06c9f | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
jhon309 | 0:666850d06c9f | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
jhon309 | 0:666850d06c9f | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
jhon309 | 0:666850d06c9f | 34 | * |
jhon309 | 0:666850d06c9f | 35 | ****************************************************************************** |
jhon309 | 0:666850d06c9f | 36 | */ |
jhon309 | 0:666850d06c9f | 37 | |
jhon309 | 0:666850d06c9f | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
jhon309 | 0:666850d06c9f | 39 | #ifndef __STM32F0xx_HAL_SMARTCARD_EX_H |
jhon309 | 0:666850d06c9f | 40 | #define __STM32F0xx_HAL_SMARTCARD_EX_H |
jhon309 | 0:666850d06c9f | 41 | |
jhon309 | 0:666850d06c9f | 42 | #ifdef __cplusplus |
jhon309 | 0:666850d06c9f | 43 | extern "C" { |
jhon309 | 0:666850d06c9f | 44 | #endif |
jhon309 | 0:666850d06c9f | 45 | |
jhon309 | 0:666850d06c9f | 46 | #if !defined(STM32F030x6) && !defined(STM32F030x8) && !defined(STM32F070x6) && !defined(STM32F070xB) && !defined(STM32F030xC) |
jhon309 | 0:666850d06c9f | 47 | |
jhon309 | 0:666850d06c9f | 48 | /* Includes ------------------------------------------------------------------*/ |
jhon309 | 0:666850d06c9f | 49 | #include "stm32f0xx_hal_def.h" |
jhon309 | 0:666850d06c9f | 50 | |
jhon309 | 0:666850d06c9f | 51 | /** @addtogroup STM32F0xx_HAL_Driver |
jhon309 | 0:666850d06c9f | 52 | * @{ |
jhon309 | 0:666850d06c9f | 53 | */ |
jhon309 | 0:666850d06c9f | 54 | |
jhon309 | 0:666850d06c9f | 55 | /** @addtogroup SMARTCARDEx |
jhon309 | 0:666850d06c9f | 56 | * @{ |
jhon309 | 0:666850d06c9f | 57 | */ |
jhon309 | 0:666850d06c9f | 58 | |
jhon309 | 0:666850d06c9f | 59 | /* Exported types ------------------------------------------------------------*/ |
jhon309 | 0:666850d06c9f | 60 | /* Exported constants --------------------------------------------------------*/ |
jhon309 | 0:666850d06c9f | 61 | /* Exported macro ------------------------------------------------------------*/ |
jhon309 | 0:666850d06c9f | 62 | |
jhon309 | 0:666850d06c9f | 63 | /** @defgroup SMARTCARD_Extended_Exported_Macros SMARTCARDEx Exported Macros |
jhon309 | 0:666850d06c9f | 64 | * @{ |
jhon309 | 0:666850d06c9f | 65 | */ |
jhon309 | 0:666850d06c9f | 66 | |
jhon309 | 0:666850d06c9f | 67 | /** @brief Reports the SMARTCARD clock source. |
jhon309 | 0:666850d06c9f | 68 | * @param __HANDLE__: specifies the SMARTCARD Handle |
jhon309 | 0:666850d06c9f | 69 | * @param __CLOCKSOURCE__ : output variable |
jhon309 | 0:666850d06c9f | 70 | * @retval the SMARTCARD clocking source, written in __CLOCKSOURCE__. |
jhon309 | 0:666850d06c9f | 71 | */ |
jhon309 | 0:666850d06c9f | 72 | #if defined(STM32F031x6) || defined(STM32F038xx) |
jhon309 | 0:666850d06c9f | 73 | #define __HAL_SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ |
jhon309 | 0:666850d06c9f | 74 | do { \ |
jhon309 | 0:666850d06c9f | 75 | switch(__HAL_RCC_GET_USART1_SOURCE()) \ |
jhon309 | 0:666850d06c9f | 76 | { \ |
jhon309 | 0:666850d06c9f | 77 | case RCC_USART1CLKSOURCE_PCLK1: \ |
jhon309 | 0:666850d06c9f | 78 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 79 | break; \ |
jhon309 | 0:666850d06c9f | 80 | case RCC_USART1CLKSOURCE_HSI: \ |
jhon309 | 0:666850d06c9f | 81 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
jhon309 | 0:666850d06c9f | 82 | break; \ |
jhon309 | 0:666850d06c9f | 83 | case RCC_USART1CLKSOURCE_SYSCLK: \ |
jhon309 | 0:666850d06c9f | 84 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
jhon309 | 0:666850d06c9f | 85 | break; \ |
jhon309 | 0:666850d06c9f | 86 | case RCC_USART1CLKSOURCE_LSE: \ |
jhon309 | 0:666850d06c9f | 87 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
jhon309 | 0:666850d06c9f | 88 | break; \ |
jhon309 | 0:666850d06c9f | 89 | default: \ |
jhon309 | 0:666850d06c9f | 90 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_UNDEFINED; \ |
jhon309 | 0:666850d06c9f | 91 | break; \ |
jhon309 | 0:666850d06c9f | 92 | } \ |
jhon309 | 0:666850d06c9f | 93 | } while(0) |
jhon309 | 0:666850d06c9f | 94 | #elif defined (STM32F030x8) || \ |
jhon309 | 0:666850d06c9f | 95 | defined (STM32F042x6) || defined (STM32F048xx) || \ |
jhon309 | 0:666850d06c9f | 96 | defined (STM32F051x8) || defined (STM32F058xx) |
jhon309 | 0:666850d06c9f | 97 | #define __HAL_SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ |
jhon309 | 0:666850d06c9f | 98 | do { \ |
jhon309 | 0:666850d06c9f | 99 | if((__HANDLE__)->Instance == USART1) \ |
jhon309 | 0:666850d06c9f | 100 | { \ |
jhon309 | 0:666850d06c9f | 101 | switch(__HAL_RCC_GET_USART1_SOURCE()) \ |
jhon309 | 0:666850d06c9f | 102 | { \ |
jhon309 | 0:666850d06c9f | 103 | case RCC_USART1CLKSOURCE_PCLK1: \ |
jhon309 | 0:666850d06c9f | 104 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 105 | break; \ |
jhon309 | 0:666850d06c9f | 106 | case RCC_USART1CLKSOURCE_HSI: \ |
jhon309 | 0:666850d06c9f | 107 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
jhon309 | 0:666850d06c9f | 108 | break; \ |
jhon309 | 0:666850d06c9f | 109 | case RCC_USART1CLKSOURCE_SYSCLK: \ |
jhon309 | 0:666850d06c9f | 110 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
jhon309 | 0:666850d06c9f | 111 | break; \ |
jhon309 | 0:666850d06c9f | 112 | case RCC_USART1CLKSOURCE_LSE: \ |
jhon309 | 0:666850d06c9f | 113 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
jhon309 | 0:666850d06c9f | 114 | break; \ |
jhon309 | 0:666850d06c9f | 115 | default: \ |
jhon309 | 0:666850d06c9f | 116 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_UNDEFINED; \ |
jhon309 | 0:666850d06c9f | 117 | break; \ |
jhon309 | 0:666850d06c9f | 118 | } \ |
jhon309 | 0:666850d06c9f | 119 | } \ |
jhon309 | 0:666850d06c9f | 120 | else if((__HANDLE__)->Instance == USART2) \ |
jhon309 | 0:666850d06c9f | 121 | { \ |
jhon309 | 0:666850d06c9f | 122 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 123 | } \ |
jhon309 | 0:666850d06c9f | 124 | else \ |
jhon309 | 0:666850d06c9f | 125 | { \ |
jhon309 | 0:666850d06c9f | 126 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_UNDEFINED; \ |
jhon309 | 0:666850d06c9f | 127 | } \ |
jhon309 | 0:666850d06c9f | 128 | } while(0) |
jhon309 | 0:666850d06c9f | 129 | #elif defined(STM32F071xB) || defined(STM32F072xB) || defined(STM32F078xx) |
jhon309 | 0:666850d06c9f | 130 | #define __HAL_SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ |
jhon309 | 0:666850d06c9f | 131 | do { \ |
jhon309 | 0:666850d06c9f | 132 | if((__HANDLE__)->Instance == USART1) \ |
jhon309 | 0:666850d06c9f | 133 | { \ |
jhon309 | 0:666850d06c9f | 134 | switch(__HAL_RCC_GET_USART1_SOURCE()) \ |
jhon309 | 0:666850d06c9f | 135 | { \ |
jhon309 | 0:666850d06c9f | 136 | case RCC_USART1CLKSOURCE_PCLK1: \ |
jhon309 | 0:666850d06c9f | 137 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 138 | break; \ |
jhon309 | 0:666850d06c9f | 139 | case RCC_USART1CLKSOURCE_HSI: \ |
jhon309 | 0:666850d06c9f | 140 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
jhon309 | 0:666850d06c9f | 141 | break; \ |
jhon309 | 0:666850d06c9f | 142 | case RCC_USART1CLKSOURCE_SYSCLK: \ |
jhon309 | 0:666850d06c9f | 143 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
jhon309 | 0:666850d06c9f | 144 | break; \ |
jhon309 | 0:666850d06c9f | 145 | case RCC_USART1CLKSOURCE_LSE: \ |
jhon309 | 0:666850d06c9f | 146 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
jhon309 | 0:666850d06c9f | 147 | break; \ |
jhon309 | 0:666850d06c9f | 148 | default: \ |
jhon309 | 0:666850d06c9f | 149 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_UNDEFINED; \ |
jhon309 | 0:666850d06c9f | 150 | break; \ |
jhon309 | 0:666850d06c9f | 151 | } \ |
jhon309 | 0:666850d06c9f | 152 | } \ |
jhon309 | 0:666850d06c9f | 153 | else if((__HANDLE__)->Instance == USART2) \ |
jhon309 | 0:666850d06c9f | 154 | { \ |
jhon309 | 0:666850d06c9f | 155 | switch(__HAL_RCC_GET_USART2_SOURCE()) \ |
jhon309 | 0:666850d06c9f | 156 | { \ |
jhon309 | 0:666850d06c9f | 157 | case RCC_USART2CLKSOURCE_PCLK1: \ |
jhon309 | 0:666850d06c9f | 158 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 159 | break; \ |
jhon309 | 0:666850d06c9f | 160 | case RCC_USART2CLKSOURCE_HSI: \ |
jhon309 | 0:666850d06c9f | 161 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
jhon309 | 0:666850d06c9f | 162 | break; \ |
jhon309 | 0:666850d06c9f | 163 | case RCC_USART2CLKSOURCE_SYSCLK: \ |
jhon309 | 0:666850d06c9f | 164 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
jhon309 | 0:666850d06c9f | 165 | break; \ |
jhon309 | 0:666850d06c9f | 166 | case RCC_USART2CLKSOURCE_LSE: \ |
jhon309 | 0:666850d06c9f | 167 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
jhon309 | 0:666850d06c9f | 168 | break; \ |
jhon309 | 0:666850d06c9f | 169 | default: \ |
jhon309 | 0:666850d06c9f | 170 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_UNDEFINED; \ |
jhon309 | 0:666850d06c9f | 171 | break; \ |
jhon309 | 0:666850d06c9f | 172 | } \ |
jhon309 | 0:666850d06c9f | 173 | } \ |
jhon309 | 0:666850d06c9f | 174 | else if((__HANDLE__)->Instance == USART3) \ |
jhon309 | 0:666850d06c9f | 175 | { \ |
jhon309 | 0:666850d06c9f | 176 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 177 | } \ |
jhon309 | 0:666850d06c9f | 178 | else if((__HANDLE__)->Instance == USART4) \ |
jhon309 | 0:666850d06c9f | 179 | { \ |
jhon309 | 0:666850d06c9f | 180 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 181 | } \ |
jhon309 | 0:666850d06c9f | 182 | else \ |
jhon309 | 0:666850d06c9f | 183 | { \ |
jhon309 | 0:666850d06c9f | 184 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_UNDEFINED; \ |
jhon309 | 0:666850d06c9f | 185 | } \ |
jhon309 | 0:666850d06c9f | 186 | } while(0) |
jhon309 | 0:666850d06c9f | 187 | #elif defined(STM32F091xC) || defined(STM32F098xx) |
jhon309 | 0:666850d06c9f | 188 | #define __HAL_SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ |
jhon309 | 0:666850d06c9f | 189 | do { \ |
jhon309 | 0:666850d06c9f | 190 | if((__HANDLE__)->Instance == USART1) \ |
jhon309 | 0:666850d06c9f | 191 | { \ |
jhon309 | 0:666850d06c9f | 192 | switch(__HAL_RCC_GET_USART1_SOURCE()) \ |
jhon309 | 0:666850d06c9f | 193 | { \ |
jhon309 | 0:666850d06c9f | 194 | case RCC_USART1CLKSOURCE_PCLK1: \ |
jhon309 | 0:666850d06c9f | 195 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 196 | break; \ |
jhon309 | 0:666850d06c9f | 197 | case RCC_USART1CLKSOURCE_HSI: \ |
jhon309 | 0:666850d06c9f | 198 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
jhon309 | 0:666850d06c9f | 199 | break; \ |
jhon309 | 0:666850d06c9f | 200 | case RCC_USART1CLKSOURCE_SYSCLK: \ |
jhon309 | 0:666850d06c9f | 201 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
jhon309 | 0:666850d06c9f | 202 | break; \ |
jhon309 | 0:666850d06c9f | 203 | case RCC_USART1CLKSOURCE_LSE: \ |
jhon309 | 0:666850d06c9f | 204 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
jhon309 | 0:666850d06c9f | 205 | break; \ |
jhon309 | 0:666850d06c9f | 206 | default: \ |
jhon309 | 0:666850d06c9f | 207 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_UNDEFINED; \ |
jhon309 | 0:666850d06c9f | 208 | break; \ |
jhon309 | 0:666850d06c9f | 209 | } \ |
jhon309 | 0:666850d06c9f | 210 | } \ |
jhon309 | 0:666850d06c9f | 211 | else if((__HANDLE__)->Instance == USART2) \ |
jhon309 | 0:666850d06c9f | 212 | { \ |
jhon309 | 0:666850d06c9f | 213 | switch(__HAL_RCC_GET_USART2_SOURCE()) \ |
jhon309 | 0:666850d06c9f | 214 | { \ |
jhon309 | 0:666850d06c9f | 215 | case RCC_USART2CLKSOURCE_PCLK1: \ |
jhon309 | 0:666850d06c9f | 216 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 217 | break; \ |
jhon309 | 0:666850d06c9f | 218 | case RCC_USART2CLKSOURCE_HSI: \ |
jhon309 | 0:666850d06c9f | 219 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
jhon309 | 0:666850d06c9f | 220 | break; \ |
jhon309 | 0:666850d06c9f | 221 | case RCC_USART2CLKSOURCE_SYSCLK: \ |
jhon309 | 0:666850d06c9f | 222 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
jhon309 | 0:666850d06c9f | 223 | break; \ |
jhon309 | 0:666850d06c9f | 224 | case RCC_USART2CLKSOURCE_LSE: \ |
jhon309 | 0:666850d06c9f | 225 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
jhon309 | 0:666850d06c9f | 226 | break; \ |
jhon309 | 0:666850d06c9f | 227 | default: \ |
jhon309 | 0:666850d06c9f | 228 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_UNDEFINED; \ |
jhon309 | 0:666850d06c9f | 229 | break; \ |
jhon309 | 0:666850d06c9f | 230 | } \ |
jhon309 | 0:666850d06c9f | 231 | } \ |
jhon309 | 0:666850d06c9f | 232 | else if((__HANDLE__)->Instance == USART3) \ |
jhon309 | 0:666850d06c9f | 233 | { \ |
jhon309 | 0:666850d06c9f | 234 | switch(__HAL_RCC_GET_USART3_SOURCE()) \ |
jhon309 | 0:666850d06c9f | 235 | { \ |
jhon309 | 0:666850d06c9f | 236 | case RCC_USART3CLKSOURCE_PCLK1: \ |
jhon309 | 0:666850d06c9f | 237 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 238 | break; \ |
jhon309 | 0:666850d06c9f | 239 | case RCC_USART3CLKSOURCE_HSI: \ |
jhon309 | 0:666850d06c9f | 240 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
jhon309 | 0:666850d06c9f | 241 | break; \ |
jhon309 | 0:666850d06c9f | 242 | case RCC_USART3CLKSOURCE_SYSCLK: \ |
jhon309 | 0:666850d06c9f | 243 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
jhon309 | 0:666850d06c9f | 244 | break; \ |
jhon309 | 0:666850d06c9f | 245 | case RCC_USART3CLKSOURCE_LSE: \ |
jhon309 | 0:666850d06c9f | 246 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
jhon309 | 0:666850d06c9f | 247 | break; \ |
jhon309 | 0:666850d06c9f | 248 | default: \ |
jhon309 | 0:666850d06c9f | 249 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_UNDEFINED; \ |
jhon309 | 0:666850d06c9f | 250 | break; \ |
jhon309 | 0:666850d06c9f | 251 | } \ |
jhon309 | 0:666850d06c9f | 252 | } \ |
jhon309 | 0:666850d06c9f | 253 | else if((__HANDLE__)->Instance == USART4) \ |
jhon309 | 0:666850d06c9f | 254 | { \ |
jhon309 | 0:666850d06c9f | 255 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 256 | } \ |
jhon309 | 0:666850d06c9f | 257 | else if((__HANDLE__)->Instance == USART5) \ |
jhon309 | 0:666850d06c9f | 258 | { \ |
jhon309 | 0:666850d06c9f | 259 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 260 | } \ |
jhon309 | 0:666850d06c9f | 261 | else if((__HANDLE__)->Instance == USART6) \ |
jhon309 | 0:666850d06c9f | 262 | { \ |
jhon309 | 0:666850d06c9f | 263 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 264 | } \ |
jhon309 | 0:666850d06c9f | 265 | else if((__HANDLE__)->Instance == USART7) \ |
jhon309 | 0:666850d06c9f | 266 | { \ |
jhon309 | 0:666850d06c9f | 267 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 268 | } \ |
jhon309 | 0:666850d06c9f | 269 | else if((__HANDLE__)->Instance == USART8) \ |
jhon309 | 0:666850d06c9f | 270 | { \ |
jhon309 | 0:666850d06c9f | 271 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
jhon309 | 0:666850d06c9f | 272 | } \ |
jhon309 | 0:666850d06c9f | 273 | else \ |
jhon309 | 0:666850d06c9f | 274 | { \ |
jhon309 | 0:666850d06c9f | 275 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_UNDEFINED; \ |
jhon309 | 0:666850d06c9f | 276 | } \ |
jhon309 | 0:666850d06c9f | 277 | } while(0) |
jhon309 | 0:666850d06c9f | 278 | #endif /* defined(STM32F031x6) || defined(STM32F038xx) */ |
jhon309 | 0:666850d06c9f | 279 | |
jhon309 | 0:666850d06c9f | 280 | /** |
jhon309 | 0:666850d06c9f | 281 | * @} |
jhon309 | 0:666850d06c9f | 282 | */ |
jhon309 | 0:666850d06c9f | 283 | |
jhon309 | 0:666850d06c9f | 284 | /* Exported functions --------------------------------------------------------*/ |
jhon309 | 0:666850d06c9f | 285 | |
jhon309 | 0:666850d06c9f | 286 | /* Initialization and de-initialization functions ****************************/ |
jhon309 | 0:666850d06c9f | 287 | /* IO operation functions *****************************************************/ |
jhon309 | 0:666850d06c9f | 288 | |
jhon309 | 0:666850d06c9f | 289 | /** @addtogroup SMARTCARDEx_Exported_Functions |
jhon309 | 0:666850d06c9f | 290 | * @{ |
jhon309 | 0:666850d06c9f | 291 | */ |
jhon309 | 0:666850d06c9f | 292 | |
jhon309 | 0:666850d06c9f | 293 | /** @addtogroup SMARTCARDEx_Exported_Functions_Group1 |
jhon309 | 0:666850d06c9f | 294 | * @{ |
jhon309 | 0:666850d06c9f | 295 | */ |
jhon309 | 0:666850d06c9f | 296 | |
jhon309 | 0:666850d06c9f | 297 | /* Peripheral Control functions ***********************************************/ |
jhon309 | 0:666850d06c9f | 298 | void HAL_SMARTCARDEx_BlockLength_Config(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t BlockLength); |
jhon309 | 0:666850d06c9f | 299 | void HAL_SMARTCARDEx_TimeOut_Config(SMARTCARD_HandleTypeDef *hsmartcard, uint32_t TimeOutValue); |
jhon309 | 0:666850d06c9f | 300 | HAL_StatusTypeDef HAL_SMARTCARDEx_EnableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsmartcard); |
jhon309 | 0:666850d06c9f | 301 | HAL_StatusTypeDef HAL_SMARTCARDEx_DisableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsmartcard); |
jhon309 | 0:666850d06c9f | 302 | |
jhon309 | 0:666850d06c9f | 303 | /* Peripheral State and Error functions ***************************************/ |
jhon309 | 0:666850d06c9f | 304 | |
jhon309 | 0:666850d06c9f | 305 | /** |
jhon309 | 0:666850d06c9f | 306 | * @} |
jhon309 | 0:666850d06c9f | 307 | */ |
jhon309 | 0:666850d06c9f | 308 | |
jhon309 | 0:666850d06c9f | 309 | /** |
jhon309 | 0:666850d06c9f | 310 | * @} |
jhon309 | 0:666850d06c9f | 311 | */ |
jhon309 | 0:666850d06c9f | 312 | |
jhon309 | 0:666850d06c9f | 313 | /** |
jhon309 | 0:666850d06c9f | 314 | * @} |
jhon309 | 0:666850d06c9f | 315 | */ |
jhon309 | 0:666850d06c9f | 316 | |
jhon309 | 0:666850d06c9f | 317 | /** |
jhon309 | 0:666850d06c9f | 318 | * @} |
jhon309 | 0:666850d06c9f | 319 | */ |
jhon309 | 0:666850d06c9f | 320 | |
jhon309 | 0:666850d06c9f | 321 | #endif /* !defined(STM32F030x6) && !defined(STM32F030x8)&& !defined(STM32F070x6) && !defined(STM32F070xB) && !defined(STM32F030xC) */ |
jhon309 | 0:666850d06c9f | 322 | |
jhon309 | 0:666850d06c9f | 323 | #ifdef __cplusplus |
jhon309 | 0:666850d06c9f | 324 | } |
jhon309 | 0:666850d06c9f | 325 | #endif |
jhon309 | 0:666850d06c9f | 326 | |
jhon309 | 0:666850d06c9f | 327 | #endif /* __STM32F0xx_HAL_SMARTCARD_EX_H */ |
jhon309 | 0:666850d06c9f | 328 | |
jhon309 | 0:666850d06c9f | 329 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
jhon309 | 0:666850d06c9f | 330 |