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