DHT11

Committer:
jhon309
Date:
Thu Aug 13 00:21:57 2015 +0000
Revision:
0:c52df770855b
DHT11

Who changed what in which revision?

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