mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
shaoziyang
Date:
Sat Sep 13 14:25:46 2014 +0000
Revision:
323:9e901b0a5aa1
Parent:
237:f3da66175598
test with CLOCK_SETUP = 0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 237:f3da66175598 1 /**
mbed_official 237:f3da66175598 2 ******************************************************************************
mbed_official 237:f3da66175598 3 * @file stm32f3xx_hal_smartcard.h
mbed_official 237:f3da66175598 4 * @author MCD Application Team
mbed_official 237:f3da66175598 5 * @version V1.0.1
mbed_official 237:f3da66175598 6 * @date 18-June-2014
mbed_official 237:f3da66175598 7 * @brief Header file of SMARTCARD HAL module.
mbed_official 237:f3da66175598 8 ******************************************************************************
mbed_official 237:f3da66175598 9 * @attention
mbed_official 237:f3da66175598 10 *
mbed_official 237:f3da66175598 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 237:f3da66175598 12 *
mbed_official 237:f3da66175598 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 237:f3da66175598 14 * are permitted provided that the following conditions are met:
mbed_official 237:f3da66175598 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 237:f3da66175598 16 * this list of conditions and the following disclaimer.
mbed_official 237:f3da66175598 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 237:f3da66175598 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 237:f3da66175598 19 * and/or other materials provided with the distribution.
mbed_official 237:f3da66175598 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 237:f3da66175598 21 * may be used to endorse or promote products derived from this software
mbed_official 237:f3da66175598 22 * without specific prior written permission.
mbed_official 237:f3da66175598 23 *
mbed_official 237:f3da66175598 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 237:f3da66175598 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 237:f3da66175598 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 237:f3da66175598 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 237:f3da66175598 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 237:f3da66175598 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 237:f3da66175598 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 237:f3da66175598 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 237:f3da66175598 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 237:f3da66175598 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 237:f3da66175598 34 *
mbed_official 237:f3da66175598 35 ******************************************************************************
mbed_official 237:f3da66175598 36 */
mbed_official 237:f3da66175598 37
mbed_official 237:f3da66175598 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 237:f3da66175598 39 #ifndef __STM32F3xx_HAL_SMARTCARD_H
mbed_official 237:f3da66175598 40 #define __STM32F3xx_HAL_SMARTCARD_H
mbed_official 237:f3da66175598 41
mbed_official 237:f3da66175598 42 #ifdef __cplusplus
mbed_official 237:f3da66175598 43 extern "C" {
mbed_official 237:f3da66175598 44 #endif
mbed_official 237:f3da66175598 45
mbed_official 237:f3da66175598 46 /* Includes ------------------------------------------------------------------*/
mbed_official 237:f3da66175598 47 #include "stm32f3xx_hal_def.h"
mbed_official 237:f3da66175598 48
mbed_official 237:f3da66175598 49 /** @addtogroup STM32F3xx_HAL_Driver
mbed_official 237:f3da66175598 50 * @{
mbed_official 237:f3da66175598 51 */
mbed_official 237:f3da66175598 52
mbed_official 237:f3da66175598 53 /** @addtogroup SMARTCARD
mbed_official 237:f3da66175598 54 * @{
mbed_official 237:f3da66175598 55 */
mbed_official 237:f3da66175598 56
mbed_official 237:f3da66175598 57 /* Exported types ------------------------------------------------------------*/
mbed_official 237:f3da66175598 58 /**
mbed_official 237:f3da66175598 59 * @brief SMARTCARD Init Structure definition
mbed_official 237:f3da66175598 60 */
mbed_official 237:f3da66175598 61 typedef struct
mbed_official 237:f3da66175598 62 {
mbed_official 237:f3da66175598 63 uint32_t BaudRate; /*!< Configures the SmartCard communication baud rate.
mbed_official 237:f3da66175598 64 The baud rate register is computed using the following formula:
mbed_official 237:f3da66175598 65 Baud Rate Register = ((PCLKx) / ((hsmartcard->Init.BaudRate))) */
mbed_official 237:f3da66175598 66
mbed_official 237:f3da66175598 67 uint32_t WordLength; /*!< Specifies the number of data bits transmitted or received in a frame.
mbed_official 237:f3da66175598 68 This parameter @ref SMARTCARD_Word_Length can only be set to 9 (8 data + 1 parity bits). */
mbed_official 237:f3da66175598 69
mbed_official 237:f3da66175598 70 uint32_t StopBits; /*!< Specifies the number of stop bits @ref SMARTCARD_Stop_Bits.
mbed_official 237:f3da66175598 71 Only 1.5 stop bits are authorized in SmartCard mode. */
mbed_official 237:f3da66175598 72
mbed_official 237:f3da66175598 73 uint16_t Parity; /*!< Specifies the parity mode.
mbed_official 237:f3da66175598 74 This parameter can be a value of @ref SMARTCARD_Parity
mbed_official 237:f3da66175598 75 @note The parity is enabled by default (PCE is forced to 1).
mbed_official 237:f3da66175598 76 Since the WordLength is forced to 8 bits + parity, M is
mbed_official 237:f3da66175598 77 forced to 1 and the parity bit is the 9th bit. */
mbed_official 237:f3da66175598 78
mbed_official 237:f3da66175598 79 uint16_t Mode; /*!< Specifies whether the Receive or Transmit mode is enabled or disabled.
mbed_official 237:f3da66175598 80 This parameter can be a value of @ref SMARTCARD_Mode */
mbed_official 237:f3da66175598 81
mbed_official 237:f3da66175598 82 uint16_t CLKPolarity; /*!< Specifies the steady state of the serial clock.
mbed_official 237:f3da66175598 83 This parameter can be a value of @ref SMARTCARD_Clock_Polarity */
mbed_official 237:f3da66175598 84
mbed_official 237:f3da66175598 85 uint16_t CLKPhase; /*!< Specifies the clock transition on which the bit capture is made.
mbed_official 237:f3da66175598 86 This parameter can be a value of @ref SMARTCARD_Clock_Phase */
mbed_official 237:f3da66175598 87
mbed_official 237:f3da66175598 88 uint16_t CLKLastBit; /*!< Specifies whether the clock pulse corresponding to the last transmitted
mbed_official 237:f3da66175598 89 data bit (MSB) has to be output on the SCLK pin in synchronous mode.
mbed_official 237:f3da66175598 90 This parameter can be a value of @ref SMARTCARD_Last_Bit */
mbed_official 237:f3da66175598 91
mbed_official 237:f3da66175598 92 uint16_t OneBitSampling; /*!< Specifies wether a single sample or three samples' majority vote is selected.
mbed_official 237:f3da66175598 93 Selecting the single sample method increases the receiver tolerance to clock
mbed_official 237:f3da66175598 94 deviations. This parameter can be a value of @ref SMARTCARD_OneBit_Sampling. */
mbed_official 237:f3da66175598 95
mbed_official 237:f3da66175598 96 uint8_t Prescaler; /*!< Specifies the SmartCard Prescaler */
mbed_official 237:f3da66175598 97
mbed_official 237:f3da66175598 98 uint8_t GuardTime; /*!< Specifies the SmartCard Guard Time */
mbed_official 237:f3da66175598 99
mbed_official 237:f3da66175598 100 uint16_t NACKEnable; /*!< Specifies whether the SmartCard NACK transmission is enabled
mbed_official 237:f3da66175598 101 in case of parity error.
mbed_official 237:f3da66175598 102 This parameter can be a value of @ref SMARTCARD_NACK_Enable */
mbed_official 237:f3da66175598 103
mbed_official 237:f3da66175598 104 uint32_t TimeOutEnable; /*!< Specifies whether the receiver timeout is enabled.
mbed_official 237:f3da66175598 105 This parameter can be a value of @ref SMARTCARD_Timeout_Enable*/
mbed_official 237:f3da66175598 106
mbed_official 237:f3da66175598 107 uint32_t TimeOutValue; /*!< Specifies the receiver time out value in number of baud blocks:
mbed_official 237:f3da66175598 108 it is used to implement the Character Wait Time (CWT) and
mbed_official 237:f3da66175598 109 Block Wait Time (BWT). It is coded over 24 bits. */
mbed_official 237:f3da66175598 110
mbed_official 237:f3da66175598 111 uint8_t BlockLength; /*!< Specifies the SmartCard Block Length in T=1 Reception mode.
mbed_official 237:f3da66175598 112 This parameter can be any value from 0x0 to 0xFF */
mbed_official 237:f3da66175598 113
mbed_official 237:f3da66175598 114 uint8_t AutoRetryCount; /*!< Specifies the SmartCard auto-retry count (number of retries in
mbed_official 237:f3da66175598 115 receive and transmit mode). When set to 0, retransmission is
mbed_official 237:f3da66175598 116 disabled. Otherwise, its maximum value is 7 (before signalling
mbed_official 237:f3da66175598 117 an error) */
mbed_official 237:f3da66175598 118
mbed_official 237:f3da66175598 119 }SMARTCARD_InitTypeDef;
mbed_official 237:f3da66175598 120
mbed_official 237:f3da66175598 121 /**
mbed_official 237:f3da66175598 122 * @brief SMARTCARD advanced features initalization structure definition
mbed_official 237:f3da66175598 123 */
mbed_official 237:f3da66175598 124 typedef struct
mbed_official 237:f3da66175598 125 {
mbed_official 237:f3da66175598 126 uint32_t AdvFeatureInit; /*!< Specifies which advanced SMARTCARD features is initialized. Several
mbed_official 237:f3da66175598 127 advanced features may be initialized at the same time. This parameter
mbed_official 237:f3da66175598 128 can be a value of @ref SMARTCARD_Advanced_Features_Initialization_Type */
mbed_official 237:f3da66175598 129
mbed_official 237:f3da66175598 130 uint32_t TxPinLevelInvert; /*!< Specifies whether the TX pin active level is inverted.
mbed_official 237:f3da66175598 131 This parameter can be a value of @ref SMARTCARD_Tx_Inv */
mbed_official 237:f3da66175598 132
mbed_official 237:f3da66175598 133 uint32_t RxPinLevelInvert; /*!< Specifies whether the RX pin active level is inverted.
mbed_official 237:f3da66175598 134 This parameter can be a value of @ref SMARTCARD_Rx_Inv */
mbed_official 237:f3da66175598 135
mbed_official 237:f3da66175598 136 uint32_t DataInvert; /*!< Specifies whether data are inverted (positive/direct logic
mbed_official 237:f3da66175598 137 vs negative/inverted logic).
mbed_official 237:f3da66175598 138 This parameter can be a value of @ref SMARTCARD_Data_Inv */
mbed_official 237:f3da66175598 139
mbed_official 237:f3da66175598 140 uint32_t Swap; /*!< Specifies whether TX and RX pins are swapped.
mbed_official 237:f3da66175598 141 This parameter can be a value of @ref SMARTCARD_Rx_Tx_Swap */
mbed_official 237:f3da66175598 142
mbed_official 237:f3da66175598 143 uint32_t OverrunDisable; /*!< Specifies whether the reception overrun detection is disabled.
mbed_official 237:f3da66175598 144 This parameter can be a value of @ref SMARTCARD_Overrun_Disable */
mbed_official 237:f3da66175598 145
mbed_official 237:f3da66175598 146 uint32_t DMADisableonRxError; /*!< Specifies whether the DMA is disabled in case of reception error.
mbed_official 237:f3da66175598 147 This parameter can be a value of @ref SMARTCARD_DMA_Disable_on_Rx_Error */
mbed_official 237:f3da66175598 148
mbed_official 237:f3da66175598 149 uint32_t MSBFirst; /*!< Specifies whether MSB is sent first on UART line.
mbed_official 237:f3da66175598 150 This parameter can be a value of @ref SMARTCARD_MSB_First */
mbed_official 237:f3da66175598 151 }SMARTCARD_AdvFeatureInitTypeDef;
mbed_official 237:f3da66175598 152
mbed_official 237:f3da66175598 153 /**
mbed_official 237:f3da66175598 154 * @brief HAL State structures definition
mbed_official 237:f3da66175598 155 */
mbed_official 237:f3da66175598 156 typedef enum
mbed_official 237:f3da66175598 157 {
mbed_official 237:f3da66175598 158 HAL_SMARTCARD_STATE_RESET = 0x00, /*!< Peripheral is not initialized */
mbed_official 237:f3da66175598 159 HAL_SMARTCARD_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */
mbed_official 237:f3da66175598 160 HAL_SMARTCARD_STATE_BUSY = 0x02, /*!< an internal process is ongoing */
mbed_official 237:f3da66175598 161 HAL_SMARTCARD_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */
mbed_official 237:f3da66175598 162 HAL_SMARTCARD_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */
mbed_official 237:f3da66175598 163 HAL_SMARTCARD_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission and Reception process is ongoing */
mbed_official 237:f3da66175598 164 HAL_SMARTCARD_STATE_TIMEOUT = 0x03, /*!< Timeout state */
mbed_official 237:f3da66175598 165 HAL_SMARTCARD_STATE_ERROR = 0x04 /*!< Error */
mbed_official 237:f3da66175598 166 }HAL_SMARTCARD_StateTypeDef;
mbed_official 237:f3da66175598 167
mbed_official 237:f3da66175598 168 /**
mbed_official 237:f3da66175598 169 * @brief HAL SMARTCARD Error Code structure definition
mbed_official 237:f3da66175598 170 */
mbed_official 237:f3da66175598 171 typedef enum
mbed_official 237:f3da66175598 172 {
mbed_official 237:f3da66175598 173 HAL_SMARTCARD_ERROR_NONE = 0x00, /*!< No error */
mbed_official 237:f3da66175598 174 HAL_SMARTCARD_ERROR_PE = 0x01, /*!< Parity error */
mbed_official 237:f3da66175598 175 HAL_SMARTCARD_ERROR_NE = 0x02, /*!< Noise error */
mbed_official 237:f3da66175598 176 HAL_SMARTCARD_ERROR_FE = 0x04, /*!< frame error */
mbed_official 237:f3da66175598 177 HAL_SMARTCARD_ERROR_ORE = 0x08, /*!< Overrun error */
mbed_official 237:f3da66175598 178 HAL_SMARTCARD_ERROR_DMA = 0x10, /*!< DMA transfer error */
mbed_official 237:f3da66175598 179 HAL_SMARTCARD_ERROR_RTO = 0x20 /*!< Receiver TimeOut error */
mbed_official 237:f3da66175598 180 }HAL_SMARTCARD_ErrorTypeDef;
mbed_official 237:f3da66175598 181
mbed_official 237:f3da66175598 182 /**
mbed_official 237:f3da66175598 183 * @brief SMARTCARD handle Structure definition
mbed_official 237:f3da66175598 184 */
mbed_official 237:f3da66175598 185 typedef struct
mbed_official 237:f3da66175598 186 {
mbed_official 237:f3da66175598 187 USART_TypeDef *Instance; /* USART registers base address */
mbed_official 237:f3da66175598 188
mbed_official 237:f3da66175598 189 SMARTCARD_InitTypeDef Init; /* SmartCard communication parameters */
mbed_official 237:f3da66175598 190
mbed_official 237:f3da66175598 191 SMARTCARD_AdvFeatureInitTypeDef AdvancedInit; /* SmartCard advanced features initialization parameters */
mbed_official 237:f3da66175598 192
mbed_official 237:f3da66175598 193 uint8_t *pTxBuffPtr; /* Pointer to SmartCard Tx transfer Buffer */
mbed_official 237:f3da66175598 194
mbed_official 237:f3da66175598 195 uint16_t TxXferSize; /* SmartCard Tx Transfer size */
mbed_official 237:f3da66175598 196
mbed_official 237:f3da66175598 197 uint16_t TxXferCount; /* SmartCard Tx Transfer Counter */
mbed_official 237:f3da66175598 198
mbed_official 237:f3da66175598 199 uint8_t *pRxBuffPtr; /* Pointer to SmartCard Rx transfer Buffer */
mbed_official 237:f3da66175598 200
mbed_official 237:f3da66175598 201 uint16_t RxXferSize; /* SmartCard Rx Transfer size */
mbed_official 237:f3da66175598 202
mbed_official 237:f3da66175598 203 uint16_t RxXferCount; /* SmartCard Rx Transfer Counter */
mbed_official 237:f3da66175598 204
mbed_official 237:f3da66175598 205 DMA_HandleTypeDef *hdmatx; /* SmartCard Tx DMA Handle parameters */
mbed_official 237:f3da66175598 206
mbed_official 237:f3da66175598 207 DMA_HandleTypeDef *hdmarx; /* SmartCard Rx DMA Handle parameters */
mbed_official 237:f3da66175598 208
mbed_official 237:f3da66175598 209 HAL_LockTypeDef Lock; /* Locking object */
mbed_official 237:f3da66175598 210
mbed_official 237:f3da66175598 211 HAL_SMARTCARD_StateTypeDef State; /* SmartCard communication state */
mbed_official 237:f3da66175598 212
mbed_official 237:f3da66175598 213 HAL_SMARTCARD_ErrorTypeDef ErrorCode; /* SmartCard Error code */
mbed_official 237:f3da66175598 214
mbed_official 237:f3da66175598 215 }SMARTCARD_HandleTypeDef;
mbed_official 237:f3da66175598 216
mbed_official 237:f3da66175598 217 /**
mbed_official 237:f3da66175598 218 * @brief SMARTCARD clock sources
mbed_official 237:f3da66175598 219 */
mbed_official 237:f3da66175598 220 typedef enum
mbed_official 237:f3da66175598 221 {
mbed_official 237:f3da66175598 222 SMARTCARD_CLOCKSOURCE_PCLK1 = 0x00, /*!< PCLK1 clock source */
mbed_official 237:f3da66175598 223 SMARTCARD_CLOCKSOURCE_PCLK2 = 0x01, /*!< PCLK2 clock source */
mbed_official 237:f3da66175598 224 SMARTCARD_CLOCKSOURCE_HSI = 0x02, /*!< HSI clock source */
mbed_official 237:f3da66175598 225 SMARTCARD_CLOCKSOURCE_SYSCLK = 0x04, /*!< SYSCLK clock source */
mbed_official 237:f3da66175598 226 SMARTCARD_CLOCKSOURCE_LSE = 0x08, /*!< LSE clock source */
mbed_official 237:f3da66175598 227 SMARTCARD_CLOCKSOURCE_UNDEFINED = 0x10 /*!< undefined clock source */
mbed_official 237:f3da66175598 228 }SMARTCARD_ClockSourceTypeDef;
mbed_official 237:f3da66175598 229
mbed_official 237:f3da66175598 230
mbed_official 237:f3da66175598 231 /* Exported constants --------------------------------------------------------*/
mbed_official 237:f3da66175598 232 /** @defgroup SMARTCARD_Exported_Constants
mbed_official 237:f3da66175598 233 * @{
mbed_official 237:f3da66175598 234 */
mbed_official 237:f3da66175598 235
mbed_official 237:f3da66175598 236 /** @defgroup SMARTCARD_Word_Length SMARTCARD Word Length
mbed_official 237:f3da66175598 237 * @{
mbed_official 237:f3da66175598 238 */
mbed_official 237:f3da66175598 239 #define SMARTCARD_WORDLENGTH_9B ((uint32_t)USART_CR1_M0)
mbed_official 237:f3da66175598 240 #define IS_SMARTCARD_WORD_LENGTH(LENGTH) ((LENGTH) == SMARTCARD_WORDLENGTH_9B)
mbed_official 237:f3da66175598 241 /**
mbed_official 237:f3da66175598 242 * @}
mbed_official 237:f3da66175598 243 */
mbed_official 237:f3da66175598 244
mbed_official 237:f3da66175598 245 /** @defgroup SMARTCARD_Stop_Bits SMARTCARD Stop Bits
mbed_official 237:f3da66175598 246 * @{
mbed_official 237:f3da66175598 247 */
mbed_official 237:f3da66175598 248 #define SMARTCARD_STOPBITS_1_5 ((uint32_t)(USART_CR2_STOP))
mbed_official 237:f3da66175598 249 #define IS_SMARTCARD_STOPBITS(STOPBITS) ((STOPBITS) == SMARTCARD_STOPBITS_1_5)
mbed_official 237:f3da66175598 250 /**
mbed_official 237:f3da66175598 251 * @}
mbed_official 237:f3da66175598 252 */
mbed_official 237:f3da66175598 253
mbed_official 237:f3da66175598 254 /** @defgroup SMARTCARD_Parity SMARTCARD Parity
mbed_official 237:f3da66175598 255 * @{
mbed_official 237:f3da66175598 256 */
mbed_official 237:f3da66175598 257 #define SMARTCARD_PARITY_EVEN ((uint16_t)USART_CR1_PCE)
mbed_official 237:f3da66175598 258 #define SMARTCARD_PARITY_ODD ((uint16_t)(USART_CR1_PCE | USART_CR1_PS))
mbed_official 237:f3da66175598 259 #define IS_SMARTCARD_PARITY(PARITY) (((PARITY) == SMARTCARD_PARITY_EVEN) || \
mbed_official 237:f3da66175598 260 ((PARITY) == SMARTCARD_PARITY_ODD))
mbed_official 237:f3da66175598 261 /**
mbed_official 237:f3da66175598 262 * @}
mbed_official 237:f3da66175598 263 */
mbed_official 237:f3da66175598 264
mbed_official 237:f3da66175598 265 /** @defgroup SMARTCARD_Mode SMARTCARD Transfer Mode
mbed_official 237:f3da66175598 266 * @{
mbed_official 237:f3da66175598 267 */
mbed_official 237:f3da66175598 268 #define SMARTCARD_MODE_RX ((uint16_t)USART_CR1_RE)
mbed_official 237:f3da66175598 269 #define SMARTCARD_MODE_TX ((uint16_t)USART_CR1_TE)
mbed_official 237:f3da66175598 270 #define SMARTCARD_MODE_TX_RX ((uint16_t)(USART_CR1_TE |USART_CR1_RE))
mbed_official 237:f3da66175598 271 #define IS_SMARTCARD_MODE(MODE) ((((MODE) & (uint16_t)0xFFF3) == 0x00) && ((MODE) != (uint16_t)0x00))
mbed_official 237:f3da66175598 272 /**
mbed_official 237:f3da66175598 273 * @}
mbed_official 237:f3da66175598 274 */
mbed_official 237:f3da66175598 275
mbed_official 237:f3da66175598 276 /** @defgroup SMARTCARD_Clock_Polarity SMARTCARD Clock Polarity
mbed_official 237:f3da66175598 277 * @{
mbed_official 237:f3da66175598 278 */
mbed_official 237:f3da66175598 279 #define SMARTCARD_POLARITY_LOW ((uint16_t)0x0000)
mbed_official 237:f3da66175598 280 #define SMARTCARD_POLARITY_HIGH ((uint16_t)USART_CR2_CPOL)
mbed_official 237:f3da66175598 281 #define IS_SMARTCARD_POLARITY(CPOL) (((CPOL) == SMARTCARD_POLARITY_LOW) || ((CPOL) == SMARTCARD_POLARITY_HIGH))
mbed_official 237:f3da66175598 282 /**
mbed_official 237:f3da66175598 283 * @}
mbed_official 237:f3da66175598 284 */
mbed_official 237:f3da66175598 285
mbed_official 237:f3da66175598 286 /** @defgroup SMARTCARD_Clock_Phase SMARTCARD Clock Phase
mbed_official 237:f3da66175598 287 * @{
mbed_official 237:f3da66175598 288 */
mbed_official 237:f3da66175598 289 #define SMARTCARD_PHASE_1EDGE ((uint16_t)0x0000)
mbed_official 237:f3da66175598 290 #define SMARTCARD_PHASE_2EDGE ((uint16_t)USART_CR2_CPHA)
mbed_official 237:f3da66175598 291 #define IS_SMARTCARD_PHASE(CPHA) (((CPHA) == SMARTCARD_PHASE_1EDGE) || ((CPHA) == SMARTCARD_PHASE_2EDGE))
mbed_official 237:f3da66175598 292 /**
mbed_official 237:f3da66175598 293 * @}
mbed_official 237:f3da66175598 294 */
mbed_official 237:f3da66175598 295
mbed_official 237:f3da66175598 296 /** @defgroup SMARTCARD_Last_Bit SMARTCARD Last Bit
mbed_official 237:f3da66175598 297 * @{
mbed_official 237:f3da66175598 298 */
mbed_official 237:f3da66175598 299 #define SMARTCARD_LASTBIT_DISABLED ((uint16_t)0x0000)
mbed_official 237:f3da66175598 300 #define SMARTCARD_LASTBIT_ENABLED ((uint16_t)USART_CR2_LBCL)
mbed_official 237:f3da66175598 301 #define IS_SMARTCARD_LASTBIT(LASTBIT) (((LASTBIT) == SMARTCARD_LASTBIT_DISABLED) || \
mbed_official 237:f3da66175598 302 ((LASTBIT) == SMARTCARD_LASTBIT_ENABLED))
mbed_official 237:f3da66175598 303 /**
mbed_official 237:f3da66175598 304 * @}
mbed_official 237:f3da66175598 305 */
mbed_official 237:f3da66175598 306
mbed_official 237:f3da66175598 307 /** @defgroup SMARTCARD_OneBit_Sampling SMARTCARD One Bit Sampling Method
mbed_official 237:f3da66175598 308 * @{
mbed_official 237:f3da66175598 309 */
mbed_official 237:f3da66175598 310 #define SMARTCARD_ONEBIT_SAMPLING_DISABLED ((uint16_t)0x0000)
mbed_official 237:f3da66175598 311 #define SMARTCARD_ONEBIT_SAMPLING_ENABLED ((uint16_t)USART_CR3_ONEBIT)
mbed_official 237:f3da66175598 312 #define IS_SMARTCARD_ONEBIT_SAMPLING(ONEBIT) (((ONEBIT) == SMARTCARD_ONEBIT_SAMPLING_DISABLED) || \
mbed_official 237:f3da66175598 313 ((ONEBIT) == SMARTCARD_ONEBIT_SAMPLING_ENABLED))
mbed_official 237:f3da66175598 314 /**
mbed_official 237:f3da66175598 315 * @}
mbed_official 237:f3da66175598 316 */
mbed_official 237:f3da66175598 317
mbed_official 237:f3da66175598 318
mbed_official 237:f3da66175598 319 /** @defgroup SMARTCARD_NACK_Enable SMARTCARD NACK Enable
mbed_official 237:f3da66175598 320 * @{
mbed_official 237:f3da66175598 321 */
mbed_official 237:f3da66175598 322 #define SMARTCARD_NACK_ENABLED ((uint16_t)USART_CR3_NACK)
mbed_official 237:f3da66175598 323 #define SMARTCARD_NACK_DISABLED ((uint16_t)0x0000)
mbed_official 237:f3da66175598 324 #define IS_SMARTCARD_NACK(NACK) (((NACK) == SMARTCARD_NACK_ENABLED) || \
mbed_official 237:f3da66175598 325 ((NACK) == SMARTCARD_NACK_DISABLED))
mbed_official 237:f3da66175598 326 /**
mbed_official 237:f3da66175598 327 * @}
mbed_official 237:f3da66175598 328 */
mbed_official 237:f3da66175598 329
mbed_official 237:f3da66175598 330 /** @defgroup SMARTCARD_Timeout_Enable SMARTCARD Timeout Enable
mbed_official 237:f3da66175598 331 * @{
mbed_official 237:f3da66175598 332 */
mbed_official 237:f3da66175598 333 #define SMARTCARD_TIMEOUT_DISABLED ((uint32_t)0x00000000)
mbed_official 237:f3da66175598 334 #define SMARTCARD_TIMEOUT_ENABLED ((uint32_t)USART_CR2_RTOEN)
mbed_official 237:f3da66175598 335 #define IS_SMARTCARD_TIMEOUT(TIMEOUT) (((TIMEOUT) == SMARTCARD_TIMEOUT_DISABLED) || \
mbed_official 237:f3da66175598 336 ((TIMEOUT) == SMARTCARD_TIMEOUT_ENABLED))
mbed_official 237:f3da66175598 337 /**
mbed_official 237:f3da66175598 338 * @}
mbed_official 237:f3da66175598 339 */
mbed_official 237:f3da66175598 340
mbed_official 237:f3da66175598 341 /** @defgroup SMARTCARD_Advanced_Features_Initialization_Type SMARTCARD advanced feature initialization type
mbed_official 237:f3da66175598 342 * @{
mbed_official 237:f3da66175598 343 */
mbed_official 237:f3da66175598 344 #define SMARTCARD_ADVFEATURE_NO_INIT ((uint32_t)0x00000000)
mbed_official 237:f3da66175598 345 #define SMARTCARD_ADVFEATURE_TXINVERT_INIT ((uint32_t)0x00000001)
mbed_official 237:f3da66175598 346 #define SMARTCARD_ADVFEATURE_RXINVERT_INIT ((uint32_t)0x00000002)
mbed_official 237:f3da66175598 347 #define SMARTCARD_ADVFEATURE_DATAINVERT_INIT ((uint32_t)0x00000004)
mbed_official 237:f3da66175598 348 #define SMARTCARD_ADVFEATURE_SWAP_INIT ((uint32_t)0x00000008)
mbed_official 237:f3da66175598 349 #define SMARTCARD_ADVFEATURE_RXOVERRUNDISABLE_INIT ((uint32_t)0x00000010)
mbed_official 237:f3da66175598 350 #define SMARTCARD_ADVFEATURE_DMADISABLEONERROR_INIT ((uint32_t)0x00000020)
mbed_official 237:f3da66175598 351 #define SMARTCARD_ADVFEATURE_MSBFIRST_INIT ((uint32_t)0x00000080)
mbed_official 237:f3da66175598 352 #define IS_SMARTCARD_ADVFEATURE_INIT(INIT) ((INIT) <= (SMARTCARD_ADVFEATURE_NO_INIT | \
mbed_official 237:f3da66175598 353 SMARTCARD_ADVFEATURE_TXINVERT_INIT | \
mbed_official 237:f3da66175598 354 SMARTCARD_ADVFEATURE_RXINVERT_INIT | \
mbed_official 237:f3da66175598 355 SMARTCARD_ADVFEATURE_DATAINVERT_INIT | \
mbed_official 237:f3da66175598 356 SMARTCARD_ADVFEATURE_SWAP_INIT | \
mbed_official 237:f3da66175598 357 SMARTCARD_ADVFEATURE_RXOVERRUNDISABLE_INIT | \
mbed_official 237:f3da66175598 358 SMARTCARD_ADVFEATURE_DMADISABLEONERROR_INIT | \
mbed_official 237:f3da66175598 359 SMARTCARD_ADVFEATURE_MSBFIRST_INIT))
mbed_official 237:f3da66175598 360 /**
mbed_official 237:f3da66175598 361 * @}
mbed_official 237:f3da66175598 362 */
mbed_official 237:f3da66175598 363
mbed_official 237:f3da66175598 364 /** @defgroup SMARTCARD_Tx_Inv SMARTCARD advanced feature TX pin active level inversion
mbed_official 237:f3da66175598 365 * @{
mbed_official 237:f3da66175598 366 */
mbed_official 237:f3da66175598 367 #define SMARTCARD_ADVFEATURE_TXINV_DISABLE ((uint32_t)0x00000000)
mbed_official 237:f3da66175598 368 #define SMARTCARD_ADVFEATURE_TXINV_ENABLE ((uint32_t)USART_CR2_TXINV)
mbed_official 237:f3da66175598 369 #define IS_SMARTCARD_ADVFEATURE_TXINV(TXINV) (((TXINV) == SMARTCARD_ADVFEATURE_TXINV_DISABLE) || \
mbed_official 237:f3da66175598 370 ((TXINV) == SMARTCARD_ADVFEATURE_TXINV_ENABLE))
mbed_official 237:f3da66175598 371 /**
mbed_official 237:f3da66175598 372 * @}
mbed_official 237:f3da66175598 373 */
mbed_official 237:f3da66175598 374
mbed_official 237:f3da66175598 375 /** @defgroup SMARTCARD_Rx_Inv SMARTCARD advanced feature RX pin active level inversion
mbed_official 237:f3da66175598 376 * @{
mbed_official 237:f3da66175598 377 */
mbed_official 237:f3da66175598 378 #define SMARTCARD_ADVFEATURE_RXINV_DISABLE ((uint32_t)0x00000000)
mbed_official 237:f3da66175598 379 #define SMARTCARD_ADVFEATURE_RXINV_ENABLE ((uint32_t)USART_CR2_RXINV)
mbed_official 237:f3da66175598 380 #define IS_SMARTCARD_ADVFEATURE_RXINV(RXINV) (((RXINV) == SMARTCARD_ADVFEATURE_RXINV_DISABLE) || \
mbed_official 237:f3da66175598 381 ((RXINV) == SMARTCARD_ADVFEATURE_RXINV_ENABLE))
mbed_official 237:f3da66175598 382 /**
mbed_official 237:f3da66175598 383 * @}
mbed_official 237:f3da66175598 384 */
mbed_official 237:f3da66175598 385
mbed_official 237:f3da66175598 386 /** @defgroup SMARTCARD_Data_Inv SMARTCARD advanced feature Binary Data inversion
mbed_official 237:f3da66175598 387 * @{
mbed_official 237:f3da66175598 388 */
mbed_official 237:f3da66175598 389 #define SMARTCARD_ADVFEATURE_DATAINV_DISABLE ((uint32_t)0x00000000)
mbed_official 237:f3da66175598 390 #define SMARTCARD_ADVFEATURE_DATAINV_ENABLE ((uint32_t)USART_CR2_DATAINV)
mbed_official 237:f3da66175598 391 #define IS_SMARTCARD_ADVFEATURE_DATAINV(DATAINV) (((DATAINV) == SMARTCARD_ADVFEATURE_DATAINV_DISABLE) || \
mbed_official 237:f3da66175598 392 ((DATAINV) == SMARTCARD_ADVFEATURE_DATAINV_ENABLE))
mbed_official 237:f3da66175598 393 /**
mbed_official 237:f3da66175598 394 * @}
mbed_official 237:f3da66175598 395 */
mbed_official 237:f3da66175598 396
mbed_official 237:f3da66175598 397 /** @defgroup SMARTCARD_Rx_Tx_Swap SMARTCARD advanced feature RX TX pins swap
mbed_official 237:f3da66175598 398 * @{
mbed_official 237:f3da66175598 399 */
mbed_official 237:f3da66175598 400 #define SMARTCARD_ADVFEATURE_SWAP_DISABLE ((uint32_t)0x00000000)
mbed_official 237:f3da66175598 401 #define SMARTCARD_ADVFEATURE_SWAP_ENABLE ((uint32_t)USART_CR2_SWAP)
mbed_official 237:f3da66175598 402 #define IS_SMARTCARD_ADVFEATURE_SWAP(SWAP) (((SWAP) == SMARTCARD_ADVFEATURE_SWAP_DISABLE) || \
mbed_official 237:f3da66175598 403 ((SWAP) == SMARTCARD_ADVFEATURE_SWAP_ENABLE))
mbed_official 237:f3da66175598 404 /**
mbed_official 237:f3da66175598 405 * @}
mbed_official 237:f3da66175598 406 */
mbed_official 237:f3da66175598 407
mbed_official 237:f3da66175598 408 /** @defgroup SMARTCARD_Overrun_Disable SMARTCARD advanced feature Overrun Disable
mbed_official 237:f3da66175598 409 * @{
mbed_official 237:f3da66175598 410 */
mbed_official 237:f3da66175598 411 #define SMARTCARD_ADVFEATURE_OVERRUN_ENABLE ((uint32_t)0x00000000)
mbed_official 237:f3da66175598 412 #define SMARTCARD_ADVFEATURE_OVERRUN_DISABLE ((uint32_t)USART_CR3_OVRDIS)
mbed_official 237:f3da66175598 413 #define IS_SMARTCARD_OVERRUN(OVERRUN) (((OVERRUN) == SMARTCARD_ADVFEATURE_OVERRUN_ENABLE) || \
mbed_official 237:f3da66175598 414 ((OVERRUN) == SMARTCARD_ADVFEATURE_OVERRUN_DISABLE))
mbed_official 237:f3da66175598 415 /**
mbed_official 237:f3da66175598 416 * @}
mbed_official 237:f3da66175598 417 */
mbed_official 237:f3da66175598 418
mbed_official 237:f3da66175598 419 /** @defgroup SMARTCARD_DMA_Disable_on_Rx_Error SMARTCARD advanced feature DMA Disable on Rx Error
mbed_official 237:f3da66175598 420 * @{
mbed_official 237:f3da66175598 421 */
mbed_official 237:f3da66175598 422 #define SMARTCARD_ADVFEATURE_DMA_ENABLEONRXERROR ((uint32_t)0x00000000)
mbed_official 237:f3da66175598 423 #define SMARTCARD_ADVFEATURE_DMA_DISABLEONRXERROR ((uint32_t)USART_CR3_DDRE)
mbed_official 237:f3da66175598 424 #define IS_SMARTCARD_ADVFEATURE_DMAONRXERROR(DMA) (((DMA) == SMARTCARD_ADVFEATURE_DMA_ENABLEONRXERROR) || \
mbed_official 237:f3da66175598 425 ((DMA) == SMARTCARD_ADVFEATURE_DMA_DISABLEONRXERROR))
mbed_official 237:f3da66175598 426 /**
mbed_official 237:f3da66175598 427 * @}
mbed_official 237:f3da66175598 428 */
mbed_official 237:f3da66175598 429
mbed_official 237:f3da66175598 430 /** @defgroup SMARTCARD_MSB_First SMARTCARD advanced feature MSB first
mbed_official 237:f3da66175598 431 * @{
mbed_official 237:f3da66175598 432 */
mbed_official 237:f3da66175598 433 #define SMARTCARD_ADVFEATURE_MSBFIRST_DISABLE ((uint32_t)0x00000000)
mbed_official 237:f3da66175598 434 #define SMARTCARD_ADVFEATURE_MSBFIRST_ENABLE ((uint32_t)USART_CR2_MSBFIRST)
mbed_official 237:f3da66175598 435 #define IS_SMARTCARD_ADVFEATURE_MSBFIRST(MSBFIRST) (((MSBFIRST) == SMARTCARD_ADVFEATURE_MSBFIRST_DISABLE) || \
mbed_official 237:f3da66175598 436 ((MSBFIRST) == SMARTCARD_ADVFEATURE_MSBFIRST_ENABLE))
mbed_official 237:f3da66175598 437 /**
mbed_official 237:f3da66175598 438 * @}
mbed_official 237:f3da66175598 439 */
mbed_official 237:f3da66175598 440
mbed_official 237:f3da66175598 441 /** @defgroup SmartCard_Flags SMARTCARD Flags
mbed_official 237:f3da66175598 442 * Elements values convention: 0xXXXX
mbed_official 237:f3da66175598 443 * - 0xXXXX : Flag mask in the ISR register
mbed_official 237:f3da66175598 444 * @{
mbed_official 237:f3da66175598 445 */
mbed_official 237:f3da66175598 446 #define SMARTCARD_FLAG_REACK ((uint32_t)0x00400000)
mbed_official 237:f3da66175598 447 #define SMARTCARD_FLAG_TEACK ((uint32_t)0x00200000)
mbed_official 237:f3da66175598 448 #define SMARTCARD_FLAG_BUSY ((uint32_t)0x00010000)
mbed_official 237:f3da66175598 449 #define SMARTCARD_FLAG_EOBF ((uint32_t)0x00001000)
mbed_official 237:f3da66175598 450 #define SMARTCARD_FLAG_RTOF ((uint32_t)0x00000800)
mbed_official 237:f3da66175598 451 #define SMARTCARD_FLAG_TXE ((uint32_t)0x00000080)
mbed_official 237:f3da66175598 452 #define SMARTCARD_FLAG_TC ((uint32_t)0x00000040)
mbed_official 237:f3da66175598 453 #define SMARTCARD_FLAG_RXNE ((uint32_t)0x00000020)
mbed_official 237:f3da66175598 454 #define SMARTCARD_FLAG_ORE ((uint32_t)0x00000008)
mbed_official 237:f3da66175598 455 #define SMARTCARD_FLAG_NE ((uint32_t)0x00000004)
mbed_official 237:f3da66175598 456 #define SMARTCARD_FLAG_FE ((uint32_t)0x00000002)
mbed_official 237:f3da66175598 457 #define SMARTCARD_FLAG_PE ((uint32_t)0x00000001)
mbed_official 237:f3da66175598 458 /**
mbed_official 237:f3da66175598 459 * @}
mbed_official 237:f3da66175598 460 */
mbed_official 237:f3da66175598 461
mbed_official 237:f3da66175598 462 /** @defgroup SMARTCARD_Interrupt_definition SMARTCARD Interrupts Definition
mbed_official 237:f3da66175598 463 * Elements values convention: 0000ZZZZ0XXYYYYYb
mbed_official 237:f3da66175598 464 * - YYYYY : Interrupt source position in the XX register (5bits)
mbed_official 237:f3da66175598 465 * - XX : Interrupt source register (2bits)
mbed_official 237:f3da66175598 466 * - 01: CR1 register
mbed_official 237:f3da66175598 467 * - 10: CR2 register
mbed_official 237:f3da66175598 468 * - 11: CR3 register
mbed_official 237:f3da66175598 469 * - ZZZZ : Flag position in the ISR register(4bits)
mbed_official 237:f3da66175598 470 * @{
mbed_official 237:f3da66175598 471 */
mbed_official 237:f3da66175598 472
mbed_official 237:f3da66175598 473 #define SMARTCARD_IT_PE ((uint16_t)0x0028)
mbed_official 237:f3da66175598 474 #define SMARTCARD_IT_TXE ((uint16_t)0x0727)
mbed_official 237:f3da66175598 475 #define SMARTCARD_IT_TC ((uint16_t)0x0626)
mbed_official 237:f3da66175598 476 #define SMARTCARD_IT_RXNE ((uint16_t)0x0525)
mbed_official 237:f3da66175598 477
mbed_official 237:f3da66175598 478 #define SMARTCARD_IT_ERR ((uint16_t)0x0060)
mbed_official 237:f3da66175598 479 #define SMARTCARD_IT_ORE ((uint16_t)0x0300)
mbed_official 237:f3da66175598 480 #define SMARTCARD_IT_NE ((uint16_t)0x0200)
mbed_official 237:f3da66175598 481 #define SMARTCARD_IT_FE ((uint16_t)0x0100)
mbed_official 237:f3da66175598 482
mbed_official 237:f3da66175598 483 #define SMARTCARD_IT_EOB ((uint16_t)0x0C3B)
mbed_official 237:f3da66175598 484 #define SMARTCARD_IT_RTO ((uint16_t)0x0B3A)
mbed_official 237:f3da66175598 485 /**
mbed_official 237:f3da66175598 486 * @}
mbed_official 237:f3da66175598 487 */
mbed_official 237:f3da66175598 488
mbed_official 237:f3da66175598 489
mbed_official 237:f3da66175598 490 /** @defgroup SMARTCARD_IT_CLEAR_Flags SMARTCARD Interruption Clear Flags
mbed_official 237:f3da66175598 491 * @{
mbed_official 237:f3da66175598 492 */
mbed_official 237:f3da66175598 493 #define SMARTCARD_CLEAR_PEF USART_ICR_PECF /*!< Parity Error Clear Flag */
mbed_official 237:f3da66175598 494 #define SMARTCARD_CLEAR_FEF USART_ICR_FECF /*!< Framing Error Clear Flag */
mbed_official 237:f3da66175598 495 #define SMARTCARD_CLEAR_NEF USART_ICR_NCF /*!< Noise detected Clear Flag */
mbed_official 237:f3da66175598 496 #define SMARTCARD_CLEAR_OREF USART_ICR_ORECF /*!< OverRun Error Clear Flag */
mbed_official 237:f3da66175598 497 #define SMARTCARD_CLEAR_TCF USART_ICR_TCCF /*!< Transmission Complete Clear Flag */
mbed_official 237:f3da66175598 498 #define SMARTCARD_CLEAR_RTOF USART_ICR_RTOCF /*!< Receiver Time Out Clear Flag */
mbed_official 237:f3da66175598 499 #define SMARTCARD_CLEAR_EOBF USART_ICR_EOBCF /*!< End Of Block Clear Flag */
mbed_official 237:f3da66175598 500 /**
mbed_official 237:f3da66175598 501 * @}
mbed_official 237:f3da66175598 502 */
mbed_official 237:f3da66175598 503
mbed_official 237:f3da66175598 504 /** @defgroup SMARTCARD_Request_Parameters SMARTCARD Request Parameters
mbed_official 237:f3da66175598 505 * @{
mbed_official 237:f3da66175598 506 */
mbed_official 237:f3da66175598 507 #define SMARTCARD_RXDATA_FLUSH_REQUEST ((uint16_t)USART_RQR_RXFRQ) /*!< Receive Data flush Request */
mbed_official 237:f3da66175598 508 #define SMARTCARD_TXDATA_FLUSH_REQUEST ((uint16_t)USART_RQR_TXFRQ) /*!< Transmit data flush Request */
mbed_official 237:f3da66175598 509 #define IS_SMARTCARD_REQUEST_PARAMETER(PARAM) (((PARAM) == SMARTCARD_RXDATA_FLUSH_REQUEST) || \
mbed_official 237:f3da66175598 510 ((PARAM) == SMARTCARD_TXDATA_FLUSH_REQUEST))
mbed_official 237:f3da66175598 511 /**
mbed_official 237:f3da66175598 512 * @}
mbed_official 237:f3da66175598 513 */
mbed_official 237:f3da66175598 514
mbed_official 237:f3da66175598 515
mbed_official 237:f3da66175598 516 /** @defgroup SMARTCARD_CR3_SCARCNT_LSB_POS SMARTCARD auto retry counter LSB position in CR3 register
mbed_official 237:f3da66175598 517 * @{
mbed_official 237:f3da66175598 518 */
mbed_official 237:f3da66175598 519 #define SMARTCARD_CR3_SCARCNT_LSB_POS ((uint32_t) 17)
mbed_official 237:f3da66175598 520 /**
mbed_official 237:f3da66175598 521 * @}
mbed_official 237:f3da66175598 522 */
mbed_official 237:f3da66175598 523
mbed_official 237:f3da66175598 524 /** @defgroup SMARTCARD_GTPR_GT_LSB_POS SMARTCARD guard time value LSB position in GTPR register
mbed_official 237:f3da66175598 525 * @{
mbed_official 237:f3da66175598 526 */
mbed_official 237:f3da66175598 527 #define SMARTCARD_GTPR_GT_LSB_POS ((uint32_t) 8)
mbed_official 237:f3da66175598 528 /**
mbed_official 237:f3da66175598 529 * @}
mbed_official 237:f3da66175598 530 */
mbed_official 237:f3da66175598 531
mbed_official 237:f3da66175598 532 /** @defgroup SMARTCARD_RTOR_BLEN_LSB_POS SMARTCARD block length LSB position in RTOR register
mbed_official 237:f3da66175598 533 * @{
mbed_official 237:f3da66175598 534 */
mbed_official 237:f3da66175598 535 #define SMARTCARD_RTOR_BLEN_LSB_POS ((uint32_t) 24)
mbed_official 237:f3da66175598 536 /**
mbed_official 237:f3da66175598 537 * @}
mbed_official 237:f3da66175598 538 */
mbed_official 237:f3da66175598 539
mbed_official 237:f3da66175598 540 /** @defgroup SMARTCARD_Interruption_Mask SMARTCARD interruptions flag mask
mbed_official 237:f3da66175598 541 * @{
mbed_official 237:f3da66175598 542 */
mbed_official 237:f3da66175598 543 #define SMARTCARD_IT_MASK ((uint16_t)0x001F)
mbed_official 237:f3da66175598 544 /**
mbed_official 237:f3da66175598 545 * @}
mbed_official 237:f3da66175598 546 */
mbed_official 237:f3da66175598 547
mbed_official 237:f3da66175598 548 /**
mbed_official 237:f3da66175598 549 * @}
mbed_official 237:f3da66175598 550 */
mbed_official 237:f3da66175598 551
mbed_official 237:f3da66175598 552 /* Exported macros -----------------------------------------------------------*/
mbed_official 237:f3da66175598 553 /** @defgroup SMARTCARD_Exported_Macros
mbed_official 237:f3da66175598 554 * @{
mbed_official 237:f3da66175598 555 */
mbed_official 237:f3da66175598 556
mbed_official 237:f3da66175598 557 /** @brief Reset SMARTCARD handle state
mbed_official 237:f3da66175598 558 * @param __HANDLE__: SMARTCARD handle.
mbed_official 237:f3da66175598 559 * @retval None
mbed_official 237:f3da66175598 560 */
mbed_official 237:f3da66175598 561 #define __HAL_SMARTCARD_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SMARTCARD_STATE_RESET)
mbed_official 237:f3da66175598 562
mbed_official 237:f3da66175598 563 /** @brief Checks whether the specified Smartcard flag is set or not.
mbed_official 237:f3da66175598 564 * @param __HANDLE__: specifies the SMARTCARD Handle.
mbed_official 237:f3da66175598 565 * The Handle Instance can be USARTx where x: 1, 2 or 3 to select the USART peripheral.
mbed_official 237:f3da66175598 566 * @param __FLAG__: specifies the flag to check.
mbed_official 237:f3da66175598 567 * This parameter can be one of the following values:
mbed_official 237:f3da66175598 568 * @arg SMARTCARD_FLAG_REACK: Receive enable ackowledge flag
mbed_official 237:f3da66175598 569 * @arg SMARTCARD_FLAG_TEACK: Transmit enable ackowledge flag
mbed_official 237:f3da66175598 570 * @arg SMARTCARD_FLAG_BUSY: Busy flag
mbed_official 237:f3da66175598 571 * @arg SMARTCARD_FLAG_EOBF: End of block flag
mbed_official 237:f3da66175598 572 * @arg SMARTCARD_FLAG_RTOF: Receiver timeout flag
mbed_official 237:f3da66175598 573 * @arg SMARTCARD_FLAG_TXE: Transmit data register empty flag
mbed_official 237:f3da66175598 574 * @arg SMARTCARD_FLAG_TC: Transmission Complete flag
mbed_official 237:f3da66175598 575 * @arg SMARTCARD_FLAG_RXNE: Receive data register not empty flag
mbed_official 237:f3da66175598 576 * @arg SMARTCARD_FLAG_ORE: OverRun Error flag
mbed_official 237:f3da66175598 577 * @arg SMARTCARD_FLAG_NE: Noise Error flag
mbed_official 237:f3da66175598 578 * @arg SMARTCARD_FLAG_FE: Framing Error flag
mbed_official 237:f3da66175598 579 * @arg SMARTCARD_FLAG_PE: Parity Error flag
mbed_official 237:f3da66175598 580 * @retval The new state of __FLAG__ (TRUE or FALSE).
mbed_official 237:f3da66175598 581 */
mbed_official 237:f3da66175598 582 #define __HAL_SMARTCARD_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->ISR & (__FLAG__)) == (__FLAG__))
mbed_official 237:f3da66175598 583
mbed_official 237:f3da66175598 584
mbed_official 237:f3da66175598 585 /** @brief Enables the specified SmartCard interrupt.
mbed_official 237:f3da66175598 586 * @param __HANDLE__: specifies the SMARTCARD Handle.
mbed_official 237:f3da66175598 587 * The Handle Instance can be USARTx where x: 1, 2 or 3 to select the USART peripheral.
mbed_official 237:f3da66175598 588 * @param __INTERRUPT__: specifies the SMARTCARD interrupt to enable.
mbed_official 237:f3da66175598 589 * This parameter can be one of the following values:
mbed_official 237:f3da66175598 590 * @arg SMARTCARD_IT_EOBF: End Of Block interrupt
mbed_official 237:f3da66175598 591 * @arg SMARTCARD_IT_RTOF: Receive TimeOut interrupt
mbed_official 237:f3da66175598 592 * @arg SMARTCARD_IT_TXE: Transmit Data Register empty interrupt
mbed_official 237:f3da66175598 593 * @arg SMARTCARD_IT_TC: Transmission complete interrupt
mbed_official 237:f3da66175598 594 * @arg SMARTCARD_IT_RXNE: Receive Data register not empty interrupt
mbed_official 237:f3da66175598 595 * @arg SMARTCARD_IT_PE: Parity Error interrupt
mbed_official 237:f3da66175598 596 * @arg SMARTCARD_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
mbed_official 237:f3da66175598 597 * @retval None
mbed_official 237:f3da66175598 598 */
mbed_official 237:f3da66175598 599 #define __HAL_SMARTCARD_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((((uint8_t)(__INTERRUPT__)) >> 5U) == 1)? ((__HANDLE__)->Instance->CR1 |= (1U << ((__INTERRUPT__) & SMARTCARD_IT_MASK))): \
mbed_official 237:f3da66175598 600 ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2)? ((__HANDLE__)->Instance->CR2 |= (1U << ((__INTERRUPT__) & SMARTCARD_IT_MASK))): \
mbed_official 237:f3da66175598 601 ((__HANDLE__)->Instance->CR3 |= (1U << ((__INTERRUPT__) & SMARTCARD_IT_MASK))))
mbed_official 237:f3da66175598 602
mbed_official 237:f3da66175598 603 /** @brief Disables the specified SmartCard interrupt.
mbed_official 237:f3da66175598 604 * @param __HANDLE__: specifies the SMARTCARD Handle.
mbed_official 237:f3da66175598 605 * The Handle Instance can be USARTx where x: 1, 2 or 3 to select the USART peripheral.
mbed_official 237:f3da66175598 606 * @param __INTERRUPT__: specifies the SMARTCARD interrupt to disable.
mbed_official 237:f3da66175598 607 * This parameter can be one of the following values:
mbed_official 237:f3da66175598 608 * @arg SMARTCARD_IT_EOBF: End Of Block interrupt
mbed_official 237:f3da66175598 609 * @arg SMARTCARD_IT_RTOF: Receive TimeOut interrupt
mbed_official 237:f3da66175598 610 * @arg SMARTCARD_IT_TXE: Transmit Data Register empty interrupt
mbed_official 237:f3da66175598 611 * @arg SMARTCARD_IT_TC: Transmission complete interrupt
mbed_official 237:f3da66175598 612 * @arg SMARTCARD_IT_RXNE: Receive Data register not empty interrupt
mbed_official 237:f3da66175598 613 * @arg SMARTCARD_IT_PE: Parity Error interrupt
mbed_official 237:f3da66175598 614 * @arg SMARTCARD_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
mbed_official 237:f3da66175598 615 * @retval None
mbed_official 237:f3da66175598 616 */
mbed_official 237:f3da66175598 617 #define __HAL_SMARTCARD_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((((uint8_t)(__INTERRUPT__)) >> 5U) == 1)? ((__HANDLE__)->Instance->CR1 &= ~ (1U << ((__INTERRUPT__) & SMARTCARD_IT_MASK))): \
mbed_official 237:f3da66175598 618 ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2)? ((__HANDLE__)->Instance->CR2 &= ~ (1U << ((__INTERRUPT__) & SMARTCARD_IT_MASK))): \
mbed_official 237:f3da66175598 619 ((__HANDLE__)->Instance->CR3 &= ~ (1U << ((__INTERRUPT__) & SMARTCARD_IT_MASK))))
mbed_official 237:f3da66175598 620
mbed_official 237:f3da66175598 621
mbed_official 237:f3da66175598 622 /** @brief Checks whether the specified SmartCard interrupt has occurred or not.
mbed_official 237:f3da66175598 623 * @param __HANDLE__: specifies the SMARTCARD Handle.
mbed_official 237:f3da66175598 624 * The Handle Instance can be USARTx where x: 1, 2 or 3 to select the USART peripheral.
mbed_official 237:f3da66175598 625 * @param __IT__: specifies the SMARTCARD interrupt to check.
mbed_official 237:f3da66175598 626 * This parameter can be one of the following values:
mbed_official 237:f3da66175598 627 * @arg SMARTCARD_IT_EOBF: End Of Block interrupt
mbed_official 237:f3da66175598 628 * @arg SMARTCARD_IT_RTOF: Receive TimeOut interrupt
mbed_official 237:f3da66175598 629 * @arg SMARTCARD_IT_TXE: Transmit Data Register empty interrupt
mbed_official 237:f3da66175598 630 * @arg SMARTCARD_IT_TC: Transmission complete interrupt
mbed_official 237:f3da66175598 631 * @arg SMARTCARD_IT_RXNE: Receive Data register not empty interrupt
mbed_official 237:f3da66175598 632 * @arg SMARTCARD_IT_ORE: OverRun Error interrupt
mbed_official 237:f3da66175598 633 * @arg SMARTCARD_IT_NE: Noise Error interrupt
mbed_official 237:f3da66175598 634 * @arg SMARTCARD_IT_FE: Framing Error interrupt
mbed_official 237:f3da66175598 635 * @arg SMARTCARD_IT_PE: Parity Error interrupt
mbed_official 237:f3da66175598 636 * @retval The new state of __IT__ (TRUE or FALSE).
mbed_official 237:f3da66175598 637 */
mbed_official 237:f3da66175598 638 #define __HAL_SMARTCARD_GET_IT(__HANDLE__, __IT__) ((__HANDLE__)->Instance->ISR & ((uint32_t)1 << ((__IT__)>> 0x08)))
mbed_official 237:f3da66175598 639
mbed_official 237:f3da66175598 640 /** @brief Checks whether the specified SmartCard interrupt interrupt source is enabled.
mbed_official 237:f3da66175598 641 * @param __HANDLE__: specifies the SMARTCARD Handle.
mbed_official 237:f3da66175598 642 * The Handle Instance can be USARTx where x: 1, 2 or 3 to select the USART peripheral.
mbed_official 237:f3da66175598 643 * @param __IT__: specifies the SMARTCARD interrupt source to check.
mbed_official 237:f3da66175598 644 * This parameter can be one of the following values:
mbed_official 237:f3da66175598 645 * @arg SMARTCARD_IT_EOBF: End Of Block interrupt
mbed_official 237:f3da66175598 646 * @arg SMARTCARD_IT_RTOF: Receive TimeOut interrupt
mbed_official 237:f3da66175598 647 * @arg SMARTCARD_IT_TXE: Transmit Data Register empty interrupt
mbed_official 237:f3da66175598 648 * @arg SMARTCARD_IT_TC: Transmission complete interrupt
mbed_official 237:f3da66175598 649 * @arg SMARTCARD_IT_RXNE: Receive Data register not empty interrupt
mbed_official 237:f3da66175598 650 * @arg SMARTCARD_IT_ORE: OverRun Error interrupt
mbed_official 237:f3da66175598 651 * @arg SMARTCARD_IT_NE: Noise Error interrupt
mbed_official 237:f3da66175598 652 * @arg SMARTCARD_IT_FE: Framing Error interrupt
mbed_official 237:f3da66175598 653 * @arg SMARTCARD_IT_PE: Parity Error interrupt
mbed_official 237:f3da66175598 654 * @retval The new state of __IT__ (TRUE or FALSE).
mbed_official 237:f3da66175598 655 */
mbed_official 237:f3da66175598 656 #define __HAL_SMARTCARD_GET_IT_SOURCE(__HANDLE__, __IT__) ((((((uint8_t)(__IT__)) >> 5U) == 1)? (__HANDLE__)->Instance->CR1 : \
mbed_official 237:f3da66175598 657 (((((uint8_t)(__IT__)) >> 5U) == 2)? (__HANDLE__)->Instance->CR2 : \
mbed_official 237:f3da66175598 658 (__HANDLE__)->Instance->CR3)) & ((uint32_t)1 << (((uint16_t)(__IT__)) & SMARTCARD_IT_MASK)))
mbed_official 237:f3da66175598 659
mbed_official 237:f3da66175598 660
mbed_official 237:f3da66175598 661 /** @brief Clears the specified SMARTCARD ISR flag, in setting the proper ICR register flag.
mbed_official 237:f3da66175598 662 * @param __HANDLE__: specifies the SMARTCARD Handle.
mbed_official 237:f3da66175598 663 * The Handle Instance can be USARTx where x: 1, 2 or 3 to select the USART peripheral.
mbed_official 237:f3da66175598 664 * @param __IT_CLEAR__: specifies the interrupt clear register flag that needs to be set
mbed_official 237:f3da66175598 665 * to clear the corresponding interrupt
mbed_official 237:f3da66175598 666 * This parameter can be one of the following values:
mbed_official 237:f3da66175598 667 * @arg USART_CLEAR_PEF: Parity Error Clear Flag
mbed_official 237:f3da66175598 668 * @arg USART_CLEAR_FEF: Framing Error Clear Flag
mbed_official 237:f3da66175598 669 * @arg USART_CLEAR_NEF: Noise detected Clear Flag
mbed_official 237:f3da66175598 670 * @arg USART_CLEAR_OREF: OverRun Error Clear Flag
mbed_official 237:f3da66175598 671 * @arg USART_CLEAR_TCF: Transmission Complete Clear Flag
mbed_official 237:f3da66175598 672 * @arg USART_CLEAR_RTOF: Receiver Time Out Clear Flag
mbed_official 237:f3da66175598 673 * @arg USART_CLEAR_EOBF: End Of Block Clear Flag
mbed_official 237:f3da66175598 674 * @retval None
mbed_official 237:f3da66175598 675 */
mbed_official 237:f3da66175598 676 #define __HAL_SMARTCARD_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->ICR = (uint32_t)(__IT_CLEAR__))
mbed_official 237:f3da66175598 677
mbed_official 237:f3da66175598 678 /** @brief Set a specific SMARTCARD request flag.
mbed_official 237:f3da66175598 679 * @param __HANDLE__: specifies the SMARTCARD Handle.
mbed_official 237:f3da66175598 680 * The Handle Instance can be USARTx where x: 1, 2 or 3 to select the USART peripheral.
mbed_official 237:f3da66175598 681 * @param __REQ__: specifies the request flag to set
mbed_official 237:f3da66175598 682 * This parameter can be one of the following values:
mbed_official 237:f3da66175598 683 * @arg SMARTCARD_RXDATA_FLUSH_REQUEST: Receive Data flush Request
mbed_official 237:f3da66175598 684 * @arg SMARTCARD_TXDATA_FLUSH_REQUEST: Transmit data flush Request
mbed_official 237:f3da66175598 685 *
mbed_official 237:f3da66175598 686 * @retval None
mbed_official 237:f3da66175598 687 */
mbed_official 237:f3da66175598 688 #define __HAL_SMARTCARD_SEND_REQ(__HANDLE__, __REQ__) ((__HANDLE__)->Instance->RQR |= (uint16_t)(__REQ__))
mbed_official 237:f3da66175598 689
mbed_official 237:f3da66175598 690 /** @brief Enable the USART associated to the SMARTCARD Handle
mbed_official 237:f3da66175598 691 * @param __HANDLE__: specifies the SMARTCARD Handle.
mbed_official 237:f3da66175598 692 * The Handle Instance can be UARTx where x: 1, 2, 3 to select the USART peripheral
mbed_official 237:f3da66175598 693 * @retval None
mbed_official 237:f3da66175598 694 */
mbed_official 237:f3da66175598 695 #define __HAL_SMARTCARD_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE)
mbed_official 237:f3da66175598 696
mbed_official 237:f3da66175598 697 /** @brief Disable the USART associated to the SMARTCARD Handle
mbed_official 237:f3da66175598 698 * @param __HANDLE__: specifies the SMARTCARD Handle.
mbed_official 237:f3da66175598 699 * The Handle Instance can be UARTx where x: 1, 2, 3 to select the USART peripheral
mbed_official 237:f3da66175598 700 * @retval None
mbed_official 237:f3da66175598 701 */
mbed_official 237:f3da66175598 702 #define __HAL_SMARTCARD_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE)
mbed_official 237:f3da66175598 703
mbed_official 237:f3da66175598 704 /** @brief Check the Baud rate range. The maximum Baud Rate is derived from the
mbed_official 237:f3da66175598 705 * maximum clock on F3 (i.e. 72 MHz) divided by the oversampling used
mbed_official 237:f3da66175598 706 * on the SMARTCARD (i.e. 16)
mbed_official 237:f3da66175598 707 * @param __BAUDRATE__: Baud rate set by the configuration function.
mbed_official 237:f3da66175598 708 * @retval Test result (TRUE or FALSE)
mbed_official 237:f3da66175598 709 */
mbed_official 237:f3da66175598 710 #define IS_SMARTCARD_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) < 4500001)
mbed_official 237:f3da66175598 711
mbed_official 237:f3da66175598 712 /** @brief Check the block length range. The maximum SMARTCARD block length is 0xFF.
mbed_official 237:f3da66175598 713 * @param __LENGTH__: block length.
mbed_official 237:f3da66175598 714 * @retval Test result (TRUE or FALSE)
mbed_official 237:f3da66175598 715 */
mbed_official 237:f3da66175598 716 #define IS_SMARTCARD_BLOCKLENGTH(__LENGTH__) ((__LENGTH__) <= 0xFF)
mbed_official 237:f3da66175598 717
mbed_official 237:f3da66175598 718 /** @brief Check the receiver timeout value. The maximum SMARTCARD receiver timeout
mbed_official 237:f3da66175598 719 * value is 0xFFFFFF.
mbed_official 237:f3da66175598 720 * @param __TIMEOUTVALUE__: receiver timeout value.
mbed_official 237:f3da66175598 721 * @retval Test result (TRUE or FALSE)
mbed_official 237:f3da66175598 722 */
mbed_official 237:f3da66175598 723 #define IS_SMARTCARD_TIMEOUT_VALUE(__TIMEOUTVALUE__) ((__TIMEOUTVALUE__) <= 0xFFFFFF)
mbed_official 237:f3da66175598 724
mbed_official 237:f3da66175598 725 /** @brief Check the SMARTCARD autoretry counter value. The maximum number of
mbed_official 237:f3da66175598 726 * retransmissions is 0x7.
mbed_official 237:f3da66175598 727 * @param __COUNT__: number of retransmissions
mbed_official 237:f3da66175598 728 * @retval Test result (TRUE or FALSE)
mbed_official 237:f3da66175598 729 */
mbed_official 237:f3da66175598 730 #define IS_SMARTCARD_AUTORETRY_COUNT(__COUNT__) ((__COUNT__) <= 0x7)
mbed_official 237:f3da66175598 731
mbed_official 237:f3da66175598 732
mbed_official 237:f3da66175598 733
mbed_official 237:f3da66175598 734 /**
mbed_official 237:f3da66175598 735 * @}
mbed_official 237:f3da66175598 736 */
mbed_official 237:f3da66175598 737
mbed_official 237:f3da66175598 738 /* Include SMARTCARD HAL Extension module */
mbed_official 237:f3da66175598 739 #include "stm32f3xx_hal_smartcard_ex.h"
mbed_official 237:f3da66175598 740
mbed_official 237:f3da66175598 741
mbed_official 237:f3da66175598 742 /* Exported functions --------------------------------------------------------*/
mbed_official 237:f3da66175598 743 /* Initialization and de-initialization functions ****************************/
mbed_official 237:f3da66175598 744 HAL_StatusTypeDef HAL_SMARTCARD_Init(SMARTCARD_HandleTypeDef *hsmartcard);
mbed_official 237:f3da66175598 745 HAL_StatusTypeDef HAL_SMARTCARD_DeInit(SMARTCARD_HandleTypeDef *hsmartcard);
mbed_official 237:f3da66175598 746 void HAL_SMARTCARD_MspInit(SMARTCARD_HandleTypeDef *hsmartcard);
mbed_official 237:f3da66175598 747 void HAL_SMARTCARD_MspDeInit(SMARTCARD_HandleTypeDef *hsmartcard);
mbed_official 237:f3da66175598 748
mbed_official 237:f3da66175598 749
mbed_official 237:f3da66175598 750 /* IO operation functions *****************************************************/
mbed_official 237:f3da66175598 751 HAL_StatusTypeDef HAL_SMARTCARD_Transmit(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size, uint32_t Timeout);
mbed_official 237:f3da66175598 752 HAL_StatusTypeDef HAL_SMARTCARD_Receive(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size, uint32_t Timeout);
mbed_official 237:f3da66175598 753 HAL_StatusTypeDef HAL_SMARTCARD_Transmit_IT(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size);
mbed_official 237:f3da66175598 754 HAL_StatusTypeDef HAL_SMARTCARD_Receive_IT(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size);
mbed_official 237:f3da66175598 755 HAL_StatusTypeDef HAL_SMARTCARD_Transmit_DMA(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size);
mbed_official 237:f3da66175598 756 HAL_StatusTypeDef HAL_SMARTCARD_Receive_DMA(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t *pData, uint16_t Size);
mbed_official 237:f3da66175598 757 void HAL_SMARTCARD_IRQHandler(SMARTCARD_HandleTypeDef *hsmartcard);
mbed_official 237:f3da66175598 758 void HAL_SMARTCARD_TxCpltCallback(SMARTCARD_HandleTypeDef *hsmartcard);
mbed_official 237:f3da66175598 759 void HAL_SMARTCARD_RxCpltCallback(SMARTCARD_HandleTypeDef *hsmartcard);
mbed_official 237:f3da66175598 760 void HAL_SMARTCARD_ErrorCallback(SMARTCARD_HandleTypeDef *hsmartcard);
mbed_official 237:f3da66175598 761
mbed_official 237:f3da66175598 762 /* Peripheral Control functions ***********************************************/
mbed_official 237:f3da66175598 763 void SMARTCARD_AdvFeatureConfig(SMARTCARD_HandleTypeDef *hsmartcard);
mbed_official 237:f3da66175598 764
mbed_official 237:f3da66175598 765 /* Peripheral State and Error functions ***************************************/
mbed_official 237:f3da66175598 766 HAL_SMARTCARD_StateTypeDef HAL_SMARTCARD_GetState(SMARTCARD_HandleTypeDef *hsmartcard);
mbed_official 237:f3da66175598 767 uint32_t HAL_SMARTCARD_GetError(SMARTCARD_HandleTypeDef *hsmartcard);
mbed_official 237:f3da66175598 768 /**
mbed_official 237:f3da66175598 769 * @}
mbed_official 237:f3da66175598 770 */
mbed_official 237:f3da66175598 771
mbed_official 237:f3da66175598 772 /**
mbed_official 237:f3da66175598 773 * @}
mbed_official 237:f3da66175598 774 */
mbed_official 237:f3da66175598 775
mbed_official 237:f3da66175598 776 #ifdef __cplusplus
mbed_official 237:f3da66175598 777 }
mbed_official 237:f3da66175598 778 #endif
mbed_official 237:f3da66175598 779
mbed_official 237:f3da66175598 780 #endif /* __STM32F3xx_HAL_SMARTCARD_H */
mbed_official 237:f3da66175598 781
mbed_official 237:f3da66175598 782 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/