]> git.sur5r.net Git - freertos/blob
b7031612c4634d5c5f44c879ba134e523ddc7a95
[freertos] /
1 /**\r
2   ******************************************************************************\r
3   * @file    stm32f7xx_hal_smartcard_ex.h\r
4   * @author  MCD Application Team\r
5   * @version V1.0.0RC1\r
6   * @date    24-March-2015\r
7   * @brief   Header file of SMARTCARD HAL module.\r
8   ******************************************************************************\r
9   * @attention\r
10   *\r
11   * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>\r
12   *\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
23   *\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
34   *\r
35   ******************************************************************************\r
36   */\r
37 \r
38 /* Define to prevent recursive inclusion -------------------------------------*/\r
39 #ifndef __STM32F7xx_HAL_SMARTCARD_EX_H\r
40 #define __STM32F7xx_HAL_SMARTCARD_EX_H\r
41 \r
42 #ifdef __cplusplus\r
43  extern "C" {\r
44 #endif\r
45 \r
46 /* Includes ------------------------------------------------------------------*/\r
47 #include "stm32f7xx_hal_def.h"\r
48 \r
49 /** @addtogroup STM32F7xx_HAL_Driver\r
50   * @{\r
51   */\r
52 \r
53 /** @addtogroup SMARTCARDEx\r
54   * @{\r
55   */ \r
56 \r
57 /* Exported types ------------------------------------------------------------*/\r
58 /* Exported constants --------------------------------------------------------*/\r
59 /* Exported macro ------------------------------------------------------------*/\r
60    \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
65   */\r
66 #define SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \\r
67   do {                                                             \\r
68     if((__HANDLE__)->Instance == USART1)                           \\r
69     {                                                              \\r
70        switch(__HAL_RCC_GET_USART1_SOURCE())                       \\r
71        {                                                           \\r
72         case RCC_USART1CLKSOURCE_PCLK2:                            \\r
73           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK2;         \\r
74           break;                                                   \\r
75         case RCC_USART1CLKSOURCE_HSI:                              \\r
76           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI;           \\r
77           break;                                                   \\r
78         case RCC_USART1CLKSOURCE_SYSCLK:                           \\r
79           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK;        \\r
80           break;                                                   \\r
81         case RCC_USART1CLKSOURCE_LSE:                              \\r
82           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE;           \\r
83           break;                                                   \\r
84         default:                                                   \\r
85           break;                                                   \\r
86        }                                                           \\r
87     }                                                              \\r
88     else if((__HANDLE__)->Instance == USART2)                      \\r
89     {                                                              \\r
90        switch(__HAL_RCC_GET_USART2_SOURCE())                       \\r
91        {                                                           \\r
92         case RCC_USART2CLKSOURCE_PCLK1:                            \\r
93           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1;         \\r
94           break;                                                   \\r
95         case RCC_USART2CLKSOURCE_HSI:                              \\r
96           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI;           \\r
97           break;                                                   \\r
98         case RCC_USART2CLKSOURCE_SYSCLK:                           \\r
99           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK;        \\r
100           break;                                                   \\r
101         case RCC_USART2CLKSOURCE_LSE:                              \\r
102           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE;           \\r
103           break;                                                   \\r
104         default:                                                   \\r
105           break;                                                   \\r
106        }                                                           \\r
107     }                                                              \\r
108     else if((__HANDLE__)->Instance == USART3)                      \\r
109     {                                                              \\r
110        switch(__HAL_RCC_GET_USART3_SOURCE())                       \\r
111        {                                                           \\r
112         case RCC_USART3CLKSOURCE_PCLK1:                            \\r
113           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1;         \\r
114           break;                                                   \\r
115         case RCC_USART3CLKSOURCE_HSI:                              \\r
116           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI;           \\r
117           break;                                                   \\r
118         case RCC_USART3CLKSOURCE_SYSCLK:                           \\r
119           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK;        \\r
120           break;                                                   \\r
121         case RCC_USART3CLKSOURCE_LSE:                              \\r
122           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE;           \\r
123           break;                                                   \\r
124         default:                                                   \\r
125           break;                                                   \\r
126        }                                                           \\r
127     }                                                              \\r
128     else if((__HANDLE__)->Instance == USART6)                      \\r
129     {                                                              \\r
130        switch(__HAL_RCC_GET_USART6_SOURCE())                       \\r
131        {                                                           \\r
132         case RCC_USART6CLKSOURCE_PCLK2:                            \\r
133           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK2;         \\r
134           break;                                                   \\r
135         case RCC_USART6CLKSOURCE_HSI:                              \\r
136           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI;           \\r
137           break;                                                   \\r
138         case RCC_USART6CLKSOURCE_SYSCLK:                           \\r
139           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK;        \\r
140           break;                                                   \\r
141         case RCC_USART6CLKSOURCE_LSE:                              \\r
142           (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE;           \\r
143           break;                                                   \\r
144         default:                                                   \\r
145           break;                                                   \\r
146        }                                                           \\r
147     }                                                              \\r
148     } while(0)\r
149 \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
158 \r
159 /* Peripheral State and Error functions ***************************************/\r
160 \r
161 /**\r
162   * @}\r
163   */ \r
164 \r
165 /**\r
166   * @}\r
167   */\r
168   \r
169 #ifdef __cplusplus\r
170 }\r
171 #endif\r
172 \r
173 #endif /* __STM32F7xx_HAL_SMARTCARD_EX_H */\r
174 \r
175 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/\r