I2C_EEPROM

Committer:
jhon309
Date:
Thu Aug 13 00:23:16 2015 +0000
Revision:
0:ac8863619623
I2C

Who changed what in which revision?

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