2 ******************************************************************************
\r
3 * @file stm32f7xx_hal_smartcard_ex.h
\r
4 * @author MCD Application Team
\r
6 * @date 24-March-2015
\r
7 * @brief Header file of SMARTCARD HAL module.
\r
8 ******************************************************************************
\r
11 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
\r
13 * Redistribution and use in source and binary forms, with or without modification,
\r
14 * are permitted provided that the following conditions are met:
\r
15 * 1. Redistributions of source code must retain the above copyright notice,
\r
16 * this list of conditions and the following disclaimer.
\r
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
\r
18 * this list of conditions and the following disclaimer in the documentation
\r
19 * and/or other materials provided with the distribution.
\r
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
\r
21 * may be used to endorse or promote products derived from this software
\r
22 * without specific prior written permission.
\r
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
\r
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
\r
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
\r
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
\r
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
\r
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
\r
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
\r
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
\r
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
\r
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
35 ******************************************************************************
\r
38 /* Define to prevent recursive inclusion -------------------------------------*/
\r
39 #ifndef __STM32F7xx_HAL_SMARTCARD_EX_H
\r
40 #define __STM32F7xx_HAL_SMARTCARD_EX_H
\r
46 /* Includes ------------------------------------------------------------------*/
\r
47 #include "stm32f7xx_hal_def.h"
\r
49 /** @addtogroup STM32F7xx_HAL_Driver
\r
53 /** @addtogroup SMARTCARDEx
\r
57 /* Exported types ------------------------------------------------------------*/
\r
58 /* Exported constants --------------------------------------------------------*/
\r
59 /* Exported macro ------------------------------------------------------------*/
\r
61 /** @brief Reports the SMARTCARD clock source.
\r
62 * @param __HANDLE__: specifies the USART Handle
\r
63 * @param __CLOCKSOURCE__ : output variable
\r
64 * @retval the USART clocking source, written in __CLOCKSOURCE__.
\r
66 #define SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \
\r
68 if((__HANDLE__)->Instance == USART1) \
\r
70 switch(__HAL_RCC_GET_USART1_SOURCE()) \
\r
72 case RCC_USART1CLKSOURCE_PCLK2: \
\r
73 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK2; \
\r
75 case RCC_USART1CLKSOURCE_HSI: \
\r
76 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
\r
78 case RCC_USART1CLKSOURCE_SYSCLK: \
\r
79 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
\r
81 case RCC_USART1CLKSOURCE_LSE: \
\r
82 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
\r
88 else if((__HANDLE__)->Instance == USART2) \
\r
90 switch(__HAL_RCC_GET_USART2_SOURCE()) \
\r
92 case RCC_USART2CLKSOURCE_PCLK1: \
\r
93 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \
\r
95 case RCC_USART2CLKSOURCE_HSI: \
\r
96 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
\r
98 case RCC_USART2CLKSOURCE_SYSCLK: \
\r
99 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
\r
101 case RCC_USART2CLKSOURCE_LSE: \
\r
102 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
\r
108 else if((__HANDLE__)->Instance == USART3) \
\r
110 switch(__HAL_RCC_GET_USART3_SOURCE()) \
\r
112 case RCC_USART3CLKSOURCE_PCLK1: \
\r
113 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \
\r
115 case RCC_USART3CLKSOURCE_HSI: \
\r
116 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
\r
118 case RCC_USART3CLKSOURCE_SYSCLK: \
\r
119 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
\r
121 case RCC_USART3CLKSOURCE_LSE: \
\r
122 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
\r
128 else if((__HANDLE__)->Instance == USART6) \
\r
130 switch(__HAL_RCC_GET_USART6_SOURCE()) \
\r
132 case RCC_USART6CLKSOURCE_PCLK2: \
\r
133 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK2; \
\r
135 case RCC_USART6CLKSOURCE_HSI: \
\r
136 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
\r
138 case RCC_USART6CLKSOURCE_SYSCLK: \
\r
139 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
\r
141 case RCC_USART6CLKSOURCE_LSE: \
\r
142 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
\r
150 /* Exported functions --------------------------------------------------------*/
\r
151 /* Initialization and de-initialization functions ****************************/
\r
152 /* IO operation functions *****************************************************/
\r
153 /* Peripheral Control functions ***********************************************/
\r
154 void HAL_SMARTCARDEx_BlockLength_Config(SMARTCARD_HandleTypeDef *hsc, uint8_t BlockLength);
\r
155 void HAL_SMARTCARDEx_TimeOut_Config(SMARTCARD_HandleTypeDef *hsc, uint32_t TimeOutValue);
\r
156 HAL_StatusTypeDef HAL_SMARTCARDEx_EnableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsc);
\r
157 HAL_StatusTypeDef HAL_SMARTCARDEx_DisableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsc);
\r
159 /* Peripheral State and Error functions ***************************************/
\r
173 #endif /* __STM32F7xx_HAL_SMARTCARD_EX_H */
\r
175 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
\r