mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Jul 02 16:30:08 2015 +0100
Revision:
581:39197bcd20f2
Parent:
489:119543c9f674
Synchronized with git revision ae2d3cdffe70184eb8736d94f76c45c93f4b7724

Full URL: https://github.com/mbedmicro/mbed/commit/ae2d3cdffe70184eb8736d94f76c45c93f4b7724/

Make it possible to build the core mbed library with yotta

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 489:119543c9f674 1 /**
mbed_official 489:119543c9f674 2 ******************************************************************************
mbed_official 489:119543c9f674 3 * @file stm32f1xx_hal_usart.h
mbed_official 489:119543c9f674 4 * @author MCD Application Team
mbed_official 489:119543c9f674 5 * @version V1.0.0
mbed_official 489:119543c9f674 6 * @date 15-December-2014
mbed_official 489:119543c9f674 7 * @brief Header file of USART HAL module.
mbed_official 489:119543c9f674 8 ******************************************************************************
mbed_official 489:119543c9f674 9 * @attention
mbed_official 489:119543c9f674 10 *
mbed_official 489:119543c9f674 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 489:119543c9f674 12 *
mbed_official 489:119543c9f674 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 489:119543c9f674 14 * are permitted provided that the following conditions are met:
mbed_official 489:119543c9f674 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 489:119543c9f674 16 * this list of conditions and the following disclaimer.
mbed_official 489:119543c9f674 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 489:119543c9f674 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 489:119543c9f674 19 * and/or other materials provided with the distribution.
mbed_official 489:119543c9f674 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 489:119543c9f674 21 * may be used to endorse or promote products derived from this software
mbed_official 489:119543c9f674 22 * without specific prior written permission.
mbed_official 489:119543c9f674 23 *
mbed_official 489:119543c9f674 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 489:119543c9f674 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 489:119543c9f674 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 489:119543c9f674 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 489:119543c9f674 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 489:119543c9f674 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 489:119543c9f674 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 489:119543c9f674 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 489:119543c9f674 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 489:119543c9f674 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 489:119543c9f674 34 *
mbed_official 489:119543c9f674 35 ******************************************************************************
mbed_official 489:119543c9f674 36 */
mbed_official 489:119543c9f674 37
mbed_official 489:119543c9f674 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 489:119543c9f674 39 #ifndef __STM32F1xx_HAL_USART_H
mbed_official 489:119543c9f674 40 #define __STM32F1xx_HAL_USART_H
mbed_official 489:119543c9f674 41
mbed_official 489:119543c9f674 42 #ifdef __cplusplus
mbed_official 489:119543c9f674 43 extern "C" {
mbed_official 489:119543c9f674 44 #endif
mbed_official 489:119543c9f674 45
mbed_official 489:119543c9f674 46 /* Includes ------------------------------------------------------------------*/
mbed_official 489:119543c9f674 47 #include "stm32f1xx_hal_def.h"
mbed_official 489:119543c9f674 48
mbed_official 489:119543c9f674 49 /** @addtogroup STM32F1xx_HAL_Driver
mbed_official 489:119543c9f674 50 * @{
mbed_official 489:119543c9f674 51 */
mbed_official 489:119543c9f674 52
mbed_official 489:119543c9f674 53 /** @addtogroup USART
mbed_official 489:119543c9f674 54 * @{
mbed_official 489:119543c9f674 55 */
mbed_official 489:119543c9f674 56
mbed_official 489:119543c9f674 57 /* Exported types ------------------------------------------------------------*/
mbed_official 489:119543c9f674 58 /** @defgroup USART_Exported_Types USART Exported Types
mbed_official 489:119543c9f674 59 * @{
mbed_official 489:119543c9f674 60 */
mbed_official 489:119543c9f674 61
mbed_official 489:119543c9f674 62
mbed_official 489:119543c9f674 63 /**
mbed_official 489:119543c9f674 64 * @brief USART Init Structure definition
mbed_official 489:119543c9f674 65 */
mbed_official 489:119543c9f674 66 typedef struct
mbed_official 489:119543c9f674 67 {
mbed_official 489:119543c9f674 68 uint32_t BaudRate; /*!< This member configures the Usart communication baud rate.
mbed_official 489:119543c9f674 69 The baud rate is computed using the following formula:
mbed_official 489:119543c9f674 70 - IntegerDivider = ((PCLKx) / (16 * (husart->Init.BaudRate)))
mbed_official 489:119543c9f674 71 - FractionalDivider = ((IntegerDivider - ((uint32_t) IntegerDivider)) * 16) + 0.5 */
mbed_official 489:119543c9f674 72
mbed_official 489:119543c9f674 73 uint32_t WordLength; /*!< Specifies the number of data bits transmitted or received in a frame.
mbed_official 489:119543c9f674 74 This parameter can be a value of @ref USART_Word_Length */
mbed_official 489:119543c9f674 75
mbed_official 489:119543c9f674 76 uint32_t StopBits; /*!< Specifies the number of stop bits transmitted.
mbed_official 489:119543c9f674 77 This parameter can be a value of @ref USART_Stop_Bits */
mbed_official 489:119543c9f674 78
mbed_official 489:119543c9f674 79 uint32_t Parity; /*!< Specifies the parity mode.
mbed_official 489:119543c9f674 80 This parameter can be a value of @ref USART_Parity
mbed_official 489:119543c9f674 81 @note When parity is enabled, the computed parity is inserted
mbed_official 489:119543c9f674 82 at the MSB position of the transmitted data (9th bit when
mbed_official 489:119543c9f674 83 the word length is set to 9 data bits; 8th bit when the
mbed_official 489:119543c9f674 84 word length is set to 8 data bits). */
mbed_official 489:119543c9f674 85
mbed_official 489:119543c9f674 86 uint32_t Mode; /*!< Specifies wether the Receive or Transmit mode is enabled or disabled.
mbed_official 489:119543c9f674 87 This parameter can be a value of @ref USART_Mode */
mbed_official 489:119543c9f674 88
mbed_official 489:119543c9f674 89 uint32_t CLKPolarity; /*!< Specifies the steady state of the serial clock.
mbed_official 489:119543c9f674 90 This parameter can be a value of @ref USART_Clock_Polarity */
mbed_official 489:119543c9f674 91
mbed_official 489:119543c9f674 92 uint32_t CLKPhase; /*!< Specifies the clock transition on which the bit capture is made.
mbed_official 489:119543c9f674 93 This parameter can be a value of @ref USART_Clock_Phase */
mbed_official 489:119543c9f674 94
mbed_official 489:119543c9f674 95 uint32_t CLKLastBit; /*!< Specifies whether the clock pulse corresponding to the last transmitted
mbed_official 489:119543c9f674 96 data bit (MSB) has to be output on the SCLK pin in synchronous mode.
mbed_official 489:119543c9f674 97 This parameter can be a value of @ref USART_Last_Bit */
mbed_official 489:119543c9f674 98 }USART_InitTypeDef;
mbed_official 489:119543c9f674 99
mbed_official 489:119543c9f674 100 /**
mbed_official 489:119543c9f674 101 * @brief HAL State structures definition
mbed_official 489:119543c9f674 102 */
mbed_official 489:119543c9f674 103 typedef enum
mbed_official 489:119543c9f674 104 {
mbed_official 489:119543c9f674 105 HAL_USART_STATE_RESET = 0x00, /*!< Peripheral is not initialized */
mbed_official 489:119543c9f674 106 HAL_USART_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */
mbed_official 489:119543c9f674 107 HAL_USART_STATE_BUSY = 0x02, /*!< an internal process is ongoing */
mbed_official 489:119543c9f674 108 HAL_USART_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */
mbed_official 489:119543c9f674 109 HAL_USART_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */
mbed_official 489:119543c9f674 110 HAL_USART_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission Reception process is ongoing */
mbed_official 489:119543c9f674 111 HAL_USART_STATE_TIMEOUT = 0x03, /*!< Timeout state */
mbed_official 489:119543c9f674 112 HAL_USART_STATE_ERROR = 0x04 /*!< Error */
mbed_official 489:119543c9f674 113 }HAL_USART_StateTypeDef;
mbed_official 489:119543c9f674 114
mbed_official 489:119543c9f674 115
mbed_official 489:119543c9f674 116 /**
mbed_official 489:119543c9f674 117 * @brief USART handle Structure definition
mbed_official 489:119543c9f674 118 */
mbed_official 489:119543c9f674 119 typedef struct
mbed_official 489:119543c9f674 120 {
mbed_official 489:119543c9f674 121 USART_TypeDef *Instance; /*!< USART registers base address */
mbed_official 489:119543c9f674 122
mbed_official 489:119543c9f674 123 USART_InitTypeDef Init; /*!< Usart communication parameters */
mbed_official 489:119543c9f674 124
mbed_official 489:119543c9f674 125 uint8_t *pTxBuffPtr; /*!< Pointer to Usart Tx transfer Buffer */
mbed_official 489:119543c9f674 126
mbed_official 489:119543c9f674 127 uint16_t TxXferSize; /*!< Usart Tx Transfer size */
mbed_official 489:119543c9f674 128
mbed_official 489:119543c9f674 129 __IO uint16_t TxXferCount; /*!< Usart Tx Transfer Counter */
mbed_official 489:119543c9f674 130
mbed_official 489:119543c9f674 131 uint8_t *pRxBuffPtr; /*!< Pointer to Usart Rx transfer Buffer */
mbed_official 489:119543c9f674 132
mbed_official 489:119543c9f674 133 uint16_t RxXferSize; /*!< Usart Rx Transfer size */
mbed_official 489:119543c9f674 134
mbed_official 489:119543c9f674 135 __IO uint16_t RxXferCount; /*!< Usart Rx Transfer Counter */
mbed_official 489:119543c9f674 136
mbed_official 489:119543c9f674 137 DMA_HandleTypeDef *hdmatx; /*!< Usart Tx DMA Handle parameters */
mbed_official 489:119543c9f674 138
mbed_official 489:119543c9f674 139 DMA_HandleTypeDef *hdmarx; /*!< Usart Rx DMA Handle parameters */
mbed_official 489:119543c9f674 140
mbed_official 489:119543c9f674 141 HAL_LockTypeDef Lock; /*!< Locking object */
mbed_official 489:119543c9f674 142
mbed_official 489:119543c9f674 143 __IO HAL_USART_StateTypeDef State; /*!< Usart communication state */
mbed_official 489:119543c9f674 144
mbed_official 489:119543c9f674 145 __IO uint32_t ErrorCode; /*!< USART Error code */
mbed_official 489:119543c9f674 146
mbed_official 489:119543c9f674 147 }USART_HandleTypeDef;
mbed_official 489:119543c9f674 148
mbed_official 489:119543c9f674 149 /**
mbed_official 489:119543c9f674 150 * @}
mbed_official 489:119543c9f674 151 */
mbed_official 489:119543c9f674 152
mbed_official 489:119543c9f674 153 /* Exported constants --------------------------------------------------------*/
mbed_official 489:119543c9f674 154 /** @defgroup USART_Exported_Constants USART Exported constants
mbed_official 489:119543c9f674 155 * @{
mbed_official 489:119543c9f674 156 */
mbed_official 489:119543c9f674 157
mbed_official 489:119543c9f674 158 /** @defgroup USART_Error_Codes USART Error Codes
mbed_official 489:119543c9f674 159 * @{
mbed_official 489:119543c9f674 160 */
mbed_official 489:119543c9f674 161 #define HAL_USART_ERROR_NONE ((uint32_t)0x00) /*!< No error */
mbed_official 489:119543c9f674 162 #define HAL_USART_ERROR_PE ((uint32_t)0x01) /*!< Parity error */
mbed_official 489:119543c9f674 163 #define HAL_USART_ERROR_NE ((uint32_t)0x02) /*!< Noise error */
mbed_official 489:119543c9f674 164 #define HAL_USART_ERROR_FE ((uint32_t)0x04) /*!< frame error */
mbed_official 489:119543c9f674 165 #define HAL_USART_ERROR_ORE ((uint32_t)0x08) /*!< Overrun error */
mbed_official 489:119543c9f674 166 #define HAL_USART_ERROR_DMA ((uint32_t)0x10) /*!< DMA transfer error */
mbed_official 489:119543c9f674 167 /**
mbed_official 489:119543c9f674 168 * @}
mbed_official 489:119543c9f674 169 */
mbed_official 489:119543c9f674 170
mbed_official 489:119543c9f674 171 /** @defgroup USART_Word_Length USART Word Length
mbed_official 489:119543c9f674 172 * @{
mbed_official 489:119543c9f674 173 */
mbed_official 489:119543c9f674 174 #define USART_WORDLENGTH_8B ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 175 #define USART_WORDLENGTH_9B ((uint32_t)USART_CR1_M)
mbed_official 489:119543c9f674 176 /**
mbed_official 489:119543c9f674 177 * @}
mbed_official 489:119543c9f674 178 */
mbed_official 489:119543c9f674 179
mbed_official 489:119543c9f674 180 /** @defgroup USART_Stop_Bits USART Number of Stop Bits
mbed_official 489:119543c9f674 181 * @{
mbed_official 489:119543c9f674 182 */
mbed_official 489:119543c9f674 183 #define USART_STOPBITS_1 ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 184 #define USART_STOPBITS_0_5 ((uint32_t)USART_CR2_STOP_0)
mbed_official 489:119543c9f674 185 #define USART_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1)
mbed_official 489:119543c9f674 186 #define USART_STOPBITS_1_5 ((uint32_t)(USART_CR2_STOP_0 | USART_CR2_STOP_1))
mbed_official 489:119543c9f674 187 /**
mbed_official 489:119543c9f674 188 * @}
mbed_official 489:119543c9f674 189 */
mbed_official 489:119543c9f674 190
mbed_official 489:119543c9f674 191 /** @defgroup USART_Parity USART Parity
mbed_official 489:119543c9f674 192 * @{
mbed_official 489:119543c9f674 193 */
mbed_official 489:119543c9f674 194 #define USART_PARITY_NONE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 195 #define USART_PARITY_EVEN ((uint32_t)USART_CR1_PCE)
mbed_official 489:119543c9f674 196 #define USART_PARITY_ODD ((uint32_t)(USART_CR1_PCE | USART_CR1_PS))
mbed_official 489:119543c9f674 197 /**
mbed_official 489:119543c9f674 198 * @}
mbed_official 489:119543c9f674 199 */
mbed_official 489:119543c9f674 200
mbed_official 489:119543c9f674 201 /** @defgroup USART_Mode USART Mode
mbed_official 489:119543c9f674 202 * @{
mbed_official 489:119543c9f674 203 */
mbed_official 489:119543c9f674 204 #define USART_MODE_RX ((uint32_t)USART_CR1_RE)
mbed_official 489:119543c9f674 205 #define USART_MODE_TX ((uint32_t)USART_CR1_TE)
mbed_official 489:119543c9f674 206 #define USART_MODE_TX_RX ((uint32_t)(USART_CR1_TE |USART_CR1_RE))
mbed_official 489:119543c9f674 207
mbed_official 489:119543c9f674 208 /**
mbed_official 489:119543c9f674 209 * @}
mbed_official 489:119543c9f674 210 */
mbed_official 489:119543c9f674 211
mbed_official 489:119543c9f674 212 /** @defgroup USART_Clock USART Clock
mbed_official 489:119543c9f674 213 * @{
mbed_official 489:119543c9f674 214 */
mbed_official 489:119543c9f674 215 #define USART_CLOCK_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 216 #define USART_CLOCK_ENABLE ((uint32_t)USART_CR2_CLKEN)
mbed_official 489:119543c9f674 217 /**
mbed_official 489:119543c9f674 218 * @}
mbed_official 489:119543c9f674 219 */
mbed_official 489:119543c9f674 220
mbed_official 489:119543c9f674 221 /** @defgroup USART_Clock_Polarity USART Clock Polarity
mbed_official 489:119543c9f674 222 * @{
mbed_official 489:119543c9f674 223 */
mbed_official 489:119543c9f674 224 #define USART_POLARITY_LOW ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 225 #define USART_POLARITY_HIGH ((uint32_t)USART_CR2_CPOL)
mbed_official 489:119543c9f674 226 /**
mbed_official 489:119543c9f674 227 * @}
mbed_official 489:119543c9f674 228 */
mbed_official 489:119543c9f674 229
mbed_official 489:119543c9f674 230 /** @defgroup USART_Clock_Phase USART Clock Phase
mbed_official 489:119543c9f674 231 * @{
mbed_official 489:119543c9f674 232 */
mbed_official 489:119543c9f674 233 #define USART_PHASE_1EDGE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 234 #define USART_PHASE_2EDGE ((uint32_t)USART_CR2_CPHA)
mbed_official 489:119543c9f674 235 /**
mbed_official 489:119543c9f674 236 * @}
mbed_official 489:119543c9f674 237 */
mbed_official 489:119543c9f674 238
mbed_official 489:119543c9f674 239 /** @defgroup USART_Last_Bit USART Last Bit
mbed_official 489:119543c9f674 240 * @{
mbed_official 489:119543c9f674 241 */
mbed_official 489:119543c9f674 242 #define USART_LASTBIT_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 243 #define USART_LASTBIT_ENABLE ((uint32_t)USART_CR2_LBCL)
mbed_official 489:119543c9f674 244 /**
mbed_official 489:119543c9f674 245 * @}
mbed_official 489:119543c9f674 246 */
mbed_official 489:119543c9f674 247
mbed_official 489:119543c9f674 248 /** @defgroup USART_NACK_State USART NACK State
mbed_official 489:119543c9f674 249 * @{
mbed_official 489:119543c9f674 250 */
mbed_official 489:119543c9f674 251 #define USART_NACK_ENABLE ((uint32_t)USART_CR3_NACK)
mbed_official 489:119543c9f674 252 #define USART_NACK_DISABLE ((uint32_t)0x00000000)
mbed_official 489:119543c9f674 253 /**
mbed_official 489:119543c9f674 254 * @}
mbed_official 489:119543c9f674 255 */
mbed_official 489:119543c9f674 256
mbed_official 489:119543c9f674 257 /** @defgroup USART_Flags USART Flags
mbed_official 489:119543c9f674 258 * Elements values convention: 0xXXXX
mbed_official 489:119543c9f674 259 * - 0xXXXX : Flag mask in the SR register
mbed_official 489:119543c9f674 260 * @{
mbed_official 489:119543c9f674 261 */
mbed_official 489:119543c9f674 262
mbed_official 489:119543c9f674 263 #define USART_FLAG_CTS ((uint32_t)USART_SR_CTS)
mbed_official 489:119543c9f674 264 #define USART_FLAG_LBD ((uint32_t)USART_SR_LBD)
mbed_official 489:119543c9f674 265 #define USART_FLAG_TXE ((uint32_t)USART_SR_TXE)
mbed_official 489:119543c9f674 266 #define USART_FLAG_TC ((uint32_t)USART_SR_TC)
mbed_official 489:119543c9f674 267 #define USART_FLAG_RXNE ((uint32_t)USART_SR_RXNE)
mbed_official 489:119543c9f674 268 #define USART_FLAG_IDLE ((uint32_t)USART_SR_IDLE)
mbed_official 489:119543c9f674 269 #define USART_FLAG_ORE ((uint32_t)USART_SR_ORE)
mbed_official 489:119543c9f674 270 #define USART_FLAG_NE ((uint32_t)USART_SR_NE)
mbed_official 489:119543c9f674 271 #define USART_FLAG_FE ((uint32_t)USART_SR_FE)
mbed_official 489:119543c9f674 272 #define USART_FLAG_PE ((uint32_t)USART_SR_PE)
mbed_official 489:119543c9f674 273 /**
mbed_official 489:119543c9f674 274 * @}
mbed_official 489:119543c9f674 275 */
mbed_official 489:119543c9f674 276
mbed_official 489:119543c9f674 277 /** @defgroup USART_Interrupt_definition USART Interrupts Definition
mbed_official 489:119543c9f674 278 * Elements values convention: 0xY000XXXX
mbed_official 489:119543c9f674 279 * - XXXX : Interrupt mask (16 bits) in the Y register
mbed_official 489:119543c9f674 280 * - Y : Interrupt source register (4bits)
mbed_official 489:119543c9f674 281 * - 0001: CR1 register
mbed_official 489:119543c9f674 282 * - 0010: CR2 register
mbed_official 489:119543c9f674 283 * - 0011: CR3 register
mbed_official 489:119543c9f674 284 *
mbed_official 489:119543c9f674 285 * @{
mbed_official 489:119543c9f674 286 */
mbed_official 489:119543c9f674 287
mbed_official 489:119543c9f674 288 #define USART_IT_PE ((uint32_t)(USART_CR1_REG_INDEX << 28 | USART_CR1_PEIE))
mbed_official 489:119543c9f674 289 #define USART_IT_TXE ((uint32_t)(USART_CR1_REG_INDEX << 28 | USART_CR1_TXEIE))
mbed_official 489:119543c9f674 290 #define USART_IT_TC ((uint32_t)(USART_CR1_REG_INDEX << 28 | USART_CR1_TCIE))
mbed_official 489:119543c9f674 291 #define USART_IT_RXNE ((uint32_t)(USART_CR1_REG_INDEX << 28 | USART_CR1_RXNEIE))
mbed_official 489:119543c9f674 292 #define USART_IT_IDLE ((uint32_t)(USART_CR1_REG_INDEX << 28 | USART_CR1_IDLEIE))
mbed_official 489:119543c9f674 293
mbed_official 489:119543c9f674 294 #define USART_IT_LBD ((uint32_t)(USART_CR2_REG_INDEX << 28 | USART_CR2_LBDIE))
mbed_official 489:119543c9f674 295
mbed_official 489:119543c9f674 296 #define USART_IT_CTS ((uint32_t)(USART_CR3_REG_INDEX << 28 | USART_CR3_CTSIE))
mbed_official 489:119543c9f674 297 #define USART_IT_ERR ((uint32_t)(USART_CR3_REG_INDEX << 28 | USART_CR3_EIE))
mbed_official 489:119543c9f674 298
mbed_official 489:119543c9f674 299
mbed_official 489:119543c9f674 300 /**
mbed_official 489:119543c9f674 301 * @}
mbed_official 489:119543c9f674 302 */
mbed_official 489:119543c9f674 303
mbed_official 489:119543c9f674 304 /**
mbed_official 489:119543c9f674 305 * @}
mbed_official 489:119543c9f674 306 */
mbed_official 489:119543c9f674 307
mbed_official 489:119543c9f674 308
mbed_official 489:119543c9f674 309 /* Exported macro ------------------------------------------------------------*/
mbed_official 489:119543c9f674 310 /** @defgroup USART_Exported_Macros USART Exported Macros
mbed_official 489:119543c9f674 311 * @{
mbed_official 489:119543c9f674 312 */
mbed_official 489:119543c9f674 313
mbed_official 489:119543c9f674 314
mbed_official 489:119543c9f674 315 /** @brief Reset USART handle state
mbed_official 489:119543c9f674 316 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 317 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 318 * @retval None
mbed_official 489:119543c9f674 319 */
mbed_official 489:119543c9f674 320 #define __HAL_USART_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_USART_STATE_RESET)
mbed_official 489:119543c9f674 321
mbed_official 489:119543c9f674 322 /** @brief Check whether the specified USART flag is set or not.
mbed_official 489:119543c9f674 323 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 324 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 325 * @param __FLAG__: specifies the flag to check.
mbed_official 489:119543c9f674 326 * This parameter can be one of the following values:
mbed_official 489:119543c9f674 327 * @arg USART_FLAG_TXE: Transmit data register empty flag
mbed_official 489:119543c9f674 328 * @arg USART_FLAG_TC: Transmission Complete flag
mbed_official 489:119543c9f674 329 * @arg USART_FLAG_RXNE: Receive data register not empty flag
mbed_official 489:119543c9f674 330 * @arg USART_FLAG_IDLE: Idle Line detection flag
mbed_official 489:119543c9f674 331 * @arg USART_FLAG_ORE: OverRun Error flag
mbed_official 489:119543c9f674 332 * @arg USART_FLAG_NE: Noise Error flag
mbed_official 489:119543c9f674 333 * @arg USART_FLAG_FE: Framing Error flag
mbed_official 489:119543c9f674 334 * @arg USART_FLAG_PE: Parity Error flag
mbed_official 489:119543c9f674 335 * @retval The new state of __FLAG__ (TRUE or FALSE).
mbed_official 489:119543c9f674 336 */
mbed_official 489:119543c9f674 337
mbed_official 489:119543c9f674 338 #define __HAL_USART_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__))
mbed_official 489:119543c9f674 339
mbed_official 489:119543c9f674 340 /** @brief Clear the specified USART pending flags.
mbed_official 489:119543c9f674 341 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 342 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 343 * @param __FLAG__: specifies the flag to check.
mbed_official 489:119543c9f674 344 * This parameter can be any combination of the following values:
mbed_official 489:119543c9f674 345 * @arg USART_FLAG_TC: Transmission Complete flag.
mbed_official 489:119543c9f674 346 * @arg USART_FLAG_RXNE: Receive data register not empty flag.
mbed_official 489:119543c9f674 347 *
mbed_official 489:119543c9f674 348 * @note PE (Parity error), FE (Framing error), NE (Noise error), ORE (OverRun
mbed_official 489:119543c9f674 349 * error) and IDLE (Idle line detected) flags are cleared by software
mbed_official 489:119543c9f674 350 * sequence: a read operation to USART_SR register followed by a read
mbed_official 489:119543c9f674 351 * operation to USART_DR register.
mbed_official 489:119543c9f674 352 * @note RXNE flag can be also cleared by a read to the USART_DR register.
mbed_official 489:119543c9f674 353 * @note TC flag can be also cleared by software sequence: a read operation to
mbed_official 489:119543c9f674 354 * USART_SR register followed by a write operation to USART_DR register.
mbed_official 489:119543c9f674 355 * @note TXE flag is cleared only by a write to the USART_DR register.
mbed_official 489:119543c9f674 356 *
mbed_official 489:119543c9f674 357 * @retval None
mbed_official 489:119543c9f674 358 */
mbed_official 489:119543c9f674 359 #define __HAL_USART_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__))
mbed_official 489:119543c9f674 360
mbed_official 489:119543c9f674 361 /** @brief Clear the USART PE pending flag.
mbed_official 489:119543c9f674 362 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 363 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 364 * @retval None
mbed_official 489:119543c9f674 365 */
mbed_official 489:119543c9f674 366 #define __HAL_USART_CLEAR_PEFLAG(__HANDLE__) \
mbed_official 489:119543c9f674 367 do{ \
mbed_official 489:119543c9f674 368 __IO uint32_t tmpreg; \
mbed_official 489:119543c9f674 369 tmpreg = (__HANDLE__)->Instance->SR; \
mbed_official 489:119543c9f674 370 tmpreg = (__HANDLE__)->Instance->DR; \
mbed_official 489:119543c9f674 371 UNUSED(tmpreg); \
mbed_official 489:119543c9f674 372 }while(0)
mbed_official 489:119543c9f674 373
mbed_official 489:119543c9f674 374
mbed_official 489:119543c9f674 375 /** @brief Clear the USART FE pending flag.
mbed_official 489:119543c9f674 376 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 377 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 378 * @retval None
mbed_official 489:119543c9f674 379 */
mbed_official 489:119543c9f674 380 #define __HAL_USART_CLEAR_FEFLAG(__HANDLE__) __HAL_USART_CLEAR_PEFLAG(__HANDLE__)
mbed_official 489:119543c9f674 381
mbed_official 489:119543c9f674 382 /** @brief Clear the USART NE pending flag.
mbed_official 489:119543c9f674 383 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 384 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 385 * @retval None
mbed_official 489:119543c9f674 386 */
mbed_official 489:119543c9f674 387 #define __HAL_USART_CLEAR_NEFLAG(__HANDLE__) __HAL_USART_CLEAR_PEFLAG(__HANDLE__)
mbed_official 489:119543c9f674 388
mbed_official 489:119543c9f674 389 /** @brief Clear the USART ORE pending flag.
mbed_official 489:119543c9f674 390 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 391 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 392 * @retval None
mbed_official 489:119543c9f674 393 */
mbed_official 489:119543c9f674 394 #define __HAL_USART_CLEAR_OREFLAG(__HANDLE__) __HAL_USART_CLEAR_PEFLAG(__HANDLE__)
mbed_official 489:119543c9f674 395
mbed_official 489:119543c9f674 396 /** @brief Clear the USART IDLE pending flag.
mbed_official 489:119543c9f674 397 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 398 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 399 * @retval None
mbed_official 489:119543c9f674 400 */
mbed_official 489:119543c9f674 401 #define __HAL_USART_CLEAR_IDLEFLAG(__HANDLE__) __HAL_USART_CLEAR_PEFLAG(__HANDLE__)
mbed_official 489:119543c9f674 402
mbed_official 489:119543c9f674 403 /** @brief Enable the specified Usart interrupts.
mbed_official 489:119543c9f674 404 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 405 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 406 * @param __INTERRUPT__: specifies the USART interrupt source to enable.
mbed_official 489:119543c9f674 407 * This parameter can be one of the following values:
mbed_official 489:119543c9f674 408 * @arg USART_IT_TXE: Transmit Data Register empty interrupt
mbed_official 489:119543c9f674 409 * @arg USART_IT_TC: Transmission complete interrupt
mbed_official 489:119543c9f674 410 * @arg USART_IT_RXNE: Receive Data register not empty interrupt
mbed_official 489:119543c9f674 411 * @arg USART_IT_IDLE: Idle line detection interrupt
mbed_official 489:119543c9f674 412 * @arg USART_IT_PE: Parity Error interrupt
mbed_official 489:119543c9f674 413 * @arg USART_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
mbed_official 489:119543c9f674 414 * @retval None
mbed_official 489:119543c9f674 415 */
mbed_official 489:119543c9f674 416 #define __HAL_USART_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == USART_CR1_REG_INDEX)? ((__HANDLE__)->Instance->CR1 |= ((__INTERRUPT__) & USART_IT_MASK)): \
mbed_official 489:119543c9f674 417 (((__INTERRUPT__) >> 28) == USART_CR2_REG_INDEX)? ((__HANDLE__)->Instance->CR2 |= ((__INTERRUPT__) & USART_IT_MASK)): \
mbed_official 489:119543c9f674 418 ((__HANDLE__)->Instance->CR3 |= ((__INTERRUPT__) & USART_IT_MASK)))
mbed_official 489:119543c9f674 419
mbed_official 489:119543c9f674 420
mbed_official 489:119543c9f674 421 /** @brief Disable the specified Usart interrupts.
mbed_official 489:119543c9f674 422 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 423 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 424 * @param __INTERRUPT__: specifies the USART interrupt source to disable.
mbed_official 489:119543c9f674 425 * This parameter can be one of the following values:
mbed_official 489:119543c9f674 426 * @arg USART_IT_TXE: Transmit Data Register empty interrupt
mbed_official 489:119543c9f674 427 * @arg USART_IT_TC: Transmission complete interrupt
mbed_official 489:119543c9f674 428 * @arg USART_IT_RXNE: Receive Data register not empty interrupt
mbed_official 489:119543c9f674 429 * @arg USART_IT_IDLE: Idle line detection interrupt
mbed_official 489:119543c9f674 430 * @arg USART_IT_PE: Parity Error interrupt
mbed_official 489:119543c9f674 431 * @arg USART_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
mbed_official 489:119543c9f674 432 * @retval None
mbed_official 489:119543c9f674 433 */
mbed_official 489:119543c9f674 434 #define __HAL_USART_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((((__INTERRUPT__) >> 28) == USART_CR1_REG_INDEX)? ((__HANDLE__)->Instance->CR1 &= ~((__INTERRUPT__) & USART_IT_MASK)): \
mbed_official 489:119543c9f674 435 (((__INTERRUPT__) >> 28) == USART_CR2_REG_INDEX)? ((__HANDLE__)->Instance->CR2 &= ~((__INTERRUPT__) & USART_IT_MASK)): \
mbed_official 489:119543c9f674 436 ((__HANDLE__)->Instance->CR3 &= ~ ((__INTERRUPT__) & USART_IT_MASK)))
mbed_official 489:119543c9f674 437
mbed_official 489:119543c9f674 438
mbed_official 489:119543c9f674 439
mbed_official 489:119543c9f674 440 /** @brief Check whether the specified Usart interrupt has occurred or not.
mbed_official 489:119543c9f674 441 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 442 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 443 * @param __IT__: specifies the USART interrupt source to check.
mbed_official 489:119543c9f674 444 * This parameter can be one of the following values:
mbed_official 489:119543c9f674 445 * @arg USART_IT_TXE: Transmit Data Register empty interrupt
mbed_official 489:119543c9f674 446 * @arg USART_IT_TC: Transmission complete interrupt
mbed_official 489:119543c9f674 447 * @arg USART_IT_RXNE: Receive Data register not empty interrupt
mbed_official 489:119543c9f674 448 * @arg USART_IT_IDLE: Idle line detection interrupt
mbed_official 489:119543c9f674 449 * @arg USART_IT_ERR: Error interrupt
mbed_official 489:119543c9f674 450 * @arg USART_IT_PE: Parity Error interrupt
mbed_official 489:119543c9f674 451 * @retval The new state of __IT__ (TRUE or FALSE).
mbed_official 489:119543c9f674 452 */
mbed_official 489:119543c9f674 453 #define __HAL_USART_GET_IT_SOURCE(__HANDLE__, __IT__) (((((__IT__) >> 28) == USART_CR1_REG_INDEX)? (__HANDLE__)->Instance->CR1:(((((uint32_t)(__IT__)) >> 28) == USART_CR2_REG_INDEX)? \
mbed_official 489:119543c9f674 454 (__HANDLE__)->Instance->CR2 : (__HANDLE__)->Instance->CR3)) & (((uint32_t)(__IT__)) & USART_IT_MASK))
mbed_official 489:119543c9f674 455
mbed_official 489:119543c9f674 456 /** @brief Enable USART
mbed_official 489:119543c9f674 457 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 458 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 459 * @retval None
mbed_official 489:119543c9f674 460 */
mbed_official 489:119543c9f674 461 #define __HAL_USART_ENABLE(__HANDLE__) SET_BIT((__HANDLE__)->Instance->CR1,(USART_CR1_UE))
mbed_official 489:119543c9f674 462
mbed_official 489:119543c9f674 463 /** @brief Disable USART
mbed_official 489:119543c9f674 464 * @param __HANDLE__: specifies the USART Handle.
mbed_official 489:119543c9f674 465 * USART Handle selects the USARTx peripheral (USART availability and x value depending on device).
mbed_official 489:119543c9f674 466 * @retval None
mbed_official 489:119543c9f674 467 */
mbed_official 489:119543c9f674 468 #define __HAL_USART_DISABLE(__HANDLE__) CLEAR_BIT((__HANDLE__)->Instance->CR1,(USART_CR1_UE))
mbed_official 489:119543c9f674 469
mbed_official 489:119543c9f674 470
mbed_official 489:119543c9f674 471 /**
mbed_official 489:119543c9f674 472 * @}
mbed_official 489:119543c9f674 473 */
mbed_official 489:119543c9f674 474
mbed_official 489:119543c9f674 475
mbed_official 489:119543c9f674 476 /* Private macros --------------------------------------------------------*/
mbed_official 489:119543c9f674 477 /** @defgroup USART_Private_Macros USART Private Macros
mbed_official 489:119543c9f674 478 * @{
mbed_official 489:119543c9f674 479 */
mbed_official 489:119543c9f674 480
mbed_official 489:119543c9f674 481 #define USART_CR1_REG_INDEX 1
mbed_official 489:119543c9f674 482 #define USART_CR2_REG_INDEX 2
mbed_official 489:119543c9f674 483 #define USART_CR3_REG_INDEX 3
mbed_official 489:119543c9f674 484
mbed_official 489:119543c9f674 485 #define USART_DIV(__PCLK__, __BAUD__) (((__PCLK__)*25)/(4*(__BAUD__)))
mbed_official 489:119543c9f674 486 #define USART_DIVMANT(__PCLK__, __BAUD__) (USART_DIV((__PCLK__), (__BAUD__))/100)
mbed_official 489:119543c9f674 487 #define USART_DIVFRAQ(__PCLK__, __BAUD__) (((USART_DIV((__PCLK__), (__BAUD__)) - (USART_DIVMANT((__PCLK__), (__BAUD__)) * 100)) * 16 + 50) / 100)
mbed_official 489:119543c9f674 488 #define USART_BRR(__PCLK__, __BAUD__) ((USART_DIVMANT((__PCLK__), (__BAUD__)) << 4)|(USART_DIVFRAQ((__PCLK__), (__BAUD__)) & 0x0F))
mbed_official 489:119543c9f674 489
mbed_official 489:119543c9f674 490 /** Check USART Baud rate
mbed_official 489:119543c9f674 491 * __BAUDRATE__: Baudrate specified by the user
mbed_official 489:119543c9f674 492 * The maximum Baud Rate is derived from the maximum clock on APB (i.e. 72 MHz)
mbed_official 489:119543c9f674 493 * divided by the smallest oversampling used on the USART (i.e. 16)
mbed_official 489:119543c9f674 494 * return : TRUE or FALSE
mbed_official 489:119543c9f674 495 */
mbed_official 489:119543c9f674 496 #define IS_USART_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) < 4500001)
mbed_official 489:119543c9f674 497
mbed_official 489:119543c9f674 498 #define IS_USART_WORD_LENGTH(LENGTH) (((LENGTH) == USART_WORDLENGTH_8B) || \
mbed_official 489:119543c9f674 499 ((LENGTH) == USART_WORDLENGTH_9B))
mbed_official 489:119543c9f674 500
mbed_official 489:119543c9f674 501 #define IS_USART_STOPBITS(STOPBITS) (((STOPBITS) == USART_STOPBITS_1) || \
mbed_official 489:119543c9f674 502 ((STOPBITS) == USART_STOPBITS_0_5) || \
mbed_official 489:119543c9f674 503 ((STOPBITS) == USART_STOPBITS_1_5) || \
mbed_official 489:119543c9f674 504 ((STOPBITS) == USART_STOPBITS_2))
mbed_official 489:119543c9f674 505
mbed_official 489:119543c9f674 506 #define IS_USART_PARITY(PARITY) (((PARITY) == USART_PARITY_NONE) || \
mbed_official 489:119543c9f674 507 ((PARITY) == USART_PARITY_EVEN) || \
mbed_official 489:119543c9f674 508 ((PARITY) == USART_PARITY_ODD))
mbed_official 489:119543c9f674 509
mbed_official 489:119543c9f674 510 #define IS_USART_MODE(MODE) ((((MODE) & (~((uint32_t)USART_MODE_TX_RX))) == 0x00) && ((MODE) != (uint32_t)0x00000000))
mbed_official 489:119543c9f674 511
mbed_official 489:119543c9f674 512 #define IS_USART_CLOCK(CLOCK) (((CLOCK) == USART_CLOCK_DISABLE) || \
mbed_official 489:119543c9f674 513 ((CLOCK) == USART_CLOCK_ENABLE))
mbed_official 489:119543c9f674 514
mbed_official 489:119543c9f674 515 #define IS_USART_POLARITY(CPOL) (((CPOL) == USART_POLARITY_LOW) || ((CPOL) == USART_POLARITY_HIGH))
mbed_official 489:119543c9f674 516
mbed_official 489:119543c9f674 517 #define IS_USART_PHASE(CPHA) (((CPHA) == USART_PHASE_1EDGE) || ((CPHA) == USART_PHASE_2EDGE))
mbed_official 489:119543c9f674 518
mbed_official 489:119543c9f674 519 #define IS_USART_LASTBIT(LASTBIT) (((LASTBIT) == USART_LASTBIT_DISABLE) || \
mbed_official 489:119543c9f674 520 ((LASTBIT) == USART_LASTBIT_ENABLE))
mbed_official 489:119543c9f674 521
mbed_official 489:119543c9f674 522 #define IS_USART_NACK_STATE(NACK) (((NACK) == USART_NACK_ENABLE) || \
mbed_official 489:119543c9f674 523 ((NACK) == USART_NACK_DISABLE))
mbed_official 489:119543c9f674 524
mbed_official 489:119543c9f674 525 /** USART interruptions flag mask
mbed_official 489:119543c9f674 526 *
mbed_official 489:119543c9f674 527 */
mbed_official 489:119543c9f674 528 #define USART_IT_MASK ((uint32_t) USART_CR1_PEIE | USART_CR1_TXEIE | USART_CR1_TCIE | USART_CR1_RXNEIE | \
mbed_official 489:119543c9f674 529 USART_CR1_IDLEIE | USART_CR2_LBDIE | USART_CR3_CTSIE | USART_CR3_EIE )
mbed_official 489:119543c9f674 530
mbed_official 489:119543c9f674 531 /**
mbed_official 489:119543c9f674 532 * @}
mbed_official 489:119543c9f674 533 */
mbed_official 489:119543c9f674 534
mbed_official 489:119543c9f674 535
mbed_official 489:119543c9f674 536 /* Exported functions --------------------------------------------------------*/
mbed_official 489:119543c9f674 537
mbed_official 489:119543c9f674 538 /** @addtogroup USART_Exported_Functions USART Exported Functions
mbed_official 489:119543c9f674 539 * @{
mbed_official 489:119543c9f674 540 */
mbed_official 489:119543c9f674 541
mbed_official 489:119543c9f674 542 /** @addtogroup USART_Exported_Functions_Group1 Initialization and de-initialization functions
mbed_official 489:119543c9f674 543 * @{
mbed_official 489:119543c9f674 544 */
mbed_official 489:119543c9f674 545
mbed_official 489:119543c9f674 546 /* Initialization and de-initialization functions ******************************/
mbed_official 489:119543c9f674 547 HAL_StatusTypeDef HAL_USART_Init(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 548 HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 549 void HAL_USART_MspInit(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 550 void HAL_USART_MspDeInit(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 551
mbed_official 489:119543c9f674 552 /**
mbed_official 489:119543c9f674 553 * @}
mbed_official 489:119543c9f674 554 */
mbed_official 489:119543c9f674 555
mbed_official 489:119543c9f674 556 /** @addtogroup USART_Exported_Functions_Group2 IO operation functions
mbed_official 489:119543c9f674 557 * @{
mbed_official 489:119543c9f674 558 */
mbed_official 489:119543c9f674 559
mbed_official 489:119543c9f674 560 /* IO operation functions *******************************************************/
mbed_official 489:119543c9f674 561 HAL_StatusTypeDef HAL_USART_Transmit(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size, uint32_t Timeout);
mbed_official 489:119543c9f674 562 HAL_StatusTypeDef HAL_USART_Receive(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size, uint32_t Timeout);
mbed_official 489:119543c9f674 563 HAL_StatusTypeDef HAL_USART_TransmitReceive(USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout);
mbed_official 489:119543c9f674 564 HAL_StatusTypeDef HAL_USART_Transmit_IT(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size);
mbed_official 489:119543c9f674 565 HAL_StatusTypeDef HAL_USART_Receive_IT(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size);
mbed_official 489:119543c9f674 566 HAL_StatusTypeDef HAL_USART_TransmitReceive_IT(USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size);
mbed_official 489:119543c9f674 567 HAL_StatusTypeDef HAL_USART_Transmit_DMA(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size);
mbed_official 489:119543c9f674 568 HAL_StatusTypeDef HAL_USART_Receive_DMA(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size);
mbed_official 489:119543c9f674 569 HAL_StatusTypeDef HAL_USART_TransmitReceive_DMA(USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size);
mbed_official 489:119543c9f674 570 HAL_StatusTypeDef HAL_USART_DMAPause(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 571 HAL_StatusTypeDef HAL_USART_DMAResume(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 572 HAL_StatusTypeDef HAL_USART_DMAStop(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 573 void HAL_USART_IRQHandler(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 574 void HAL_USART_TxCpltCallback(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 575 void HAL_USART_TxHalfCpltCallback(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 576 void HAL_USART_RxCpltCallback(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 577 void HAL_USART_RxHalfCpltCallback(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 578 void HAL_USART_TxRxCpltCallback(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 579 void HAL_USART_ErrorCallback(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 580
mbed_official 489:119543c9f674 581 /**
mbed_official 489:119543c9f674 582 * @}
mbed_official 489:119543c9f674 583 */
mbed_official 489:119543c9f674 584
mbed_official 489:119543c9f674 585 /* Peripheral Control functions ***********************************************/
mbed_official 489:119543c9f674 586
mbed_official 489:119543c9f674 587 /** @addtogroup USART_Exported_Functions_Group3 Peripheral State and Errors functions
mbed_official 489:119543c9f674 588 * @{
mbed_official 489:119543c9f674 589 */
mbed_official 489:119543c9f674 590
mbed_official 489:119543c9f674 591 /* Peripheral State and Error functions ***************************************/
mbed_official 489:119543c9f674 592 HAL_USART_StateTypeDef HAL_USART_GetState(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 593 uint32_t HAL_USART_GetError(USART_HandleTypeDef *husart);
mbed_official 489:119543c9f674 594
mbed_official 489:119543c9f674 595 /**
mbed_official 489:119543c9f674 596 * @}
mbed_official 489:119543c9f674 597 */
mbed_official 489:119543c9f674 598
mbed_official 489:119543c9f674 599 /**
mbed_official 489:119543c9f674 600 * @}
mbed_official 489:119543c9f674 601 */
mbed_official 489:119543c9f674 602
mbed_official 489:119543c9f674 603 /**
mbed_official 489:119543c9f674 604 * @}
mbed_official 489:119543c9f674 605 */
mbed_official 489:119543c9f674 606
mbed_official 489:119543c9f674 607 /**
mbed_official 489:119543c9f674 608 * @}
mbed_official 489:119543c9f674 609 */
mbed_official 489:119543c9f674 610
mbed_official 489:119543c9f674 611 #ifdef __cplusplus
mbed_official 489:119543c9f674 612 }
mbed_official 489:119543c9f674 613 #endif
mbed_official 489:119543c9f674 614
mbed_official 489:119543c9f674 615 #endif /* __STM32F1xx_HAL_USART_H */
mbed_official 489:119543c9f674 616
mbed_official 489:119543c9f674 617 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/