Header file of UART HAL module. More...
#include "stm32f4xx_hal_def.h"
Go to the source code of this file.
Classes | |
struct | __UART_HandleTypeDef |
UART handle Structure definition. More... | |
struct | UART_InitTypeDef |
UART Init Structure definition. More... | |
Macros | |
#define | __HAL_UART_CLEAR_FEFLAG(__HANDLE__) __HAL_UART_CLEAR_PEFLAG(__HANDLE__) |
Clears the UART FE pending flag. More... | |
#define | __HAL_UART_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR = ~(__FLAG__)) |
Clears the specified UART pending flag. More... | |
#define | __HAL_UART_CLEAR_IDLEFLAG(__HANDLE__) __HAL_UART_CLEAR_PEFLAG(__HANDLE__) |
Clears the UART IDLE pending flag. More... | |
#define | __HAL_UART_CLEAR_NEFLAG(__HANDLE__) __HAL_UART_CLEAR_PEFLAG(__HANDLE__) |
Clears the UART NE pending flag. More... | |
#define | __HAL_UART_CLEAR_OREFLAG(__HANDLE__) __HAL_UART_CLEAR_PEFLAG(__HANDLE__) |
Clears the UART ORE pending flag. More... | |
#define | __HAL_UART_CLEAR_PEFLAG(__HANDLE__) |
Clears 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__) ((__HANDLE__)->Instance->DR) |
Flushes the UART DR register. More... | |
#define | __HAL_UART_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->SR & (__FLAG__)) == (__FLAG__)) |
Checks whether the specified UART flag is set or not. More... | |
#define | __HAL_UART_GET_IT_SOURCE(__HANDLE__, __IT__) |
Checks 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 This macro allows to disable RTS hardware flow control for a given UART instance, without need to call HAL_UART_Init() function. As involving direct access to UART registers, usage of this macro should be fully endorsed by user. More... | |
#define | __HAL_UART_HWCONTROL_RTS_ENABLE(__HANDLE__) |
Enable RTS flow control This macro allows to enable RTS hardware flow control for a given UART instance, without need to call HAL_UART_Init() function. As involving direct access to UART registers, usage of this macro should be fully endorsed by user. More... | |
#define | __HAL_UART_ONE_BIT_SAMPLE_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3 &= (uint16_t)~((uint16_t)USART_CR3_ONEBIT)) |
Macro to disable the UART's one bit sample method. More... | |
#define | __HAL_UART_ONE_BIT_SAMPLE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT) |
Macro to enable the UART's one bit sample method. More... | |
#define | __HAL_UART_RESET_HANDLE_STATE(__HANDLE__) |
Reset UART handle gstate & RxState. More... | |
#define | HAL_UART_ERROR_DMA 0x00000010U |
#define | HAL_UART_ERROR_FE 0x00000004U |
#define | HAL_UART_ERROR_NE 0x00000002U |
#define | HAL_UART_ERROR_NONE 0x00000000U |
#define | HAL_UART_ERROR_ORE 0x00000008U |
#define | HAL_UART_ERROR_PE 0x00000001U |
#define | IS_UART_ADDRESS(ADDRESS) ((ADDRESS) <= 0x0FU) |
#define | IS_UART_BAUDRATE(BAUDRATE) ((BAUDRATE) <= 10500000U) |
#define | IS_UART_HARDWARE_FLOW_CONTROL(CONTROL) |
#define | IS_UART_LIN_BREAK_DETECT_LENGTH(LENGTH) |
#define | IS_UART_LIN_OVERSAMPLING(SAMPLING) (((SAMPLING) == UART_OVERSAMPLING_16)) |
#define | IS_UART_LIN_WORD_LENGTH(LENGTH) (((LENGTH) == UART_WORDLENGTH_8B)) |
#define | IS_UART_MODE(MODE) ((((MODE) & 0x0000FFF3U) == 0x00U) && ((MODE) != 0x00U)) |
#define | IS_UART_OVERSAMPLING(SAMPLING) |
#define | IS_UART_PARITY(PARITY) |
#define | IS_UART_STATE(STATE) |
#define | IS_UART_STOPBITS(STOPBITS) |
#define | IS_UART_WAKEUPMETHOD(WAKEUP) |
#define | IS_UART_WORD_LENGTH(LENGTH) |
#define | UART_BRR_SAMPLING16(_PCLK_, _BAUD_) |
#define | UART_BRR_SAMPLING8(_PCLK_, _BAUD_) |
#define | UART_CR1_REG_INDEX 1U |
#define | UART_CR2_REG_INDEX 2U |
#define | UART_CR3_REG_INDEX 3U |
#define | UART_DIV_SAMPLING16(_PCLK_, _BAUD_) ((uint32_t)((((uint64_t)(_PCLK_))*25U)/(4U*((uint64_t)(_BAUD_))))) |
#define | UART_DIV_SAMPLING8(_PCLK_, _BAUD_) ((uint32_t)((((uint64_t)(_PCLK_))*25U)/(2U*((uint64_t)(_BAUD_))))) |
#define | UART_DIVFRAQ_SAMPLING16(_PCLK_, _BAUD_) ((((UART_DIV_SAMPLING16((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) * 100U)) * 16U) + 50U) / 100U) |
#define | UART_DIVFRAQ_SAMPLING8(_PCLK_, _BAUD_) ((((UART_DIV_SAMPLING8((_PCLK_), (_BAUD_)) - (UART_DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) * 100U)) * 8U) + 50U) / 100U) |
#define | UART_DIVMANT_SAMPLING16(_PCLK_, _BAUD_) (UART_DIV_SAMPLING16((_PCLK_), (_BAUD_))/100U) |
#define | UART_DIVMANT_SAMPLING8(_PCLK_, _BAUD_) (UART_DIV_SAMPLING8((_PCLK_), (_BAUD_))/100U) |
#define | UART_FLAG_CTS ((uint32_t)USART_SR_CTS) |
#define | UART_FLAG_FE ((uint32_t)USART_SR_FE) |
#define | UART_FLAG_IDLE ((uint32_t)USART_SR_IDLE) |
#define | UART_FLAG_LBD ((uint32_t)USART_SR_LBD) |
#define | UART_FLAG_NE ((uint32_t)USART_SR_NE) |
#define | UART_FLAG_ORE ((uint32_t)USART_SR_ORE) |
#define | UART_FLAG_PE ((uint32_t)USART_SR_PE) |
#define | UART_FLAG_RXNE ((uint32_t)USART_SR_RXNE) |
#define | UART_FLAG_TC ((uint32_t)USART_SR_TC) |
#define | UART_FLAG_TXE ((uint32_t)USART_SR_TXE) |
#define | UART_HWCONTROL_CTS ((uint32_t)USART_CR3_CTSE) |
#define | UART_HWCONTROL_NONE 0x00000000U |
#define | UART_HWCONTROL_RTS ((uint32_t)USART_CR3_RTSE) |
#define | UART_HWCONTROL_RTS_CTS ((uint32_t)(USART_CR3_RTSE | USART_CR3_CTSE)) |
#define | UART_IT_CTS ((uint32_t)(UART_CR3_REG_INDEX << 28U | USART_CR3_CTSIE)) |
#define | UART_IT_ERR ((uint32_t)(UART_CR3_REG_INDEX << 28U | USART_CR3_EIE)) |
#define | UART_IT_IDLE ((uint32_t)(UART_CR1_REG_INDEX << 28U | USART_CR1_IDLEIE)) |
#define | UART_IT_LBD ((uint32_t)(UART_CR2_REG_INDEX << 28U | USART_CR2_LBDIE)) |
#define | UART_IT_MASK 0x0000FFFFU |
UART interruptions flag mask. More... | |
#define | UART_IT_PE ((uint32_t)(UART_CR1_REG_INDEX << 28U | USART_CR1_PEIE)) |
#define | UART_IT_RXNE ((uint32_t)(UART_CR1_REG_INDEX << 28U | USART_CR1_RXNEIE)) |
#define | UART_IT_TC ((uint32_t)(UART_CR1_REG_INDEX << 28U | USART_CR1_TCIE)) |
#define | UART_IT_TXE ((uint32_t)(UART_CR1_REG_INDEX << 28U | USART_CR1_TXEIE)) |
#define | UART_LINBREAKDETECTLENGTH_10B 0x00000000U |
#define | UART_LINBREAKDETECTLENGTH_11B ((uint32_t)USART_CR2_LBDL) |
#define | UART_MODE_RX ((uint32_t)USART_CR1_RE) |
#define | UART_MODE_TX ((uint32_t)USART_CR1_TE) |
#define | UART_MODE_TX_RX ((uint32_t)(USART_CR1_TE | USART_CR1_RE)) |
#define | UART_OVERSAMPLING_16 0x00000000U |
#define | UART_OVERSAMPLING_8 ((uint32_t)USART_CR1_OVER8) |
#define | UART_PARITY_EVEN ((uint32_t)USART_CR1_PCE) |
#define | UART_PARITY_NONE 0x00000000U |
#define | UART_PARITY_ODD ((uint32_t)(USART_CR1_PCE | USART_CR1_PS)) |
#define | UART_STATE_DISABLE 0x00000000U |
#define | UART_STATE_ENABLE ((uint32_t)USART_CR1_UE) |
#define | UART_STOPBITS_1 0x00000000U |
#define | UART_STOPBITS_2 ((uint32_t)USART_CR2_STOP_1) |
#define | UART_WAKEUPMETHOD_ADDRESSMARK ((uint32_t)USART_CR1_WAKE) |
#define | UART_WAKEUPMETHOD_IDLELINE 0x00000000U |
#define | UART_WORDLENGTH_8B 0x00000000U |
#define | UART_WORDLENGTH_9B ((uint32_t)USART_CR1_M) |
Typedefs | |
typedef struct __UART_HandleTypeDef | UART_HandleTypeDef |
UART handle Structure definition. More... | |
Enumerations | |
enum | HAL_UART_StateTypeDef { HAL_UART_STATE_RESET = 0x00U, HAL_UART_STATE_READY = 0x20U, HAL_UART_STATE_BUSY = 0x24U, HAL_UART_STATE_BUSY_TX = 0x21U, HAL_UART_STATE_BUSY_RX = 0x22U, HAL_UART_STATE_BUSY_TX_RX = 0x23U, HAL_UART_STATE_TIMEOUT = 0xA0U, HAL_UART_STATE_ERROR = 0xE0U } |
HAL UART State structures 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 stm32f4xx_hal_uart.h.