2 ******************************************************************************
3 * @file stm32f0xx_hal_usart.h
4 * @author MCD Application Team
6 * @date 11-December-2014
7 * @brief Header file of USART HAL module.
8 ******************************************************************************
11 * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ******************************************************************************
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32F0xx_HAL_USART_H
40 #define __STM32F0xx_HAL_USART_H
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32f0xx_hal_def.h"
49 /** @addtogroup STM32F0xx_HAL_Driver
57 /* Exported types ------------------------------------------------------------*/
58 /** @defgroup USART_Exported_Types USART Exported Types
64 * @brief USART Init Structure definition
68 uint32_t BaudRate; /*!< This member configures the Usart communication baud rate.
69 The baud rate is computed using the following formula:
70 Baud Rate Register = ((PCLKx) / ((huart->Init.BaudRate))) */
72 uint32_t WordLength; /*!< Specifies the number of data bits transmitted or received in a frame.
73 This parameter can be a value of @ref USARTEx_Word_Length */
75 uint32_t StopBits; /*!< Specifies the number of stop bits transmitted.
76 This parameter can be a value of @ref USART_Stop_Bits */
78 uint32_t Parity; /*!< Specifies the parity mode.
79 This parameter can be a value of @ref USART_Parity
80 @note When parity is enabled, the computed parity is inserted
81 at the MSB position of the transmitted data (9th bit when
82 the word length is set to 9 data bits; 8th bit when the
83 word length is set to 8 data bits). */
85 uint32_t Mode; /*!< Specifies whether the Receive or Transmit mode is enabled or disabled.
86 This parameter can be a value of @ref USART_Mode */
88 uint32_t CLKPolarity; /*!< Specifies the steady state of the serial clock.
89 This parameter can be a value of @ref USART_Clock_Polarity */
91 uint32_t CLKPhase; /*!< Specifies the clock transition on which the bit capture is made.
92 This parameter can be a value of @ref USART_Clock_Phase */
94 uint32_t CLKLastBit; /*!< Specifies whether the clock pulse corresponding to the last transmitted
95 data bit (MSB) has to be output on the SCLK pin in synchronous mode.
96 This parameter can be a value of @ref USART_Last_Bit */
100 * @brief HAL State structures definition
104 HAL_USART_STATE_RESET = 0x00, /*!< Peripheral is not initialized */
105 HAL_USART_STATE_READY = 0x01, /*!< Peripheral Initialized and ready for use */
106 HAL_USART_STATE_BUSY = 0x02, /*!< an internal process is ongoing */
107 HAL_USART_STATE_BUSY_TX = 0x12, /*!< Data Transmission process is ongoing */
108 HAL_USART_STATE_BUSY_RX = 0x22, /*!< Data Reception process is ongoing */
109 HAL_USART_STATE_BUSY_TX_RX = 0x32, /*!< Data Transmission Reception process is ongoing */
110 HAL_USART_STATE_TIMEOUT = 0x03, /*!< Timeout state */
111 HAL_USART_STATE_ERROR = 0x04 /*!< Error */
112 }HAL_USART_StateTypeDef;
115 * @brief USART clock sources definitions
119 USART_CLOCKSOURCE_PCLK1 = 0x00, /*!< PCLK1 clock source */
120 USART_CLOCKSOURCE_HSI = 0x02, /*!< HSI clock source */
121 USART_CLOCKSOURCE_SYSCLK = 0x04, /*!< SYSCLK clock source */
122 USART_CLOCKSOURCE_LSE = 0x08, /*!< LSE clock source */
123 USART_CLOCKSOURCE_UNDEFINED = 0x10 /*!< undefined clock source */
124 }USART_ClockSourceTypeDef;
127 * @brief USART handle Structure definition
131 USART_TypeDef *Instance; /*!< USART registers base address */
133 USART_InitTypeDef Init; /*!< USART communication parameters */
135 uint8_t *pTxBuffPtr; /*!< Pointer to USART Tx transfer Buffer */
137 uint16_t TxXferSize; /*!< USART Tx Transfer size */
139 uint16_t TxXferCount; /*!< USART Tx Transfer Counter */
141 uint8_t *pRxBuffPtr; /*!< Pointer to USART Rx transfer Buffer */
143 uint16_t RxXferSize; /*!< USART Rx Transfer size */
145 uint16_t RxXferCount; /*!< USART Rx Transfer Counter */
147 uint16_t Mask; /*!< USART Rx RDR register mask */
149 DMA_HandleTypeDef *hdmatx; /*!< USART Tx DMA Handle parameters */
151 DMA_HandleTypeDef *hdmarx; /*!< USART Rx DMA Handle parameters */
153 HAL_LockTypeDef Lock; /*!< Locking object */
155 HAL_USART_StateTypeDef State; /*!< USART communication state */
157 __IO uint32_t ErrorCode; /*!< USART Error code
158 This parameter can be a value of @ref USART_Error */
160 }USART_HandleTypeDef;
166 /* Exported constants --------------------------------------------------------*/
167 /** @defgroup USART_Exported_Constants USART Exported constants
171 /** @defgroup USART_Error USART Error
174 #define HAL_USART_ERROR_NONE ((uint32_t)0x00000000) /*!< No error */
175 #define HAL_USART_ERROR_PE ((uint32_t)0x00000001) /*!< Parity error */
176 #define HAL_USART_ERROR_NE ((uint32_t)0x00000002) /*!< Noise error */
177 #define HAL_USART_ERROR_FE ((uint32_t)0x00000004) /*!< frame error */
178 #define HAL_USART_ERROR_ORE ((uint32_t)0x00000008) /*!< Overrun error */
179 #define HAL_USART_ERROR_DMA ((uint32_t)0x00000010) /*!< DMA transfer error */
184 /** @defgroup USART_Stop_Bits USART Number of Stop Bits
187 #define USART_STOPBITS_1 ((uint32_t)0x0000)
188 #define USART_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1)
189 #define USART_STOPBITS_1_5 ((uint32_t)(USART_CR2_STOP_0 | USART_CR2_STOP_1))
190 #define IS_USART_STOPBITS(STOPBITS) (((STOPBITS) == USART_STOPBITS_1) || \
191 ((STOPBITS) == USART_STOPBITS_1_5) || \
192 ((STOPBITS) == USART_STOPBITS_2))
197 /** @defgroup USART_Parity USART Parity
200 #define USART_PARITY_NONE ((uint32_t)0x0000)
201 #define USART_PARITY_EVEN ((uint32_t)USART_CR1_PCE)
202 #define USART_PARITY_ODD ((uint32_t)(USART_CR1_PCE | USART_CR1_PS))
203 #define IS_USART_PARITY(PARITY) (((PARITY) == USART_PARITY_NONE) || \
204 ((PARITY) == USART_PARITY_EVEN) || \
205 ((PARITY) == USART_PARITY_ODD))
210 /** @defgroup USART_Mode USART Mode
213 #define USART_MODE_RX ((uint32_t)USART_CR1_RE)
214 #define USART_MODE_TX ((uint32_t)USART_CR1_TE)
215 #define USART_MODE_TX_RX ((uint32_t)(USART_CR1_TE |USART_CR1_RE))
216 #define IS_USART_MODE(MODE) ((((MODE) & (uint32_t)0xFFFFFFF3) == 0x00) && ((MODE) != (uint32_t)0x00))
221 /** @defgroup USART_Clock USART Clock
224 #define USART_CLOCK_DISABLED ((uint32_t)0x0000)
225 #define USART_CLOCK_ENABLED ((uint32_t)USART_CR2_CLKEN)
226 #define IS_USART_CLOCK(CLOCK) (((CLOCK) == USART_CLOCK_DISABLED) || \
227 ((CLOCK) == USART_CLOCK_ENABLED))
232 /** @defgroup USART_Clock_Polarity USART Clock Polarity
235 #define USART_POLARITY_LOW ((uint32_t)0x0000)
236 #define USART_POLARITY_HIGH ((uint32_t)USART_CR2_CPOL)
237 #define IS_USART_POLARITY(CPOL) (((CPOL) == USART_POLARITY_LOW) || ((CPOL) == USART_POLARITY_HIGH))
242 /** @defgroup USART_Clock_Phase USART Clock Phase
245 #define USART_PHASE_1EDGE ((uint32_t)0x0000)
246 #define USART_PHASE_2EDGE ((uint32_t)USART_CR2_CPHA)
247 #define IS_USART_PHASE(CPHA) (((CPHA) == USART_PHASE_1EDGE) || ((CPHA) == USART_PHASE_2EDGE))
252 /** @defgroup USART_Last_Bit USART Last Bit
255 #define USART_LASTBIT_DISABLE ((uint32_t)0x0000)
256 #define USART_LASTBIT_ENABLE ((uint32_t)USART_CR2_LBCL)
257 #define IS_USART_LASTBIT(LASTBIT) (((LASTBIT) == USART_LASTBIT_DISABLE) || \
258 ((LASTBIT) == USART_LASTBIT_ENABLE))
264 /** @defgroup USART_Flags USART Flags
265 * Elements values convention: 0xXXXX
266 * - 0xXXXX : Flag mask in the ISR register
269 #define USART_FLAG_REACK ((uint32_t)0x00400000)
270 #define USART_FLAG_TEACK ((uint32_t)0x00200000)
271 #define USART_FLAG_BUSY ((uint32_t)0x00010000)
272 #define USART_FLAG_CTS ((uint32_t)0x00000400)
273 #define USART_FLAG_CTSIF ((uint32_t)0x00000200)
274 #define USART_FLAG_LBDF ((uint32_t)0x00000100)
275 #define USART_FLAG_TXE ((uint32_t)0x00000080)
276 #define USART_FLAG_TC ((uint32_t)0x00000040)
277 #define USART_FLAG_RXNE ((uint32_t)0x00000020)
278 #define USART_FLAG_IDLE ((uint32_t)0x00000010)
279 #define USART_FLAG_ORE ((uint32_t)0x00000008)
280 #define USART_FLAG_NE ((uint32_t)0x00000004)
281 #define USART_FLAG_FE ((uint32_t)0x00000002)
282 #define USART_FLAG_PE ((uint32_t)0x00000001)
287 /** @defgroup USART_Interrupt_definition USART Interrupts Definition
288 * Elements values convention: 0000ZZZZ0XXYYYYYb
289 * - YYYYY : Interrupt source position in the XX register (5bits)
290 * - XX : Interrupt source register (2bits)
294 * - ZZZZ : Flag position in the ISR register(4bits)
298 #define USART_IT_PE ((uint16_t)0x0028)
299 #define USART_IT_TXE ((uint16_t)0x0727)
300 #define USART_IT_TC ((uint16_t)0x0626)
301 #define USART_IT_RXNE ((uint16_t)0x0525)
302 #define USART_IT_IDLE ((uint16_t)0x0424)
303 #define USART_IT_ERR ((uint16_t)0x0060)
305 #define USART_IT_ORE ((uint16_t)0x0300)
306 #define USART_IT_NE ((uint16_t)0x0200)
307 #define USART_IT_FE ((uint16_t)0x0100)
312 /** @defgroup USART_IT_CLEAR_Flags USART Interruption Clear Flags
315 #define USART_CLEAR_PEF USART_ICR_PECF /*!< Parity Error Clear Flag */
316 #define USART_CLEAR_FEF USART_ICR_FECF /*!< Framing Error Clear Flag */
317 #define USART_CLEAR_NEF USART_ICR_NCF /*!< Noise detected Clear Flag */
318 #define USART_CLEAR_OREF USART_ICR_ORECF /*!< OverRun Error Clear Flag */
319 #define USART_CLEAR_IDLEF USART_ICR_IDLECF /*!< IDLE line detected Clear Flag */
320 #define USART_CLEAR_TCF USART_ICR_TCCF /*!< Transmission Complete Clear Flag */
321 #define USART_CLEAR_CTSF USART_ICR_CTSCF /*!< CTS Interrupt Clear Flag */
326 /** @defgroup USART_Request_Parameters USART Request Parameters
329 #define USART_RXDATA_FLUSH_REQUEST ((uint32_t)USART_RQR_RXFRQ) /*!< Receive Data flush Request */
330 #define USART_TXDATA_FLUSH_REQUEST ((uint32_t)USART_RQR_TXFRQ) /*!< Transmit data flush Request */
331 #define IS_USART_REQUEST_PARAMETER(PARAM) (((PARAM) == USART_RXDATA_FLUSH_REQUEST) || \
332 ((PARAM) == USART_TXDATA_FLUSH_REQUEST))
337 /** @defgroup USART_Interruption_Mask USART interruptions flag mask
340 #define USART_IT_MASK ((uint16_t)0x001F)
349 /* Exported macro ------------------------------------------------------------*/
350 /** @defgroup USART_Exported_Macros USART Exported Macros
355 /** @brief Reset USART handle state
356 * @param __HANDLE__: USART handle.
359 #define __HAL_USART_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_USART_STATE_RESET)
361 /** @brief Checks whether the specified USART flag is set or not.
362 * @param __HANDLE__: specifies the USART Handle
363 * @param __FLAG__: specifies the flag to check.
364 * This parameter can be one of the following values:
365 * @arg USART_FLAG_REACK: Receive enable ackowledge flag
366 * @arg USART_FLAG_TEACK: Transmit enable ackowledge flag
367 * @arg USART_FLAG_BUSY: Busy flag
368 * @arg USART_FLAG_CTS: CTS Change flag
369 * @arg USART_FLAG_TXE: Transmit data register empty flag
370 * @arg USART_FLAG_TC: Transmission Complete flag
371 * @arg USART_FLAG_RXNE: Receive data register not empty flag
372 * @arg USART_FLAG_IDLE: Idle Line detection flag
373 * @arg USART_FLAG_ORE: OverRun Error flag
374 * @arg USART_FLAG_NE: Noise Error flag
375 * @arg USART_FLAG_FE: Framing Error flag
376 * @arg USART_FLAG_PE: Parity Error flag
377 * @retval The new state of __FLAG__ (TRUE or FALSE).
379 #define __HAL_USART_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->ISR & (__FLAG__)) == (__FLAG__))
382 /** @brief Enables the specified USART interrupt.
383 * @param __HANDLE__: specifies the USART Handle
384 * @param __INTERRUPT__: specifies the USART interrupt source to enable.
385 * This parameter can be one of the following values:
386 * @arg USART_IT_TXE: Transmit Data Register empty interrupt
387 * @arg USART_IT_TC: Transmission complete interrupt
388 * @arg USART_IT_RXNE: Receive Data register not empty interrupt
389 * @arg USART_IT_IDLE: Idle line detection interrupt
390 * @arg USART_IT_PE: Parity Error interrupt
391 * @arg USART_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
394 #define __HAL_USART_ENABLE_IT(__HANDLE__, __INTERRUPT__) (((((uint8_t)(__INTERRUPT__)) >> 5U) == 1)? ((__HANDLE__)->Instance->CR1 |= (1U << ((__INTERRUPT__) & USART_IT_MASK))): \
395 ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2)? ((__HANDLE__)->Instance->CR2 |= (1U << ((__INTERRUPT__) & USART_IT_MASK))): \
396 ((__HANDLE__)->Instance->CR3 |= (1U << ((__INTERRUPT__) & USART_IT_MASK))))
398 /** @brief Disables the specified USART interrupt.
399 * @param __HANDLE__: specifies the USART Handle.
400 * @param __INTERRUPT__: specifies the USART interrupt source to disable.
401 * This parameter can be one of the following values:
402 * @arg USART_IT_TXE: Transmit Data Register empty interrupt
403 * @arg USART_IT_TC: Transmission complete interrupt
404 * @arg USART_IT_RXNE: Receive Data register not empty interrupt
405 * @arg USART_IT_IDLE: Idle line detection interrupt
406 * @arg USART_IT_PE: Parity Error interrupt
407 * @arg USART_IT_ERR: Error interrupt(Frame error, noise error, overrun error)
410 #define __HAL_USART_DISABLE_IT(__HANDLE__, __INTERRUPT__) (((((uint8_t)(__INTERRUPT__)) >> 5U) == 1)? ((__HANDLE__)->Instance->CR1 &= ~ (1U << ((__INTERRUPT__) & USART_IT_MASK))): \
411 ((((uint8_t)(__INTERRUPT__)) >> 5U) == 2)? ((__HANDLE__)->Instance->CR2 &= ~ (1U << ((__INTERRUPT__) & USART_IT_MASK))): \
412 ((__HANDLE__)->Instance->CR3 &= ~ (1U << ((__INTERRUPT__) & USART_IT_MASK))))
415 /** @brief Checks whether the specified USART interrupt has occurred or not.
416 * @param __HANDLE__: specifies the USART Handle
417 * @param __IT__: specifies the USART interrupt source to check.
418 * This parameter can be one of the following values:
419 * @arg USART_IT_TXE: Transmit Data Register empty interrupt
420 * @arg USART_IT_TC: Transmission complete interrupt
421 * @arg USART_IT_RXNE: Receive Data register not empty interrupt
422 * @arg USART_IT_IDLE: Idle line detection interrupt
423 * @arg USART_IT_ORE: OverRun Error interrupt
424 * @arg USART_IT_NE: Noise Error interrupt
425 * @arg USART_IT_FE: Framing Error interrupt
426 * @arg USART_IT_PE: Parity Error interrupt
427 * @retval The new state of __IT__ (TRUE or FALSE).
429 #define __HAL_USART_GET_IT(__HANDLE__, __IT__) ((__HANDLE__)->Instance->ISR & ((uint32_t)1 << ((__IT__)>> 0x08)))
431 /** @brief Checks whether the specified USART interrupt source is enabled.
432 * @param __HANDLE__: specifies the USART Handle.
433 * @param __IT__: specifies the USART interrupt source to check.
434 * This parameter can be one of the following values:
435 * @arg USART_IT_TXE: Transmit Data Register empty interrupt
436 * @arg USART_IT_TC: Transmission complete interrupt
437 * @arg USART_IT_RXNE: Receive Data register not empty interrupt
438 * @arg USART_IT_IDLE: Idle line detection interrupt
439 * @arg USART_IT_ORE: OverRun Error interrupt
440 * @arg USART_IT_NE: Noise Error interrupt
441 * @arg USART_IT_FE: Framing Error interrupt
442 * @arg USART_IT_PE: Parity Error interrupt
443 * @retval The new state of __IT__ (TRUE or FALSE).
445 #define __HAL_USART_GET_IT_SOURCE(__HANDLE__, __IT__) ((((((uint8_t)(__IT__)) >> 5) == 1)? (__HANDLE__)->Instance->CR1:(((((uint8_t)(__IT__)) >> 5) == 2)? \
446 (__HANDLE__)->Instance->CR2 : (__HANDLE__)->Instance->CR3)) & ((uint32_t)1 << \
447 (((uint16_t)(__IT__)) & USART_IT_MASK)))
450 /** @brief Clears the specified USART ISR flag, in setting the proper ICR register flag.
451 * @param __HANDLE__: specifies the USART Handle.
452 * @param __IT_CLEAR__: specifies the interrupt clear register flag that needs to be set
453 * to clear the corresponding interrupt
454 * This parameter can be one of the following values:
455 * @arg USART_CLEAR_PEF: Parity Error Clear Flag
456 * @arg USART_CLEAR_FEF: Framing Error Clear Flag
457 * @arg USART_CLEAR_NEF: Noise detected Clear Flag
458 * @arg USART_CLEAR_OREF: OverRun Error Clear Flag
459 * @arg USART_CLEAR_IDLEF: IDLE line detected Clear Flag
460 * @arg USART_CLEAR_TCF: Transmission Complete Clear Flag
461 * @arg USART_CLEAR_CTSF: CTS Interrupt Clear Flag
464 #define __HAL_USART_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->ICR = (uint32_t)(__IT_CLEAR__))
466 /** @brief Set a specific USART request flag.
467 * @param __HANDLE__: specifies the USART Handle.
468 * @param __REQ__: specifies the request flag to set
469 * This parameter can be one of the following values:
470 * @arg USART_RXDATA_FLUSH_REQUEST: Receive Data flush Request
471 * @arg USART_TXDATA_FLUSH_REQUEST: Transmit data flush Request
475 #define __HAL_USART_SEND_REQ(__HANDLE__, __REQ__) ((__HANDLE__)->Instance->RQR |= (uint16_t)(__REQ__))
477 /** @brief Enable USART
478 * @param __HANDLE__: specifies the USART Handle.
481 #define __HAL_USART_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE)
483 /** @brief Disable USART
484 * @param __HANDLE__: specifies the USART Handle.
487 #define __HAL_USART_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE)
493 /* Private macros --------------------------------------------------------*/
494 /** @defgroup USART_Private_Macros USART Private Macros
498 /** @brief Check USART Baud rate
499 * @param BAUDRATE: Baudrate specified by the user
500 * The maximum Baud Rate is derived from the maximum clock on F0 (i.e. 48 MHz)
501 * divided by the smallest oversampling used on the USART (i.e. 8)
502 * @retval Test result (TRUE or FALSE)
504 #define IS_USART_BAUDRATE(BAUDRATE) ((BAUDRATE) < 9000001)
509 /* Include USART HAL Extension module */
510 #include "stm32f0xx_hal_usart_ex.h"
512 /* Exported functions --------------------------------------------------------*/
514 /** @addtogroup USART_Exported_Functions USART Exported Functions
518 /** @addtogroup USART_Exported_Functions_Group1 Initialization and de-initialization functions
522 /* Initialization and de-initialization functions ******************************/
523 HAL_StatusTypeDef HAL_USART_Init(USART_HandleTypeDef *husart);
524 HAL_StatusTypeDef HAL_USART_DeInit(USART_HandleTypeDef *husart);
525 void HAL_USART_MspInit(USART_HandleTypeDef *husart);
526 void HAL_USART_MspDeInit(USART_HandleTypeDef *husart);
527 HAL_StatusTypeDef HAL_USART_CheckIdleState(USART_HandleTypeDef *husart);
533 /** @addtogroup USART_Exported_Functions_Group2 IO operation functions
537 /* IO operation functions *******************************************************/
538 HAL_StatusTypeDef HAL_USART_Transmit(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size, uint32_t Timeout);
539 HAL_StatusTypeDef HAL_USART_Receive(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size, uint32_t Timeout);
540 HAL_StatusTypeDef HAL_USART_TransmitReceive(USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout);
541 HAL_StatusTypeDef HAL_USART_Transmit_IT(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size);
542 HAL_StatusTypeDef HAL_USART_Receive_IT(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size);
543 HAL_StatusTypeDef HAL_USART_TransmitReceive_IT(USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size);
544 HAL_StatusTypeDef HAL_USART_Transmit_DMA(USART_HandleTypeDef *husart, uint8_t *pTxData, uint16_t Size);
545 HAL_StatusTypeDef HAL_USART_Receive_DMA(USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size);
546 HAL_StatusTypeDef HAL_USART_TransmitReceive_DMA(USART_HandleTypeDef *husart, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size);
547 HAL_StatusTypeDef HAL_USART_DMAPause(USART_HandleTypeDef *husart);
548 HAL_StatusTypeDef HAL_USART_DMAResume(USART_HandleTypeDef *husart);
549 HAL_StatusTypeDef HAL_USART_DMAStop(USART_HandleTypeDef *husart);
550 void HAL_USART_IRQHandler(USART_HandleTypeDef *husart);
551 void HAL_USART_TxCpltCallback(USART_HandleTypeDef *husart);
552 void HAL_USART_RxCpltCallback(USART_HandleTypeDef *husart);
553 void HAL_USART_TxHalfCpltCallback(USART_HandleTypeDef *husart);
554 void HAL_USART_RxHalfCpltCallback(USART_HandleTypeDef *husart);
555 void HAL_USART_TxRxCpltCallback(USART_HandleTypeDef *husart);
556 void HAL_USART_ErrorCallback(USART_HandleTypeDef *husart);
562 /* Peripheral Control functions ***********************************************/
564 /** @addtogroup USART_Exported_Functions_Group3 Peripheral State and Errors functions
568 /* Peripheral State and Error functions ***************************************/
569 HAL_USART_StateTypeDef HAL_USART_GetState(USART_HandleTypeDef *husart);
570 uint32_t HAL_USART_GetError(USART_HandleTypeDef *husart);
592 #endif /* __STM32F0xx_HAL_USART_H */
594 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/