Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
100:cbbeb26dbd92
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 100:cbbeb26dbd92 1 /**
Kojto 100:cbbeb26dbd92 2 ******************************************************************************
Kojto 100:cbbeb26dbd92 3 * @file stm32f3xx_hal_smartcard_ex.h
Kojto 100:cbbeb26dbd92 4 * @author MCD Application Team
Kojto 100:cbbeb26dbd92 5 * @version V1.1.0
Kojto 100:cbbeb26dbd92 6 * @date 12-Sept-2014
Kojto 100:cbbeb26dbd92 7 * @brief Header file of SMARTCARD HAL module.
Kojto 100:cbbeb26dbd92 8 ******************************************************************************
Kojto 100:cbbeb26dbd92 9 * @attention
Kojto 100:cbbeb26dbd92 10 *
Kojto 100:cbbeb26dbd92 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 100:cbbeb26dbd92 12 *
Kojto 100:cbbeb26dbd92 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 100:cbbeb26dbd92 14 * are permitted provided that the following conditions are met:
Kojto 100:cbbeb26dbd92 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 100:cbbeb26dbd92 16 * this list of conditions and the following disclaimer.
Kojto 100:cbbeb26dbd92 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 100:cbbeb26dbd92 18 * this list of conditions and the following disclaimer in the documentation
Kojto 100:cbbeb26dbd92 19 * and/or other materials provided with the distribution.
Kojto 100:cbbeb26dbd92 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 100:cbbeb26dbd92 21 * may be used to endorse or promote products derived from this software
Kojto 100:cbbeb26dbd92 22 * without specific prior written permission.
Kojto 100:cbbeb26dbd92 23 *
Kojto 100:cbbeb26dbd92 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 100:cbbeb26dbd92 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 100:cbbeb26dbd92 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 100:cbbeb26dbd92 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 100:cbbeb26dbd92 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 100:cbbeb26dbd92 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 100:cbbeb26dbd92 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 100:cbbeb26dbd92 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 100:cbbeb26dbd92 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 100:cbbeb26dbd92 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 100:cbbeb26dbd92 34 *
Kojto 100:cbbeb26dbd92 35 ******************************************************************************
Kojto 100:cbbeb26dbd92 36 */
Kojto 100:cbbeb26dbd92 37
Kojto 100:cbbeb26dbd92 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 100:cbbeb26dbd92 39 #ifndef __STM32F3xx_HAL_SMARTCARD_EX_H
Kojto 100:cbbeb26dbd92 40 #define __STM32F3xx_HAL_SMARTCARD_EX_H
Kojto 100:cbbeb26dbd92 41
Kojto 100:cbbeb26dbd92 42 #ifdef __cplusplus
Kojto 100:cbbeb26dbd92 43 extern "C" {
Kojto 100:cbbeb26dbd92 44 #endif
Kojto 100:cbbeb26dbd92 45
Kojto 100:cbbeb26dbd92 46 /* Includes ------------------------------------------------------------------*/
Kojto 100:cbbeb26dbd92 47 #include "stm32f3xx_hal_def.h"
Kojto 100:cbbeb26dbd92 48
Kojto 100:cbbeb26dbd92 49 /** @addtogroup STM32F3xx_HAL_Driver
Kojto 100:cbbeb26dbd92 50 * @{
Kojto 100:cbbeb26dbd92 51 */
Kojto 100:cbbeb26dbd92 52
Kojto 100:cbbeb26dbd92 53 /** @addtogroup SMARTCARDEx SMARTCARD Extended HAL module driver
Kojto 100:cbbeb26dbd92 54 * @{
Kojto 100:cbbeb26dbd92 55 */
Kojto 100:cbbeb26dbd92 56
Kojto 100:cbbeb26dbd92 57 /* Exported types ------------------------------------------------------------*/
Kojto 100:cbbeb26dbd92 58 /* Exported constants --------------------------------------------------------*/
Kojto 100:cbbeb26dbd92 59 /* Exported macro ------------------------------------------------------------*/
Kojto 100:cbbeb26dbd92 60
Kojto 100:cbbeb26dbd92 61 /** @defgroup SMARTCARDEx_Exported_Macros SMARTCARD Extended Exported Macros
Kojto 100:cbbeb26dbd92 62 * @{
Kojto 100:cbbeb26dbd92 63 */
Kojto 100:cbbeb26dbd92 64
Kojto 100:cbbeb26dbd92 65 /** @brief Reports the SMARTCARD clock source.
Kojto 100:cbbeb26dbd92 66 * @param __HANDLE__: specifies the SMARTCARD Handle
Kojto 100:cbbeb26dbd92 67 * @param __CLOCKSOURCE__ : output variable
Kojto 100:cbbeb26dbd92 68 * @retval the SMARTCARD clocking source, written in __CLOCKSOURCE__.
Kojto 100:cbbeb26dbd92 69 */
Kojto 100:cbbeb26dbd92 70 #if defined(STM32F334x8) || defined(STM32F303x8) || defined(STM32F328xx)
Kojto 100:cbbeb26dbd92 71 #define __HAL_SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \
Kojto 100:cbbeb26dbd92 72 do { \
Kojto 100:cbbeb26dbd92 73 if((__HANDLE__)->Instance == USART1) \
Kojto 100:cbbeb26dbd92 74 { \
Kojto 100:cbbeb26dbd92 75 switch(__HAL_RCC_GET_USART1_SOURCE()) \
Kojto 100:cbbeb26dbd92 76 { \
Kojto 100:cbbeb26dbd92 77 case RCC_USART1CLKSOURCE_PCLK1: \
Kojto 100:cbbeb26dbd92 78 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \
Kojto 100:cbbeb26dbd92 79 break; \
Kojto 100:cbbeb26dbd92 80 case RCC_USART1CLKSOURCE_HSI: \
Kojto 100:cbbeb26dbd92 81 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
Kojto 100:cbbeb26dbd92 82 break; \
Kojto 100:cbbeb26dbd92 83 case RCC_USART1CLKSOURCE_SYSCLK: \
Kojto 100:cbbeb26dbd92 84 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
Kojto 100:cbbeb26dbd92 85 break; \
Kojto 100:cbbeb26dbd92 86 case RCC_USART1CLKSOURCE_LSE: \
Kojto 100:cbbeb26dbd92 87 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
Kojto 100:cbbeb26dbd92 88 break; \
Kojto 100:cbbeb26dbd92 89 } \
Kojto 100:cbbeb26dbd92 90 } \
Kojto 100:cbbeb26dbd92 91 else if((__HANDLE__)->Instance == USART2) \
Kojto 100:cbbeb26dbd92 92 { \
Kojto 100:cbbeb26dbd92 93 switch(__HAL_RCC_GET_USART2_SOURCE()) \
Kojto 100:cbbeb26dbd92 94 { \
Kojto 100:cbbeb26dbd92 95 case RCC_USART2CLKSOURCE_PCLK1: \
Kojto 100:cbbeb26dbd92 96 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \
Kojto 100:cbbeb26dbd92 97 break; \
Kojto 100:cbbeb26dbd92 98 case RCC_USART2CLKSOURCE_HSI: \
Kojto 100:cbbeb26dbd92 99 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
Kojto 100:cbbeb26dbd92 100 break; \
Kojto 100:cbbeb26dbd92 101 case RCC_USART2CLKSOURCE_SYSCLK: \
Kojto 100:cbbeb26dbd92 102 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
Kojto 100:cbbeb26dbd92 103 break; \
Kojto 100:cbbeb26dbd92 104 case RCC_USART2CLKSOURCE_LSE: \
Kojto 100:cbbeb26dbd92 105 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
Kojto 100:cbbeb26dbd92 106 break; \
Kojto 100:cbbeb26dbd92 107 } \
Kojto 100:cbbeb26dbd92 108 } \
Kojto 100:cbbeb26dbd92 109 else if((__HANDLE__)->Instance == USART3) \
Kojto 100:cbbeb26dbd92 110 { \
Kojto 100:cbbeb26dbd92 111 switch(__HAL_RCC_GET_USART3_SOURCE()) \
Kojto 100:cbbeb26dbd92 112 { \
Kojto 100:cbbeb26dbd92 113 case RCC_USART3CLKSOURCE_PCLK1: \
Kojto 100:cbbeb26dbd92 114 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \
Kojto 100:cbbeb26dbd92 115 break; \
Kojto 100:cbbeb26dbd92 116 case RCC_USART3CLKSOURCE_HSI: \
Kojto 100:cbbeb26dbd92 117 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
Kojto 100:cbbeb26dbd92 118 break; \
Kojto 100:cbbeb26dbd92 119 case RCC_USART3CLKSOURCE_SYSCLK: \
Kojto 100:cbbeb26dbd92 120 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
Kojto 100:cbbeb26dbd92 121 break; \
Kojto 100:cbbeb26dbd92 122 case RCC_USART3CLKSOURCE_LSE: \
Kojto 100:cbbeb26dbd92 123 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
Kojto 100:cbbeb26dbd92 124 break; \
Kojto 100:cbbeb26dbd92 125 } \
Kojto 100:cbbeb26dbd92 126 } \
Kojto 100:cbbeb26dbd92 127 } while(0)
Kojto 100:cbbeb26dbd92 128 #else
Kojto 100:cbbeb26dbd92 129 #define __HAL_SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \
Kojto 100:cbbeb26dbd92 130 do { \
Kojto 100:cbbeb26dbd92 131 if((__HANDLE__)->Instance == USART1) \
Kojto 100:cbbeb26dbd92 132 { \
Kojto 100:cbbeb26dbd92 133 switch(__HAL_RCC_GET_USART1_SOURCE()) \
Kojto 100:cbbeb26dbd92 134 { \
Kojto 100:cbbeb26dbd92 135 case RCC_USART1CLKSOURCE_PCLK2: \
Kojto 100:cbbeb26dbd92 136 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK2; \
Kojto 100:cbbeb26dbd92 137 break; \
Kojto 100:cbbeb26dbd92 138 case RCC_USART1CLKSOURCE_HSI: \
Kojto 100:cbbeb26dbd92 139 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
Kojto 100:cbbeb26dbd92 140 break; \
Kojto 100:cbbeb26dbd92 141 case RCC_USART1CLKSOURCE_SYSCLK: \
Kojto 100:cbbeb26dbd92 142 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
Kojto 100:cbbeb26dbd92 143 break; \
Kojto 100:cbbeb26dbd92 144 case RCC_USART1CLKSOURCE_LSE: \
Kojto 100:cbbeb26dbd92 145 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
Kojto 100:cbbeb26dbd92 146 break; \
Kojto 100:cbbeb26dbd92 147 } \
Kojto 100:cbbeb26dbd92 148 } \
Kojto 100:cbbeb26dbd92 149 else if((__HANDLE__)->Instance == USART2) \
Kojto 100:cbbeb26dbd92 150 { \
Kojto 100:cbbeb26dbd92 151 switch(__HAL_RCC_GET_USART2_SOURCE()) \
Kojto 100:cbbeb26dbd92 152 { \
Kojto 100:cbbeb26dbd92 153 case RCC_USART2CLKSOURCE_PCLK1: \
Kojto 100:cbbeb26dbd92 154 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \
Kojto 100:cbbeb26dbd92 155 break; \
Kojto 100:cbbeb26dbd92 156 case RCC_USART2CLKSOURCE_HSI: \
Kojto 100:cbbeb26dbd92 157 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
Kojto 100:cbbeb26dbd92 158 break; \
Kojto 100:cbbeb26dbd92 159 case RCC_USART2CLKSOURCE_SYSCLK: \
Kojto 100:cbbeb26dbd92 160 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
Kojto 100:cbbeb26dbd92 161 break; \
Kojto 100:cbbeb26dbd92 162 case RCC_USART2CLKSOURCE_LSE: \
Kojto 100:cbbeb26dbd92 163 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
Kojto 100:cbbeb26dbd92 164 break; \
Kojto 100:cbbeb26dbd92 165 } \
Kojto 100:cbbeb26dbd92 166 } \
Kojto 100:cbbeb26dbd92 167 else if((__HANDLE__)->Instance == USART3) \
Kojto 100:cbbeb26dbd92 168 { \
Kojto 100:cbbeb26dbd92 169 switch(__HAL_RCC_GET_USART3_SOURCE()) \
Kojto 100:cbbeb26dbd92 170 { \
Kojto 100:cbbeb26dbd92 171 case RCC_USART3CLKSOURCE_PCLK1: \
Kojto 100:cbbeb26dbd92 172 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \
Kojto 100:cbbeb26dbd92 173 break; \
Kojto 100:cbbeb26dbd92 174 case RCC_USART3CLKSOURCE_HSI: \
Kojto 100:cbbeb26dbd92 175 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
Kojto 100:cbbeb26dbd92 176 break; \
Kojto 100:cbbeb26dbd92 177 case RCC_USART3CLKSOURCE_SYSCLK: \
Kojto 100:cbbeb26dbd92 178 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
Kojto 100:cbbeb26dbd92 179 break; \
Kojto 100:cbbeb26dbd92 180 case RCC_USART3CLKSOURCE_LSE: \
Kojto 100:cbbeb26dbd92 181 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
Kojto 100:cbbeb26dbd92 182 break; \
Kojto 100:cbbeb26dbd92 183 } \
Kojto 100:cbbeb26dbd92 184 } \
Kojto 100:cbbeb26dbd92 185 } while(0)
Kojto 100:cbbeb26dbd92 186 #endif
Kojto 100:cbbeb26dbd92 187
Kojto 100:cbbeb26dbd92 188 /**
Kojto 100:cbbeb26dbd92 189 * @}
Kojto 100:cbbeb26dbd92 190 */
Kojto 100:cbbeb26dbd92 191
Kojto 100:cbbeb26dbd92 192
Kojto 100:cbbeb26dbd92 193 /* Exported functions --------------------------------------------------------*/
Kojto 100:cbbeb26dbd92 194 /** @addtogroup SMARTCARDEx_Exported_Functions SMARTCARD Extended Exported Functions
Kojto 100:cbbeb26dbd92 195 * @{
Kojto 100:cbbeb26dbd92 196 */
Kojto 100:cbbeb26dbd92 197
Kojto 100:cbbeb26dbd92 198 /* Initialization and de-initialization functions ****************************/
Kojto 100:cbbeb26dbd92 199 /* IO operation functions *****************************************************/
Kojto 100:cbbeb26dbd92 200 /* Peripheral Control functions ***********************************************/
Kojto 100:cbbeb26dbd92 201 /** @addtogroup SMARTCARDEx_Exported_Functions_Group1 Extended Peripheral Control functions
Kojto 100:cbbeb26dbd92 202 * @{
Kojto 100:cbbeb26dbd92 203 */
Kojto 100:cbbeb26dbd92 204 void HAL_SMARTCARDEx_BlockLength_Config(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t BlockLength);
Kojto 100:cbbeb26dbd92 205 void HAL_SMARTCARDEx_TimeOut_Config(SMARTCARD_HandleTypeDef *hsmartcard, uint32_t TimeOutValue);
Kojto 100:cbbeb26dbd92 206 HAL_StatusTypeDef HAL_SMARTCARDEx_EnableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsmartcard);
Kojto 100:cbbeb26dbd92 207 HAL_StatusTypeDef HAL_SMARTCARDEx_DisableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsmartcard);
Kojto 100:cbbeb26dbd92 208
Kojto 100:cbbeb26dbd92 209 /* Peripheral State and Error functions ***************************************/
Kojto 100:cbbeb26dbd92 210
Kojto 100:cbbeb26dbd92 211 /**
Kojto 100:cbbeb26dbd92 212 * @}
Kojto 100:cbbeb26dbd92 213 */
Kojto 100:cbbeb26dbd92 214
Kojto 100:cbbeb26dbd92 215 /**
Kojto 100:cbbeb26dbd92 216 * @}
Kojto 100:cbbeb26dbd92 217 */
Kojto 100:cbbeb26dbd92 218
Kojto 100:cbbeb26dbd92 219 /**
Kojto 100:cbbeb26dbd92 220 * @}
Kojto 100:cbbeb26dbd92 221 */
Kojto 100:cbbeb26dbd92 222
Kojto 100:cbbeb26dbd92 223 /**
Kojto 100:cbbeb26dbd92 224 * @}
Kojto 100:cbbeb26dbd92 225 */
Kojto 100:cbbeb26dbd92 226
Kojto 100:cbbeb26dbd92 227 #ifdef __cplusplus
Kojto 100:cbbeb26dbd92 228 }
Kojto 100:cbbeb26dbd92 229 #endif
Kojto 100:cbbeb26dbd92 230
Kojto 100:cbbeb26dbd92 231 #endif /* __STM32F3xx_HAL_SMARTCARD_EX_H */
Kojto 100:cbbeb26dbd92 232
Kojto 100:cbbeb26dbd92 233 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/