cc y / mbed

Fork of mbed by mbed official

Committer:
Kojto
Date:
Thu Jul 07 14:34:11 2016 +0100
Revision:
122:f9eeca106725
Parent:
108:34e6b704fe68
Release 122 of the mbed library

Changes:
- new targets - Nucleo L432KC, Beetle, Nucleo F446ZE, Nucleo L011K4
- Thread safety addition - mbed API should contain a statement about thread safety
- critical section API addition
- CAS API (core_util_atomic_incr/decr)
- DEVICE_ are generated from targets.json file, device.h deprecated
- Callback replaces FunctionPointer to provide std like interface
- mbed HAL API docs improvements
- toolchain - prexif attributes with MBED_
- add new attributes - packed, weak, forcedinline, align
- target.json - contains targets definitions
- ST - L1XX - Cube update to 1.5
- SPI clock selection fix (clock from APB domain)
- F7 - Cube update v1.4.0
- L0 - baudrate init fix
- L1 - Cube update v1.5
- F3 - baudrate init fix, 3 targets CAN support
- F4 - Cube update v1.12.0, 3 targets CAN support
- L4XX - Cube update v1.5.1
- F0 - update Cube to v1.5.0
- L4 - 2 targets (L476RG/VG) CAN support
- NXP - pwm clock fix for KSDK2 MCU
- LPC2368 - remove ARM toolchain support - due to regression
- KSDK2 - fix SPI , I2C address and repeat start
- Silabs - some fixes backported from mbed 3
- Renesas - RZ_A1H - SystemCoreClockUpdate addition

Who changed what in which revision?

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