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