mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F411RE/stm32f4xx_hal_smartcard.h@323:9e901b0a5aa1, 2014-09-13 (annotated)
- Committer:
- shaoziyang
- Date:
- Sat Sep 13 14:25:46 2014 +0000
- Revision:
- 323:9e901b0a5aa1
- Parent:
- 235:685d5f11838f
test with CLOCK_SETUP = 0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 235:685d5f11838f | 1 | /** |
mbed_official | 235:685d5f11838f | 2 | ****************************************************************************** |
mbed_official | 235:685d5f11838f | 3 | * @file stm32f4xx_hal_smartcard.h |
mbed_official | 235:685d5f11838f | 4 | * @author MCD Application Team |
mbed_official | 235:685d5f11838f | 5 | * @version V1.1.0 |
mbed_official | 235:685d5f11838f | 6 | * @date 19-June-2014 |
mbed_official | 235:685d5f11838f | 7 | * @brief Header file of SMARTCARD HAL module. |
mbed_official | 235:685d5f11838f | 8 | ****************************************************************************** |
mbed_official | 235:685d5f11838f | 9 | * @attention |
mbed_official | 235:685d5f11838f | 10 | * |
mbed_official | 235:685d5f11838f | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 235:685d5f11838f | 12 | * |
mbed_official | 235:685d5f11838f | 13 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 235:685d5f11838f | 14 | * are permitted provided that the following conditions are met: |
mbed_official | 235:685d5f11838f | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 235:685d5f11838f | 16 | * this list of conditions and the following disclaimer. |
mbed_official | 235:685d5f11838f | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 235:685d5f11838f | 18 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 235:685d5f11838f | 19 | * and/or other materials provided with the distribution. |
mbed_official | 235:685d5f11838f | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 235:685d5f11838f | 21 | * may be used to endorse or promote products derived from this software |
mbed_official | 235:685d5f11838f | 22 | * without specific prior written permission. |
mbed_official | 235:685d5f11838f | 23 | * |
mbed_official | 235:685d5f11838f | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 235:685d5f11838f | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 235:685d5f11838f | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 235:685d5f11838f | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 235:685d5f11838f | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 235:685d5f11838f | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 235:685d5f11838f | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 235:685d5f11838f | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 235:685d5f11838f | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 235:685d5f11838f | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 235:685d5f11838f | 34 | * |
mbed_official | 235:685d5f11838f | 35 | ****************************************************************************** |
mbed_official | 235:685d5f11838f | 36 | */ |
mbed_official | 235:685d5f11838f | 37 | |
mbed_official | 235:685d5f11838f | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 235:685d5f11838f | 39 | #ifndef __STM32F4xx_HAL_SMARTCARD_H |
mbed_official | 235:685d5f11838f | 40 | #define __STM32F4xx_HAL_SMARTCARD_H |
mbed_official | 235:685d5f11838f | 41 | |
mbed_official | 235:685d5f11838f | 42 | #ifdef __cplusplus |
mbed_official | 235:685d5f11838f | 43 | extern "C" { |
mbed_official | 235:685d5f11838f | 44 | #endif |
mbed_official | 235:685d5f11838f | 45 | |
mbed_official | 235:685d5f11838f | 46 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 47 | #include "stm32f4xx_hal_def.h" |
mbed_official | 235:685d5f11838f | 48 | |
mbed_official | 235:685d5f11838f | 49 | /** @addtogroup STM32F4xx_HAL_Driver |
mbed_official | 235:685d5f11838f | 50 | * @{ |
mbed_official | 235:685d5f11838f | 51 | */ |
mbed_official | 235:685d5f11838f | 52 | |
mbed_official | 235:685d5f11838f | 53 | /** @addtogroup SMARTCARD |
mbed_official | 235:685d5f11838f | 54 | * @{ |
mbed_official | 235:685d5f11838f | 55 | */ |
mbed_official | 235:685d5f11838f | 56 | |
mbed_official | 235:685d5f11838f | 57 | /* Exported types ------------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 58 | /** |
mbed_official | 235:685d5f11838f | 59 | * @brief SMARTCARD Init Structure definition |
mbed_official | 235:685d5f11838f | 60 | */ |
mbed_official | 235:685d5f11838f | 61 | typedef struct |
mbed_official | 235:685d5f11838f | 62 | { |
mbed_official | 235:685d5f11838f | 63 | uint32_t BaudRate; /*!< This member configures the SmartCard communication baud rate. |
mbed_official | 235:685d5f11838f | 64 | The baud rate is computed using the following formula: |
mbed_official | 235:685d5f11838f | 65 | - IntegerDivider = ((PCLKx) / (8 * (hirda->Init.BaudRate))) |
mbed_official | 235:685d5f11838f | 66 | - FractionalDivider = ((IntegerDivider - ((uint32_t) IntegerDivider)) * 8) + 0.5 */ |
mbed_official | 235:685d5f11838f | 67 | |
mbed_official | 235:685d5f11838f | 68 | uint32_t WordLength; /*!< Specifies the number of data bits transmitted or received in a frame. |
mbed_official | 235:685d5f11838f | 69 | This parameter can be a value of @ref SMARTCARD_Word_Length */ |
mbed_official | 235:685d5f11838f | 70 | |
mbed_official | 235:685d5f11838f | 71 | uint32_t StopBits; /*!< Specifies the number of stop bits transmitted. |
mbed_official | 235:685d5f11838f | 72 | This parameter can be a value of @ref SMARTCARD_Stop_Bits */ |
mbed_official | 235:685d5f11838f | 73 | |
mbed_official | 235:685d5f11838f | 74 | uint32_t Parity; /*!< Specifies the parity mode. |
mbed_official | 235:685d5f11838f | 75 | This parameter can be a value of @ref SMARTCARD_Parity |
mbed_official | 235:685d5f11838f | 76 | @note When parity is enabled, the computed parity is inserted |
mbed_official | 235:685d5f11838f | 77 | at the MSB position of the transmitted data (9th bit when |
mbed_official | 235:685d5f11838f | 78 | the word length is set to 9 data bits; 8th bit when the |
mbed_official | 235:685d5f11838f | 79 | word length is set to 8 data bits).*/ |
mbed_official | 235:685d5f11838f | 80 | |
mbed_official | 235:685d5f11838f | 81 | uint32_t Mode; /*!< Specifies wether the Receive or Transmit mode is enabled or disabled. |
mbed_official | 235:685d5f11838f | 82 | This parameter can be a value of @ref SMARTCARD_Mode */ |
mbed_official | 235:685d5f11838f | 83 | |
mbed_official | 235:685d5f11838f | 84 | uint32_t CLKPolarity; /*!< Specifies the steady state of the serial clock. |
mbed_official | 235:685d5f11838f | 85 | This parameter can be a value of @ref SMARTCARD_Clock_Polarity */ |
mbed_official | 235:685d5f11838f | 86 | |
mbed_official | 235:685d5f11838f | 87 | uint32_t CLKPhase; /*!< Specifies the clock transition on which the bit capture is made. |
mbed_official | 235:685d5f11838f | 88 | This parameter can be a value of @ref SMARTCARD_Clock_Phase */ |
mbed_official | 235:685d5f11838f | 89 | |
mbed_official | 235:685d5f11838f | 90 | uint32_t CLKLastBit; /*!< Specifies whether the clock pulse corresponding to the last transmitted |
mbed_official | 235:685d5f11838f | 91 | data bit (MSB) has to be output on the SCLK pin in synchronous mode. |
mbed_official | 235:685d5f11838f | 92 | This parameter can be a value of @ref SMARTCARD_Last_Bit */ |
mbed_official | 235:685d5f11838f | 93 | |
mbed_official | 235:685d5f11838f | 94 | uint32_t Prescaler; /*!< Specifies the SmartCard Prescaler. |
mbed_official | 235:685d5f11838f | 95 | This parameter must be a number between Min_Data = 0 and Max_Data = 255 */ |
mbed_official | 235:685d5f11838f | 96 | |
mbed_official | 235:685d5f11838f | 97 | uint32_t GuardTime; /*!< Specifies the SmartCard Guard Time. |
mbed_official | 235:685d5f11838f | 98 | This parameter must be a number between Min_Data = 0 and Max_Data = 255 */ |
mbed_official | 235:685d5f11838f | 99 | |
mbed_official | 235:685d5f11838f | 100 | uint32_t NACKState; /*!< Specifies the SmartCard NACK Transmission state. |
mbed_official | 235:685d5f11838f | 101 | This parameter can be a value of @ref SmartCard_NACK_State */ |
mbed_official | 235:685d5f11838f | 102 | }SMARTCARD_InitTypeDef; |
mbed_official | 235:685d5f11838f | 103 | |
mbed_official | 235:685d5f11838f | 104 | /** |
mbed_official | 235:685d5f11838f | 105 | * @brief HAL State structures definition |
mbed_official | 235:685d5f11838f | 106 | */ |
mbed_official | 235:685d5f11838f | 107 | typedef enum |
mbed_official | 235:685d5f11838f | 108 | { |
mbed_official | 235:685d5f11838f | 109 | HAL_SMARTCARD_STATE_RESET = 0x00, /*!< Peripheral is not yet Initialized */ |
mbed_official | 235:685d5f11838f | 110 | HAL_SMARTCARD_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */ |
mbed_official | 235:685d5f11838f | 111 | HAL_SMARTCARD_STATE_BUSY = 0x02, /*!< an internal process is ongoing */ |
mbed_official | 235:685d5f11838f | 112 | HAL_SMARTCARD_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */ |
mbed_official | 235:685d5f11838f | 113 | HAL_SMARTCARD_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */ |
mbed_official | 235:685d5f11838f | 114 | HAL_SMARTCARD_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission and Reception process is ongoing */ |
mbed_official | 235:685d5f11838f | 115 | HAL_SMARTCARD_STATE_TIMEOUT = 0x03, /*!< Timeout state */ |
mbed_official | 235:685d5f11838f | 116 | HAL_SMARTCARD_STATE_ERROR = 0x04 /*!< Error */ |
mbed_official | 235:685d5f11838f | 117 | }HAL_SMARTCARD_StateTypeDef; |
mbed_official | 235:685d5f11838f | 118 | |
mbed_official | 235:685d5f11838f | 119 | /** |
mbed_official | 235:685d5f11838f | 120 | * @brief HAL SMARTCARD Error Code structure definition |
mbed_official | 235:685d5f11838f | 121 | */ |
mbed_official | 235:685d5f11838f | 122 | typedef enum |
mbed_official | 235:685d5f11838f | 123 | { |
mbed_official | 235:685d5f11838f | 124 | HAL_SMARTCARD_ERROR_NONE = 0x00, /*!< No error */ |
mbed_official | 235:685d5f11838f | 125 | HAL_SMARTCARD_ERROR_PE = 0x01, /*!< Parity error */ |
mbed_official | 235:685d5f11838f | 126 | HAL_SMARTCARD_ERROR_NE = 0x02, /*!< Noise error */ |
mbed_official | 235:685d5f11838f | 127 | HAL_SMARTCARD_ERROR_FE = 0x04, /*!< frame error */ |
mbed_official | 235:685d5f11838f | 128 | HAL_SMARTCARD_ERROR_ORE = 0x08, /*!< Overrun error */ |
mbed_official | 235:685d5f11838f | 129 | HAL_SMARTCARD_ERROR_DMA = 0x10 /*!< DMA transfer error */ |
mbed_official | 235:685d5f11838f | 130 | }HAL_SMARTCARD_ErrorTypeDef; |
mbed_official | 235:685d5f11838f | 131 | |
mbed_official | 235:685d5f11838f | 132 | /** |
mbed_official | 235:685d5f11838f | 133 | * @brief SMARTCARD handle Structure definition |
mbed_official | 235:685d5f11838f | 134 | */ |
mbed_official | 235:685d5f11838f | 135 | typedef struct |
mbed_official | 235:685d5f11838f | 136 | { |
mbed_official | 235:685d5f11838f | 137 | USART_TypeDef *Instance; /* USART registers base address */ |
mbed_official | 235:685d5f11838f | 138 | |
mbed_official | 235:685d5f11838f | 139 | SMARTCARD_InitTypeDef Init; /* SmartCard communication parameters */ |
mbed_official | 235:685d5f11838f | 140 | |
mbed_official | 235:685d5f11838f | 141 | uint8_t *pTxBuffPtr; /* Pointer to SmartCard Tx transfer Buffer */ |
mbed_official | 235:685d5f11838f | 142 | |
mbed_official | 235:685d5f11838f | 143 | uint16_t TxXferSize; /* SmartCard Tx Transfer size */ |
mbed_official | 235:685d5f11838f | 144 | |
mbed_official | 235:685d5f11838f | 145 | uint16_t TxXferCount; /* SmartCard Tx Transfer Counter */ |
mbed_official | 235:685d5f11838f | 146 | |
mbed_official | 235:685d5f11838f | 147 | uint8_t *pRxBuffPtr; /* Pointer to SmartCard Rx transfer Buffer */ |
mbed_official | 235:685d5f11838f | 148 | |
mbed_official | 235:685d5f11838f | 149 | uint16_t RxXferSize; /* SmartCard Rx Transfer size */ |
mbed_official | 235:685d5f11838f | 150 | |
mbed_official | 235:685d5f11838f | 151 | uint16_t RxXferCount; /* SmartCard Rx Transfer Counter */ |
mbed_official | 235:685d5f11838f | 152 | |
mbed_official | 235:685d5f11838f | 153 | DMA_HandleTypeDef *hdmatx; /* SmartCard Tx DMA Handle parameters */ |
mbed_official | 235:685d5f11838f | 154 | |
mbed_official | 235:685d5f11838f | 155 | DMA_HandleTypeDef *hdmarx; /* SmartCard Rx DMA Handle parameters */ |
mbed_official | 235:685d5f11838f | 156 | |
mbed_official | 235:685d5f11838f | 157 | HAL_LockTypeDef Lock; /* Locking object */ |
mbed_official | 235:685d5f11838f | 158 | |
mbed_official | 235:685d5f11838f | 159 | __IO HAL_SMARTCARD_StateTypeDef State; /* SmartCard communication state */ |
mbed_official | 235:685d5f11838f | 160 | |
mbed_official | 235:685d5f11838f | 161 | __IO HAL_SMARTCARD_ErrorTypeDef ErrorCode; /* SMARTCARD Error code */ |
mbed_official | 235:685d5f11838f | 162 | }SMARTCARD_HandleTypeDef; |
mbed_official | 235:685d5f11838f | 163 | |
mbed_official | 235:685d5f11838f | 164 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 165 | /** @defgroup SMARTCARD_Exported_Constants |
mbed_official | 235:685d5f11838f | 166 | * @{ |
mbed_official | 235:685d5f11838f | 167 | */ |
mbed_official | 235:685d5f11838f | 168 | |
mbed_official | 235:685d5f11838f | 169 | /** @defgroup SMARTCARD_Word_Length |
mbed_official | 235:685d5f11838f | 170 | * @{ |
mbed_official | 235:685d5f11838f | 171 | */ |
mbed_official | 235:685d5f11838f | 172 | #define SMARTCARD_WORDLENGTH_8B ((uint32_t)0x00000000) |
mbed_official | 235:685d5f11838f | 173 | #define SMARTCARD_WORDLENGTH_9B ((uint32_t)USART_CR1_M) |
mbed_official | 235:685d5f11838f | 174 | #define IS_SMARTCARD_WORD_LENGTH(LENGTH) (((LENGTH) == SMARTCARD_WORDLENGTH_8B) || \ |
mbed_official | 235:685d5f11838f | 175 | ((LENGTH) == SMARTCARD_WORDLENGTH_9B)) |
mbed_official | 235:685d5f11838f | 176 | /** |
mbed_official | 235:685d5f11838f | 177 | * @} |
mbed_official | 235:685d5f11838f | 178 | */ |
mbed_official | 235:685d5f11838f | 179 | |
mbed_official | 235:685d5f11838f | 180 | /** @defgroup SMARTCARD_Stop_Bits |
mbed_official | 235:685d5f11838f | 181 | * @{ |
mbed_official | 235:685d5f11838f | 182 | */ |
mbed_official | 235:685d5f11838f | 183 | #define SMARTCARD_STOPBITS_1 ((uint32_t)0x00000000) |
mbed_official | 235:685d5f11838f | 184 | #define SMARTCARD_STOPBITS_0_5 ((uint32_t)USART_CR2_STOP_0) |
mbed_official | 235:685d5f11838f | 185 | #define SMARTCARD_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1) |
mbed_official | 235:685d5f11838f | 186 | #define SMARTCARD_STOPBITS_1_5 ((uint32_t)(USART_CR2_STOP_0 | USART_CR2_STOP_1)) |
mbed_official | 235:685d5f11838f | 187 | #define IS_SMARTCARD_STOPBITS(STOPBITS) (((STOPBITS) == SMARTCARD_STOPBITS_1) || \ |
mbed_official | 235:685d5f11838f | 188 | ((STOPBITS) == SMARTCARD_STOPBITS_0_5) || \ |
mbed_official | 235:685d5f11838f | 189 | ((STOPBITS) == SMARTCARD_STOPBITS_1_5) || \ |
mbed_official | 235:685d5f11838f | 190 | ((STOPBITS) == SMARTCARD_STOPBITS_2)) |
mbed_official | 235:685d5f11838f | 191 | /** |
mbed_official | 235:685d5f11838f | 192 | * @} |
mbed_official | 235:685d5f11838f | 193 | */ |
mbed_official | 235:685d5f11838f | 194 | |
mbed_official | 235:685d5f11838f | 195 | /** @defgroup SMARTCARD_Parity |
mbed_official | 235:685d5f11838f | 196 | * @{ |
mbed_official | 235:685d5f11838f | 197 | */ |
mbed_official | 235:685d5f11838f | 198 | #define SMARTCARD_PARITY_NONE ((uint32_t)0x00000000) |
mbed_official | 235:685d5f11838f | 199 | #define SMARTCARD_PARITY_EVEN ((uint32_t)USART_CR1_PCE) |
mbed_official | 235:685d5f11838f | 200 | #define SMARTCARD_PARITY_ODD ((uint32_t)(USART_CR1_PCE | USART_CR1_PS)) |
mbed_official | 235:685d5f11838f | 201 | #define IS_SMARTCARD_PARITY(PARITY) (((PARITY) == SMARTCARD_PARITY_NONE) || \ |
mbed_official | 235:685d5f11838f | 202 | ((PARITY) == SMARTCARD_PARITY_EVEN) || \ |
mbed_official | 235:685d5f11838f | 203 | ((PARITY) == SMARTCARD_PARITY_ODD)) |
mbed_official | 235:685d5f11838f | 204 | /** |
mbed_official | 235:685d5f11838f | 205 | * @} |
mbed_official | 235:685d5f11838f | 206 | */ |
mbed_official | 235:685d5f11838f | 207 | |
mbed_official | 235:685d5f11838f | 208 | /** @defgroup SMARTCARD_Mode |
mbed_official | 235:685d5f11838f | 209 | * @{ |
mbed_official | 235:685d5f11838f | 210 | */ |
mbed_official | 235:685d5f11838f | 211 | #define SMARTCARD_MODE_RX ((uint32_t)USART_CR1_RE) |
mbed_official | 235:685d5f11838f | 212 | #define SMARTCARD_MODE_TX ((uint32_t)USART_CR1_TE) |
mbed_official | 235:685d5f11838f | 213 | #define SMARTCARD_MODE_TX_RX ((uint32_t)(USART_CR1_TE |USART_CR1_RE)) |
mbed_official | 235:685d5f11838f | 214 | #define IS_SMARTCARD_MODE(MODE) ((((MODE) & (uint32_t)0x0000FFF3) == 0x00) && ((MODE) != (uint32_t)0x000000)) |
mbed_official | 235:685d5f11838f | 215 | /** |
mbed_official | 235:685d5f11838f | 216 | * @} |
mbed_official | 235:685d5f11838f | 217 | */ |
mbed_official | 235:685d5f11838f | 218 | |
mbed_official | 235:685d5f11838f | 219 | /** @defgroup SMARTCARD_Clock_Polarity |
mbed_official | 235:685d5f11838f | 220 | * @{ |
mbed_official | 235:685d5f11838f | 221 | */ |
mbed_official | 235:685d5f11838f | 222 | #define SMARTCARD_POLARITY_LOW ((uint32_t)0x00000000) |
mbed_official | 235:685d5f11838f | 223 | #define SMARTCARD_POLARITY_HIGH ((uint32_t)USART_CR2_CPOL) |
mbed_official | 235:685d5f11838f | 224 | #define IS_SMARTCARD_POLARITY(CPOL) (((CPOL) == SMARTCARD_POLARITY_LOW) || ((CPOL) == SMARTCARD_POLARITY_HIGH)) |
mbed_official | 235:685d5f11838f | 225 | /** |
mbed_official | 235:685d5f11838f | 226 | * @} |
mbed_official | 235:685d5f11838f | 227 | */ |
mbed_official | 235:685d5f11838f | 228 | |
mbed_official | 235:685d5f11838f | 229 | /** @defgroup SMARTCARD_Clock_Phase |
mbed_official | 235:685d5f11838f | 230 | * @{ |
mbed_official | 235:685d5f11838f | 231 | */ |
mbed_official | 235:685d5f11838f | 232 | #define SMARTCARD_PHASE_1EDGE ((uint32_t)0x00000000) |
mbed_official | 235:685d5f11838f | 233 | #define SMARTCARD_PHASE_2EDGE ((uint32_t)USART_CR2_CPHA) |
mbed_official | 235:685d5f11838f | 234 | #define IS_SMARTCARD_PHASE(CPHA) (((CPHA) == SMARTCARD_PHASE_1EDGE) || ((CPHA) == SMARTCARD_PHASE_2EDGE)) |
mbed_official | 235:685d5f11838f | 235 | /** |
mbed_official | 235:685d5f11838f | 236 | * @} |
mbed_official | 235:685d5f11838f | 237 | */ |
mbed_official | 235:685d5f11838f | 238 | |
mbed_official | 235:685d5f11838f | 239 | /** @defgroup SMARTCARD_Last_Bit |
mbed_official | 235:685d5f11838f | 240 | * @{ |
mbed_official | 235:685d5f11838f | 241 | */ |
mbed_official | 235:685d5f11838f | 242 | #define SMARTCARD_LASTBIT_DISABLE ((uint32_t)0x00000000) |
mbed_official | 235:685d5f11838f | 243 | #define SMARTCARD_LASTBIT_ENABLE ((uint32_t)USART_CR2_LBCL) |
mbed_official | 235:685d5f11838f | 244 | #define IS_SMARTCARD_LASTBIT(LASTBIT) (((LASTBIT) == SMARTCARD_LASTBIT_DISABLE) || \ |
mbed_official | 235:685d5f11838f | 245 | ((LASTBIT) == SMARTCARD_LASTBIT_ENABLE)) |
mbed_official | 235:685d5f11838f | 246 | /** |
mbed_official | 235:685d5f11838f | 247 | * @} |
mbed_official | 235:685d5f11838f | 248 | */ |
mbed_official | 235:685d5f11838f | 249 | |
mbed_official | 235:685d5f11838f | 250 | /** @defgroup SmartCard_NACK_State |
mbed_official | 235:685d5f11838f | 251 | * @{ |
mbed_official | 235:685d5f11838f | 252 | */ |
mbed_official | 235:685d5f11838f | 253 | #define SMARTCARD_NACK_ENABLED ((uint32_t)USART_CR3_NACK) |
mbed_official | 235:685d5f11838f | 254 | #define SMARTCARD_NACK_DISABLED ((uint32_t)0x00000000) |
mbed_official | 235:685d5f11838f | 255 | #define IS_SMARTCARD_NACK_STATE(NACK) (((NACK) == SMARTCARD_NACK_ENABLED) || \ |
mbed_official | 235:685d5f11838f | 256 | ((NACK) == SMARTCARD_NACK_DISABLED)) |
mbed_official | 235:685d5f11838f | 257 | /** |
mbed_official | 235:685d5f11838f | 258 | * @} |
mbed_official | 235:685d5f11838f | 259 | */ |
mbed_official | 235:685d5f11838f | 260 | |
mbed_official | 235:685d5f11838f | 261 | /** @defgroup SmartCard_DMA_Requests |
mbed_official | 235:685d5f11838f | 262 | * @{ |
mbed_official | 235:685d5f11838f | 263 | */ |
mbed_official | 235:685d5f11838f | 264 | |
mbed_official | 235:685d5f11838f | 265 | #define SMARTCARD_DMAREQ_TX ((uint32_t)USART_CR3_DMAT) |
mbed_official | 235:685d5f11838f | 266 | #define SMARTCARD_DMAREQ_RX ((uint32_t)USART_CR3_DMAR) |
mbed_official | 235:685d5f11838f | 267 | |
mbed_official | 235:685d5f11838f | 268 | /** |
mbed_official | 235:685d5f11838f | 269 | * @} |
mbed_official | 235:685d5f11838f | 270 | */ |
mbed_official | 235:685d5f11838f | 271 | |
mbed_official | 235:685d5f11838f | 272 | /** @defgroup SmartCard_Flags |
mbed_official | 235:685d5f11838f | 273 | * Elements values convention: 0xXXXX |
mbed_official | 235:685d5f11838f | 274 | * - 0xXXXX : Flag mask in the SR register |
mbed_official | 235:685d5f11838f | 275 | * @{ |
mbed_official | 235:685d5f11838f | 276 | */ |
mbed_official | 235:685d5f11838f | 277 | |
mbed_official | 235:685d5f11838f | 278 | #define SMARTCARD_FLAG_TXE ((uint32_t)0x00000080) |
mbed_official | 235:685d5f11838f | 279 | #define SMARTCARD_FLAG_TC ((uint32_t)0x00000040) |
mbed_official | 235:685d5f11838f | 280 | #define SMARTCARD_FLAG_RXNE ((uint32_t)0x00000020) |
mbed_official | 235:685d5f11838f | 281 | #define SMARTCARD_FLAG_IDLE ((uint32_t)0x00000010) |
mbed_official | 235:685d5f11838f | 282 | #define SMARTCARD_FLAG_ORE ((uint32_t)0x00000008) |
mbed_official | 235:685d5f11838f | 283 | #define SMARTCARD_FLAG_NE ((uint32_t)0x00000004) |
mbed_official | 235:685d5f11838f | 284 | #define SMARTCARD_FLAG_FE ((uint32_t)0x00000002) |
mbed_official | 235:685d5f11838f | 285 | #define SMARTCARD_FLAG_PE ((uint32_t)0x00000001) |
mbed_official | 235:685d5f11838f | 286 | /** |
mbed_official | 235:685d5f11838f | 287 | * @} |
mbed_official | 235:685d5f11838f | 288 | */ |
mbed_official | 235:685d5f11838f | 289 | |
mbed_official | 235:685d5f11838f | 290 | /** @defgroup SmartCard_Interrupt_definition |
mbed_official | 235:685d5f11838f | 291 | * Elements values convention: 0xY000XXXX |
mbed_official | 235:685d5f11838f | 292 | * - XXXX : Interrupt mask in the XX register |
mbed_official | 235:685d5f11838f | 293 | * - Y : Interrupt source register (2bits) |
mbed_official | 235:685d5f11838f | 294 | * - 01: CR1 register |
mbed_official | 235:685d5f11838f | 295 | * - 10: CR3 register |
mbed_official | 235:685d5f11838f | 296 | |
mbed_official | 235:685d5f11838f | 297 | * |
mbed_official | 235:685d5f11838f | 298 | * @{ |
mbed_official | 235:685d5f11838f | 299 | */ |
mbed_official | 235:685d5f11838f | 300 | #define SMARTCARD_IT_PE ((uint32_t)0x10000100) |
mbed_official | 235:685d5f11838f | 301 | #define SMARTCARD_IT_TXE ((uint32_t)0x10000080) |
mbed_official | 235:685d5f11838f | 302 | #define SMARTCARD_IT_TC ((uint32_t)0x10000040) |
mbed_official | 235:685d5f11838f | 303 | #define SMARTCARD_IT_RXNE ((uint32_t)0x10000020) |
mbed_official | 235:685d5f11838f | 304 | #define SMARTCARD_IT_IDLE ((uint32_t)0x10000010) |
mbed_official | 235:685d5f11838f | 305 | #define SMARTCARD_IT_ERR ((uint32_t)0x20000001) |
mbed_official | 235:685d5f11838f | 306 | |
mbed_official | 235:685d5f11838f | 307 | /** |
mbed_official | 235:685d5f11838f | 308 | * @} |
mbed_official | 235:685d5f11838f | 309 | */ |
mbed_official | 235:685d5f11838f | 310 | |
mbed_official | 235:685d5f11838f | 311 | /** |
mbed_official | 235:685d5f11838f | 312 | * @} |
mbed_official | 235:685d5f11838f | 313 | */ |
mbed_official | 235:685d5f11838f | 314 | |
mbed_official | 235:685d5f11838f | 315 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 316 | |
mbed_official | 235:685d5f11838f | 317 | /** @brief Reset SMARTCARD handle state |
mbed_official | 235:685d5f11838f | 318 | * @param __HANDLE__: specifies the SMARTCARD Handle. |
mbed_official | 235:685d5f11838f | 319 | * @retval None |
mbed_official | 235:685d5f11838f | 320 | */ |
mbed_official | 235:685d5f11838f | 321 | #define __HAL_SMARTCARD_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_SMARTCARD_STATE_RESET) |
mbed_official | 235:685d5f11838f | 322 | |
mbed_official | 235:685d5f11838f | 323 | /** @brief Flushs the Smartcard DR register |
mbed_official | 235:685d5f11838f | 324 | * @param __HANDLE__: specifies the SMARTCARD Handle. |
mbed_official | 235:685d5f11838f | 325 | */ |
mbed_official | 235:685d5f11838f | 326 | #define __HAL_SMARTCARD_FLUSH_DRREGISTER(__HANDLE__) ((__HANDLE__)->Instance->DR) |
mbed_official | 235:685d5f11838f | 327 | |
mbed_official | 235:685d5f11838f | 328 | /** @brief Checks whether the specified Smartcard flag is set or not. |
mbed_official | 235:685d5f11838f | 329 | * @param __HANDLE__: specifies the SMARTCARD Handle. |
mbed_official | 235:685d5f11838f | 330 | * @param __FLAG__: specifies the flag to check. |
mbed_official | 235:685d5f11838f | 331 | * This parameter can be one of the following values: |
mbed_official | 235:685d5f11838f | 332 | * @arg SMARTCARD_FLAG_TXE: Transmit data register empty flag |
mbed_official | 235:685d5f11838f | 333 | * @arg SMARTCARD_FLAG_TC: Transmission Complete flag |
mbed_official | 235:685d5f11838f | 334 | * @arg SMARTCARD_FLAG_RXNE: Receive data register not empty flag |
mbed_official | 235:685d5f11838f | 335 | * @arg SMARTCARD_FLAG_IDLE: Idle Line detection flag |
mbed_official | 235:685d5f11838f | 336 | * @arg SMARTCARD_FLAG_ORE: OverRun Error flag |
mbed_official | 235:685d5f11838f | 337 | * @arg SMARTCARD_FLAG_NE: Noise Error flag |
mbed_official | 235:685d5f11838f | 338 | * @arg SMARTCARD_FLAG_FE: Framing Error flag |
mbed_official | 235:685d5f11838f | 339 | * @arg SMARTCARD_FLAG_PE: Parity Error flag |
mbed_official | 235:685d5f11838f | 340 | * @retval The new state of __FLAG__ (TRUE or FALSE). |
mbed_official | 235:685d5f11838f | 341 | */ |
mbed_official | 235:685d5f11838f | 342 | #define __HAL_SMARTCARD_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__)) |
mbed_official | 235:685d5f11838f | 343 | |
mbed_official | 235:685d5f11838f | 344 | /** @brief Clears the specified Smartcard pending flags. |
mbed_official | 235:685d5f11838f | 345 | * @param __HANDLE__: specifies the SMARTCARD Handle. |
mbed_official | 235:685d5f11838f | 346 | * @param __FLAG__: specifies the flag to check. |
mbed_official | 235:685d5f11838f | 347 | * This parameter can be any combination of the following values: |
mbed_official | 235:685d5f11838f | 348 | * @arg SMARTCARD_FLAG_TC: Transmission Complete flag. |
mbed_official | 235:685d5f11838f | 349 | * @arg SMARTCARD_FLAG_RXNE: Receive data register not empty flag. |
mbed_official | 235:685d5f11838f | 350 | * |
mbed_official | 235:685d5f11838f | 351 | * @note PE (Parity error), FE (Framing error), NE (Noise error) and ORE (OverRun |
mbed_official | 235:685d5f11838f | 352 | * error) flags are cleared by software sequence: a read operation to |
mbed_official | 235:685d5f11838f | 353 | * USART_SR register followed by a read operation to USART_DR register. |
mbed_official | 235:685d5f11838f | 354 | * @note RXNE flag can be also cleared by a read to the USART_DR register. |
mbed_official | 235:685d5f11838f | 355 | * @note TC flag can be also cleared by software sequence: a read operation to |
mbed_official | 235:685d5f11838f | 356 | * USART_SR register followed by a write operation to USART_DR register. |
mbed_official | 235:685d5f11838f | 357 | * @note TXE flag is cleared only by a write to the USART_DR register. |
mbed_official | 235:685d5f11838f | 358 | */ |
mbed_official | 235:685d5f11838f | 359 | #define __HAL_SMARTCARD_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__)) |
mbed_official | 235:685d5f11838f | 360 | |
mbed_official | 235:685d5f11838f | 361 | /** @brief Clear the SMARTCARD PE pending flag. |
mbed_official | 235:685d5f11838f | 362 | * @param __HANDLE__: specifies the USART Handle. |
mbed_official | 235:685d5f11838f | 363 | * This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or |
mbed_official | 235:685d5f11838f | 364 | * UART peripheral. |
mbed_official | 235:685d5f11838f | 365 | * @retval None |
mbed_official | 235:685d5f11838f | 366 | */ |
mbed_official | 235:685d5f11838f | 367 | #define __HAL_SMARTCARD_CLEAR_PEFLAG(__HANDLE__) do{(__HANDLE__)->Instance->SR;\ |
mbed_official | 235:685d5f11838f | 368 | (__HANDLE__)->Instance->DR;}while(0) |
mbed_official | 235:685d5f11838f | 369 | /** @brief Clear the SMARTCARD FE pending flag. |
mbed_official | 235:685d5f11838f | 370 | * @param __HANDLE__: specifies the USART Handle. |
mbed_official | 235:685d5f11838f | 371 | * This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or |
mbed_official | 235:685d5f11838f | 372 | * UART peripheral. |
mbed_official | 235:685d5f11838f | 373 | * @retval None |
mbed_official | 235:685d5f11838f | 374 | */ |
mbed_official | 235:685d5f11838f | 375 | #define __HAL_SMARTCARD_CLEAR_FEFLAG(__HANDLE__) __HAL_SMARTCARD_CLEAR_PEFLAG(__HANDLE__) |
mbed_official | 235:685d5f11838f | 376 | |
mbed_official | 235:685d5f11838f | 377 | /** @brief Clear the SMARTCARD NE pending flag. |
mbed_official | 235:685d5f11838f | 378 | * @param __HANDLE__: specifies the USART Handle. |
mbed_official | 235:685d5f11838f | 379 | * This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or |
mbed_official | 235:685d5f11838f | 380 | * UART peripheral. |
mbed_official | 235:685d5f11838f | 381 | * @retval None |
mbed_official | 235:685d5f11838f | 382 | */ |
mbed_official | 235:685d5f11838f | 383 | #define __HAL_SMARTCARD_CLEAR_NEFLAG(__HANDLE__) __HAL_SMARTCARD_CLEAR_PEFLAG(__HANDLE__) |
mbed_official | 235:685d5f11838f | 384 | |
mbed_official | 235:685d5f11838f | 385 | /** @brief Clear the SMARTCARD ORE pending flag. |
mbed_official | 235:685d5f11838f | 386 | * @param __HANDLE__: specifies the USART Handle. |
mbed_official | 235:685d5f11838f | 387 | * This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or |
mbed_official | 235:685d5f11838f | 388 | * UART peripheral. |
mbed_official | 235:685d5f11838f | 389 | * @retval None |
mbed_official | 235:685d5f11838f | 390 | */ |
mbed_official | 235:685d5f11838f | 391 | #define __HAL_SMARTCARD_CLEAR_OREFLAG(__HANDLE__) __HAL_SMARTCARD_CLEAR_PEFLAG(__HANDLE__) |
mbed_official | 235:685d5f11838f | 392 | |
mbed_official | 235:685d5f11838f | 393 | /** @brief Clear the SMARTCARD IDLE pending flag. |
mbed_official | 235:685d5f11838f | 394 | * @param __HANDLE__: specifies the USART Handle. |
mbed_official | 235:685d5f11838f | 395 | * This parameter can be USARTx where x: 1, 2, 3, 4, 5, 6, 7 or 8 to select the USART or |
mbed_official | 235:685d5f11838f | 396 | * UART peripheral. |
mbed_official | 235:685d5f11838f | 397 | * @retval None |
mbed_official | 235:685d5f11838f | 398 | */ |
mbed_official | 235:685d5f11838f | 399 | #define __HAL_SMARTCARD_CLEAR_IDLEFLAG(__HANDLE__) __HAL_SMARTCARD_CLEAR_PEFLAG(__HANDLE__) |
mbed_official | 235:685d5f11838f | 400 | |
mbed_official | 235:685d5f11838f | 401 | |
mbed_official | 235:685d5f11838f | 402 | /** @brief Enables or disables the specified SmartCard interrupts. |
mbed_official | 235:685d5f11838f | 403 | * @param __HANDLE__: specifies the SMARTCARD Handle. |
mbed_official | 235:685d5f11838f | 404 | * @param __INTERRUPT__: specifies the SMARTCARD interrupt source to check. |
mbed_official | 235:685d5f11838f | 405 | * This parameter can be one of the following values: |
mbed_official | 235:685d5f11838f | 406 | * @arg SMARTCARD_IT_TXE: Transmit Data Register empty interrupt |
mbed_official | 235:685d5f11838f | 407 | * @arg SMARTCARD_IT_TC: Transmission complete interrupt |
mbed_official | 235:685d5f11838f | 408 | * @arg SMARTCARD_IT_RXNE: Receive Data register not empty interrupt |
mbed_official | 235:685d5f11838f | 409 | * @arg SMARTCARD_IT_IDLE: Idle line detection interrupt |
mbed_official | 235:685d5f11838f | 410 | * @arg SMARTCARD_IT_PE: Parity Error interrupt |
mbed_official | 235:685d5f11838f | 411 | * @arg SMARTCARD_IT_ERR: Error interrupt(Frame error, noise error, overrun error) |
mbed_official | 235:685d5f11838f | 412 | */ |
mbed_official | 235:685d5f11838f | 413 | #define SMARTCARD_IT_MASK ((uint32_t)0x0000FFFF) |
mbed_official | 235:685d5f11838f | 414 | #define __SMARTCARD_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 |= ((__INTERRUPT__) & SMARTCARD_IT_MASK)): \ |
mbed_official | 235:685d5f11838f | 415 | ((__HANDLE__)->Instance->CR3 |= ((__INTERRUPT__) & SMARTCARD_IT_MASK))) |
mbed_official | 235:685d5f11838f | 416 | #define __SMARTCARD_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == 1)? ((__HANDLE__)->Instance->CR1 &= ~((__INTERRUPT__) & SMARTCARD_IT_MASK)): \ |
mbed_official | 235:685d5f11838f | 417 | ((__HANDLE__)->Instance->CR3 &= ~ ((__INTERRUPT__) & SMARTCARD_IT_MASK))) |
mbed_official | 235:685d5f11838f | 418 | |
mbed_official | 235:685d5f11838f | 419 | /** @brief Checks whether the specified SmartCard interrupt has occurred or not. |
mbed_official | 235:685d5f11838f | 420 | * @param __HANDLE__: specifies the SmartCard Handle. |
mbed_official | 235:685d5f11838f | 421 | * @param __IT__: specifies the SMARTCARD interrupt source to check. |
mbed_official | 235:685d5f11838f | 422 | * This parameter can be one of the following values: |
mbed_official | 235:685d5f11838f | 423 | * @arg SMARTCARD_IT_TXE: Transmit Data Register empty interrupt |
mbed_official | 235:685d5f11838f | 424 | * @arg SMARTCARD_IT_TC: Transmission complete interrupt |
mbed_official | 235:685d5f11838f | 425 | * @arg SMARTCARD_IT_RXNE: Receive Data register not empty interrupt |
mbed_official | 235:685d5f11838f | 426 | * @arg SMARTCARD_IT_IDLE: Idle line detection interrupt |
mbed_official | 235:685d5f11838f | 427 | * @arg SMARTCARD_IT_ERR: Error interrupt |
mbed_official | 235:685d5f11838f | 428 | * @arg SMARTCARD_IT_PE: Parity Error interrupt |
mbed_official | 235:685d5f11838f | 429 | * @retval The new state of __IT__ (TRUE or FALSE). |
mbed_official | 235:685d5f11838f | 430 | */ |
mbed_official | 235:685d5f11838f | 431 | #define __HAL_SMARTCARD_GET_IT_SOURCE(__HANDLE__, __IT__) (((((__IT__) >> 28) == 1)? (__HANDLE__)->Instance->CR1: (__HANDLE__)->Instance->CR3) & (((uint32_t)(__IT__)) & SMARTCARD_IT_MASK)) |
mbed_official | 235:685d5f11838f | 432 | |
mbed_official | 235:685d5f11838f | 433 | /** @brief Macros to enable or disable the SmartCard interface. |
mbed_official | 235:685d5f11838f | 434 | * @param __HANDLE__: specifies the SmartCard Handle. |
mbed_official | 235:685d5f11838f | 435 | */ |
mbed_official | 235:685d5f11838f | 436 | #define __SMARTCARD_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE) |
mbed_official | 235:685d5f11838f | 437 | #define __SMARTCARD_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE) |
mbed_official | 235:685d5f11838f | 438 | |
mbed_official | 235:685d5f11838f | 439 | /** @brief Macros to enable or disable the SmartCard DMA request. |
mbed_official | 235:685d5f11838f | 440 | * @param __HANDLE__: specifies the SmartCard Handle. |
mbed_official | 235:685d5f11838f | 441 | * @param __REQUEST__: specifies the SmartCard DMA request. |
mbed_official | 235:685d5f11838f | 442 | * This parameter can be one of the following values: |
mbed_official | 235:685d5f11838f | 443 | * @arg SMARTCARD_DMAREQ_TX: SmartCard DMA transmit request |
mbed_official | 235:685d5f11838f | 444 | * @arg SMARTCARD_DMAREQ_RX: SmartCard DMA receive request |
mbed_official | 235:685d5f11838f | 445 | */ |
mbed_official | 235:685d5f11838f | 446 | #define __SMARTCARD_DMA_REQUEST_ENABLE(__HANDLE__, __REQUEST__) ((__HANDLE__)->Instance->CR3 |= (__REQUEST__)) |
mbed_official | 235:685d5f11838f | 447 | #define __SMARTCARD_DMA_REQUEST_DISABLE(__HANDLE__, __REQUEST__) ((__HANDLE__)->Instance->CR3 &= ~(__REQUEST__)) |
mbed_official | 235:685d5f11838f | 448 | |
mbed_official | 235:685d5f11838f | 449 | #define __DIV(_PCLK_, _BAUD_) (((_PCLK_)*25)/(4*(_BAUD_))) |
mbed_official | 235:685d5f11838f | 450 | #define __DIVMANT(_PCLK_, _BAUD_) (__DIV((_PCLK_), (_BAUD_))/100) |
mbed_official | 235:685d5f11838f | 451 | #define __DIVFRAQ(_PCLK_, _BAUD_) (((__DIV((_PCLK_), (_BAUD_)) - (__DIVMANT((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100) |
mbed_official | 235:685d5f11838f | 452 | #define __SMARTCARD_BRR(_PCLK_, _BAUD_) ((__DIVMANT((_PCLK_), (_BAUD_)) << 4)|(__DIVFRAQ((_PCLK_), (_BAUD_)) & 0x0F)) |
mbed_official | 235:685d5f11838f | 453 | |
mbed_official | 235:685d5f11838f | 454 | #define IS_SMARTCARD_BAUDRATE(BAUDRATE) ((BAUDRATE) < 10500001) |
mbed_official | 235:685d5f11838f | 455 | |
mbed_official | 235:685d5f11838f | 456 | /* Exported functions --------------------------------------------------------*/ |
mbed_official | 235:685d5f11838f | 457 | /* Initialization/de-initialization functions **********************************/ |
mbed_official | 235:685d5f11838f | 458 | HAL_StatusTypeDef HAL_SMARTCARD_Init(SMARTCARD_HandleTypeDef *hsc); |
mbed_official | 235:685d5f11838f | 459 | HAL_StatusTypeDef HAL_SMARTCARD_ReInit(SMARTCARD_HandleTypeDef *hsc); |
mbed_official | 235:685d5f11838f | 460 | HAL_StatusTypeDef HAL_SMARTCARD_DeInit(SMARTCARD_HandleTypeDef *hsc); |
mbed_official | 235:685d5f11838f | 461 | void HAL_SMARTCARD_MspInit(SMARTCARD_HandleTypeDef *hsc); |
mbed_official | 235:685d5f11838f | 462 | void HAL_SMARTCARD_MspDeInit(SMARTCARD_HandleTypeDef *hsc); |
mbed_official | 235:685d5f11838f | 463 | /* IO operation functions *******************************************************/ |
mbed_official | 235:685d5f11838f | 464 | HAL_StatusTypeDef HAL_SMARTCARD_Transmit(SMARTCARD_HandleTypeDef *hsc, uint8_t *pData, uint16_t Size, uint32_t Timeout); |
mbed_official | 235:685d5f11838f | 465 | HAL_StatusTypeDef HAL_SMARTCARD_Receive(SMARTCARD_HandleTypeDef *hsc, uint8_t *pData, uint16_t Size, uint32_t Timeout); |
mbed_official | 235:685d5f11838f | 466 | HAL_StatusTypeDef HAL_SMARTCARD_Transmit_IT(SMARTCARD_HandleTypeDef *hsc, uint8_t *pData, uint16_t Size); |
mbed_official | 235:685d5f11838f | 467 | HAL_StatusTypeDef HAL_SMARTCARD_Receive_IT(SMARTCARD_HandleTypeDef *hsc, uint8_t *pData, uint16_t Size); |
mbed_official | 235:685d5f11838f | 468 | HAL_StatusTypeDef HAL_SMARTCARD_Transmit_DMA(SMARTCARD_HandleTypeDef *hsc, uint8_t *pData, uint16_t Size); |
mbed_official | 235:685d5f11838f | 469 | HAL_StatusTypeDef HAL_SMARTCARD_Receive_DMA(SMARTCARD_HandleTypeDef *hsc, uint8_t *pData, uint16_t Size); |
mbed_official | 235:685d5f11838f | 470 | void HAL_SMARTCARD_IRQHandler(SMARTCARD_HandleTypeDef *hsc); |
mbed_official | 235:685d5f11838f | 471 | void HAL_SMARTCARD_TxCpltCallback(SMARTCARD_HandleTypeDef *hsc); |
mbed_official | 235:685d5f11838f | 472 | void HAL_SMARTCARD_RxCpltCallback(SMARTCARD_HandleTypeDef *hsc); |
mbed_official | 235:685d5f11838f | 473 | void HAL_SMARTCARD_ErrorCallback(SMARTCARD_HandleTypeDef *hsc); |
mbed_official | 235:685d5f11838f | 474 | |
mbed_official | 235:685d5f11838f | 475 | /* Peripheral State functions **************************************************/ |
mbed_official | 235:685d5f11838f | 476 | HAL_SMARTCARD_StateTypeDef HAL_SMARTCARD_GetState(SMARTCARD_HandleTypeDef *hsc); |
mbed_official | 235:685d5f11838f | 477 | uint32_t HAL_SMARTCARD_GetError(SMARTCARD_HandleTypeDef *hsc); |
mbed_official | 235:685d5f11838f | 478 | |
mbed_official | 235:685d5f11838f | 479 | /** |
mbed_official | 235:685d5f11838f | 480 | * @} |
mbed_official | 235:685d5f11838f | 481 | */ |
mbed_official | 235:685d5f11838f | 482 | |
mbed_official | 235:685d5f11838f | 483 | /** |
mbed_official | 235:685d5f11838f | 484 | * @} |
mbed_official | 235:685d5f11838f | 485 | */ |
mbed_official | 235:685d5f11838f | 486 | |
mbed_official | 235:685d5f11838f | 487 | #ifdef __cplusplus |
mbed_official | 235:685d5f11838f | 488 | } |
mbed_official | 235:685d5f11838f | 489 | #endif |
mbed_official | 235:685d5f11838f | 490 | |
mbed_official | 235:685d5f11838f | 491 | #endif /* __STM32F4xx_HAL_SMARTCARD_H */ |
mbed_official | 235:685d5f11838f | 492 | |
mbed_official | 235:685d5f11838f | 493 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |