mbed(SerialHalfDuplex入り)

Fork of mbed by mbed official

Committer:
yusuke_kyo
Date:
Wed Apr 08 08:04:18 2015 +0000
Revision:
98:01a414ca7d6d
Parent:
96:487b796308b0
remove SerialHalfDuplex.h

Who changed what in which revision?

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