Header file of UART HAL module. More...
Go to the source code of this file.
Classes | |
struct | __UART_HandleTypeDef |
UART handle Structure definition. More... | |
struct | UART_AdvFeatureInitTypeDef |
UART Advanced Features initialization structure definition. More... | |
struct | UART_InitTypeDef |
UART Init Structure definition. More... | |
Macros | |
#define | __HAL_UART_CLEAR_FEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_FEF) |
Clear the UART FE pending flag. More... | |
#define | __HAL_UART_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__)) |
Clear the specified UART pending flag. More... | |
#define | __HAL_UART_CLEAR_IDLEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_IDLEF) |
Clear the UART IDLE pending flag. More... | |
#define | __HAL_UART_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->ICR = (uint32_t)(__IT_CLEAR__)) |
Clear the specified UART ISR flag, in setting the proper ICR register flag. More... | |
#define | __HAL_UART_CLEAR_NEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_NEF) |
Clear the UART NE pending flag. More... | |
#define | __HAL_UART_CLEAR_OREFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_OREF) |
Clear the UART ORE pending flag. More... | |
#define | __HAL_UART_CLEAR_PEFLAG(__HANDLE__) __HAL_UART_CLEAR_FLAG((__HANDLE__), UART_CLEAR_PEF) |
Clear the UART PE pending flag. More... | |
#define | __HAL_UART_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE) |
Disable UART. More... | |
#define | __HAL_UART_DISABLE_IT(__HANDLE__, __INTERRUPT__) |
Disable the specified UART interrupt. More... | |
#define | __HAL_UART_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE) |
Enable UART. More... | |
#define | __HAL_UART_ENABLE_IT(__HANDLE__, __INTERRUPT__) |
Enable the specified UART interrupt. More... | |
#define | __HAL_UART_FLUSH_DRREGISTER(__HANDLE__) |
Flush the UART Data registers. More... | |
#define | __HAL_UART_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->ISR & (__FLAG__)) == (__FLAG__)) |
Check whether the specified UART flag is set or not. More... | |
#define | __HAL_UART_GET_IT(__HANDLE__, __INTERRUPT__) |
Check whether the specified UART interrupt has occurred or not. More... | |
#define | __HAL_UART_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) |
Check whether the specified UART interrupt source is enabled or not. More... | |
#define | __HAL_UART_HWCONTROL_CTS_DISABLE(__HANDLE__) |
Disable CTS flow control. More... | |
#define | __HAL_UART_HWCONTROL_CTS_ENABLE(__HANDLE__) |
Enable CTS flow control. More... | |
#define | __HAL_UART_HWCONTROL_RTS_DISABLE(__HANDLE__) |
Disable RTS flow control. More... | |
#define | __HAL_UART_HWCONTROL_RTS_ENABLE(__HANDLE__) |
Enable RTS flow control. More... | |
#define | __HAL_UART_ONE_BIT_SAMPLE_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3 &= ~USART_CR3_ONEBIT) |
Disable the UART one bit sample method. More... | |
#define | __HAL_UART_ONE_BIT_SAMPLE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT) |
Enable the UART one bit sample method. More... | |
#define | __HAL_UART_RESET_HANDLE_STATE(__HANDLE__) |
Reset UART handle states. More... | |
#define | __HAL_UART_SEND_REQ(__HANDLE__, __REQ__) ((__HANDLE__)->Instance->RQR |= (uint16_t)(__REQ__)) |
Set a specific UART request flag. More... | |
#define | HAL_UART_ERROR_DMA ((uint32_t)0x00000010U) |
#define | HAL_UART_ERROR_FE ((uint32_t)0x00000004U) |
#define | HAL_UART_ERROR_NE ((uint32_t)0x00000002U) |
#define | HAL_UART_ERROR_NONE ((uint32_t)0x00000000U) |
#define | HAL_UART_ERROR_ORE ((uint32_t)0x00000008U) |
#define | HAL_UART_ERROR_PE ((uint32_t)0x00000001U) |
#define | HAL_UART_ERROR_RTO ((uint32_t)0x00000020U) |
#define | HAL_UART_STATE_BUSY 0x00000024U |
#define | HAL_UART_STATE_BUSY_RX 0x00000022U |
#define | HAL_UART_STATE_BUSY_TX 0x00000021U |
#define | HAL_UART_STATE_BUSY_TX_RX 0x00000023U |
#define | HAL_UART_STATE_ERROR 0x000000E0U |
#define | HAL_UART_STATE_READY 0x00000020U |
#define | HAL_UART_STATE_RESET 0x00000000U |
#define | HAL_UART_STATE_TIMEOUT 0x000000A0U |
#define | HAL_UART_TIMEOUT_VALUE 0x1FFFFFFU |
#define | IS_UART_ADVFEATURE_AUTOBAUDRATE(__AUTOBAUDRATE__) |
Ensure that UART auto Baud rate state is valid. More... | |
#define | IS_UART_ADVFEATURE_AUTOBAUDRATEMODE(__MODE__) |
Ensure that UART auto Baud rate detection mode is valid. More... | |
#define | IS_UART_ADVFEATURE_DATAINV(__DATAINV__) |
Ensure that UART frame data inversion setting is valid. More... | |
#define | IS_UART_ADVFEATURE_DMAONRXERROR(__DMA__) |
Ensure that UART DMA enabling or disabling on error setting is valid. More... | |
#define | IS_UART_ADVFEATURE_INIT(__INIT__) |
Ensure that UART advanced features initialization is valid. More... | |
#define | IS_UART_ADVFEATURE_MSBFIRST(__MSBFIRST__) |
Ensure that UART frame MSB first setting is valid. More... | |
#define | IS_UART_ADVFEATURE_RXINV(__RXINV__) |
Ensure that UART frame RX inversion setting is valid. More... | |
#define | IS_UART_ADVFEATURE_SWAP(__SWAP__) |
Ensure that UART frame RX/TX pins swap setting is valid. More... | |
#define | IS_UART_ADVFEATURE_TXINV(__TXINV__) |
Ensure that UART frame TX inversion setting is valid. More... | |
#define | IS_UART_ASSERTIONTIME(__TIME__) ((__TIME__) <= 0x1FU) |
Check UART assertion time. More... | |
#define | IS_UART_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) < 27000001U) |
Check UART Baud rate. More... | |
#define | IS_UART_DE_POLARITY(__POLARITY__) |
Ensure that UART driver enable polarity is valid. More... | |
#define | IS_UART_DEASSERTIONTIME(__TIME__) ((__TIME__) <= 0x1FU) |
Check UART deassertion time. More... | |
#define | IS_UART_DMA_RX(__DMARX__) |
Ensure that UART DMA RX state is valid. More... | |
#define | IS_UART_DMA_TX(__DMATX__) |
Ensure that UART DMA TX state is valid. More... | |
#define | IS_UART_HALF_DUPLEX(__HDSEL__) |
Ensure that UART half-duplex state is valid. More... | |
#define | IS_UART_HARDWARE_FLOW_CONTROL(__CONTROL__) |
Ensure that UART hardware flow control is valid. More... | |
#define | IS_UART_LIN(__LIN__) |
Ensure that UART LIN state is valid. More... | |
#define | IS_UART_LIN_BREAK_DETECT_LENGTH(__LENGTH__) |
Ensure that UART LIN break detection length is valid. More... | |
#define | IS_UART_MODE(__MODE__) ((((__MODE__) & (~((uint32_t)(UART_MODE_TX_RX)))) == 0x00U) && ((__MODE__) != 0x00U)) |
Ensure that UART communication mode is valid. More... | |
#define | IS_UART_MUTE_MODE(__MUTE__) |
Ensure that UART mute mode state is valid. More... | |
#define | IS_UART_ONE_BIT_SAMPLE(__ONEBIT__) |
Ensure that UART frame sampling is valid. More... | |
#define | IS_UART_OVERRUN(__OVERRUN__) |
Ensure that UART frame overrun setting is valid. More... | |
#define | IS_UART_OVERSAMPLING(__SAMPLING__) |
Ensure that UART oversampling is valid. More... | |
#define | IS_UART_PARITY(__PARITY__) |
Ensure that UART frame parity is valid. More... | |
#define | IS_UART_RECEIVER_TIMEOUT(__TIMEOUT__) |
Ensure that UART receiver timeout setting is valid. More... | |
#define | IS_UART_RECEIVER_TIMEOUT_VALUE(__TIMEOUTVALUE__) ((__TIMEOUTVALUE__) <= 0xFFFFFFU) |
Check the receiver timeout value. More... | |
#define | IS_UART_REQUEST_PARAMETER(__PARAM__) |
Ensure that UART request parameter is valid. More... | |
#define | IS_UART_STATE(__STATE__) |
Ensure that UART state is valid. More... | |
#define | IS_UART_STOPBITS(__STOPBITS__) |
Ensure that UART frame number of stop bits is valid. More... | |
#define | IS_UART_WAKEUPMETHOD(__WAKEUP__) |
Ensure that UART wake-up method is valid. More... | |
#define | UART_ADVFEATURE_AUTOBAUDRATE_DISABLE 0x00000000U |
#define | UART_ADVFEATURE_AUTOBAUDRATE_ENABLE USART_CR2_ABREN |
#define | UART_ADVFEATURE_AUTOBAUDRATE_INIT 0x00000040U |
#define | UART_ADVFEATURE_AUTOBAUDRATE_ON0X55FRAME USART_CR2_ABRMODE |
#define | UART_ADVFEATURE_AUTOBAUDRATE_ON0X7FFRAME USART_CR2_ABRMODE_1 |
#define | UART_ADVFEATURE_AUTOBAUDRATE_ONFALLINGEDGE USART_CR2_ABRMODE_0 |
#define | UART_ADVFEATURE_AUTOBAUDRATE_ONSTARTBIT 0x00000000U |
#define | UART_ADVFEATURE_DATAINV_DISABLE 0x00000000U |
#define | UART_ADVFEATURE_DATAINV_ENABLE USART_CR2_DATAINV |
#define | UART_ADVFEATURE_DATAINVERT_INIT 0x00000004U |
#define | UART_ADVFEATURE_DMA_DISABLEONRXERROR USART_CR3_DDRE |
#define | UART_ADVFEATURE_DMA_ENABLEONRXERROR 0x00000000U |
#define | UART_ADVFEATURE_DMADISABLEONERROR_INIT 0x00000020U |
#define | UART_ADVFEATURE_MSBFIRST_DISABLE 0x00000000U |
#define | UART_ADVFEATURE_MSBFIRST_ENABLE USART_CR2_MSBFIRST |
#define | UART_ADVFEATURE_MSBFIRST_INIT 0x00000080U |
#define | UART_ADVFEATURE_MUTEMODE_DISABLE 0x00000000U |
#define | UART_ADVFEATURE_MUTEMODE_ENABLE USART_CR1_MME |
#define | UART_ADVFEATURE_NO_INIT 0x00000000U |
#define | UART_ADVFEATURE_OVERRUN_DISABLE USART_CR3_OVRDIS |
#define | UART_ADVFEATURE_OVERRUN_ENABLE 0x00000000U |
#define | UART_ADVFEATURE_RXINV_DISABLE 0x00000000U |
#define | UART_ADVFEATURE_RXINV_ENABLE USART_CR2_RXINV |
#define | UART_ADVFEATURE_RXINVERT_INIT 0x00000002U |
#define | UART_ADVFEATURE_RXOVERRUNDISABLE_INIT 0x00000010U |
#define | UART_ADVFEATURE_SWAP_DISABLE 0x00000000U |
#define | UART_ADVFEATURE_SWAP_ENABLE USART_CR2_SWAP |
#define | UART_ADVFEATURE_SWAP_INIT 0x00000008U |
#define | UART_ADVFEATURE_TXINV_DISABLE 0x00000000U |
#define | UART_ADVFEATURE_TXINV_ENABLE USART_CR2_TXINV |
#define | UART_ADVFEATURE_TXINVERT_INIT 0x00000001U |
#define | UART_AUTOBAUD_REQUEST USART_RQR_ABRRQ |
#define | UART_CLEAR_CMF USART_ICR_CMCF |
#define | UART_CLEAR_CTSF USART_ICR_CTSCF |
#define | UART_CLEAR_FEF USART_ICR_FECF |
#define | UART_CLEAR_IDLEF USART_ICR_IDLECF |
#define | UART_CLEAR_LBDF USART_ICR_LBDCF |
#define | UART_CLEAR_NEF USART_ICR_NCF |
#define | UART_CLEAR_OREF USART_ICR_ORECF |
#define | UART_CLEAR_PEF USART_ICR_PECF |
#define | UART_CLEAR_RTOF USART_ICR_RTOCF |
#define | UART_CLEAR_TCF USART_ICR_TCCF |
#define | UART_CR1_DEAT_ADDRESS_LSB_POS 21U |
#define | UART_CR1_DEDT_ADDRESS_LSB_POS 16U |
#define | UART_CR2_ADDRESS_LSB_POS 24U |
#define | UART_DE_POLARITY_HIGH 0x00000000U |
#define | UART_DE_POLARITY_LOW USART_CR3_DEP |
#define | UART_DIV_SAMPLING16(__PCLK__, __BAUD__) (((__PCLK__) + ((__BAUD__)/2U)) / (__BAUD__)) |
BRR division operation to set BRR register in 16-bit oversampling mode. More... | |
#define | UART_DIV_SAMPLING8(__PCLK__, __BAUD__) ((((__PCLK__)*2U) + ((__BAUD__)/2U)) / (__BAUD__)) |
BRR division operation to set BRR register in 8-bit oversampling mode. More... | |
#define | UART_DMA_RX_DISABLE 0x00000000U |
#define | UART_DMA_RX_ENABLE USART_CR3_DMAR |
#define | UART_DMA_TX_DISABLE 0x00000000U |
#define | UART_DMA_TX_ENABLE USART_CR3_DMAT |
#define | UART_FLAG_ABRE USART_ISR_ABRE |
#define | UART_FLAG_ABRF USART_ISR_ABRF |
#define | UART_FLAG_BUSY USART_ISR_BUSY |
#define | UART_FLAG_CMF USART_ISR_CMF |
#define | UART_FLAG_CTS USART_ISR_CTS |
#define | UART_FLAG_CTSIF USART_ISR_CTSIF |
#define | UART_FLAG_FE USART_ISR_FE |
#define | UART_FLAG_IDLE USART_ISR_IDLE |
#define | UART_FLAG_LBDF USART_ISR_LBDF |
#define | UART_FLAG_NE USART_ISR_NE |
#define | UART_FLAG_ORE USART_ISR_ORE |
#define | UART_FLAG_PE USART_ISR_PE |
#define | UART_FLAG_RTOF USART_ISR_RTOF |
#define | UART_FLAG_RWU USART_ISR_RWU |
#define | UART_FLAG_RXNE USART_ISR_RXNE |
#define | UART_FLAG_SBKF USART_ISR_SBKF |
#define | UART_FLAG_TC USART_ISR_TC |
#define | UART_FLAG_TEACK USART_ISR_TEACK |
#define | UART_FLAG_TXE USART_ISR_TXE |
#define | UART_HALF_DUPLEX_DISABLE 0x00000000U |
#define | UART_HALF_DUPLEX_ENABLE USART_CR3_HDSEL |
#define | UART_HWCONTROL_CTS USART_CR3_CTSE |
#define | UART_HWCONTROL_NONE 0x00000000U |
#define | UART_HWCONTROL_RTS USART_CR3_RTSE |
#define | UART_HWCONTROL_RTS_CTS (USART_CR3_RTSE | USART_CR3_CTSE) |
#define | UART_IT_CM 0x112EU |
#define | UART_IT_CTS 0x096AU |
#define | UART_IT_ERR 0x0060U |
#define | UART_IT_FE 0x0100U |
#define | UART_IT_IDLE 0x0424U |
#define | UART_IT_LBD 0x0846U |
#define | UART_IT_MASK 0x001FU |
#define | UART_IT_NE 0x0200U |
#define | UART_IT_ORE 0x0300U |
#define | UART_IT_PE 0x0028U |
#define | UART_IT_RTO 0x0B3AU |
#define | UART_IT_RXNE 0x0525U |
#define | UART_IT_TC 0x0626U |
#define | UART_IT_TXE 0x0727U |
#define | UART_LIN_DISABLE 0x00000000U |
#define | UART_LIN_ENABLE USART_CR2_LINEN |
#define | UART_LINBREAKDETECTLENGTH_10B 0x00000000U |
#define | UART_LINBREAKDETECTLENGTH_11B USART_CR2_LBDL |
#define | UART_MODE_RX USART_CR1_RE |
#define | UART_MODE_TX USART_CR1_TE |
#define | UART_MODE_TX_RX (USART_CR1_TE |USART_CR1_RE) |
#define | UART_MUTE_MODE_REQUEST USART_RQR_MMRQ |
#define | UART_ONE_BIT_SAMPLE_DISABLE 0x00000000U |
#define | UART_ONE_BIT_SAMPLE_ENABLE USART_CR3_ONEBIT |
#define | UART_OVERSAMPLING_16 0x00000000U |
#define | UART_OVERSAMPLING_8 USART_CR1_OVER8 |
#define | UART_PARITY_EVEN USART_CR1_PCE |
#define | UART_PARITY_NONE 0x00000000U |
#define | UART_PARITY_ODD (USART_CR1_PCE | USART_CR1_PS) |
#define | UART_RECEIVER_TIMEOUT_DISABLE 0x00000000U |
#define | UART_RECEIVER_TIMEOUT_ENABLE USART_CR2_RTOEN |
#define | UART_RXDATA_FLUSH_REQUEST USART_RQR_RXFRQ |
#define | UART_SENDBREAK_REQUEST USART_RQR_SBKRQ |
#define | UART_STATE_DISABLE 0x00000000U |
#define | UART_STATE_ENABLE USART_CR1_UE |
#define | UART_STOPBITS_0_5 USART_CR2_STOP_0 |
#define | UART_STOPBITS_1 0x00000000U |
#define | UART_STOPBITS_1_5 (USART_CR2_STOP_0 | USART_CR2_STOP_1) |
#define | UART_STOPBITS_2 USART_CR2_STOP_1 |
#define | UART_TXDATA_FLUSH_REQUEST USART_RQR_TXFRQ |
#define | UART_WAKEUPMETHOD_ADDRESSMARK USART_CR1_WAKE |
#define | UART_WAKEUPMETHOD_IDLELINE 0x00000000U |
Typedefs | |
typedef uint32_t | HAL_UART_StateTypeDef |
HAL UART State definition. More... | |
typedef struct __UART_HandleTypeDef | UART_HandleTypeDef |
UART handle Structure definition. More... | |
Enumerations | |
enum | UART_ClockSourceTypeDef { UART_CLOCKSOURCE_PCLK1 = 0x00U, UART_CLOCKSOURCE_PCLK2 = 0x01U, UART_CLOCKSOURCE_HSI = 0x02U, UART_CLOCKSOURCE_SYSCLK = 0x04U, UART_CLOCKSOURCE_LSE = 0x08U, UART_CLOCKSOURCE_UNDEFINED = 0x10U, UART_CLOCKSOURCE_D2PCLK1 = 0x00U, UART_CLOCKSOURCE_D2PCLK2 = 0x01U, UART_CLOCKSOURCE_D3PCLK1 = 0x02U, UART_CLOCKSOURCE_PLL2 = 0x04U, UART_CLOCKSOURCE_PLL3 = 0x08U, UART_CLOCKSOURCE_HSI = 0x10U, UART_CLOCKSOURCE_CSI = 0x20U, UART_CLOCKSOURCE_LSE = 0x40U, UART_CLOCKSOURCE_UNDEFINED = 0x80U, UART_CLOCKSOURCE_D2PCLK1 = 0x00U, UART_CLOCKSOURCE_D2PCLK2 = 0x01U, UART_CLOCKSOURCE_D3PCLK1 = 0x02U, UART_CLOCKSOURCE_PLL2 = 0x04U, UART_CLOCKSOURCE_PLL3 = 0x08U, UART_CLOCKSOURCE_HSI = 0x10U, UART_CLOCKSOURCE_CSI = 0x20U, UART_CLOCKSOURCE_LSE = 0x40U, UART_CLOCKSOURCE_UNDEFINED = 0x80U } |
UART clock sources definition. More... | |
Header file of UART HAL module.
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this file except in compliance with the License. You may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause
Definition in file stm32f7xx_hal_uart.h.