RTEMS 6.1-rc6
|
Header file of USART HAL module. More...
Go to the source code of this file.
Data Structures | |
struct | USART_InitTypeDef |
USART Init Structure definition. More... | |
struct | __USART_HandleTypeDef |
USART handle Structure definition. More... | |
Macros | |
#define | HAL_USART_ERROR_NONE (0x00000000U) |
#define | HAL_USART_ERROR_PE (0x00000001U) |
#define | HAL_USART_ERROR_NE (0x00000002U) |
#define | HAL_USART_ERROR_FE (0x00000004U) |
#define | HAL_USART_ERROR_ORE (0x00000008U) |
#define | HAL_USART_ERROR_DMA (0x00000010U) |
#define | HAL_USART_ERROR_UDR (0x00000020U) |
#define | HAL_USART_ERROR_RTO (0x00000080U) |
#define | USART_STOPBITS_0_5 USART_CR2_STOP_0 |
#define | USART_STOPBITS_1 0x00000000U |
#define | USART_STOPBITS_1_5 (USART_CR2_STOP_0 | USART_CR2_STOP_1) |
#define | USART_STOPBITS_2 USART_CR2_STOP_1 |
#define | USART_PARITY_NONE 0x00000000U |
#define | USART_PARITY_EVEN USART_CR1_PCE |
#define | USART_PARITY_ODD (USART_CR1_PCE | USART_CR1_PS) |
#define | USART_MODE_RX USART_CR1_RE |
#define | USART_MODE_TX USART_CR1_TE |
#define | USART_MODE_TX_RX (USART_CR1_TE |USART_CR1_RE) |
#define | USART_CLOCK_DISABLE 0x00000000U |
#define | USART_CLOCK_ENABLE USART_CR2_CLKEN |
#define | USART_POLARITY_LOW 0x00000000U |
#define | USART_POLARITY_HIGH USART_CR2_CPOL |
#define | USART_PHASE_1EDGE 0x00000000U |
#define | USART_PHASE_2EDGE USART_CR2_CPHA |
#define | USART_LASTBIT_DISABLE 0x00000000U |
#define | USART_LASTBIT_ENABLE USART_CR2_LBCL |
#define | USART_PRESCALER_DIV1 0x00000000U |
#define | USART_PRESCALER_DIV2 0x00000001U |
#define | USART_PRESCALER_DIV4 0x00000002U |
#define | USART_PRESCALER_DIV6 0x00000003U |
#define | USART_PRESCALER_DIV8 0x00000004U |
#define | USART_PRESCALER_DIV10 0x00000005U |
#define | USART_PRESCALER_DIV12 0x00000006U |
#define | USART_PRESCALER_DIV16 0x00000007U |
#define | USART_PRESCALER_DIV32 0x00000008U |
#define | USART_PRESCALER_DIV64 0x00000009U |
#define | USART_PRESCALER_DIV128 0x0000000AU |
#define | USART_PRESCALER_DIV256 0x0000000BU |
#define | USART_RXDATA_FLUSH_REQUEST USART_RQR_RXFRQ |
#define | USART_TXDATA_FLUSH_REQUEST USART_RQR_TXFRQ |
#define | USART_FLAG_TXFT USART_ISR_TXFT |
#define | USART_FLAG_RXFT USART_ISR_RXFT |
#define | USART_FLAG_RXFF USART_ISR_RXFF |
#define | USART_FLAG_TXFE USART_ISR_TXFE |
#define | USART_FLAG_REACK USART_ISR_REACK |
#define | USART_FLAG_TEACK USART_ISR_TEACK |
#define | USART_FLAG_BUSY USART_ISR_BUSY |
#define | USART_FLAG_UDR USART_ISR_UDR |
#define | USART_FLAG_TXE USART_ISR_TXE_TXFNF |
#define | USART_FLAG_TXFNF USART_ISR_TXE_TXFNF |
#define | USART_FLAG_RTOF USART_ISR_RTOF |
#define | USART_FLAG_TC USART_ISR_TC |
#define | USART_FLAG_RXNE USART_ISR_RXNE_RXFNE |
#define | USART_FLAG_RXFNE USART_ISR_RXNE_RXFNE |
#define | USART_FLAG_IDLE USART_ISR_IDLE |
#define | USART_FLAG_ORE USART_ISR_ORE |
#define | USART_FLAG_NE USART_ISR_NE |
#define | USART_FLAG_FE USART_ISR_FE |
#define | USART_FLAG_PE USART_ISR_PE |
#define | USART_IT_PE 0x0028U |
#define | USART_IT_TXE 0x0727U |
#define | USART_IT_TXFNF 0x0727U |
#define | USART_IT_TC 0x0626U |
#define | USART_IT_RXNE 0x0525U |
#define | USART_IT_RXFNE 0x0525U |
#define | USART_IT_IDLE 0x0424U |
#define | USART_IT_ERR 0x0060U |
#define | USART_IT_ORE 0x0300U |
#define | USART_IT_NE 0x0200U |
#define | USART_IT_FE 0x0100U |
#define | USART_IT_RXFF 0x183FU |
#define | USART_IT_TXFE 0x173EU |
#define | USART_IT_RXFT 0x1A7CU |
#define | USART_IT_TXFT 0x1B77U |
#define | USART_CLEAR_PEF USART_ICR_PECF |
#define | USART_CLEAR_FEF USART_ICR_FECF |
#define | USART_CLEAR_NEF USART_ICR_NECF |
#define | USART_CLEAR_OREF USART_ICR_ORECF |
#define | USART_CLEAR_IDLEF USART_ICR_IDLECF |
#define | USART_CLEAR_TCF USART_ICR_TCCF |
#define | USART_CLEAR_UDRF USART_ICR_UDRCF |
#define | USART_CLEAR_TXFECF USART_ICR_TXFECF |
#define | USART_CLEAR_RTOF USART_ICR_RTOCF |
#define | USART_IT_MASK 0x001FU |
#define | USART_CR_MASK 0x00E0U |
#define | USART_CR_POS 5U |
#define | USART_ISR_MASK 0x1F00U |
#define | USART_ISR_POS 8U |
#define | __HAL_USART_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_USART_STATE_RESET) |
Reset USART handle state. | |
#define | __HAL_USART_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->ISR & (__FLAG__)) == (__FLAG__)) |
Check whether the specified USART flag is set or not. | |
#define | __HAL_USART_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->ICR = (__FLAG__)) |
Clear the specified USART pending flag. | |
#define | __HAL_USART_CLEAR_PEFLAG(__HANDLE__) __HAL_USART_CLEAR_FLAG((__HANDLE__), USART_CLEAR_PEF) |
Clear the USART PE pending flag. | |
#define | __HAL_USART_CLEAR_FEFLAG(__HANDLE__) __HAL_USART_CLEAR_FLAG((__HANDLE__), USART_CLEAR_FEF) |
Clear the USART FE pending flag. | |
#define | __HAL_USART_CLEAR_NEFLAG(__HANDLE__) __HAL_USART_CLEAR_FLAG((__HANDLE__), USART_CLEAR_NEF) |
Clear the USART NE pending flag. | |
#define | __HAL_USART_CLEAR_OREFLAG(__HANDLE__) __HAL_USART_CLEAR_FLAG((__HANDLE__), USART_CLEAR_OREF) |
Clear the USART ORE pending flag. | |
#define | __HAL_USART_CLEAR_IDLEFLAG(__HANDLE__) __HAL_USART_CLEAR_FLAG((__HANDLE__), USART_CLEAR_IDLEF) |
Clear the USART IDLE pending flag. | |
#define | __HAL_USART_CLEAR_TXFECF(__HANDLE__) __HAL_USART_CLEAR_FLAG((__HANDLE__), USART_CLEAR_TXFECF) |
Clear the USART TX FIFO empty clear flag. | |
#define | __HAL_USART_CLEAR_UDRFLAG(__HANDLE__) __HAL_USART_CLEAR_FLAG((__HANDLE__), USART_CLEAR_UDRF) |
Clear SPI slave underrun error flag. | |
#define | __HAL_USART_ENABLE_IT(__HANDLE__, __INTERRUPT__) |
Enable the specified USART interrupt. | |
#define | __HAL_USART_DISABLE_IT(__HANDLE__, __INTERRUPT__) |
Disable the specified USART interrupt. | |
#define | __HAL_USART_GET_IT(__HANDLE__, __INTERRUPT__) |
Check whether the specified USART interrupt has occurred or not. | |
#define | __HAL_USART_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) |
Check whether the specified USART interrupt source is enabled or not. | |
#define | __HAL_USART_CLEAR_IT(__HANDLE__, __IT_CLEAR__) ((__HANDLE__)->Instance->ICR = (uint32_t)(__IT_CLEAR__)) |
Clear the specified USART ISR flag, in setting the proper ICR register flag. | |
#define | __HAL_USART_SEND_REQ(__HANDLE__, __REQ__) ((__HANDLE__)->Instance->RQR |= (uint16_t)(__REQ__)) |
Set a specific USART request flag. | |
#define | __HAL_USART_ONE_BIT_SAMPLE_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3|= USART_CR3_ONEBIT) |
Enable the USART one bit sample method. | |
#define | __HAL_USART_ONE_BIT_SAMPLE_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR3 &= ~USART_CR3_ONEBIT) |
Disable the USART one bit sample method. | |
#define | __HAL_USART_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 |= USART_CR1_UE) |
Enable USART. | |
#define | __HAL_USART_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR1 &= ~USART_CR1_UE) |
Disable USART. | |
#define | USART_GET_DIV_FACTOR(__CLOCKPRESCALER__) |
Get USART clock division factor from clock prescaler value. | |
#define | USART_DIV_SAMPLING8(__PCLK__, __BAUD__, __CLOCKPRESCALER__) |
BRR division operation to set BRR register in 8-bit oversampling mode. | |
#define | USART_GETCLOCKSOURCE(__HANDLE__, __CLOCKSOURCE__) |
Report the USART clock source. | |
#define | IS_USART_BAUDRATE(__BAUDRATE__) ((__BAUDRATE__) <= 12500000U) |
Check USART Baud rate. | |
#define | IS_USART_STOPBITS(__STOPBITS__) |
Ensure that USART frame number of stop bits is valid. | |
#define | IS_USART_PARITY(__PARITY__) |
Ensure that USART frame parity is valid. | |
#define | IS_USART_MODE(__MODE__) ((((__MODE__) & 0xFFFFFFF3U) == 0x00U) && ((__MODE__) != 0x00U)) |
Ensure that USART communication mode is valid. | |
#define | IS_USART_CLOCK(__CLOCK__) |
Ensure that USART clock state is valid. | |
#define | IS_USART_POLARITY(__CPOL__) (((__CPOL__) == USART_POLARITY_LOW) || ((__CPOL__) == USART_POLARITY_HIGH)) |
Ensure that USART frame polarity is valid. | |
#define | IS_USART_PHASE(__CPHA__) (((__CPHA__) == USART_PHASE_1EDGE) || ((__CPHA__) == USART_PHASE_2EDGE)) |
Ensure that USART frame phase is valid. | |
#define | IS_USART_LASTBIT(__LASTBIT__) |
Ensure that USART frame last bit clock pulse setting is valid. | |
#define | IS_USART_REQUEST_PARAMETER(__PARAM__) |
Ensure that USART request parameter is valid. | |
#define | IS_USART_PRESCALER(__CLOCKPRESCALER__) |
Ensure that USART Prescaler is valid. | |
Typedefs | |
typedef struct __USART_HandleTypeDef | USART_HandleTypeDef |
USART handle Structure definition. | |
Enumerations | |
enum | HAL_USART_StateTypeDef { HAL_USART_STATE_RESET = 0x00U , HAL_USART_STATE_READY = 0x01U , HAL_USART_STATE_BUSY = 0x02U , HAL_USART_STATE_BUSY_TX = 0x12U , HAL_USART_STATE_BUSY_RX = 0x22U , HAL_USART_STATE_BUSY_TX_RX = 0x32U , HAL_USART_STATE_TIMEOUT = 0x03U , HAL_USART_STATE_ERROR = 0x04U } |
HAL USART State structures definition. More... | |
enum | USART_ClockSourceTypeDef { USART_CLOCKSOURCE_D2PCLK1 = 0x00U , USART_CLOCKSOURCE_D2PCLK2 = 0x01U , USART_CLOCKSOURCE_PLL2 = 0x02U , USART_CLOCKSOURCE_PLL3 = 0x04U , USART_CLOCKSOURCE_HSI = 0x08U , USART_CLOCKSOURCE_CSI = 0x10U , USART_CLOCKSOURCE_LSE = 0x20U , USART_CLOCKSOURCE_UNDEFINED = 0x40U } |
USART clock sources definitions. More... | |
Functions | |
HAL_StatusTypeDef | HAL_USART_Init (USART_HandleTypeDef *husart) |
HAL_StatusTypeDef | HAL_USART_DeInit (USART_HandleTypeDef *husart) |
void | HAL_USART_MspInit (USART_HandleTypeDef *husart) |
void | HAL_USART_MspDeInit (USART_HandleTypeDef *husart) |
HAL_StatusTypeDef | HAL_USART_Transmit (USART_HandleTypeDef *husart, const uint8_t *pTxData, uint16_t Size, uint32_t Timeout) |
HAL_StatusTypeDef | HAL_USART_Receive (USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size, uint32_t Timeout) |
HAL_StatusTypeDef | HAL_USART_TransmitReceive (USART_HandleTypeDef *husart, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size, uint32_t Timeout) |
HAL_StatusTypeDef | HAL_USART_Transmit_IT (USART_HandleTypeDef *husart, const uint8_t *pTxData, uint16_t Size) |
HAL_StatusTypeDef | HAL_USART_Receive_IT (USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size) |
HAL_StatusTypeDef | HAL_USART_TransmitReceive_IT (USART_HandleTypeDef *husart, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size) |
HAL_StatusTypeDef | HAL_USART_Transmit_DMA (USART_HandleTypeDef *husart, const uint8_t *pTxData, uint16_t Size) |
HAL_StatusTypeDef | HAL_USART_Receive_DMA (USART_HandleTypeDef *husart, uint8_t *pRxData, uint16_t Size) |
HAL_StatusTypeDef | HAL_USART_TransmitReceive_DMA (USART_HandleTypeDef *husart, const uint8_t *pTxData, uint8_t *pRxData, uint16_t Size) |
HAL_StatusTypeDef | HAL_USART_DMAPause (USART_HandleTypeDef *husart) |
HAL_StatusTypeDef | HAL_USART_DMAResume (USART_HandleTypeDef *husart) |
HAL_StatusTypeDef | HAL_USART_DMAStop (USART_HandleTypeDef *husart) |
HAL_StatusTypeDef | HAL_USART_Abort (USART_HandleTypeDef *husart) |
HAL_StatusTypeDef | HAL_USART_Abort_IT (USART_HandleTypeDef *husart) |
void | HAL_USART_IRQHandler (USART_HandleTypeDef *husart) |
void | HAL_USART_TxHalfCpltCallback (USART_HandleTypeDef *husart) |
void | HAL_USART_TxCpltCallback (USART_HandleTypeDef *husart) |
void | HAL_USART_RxCpltCallback (USART_HandleTypeDef *husart) |
void | HAL_USART_RxHalfCpltCallback (USART_HandleTypeDef *husart) |
void | HAL_USART_TxRxCpltCallback (USART_HandleTypeDef *husart) |
void | HAL_USART_ErrorCallback (USART_HandleTypeDef *husart) |
void | HAL_USART_AbortCpltCallback (USART_HandleTypeDef *husart) |
HAL_USART_StateTypeDef | HAL_USART_GetState (const USART_HandleTypeDef *husart) |
uint32_t | HAL_USART_GetError (const USART_HandleTypeDef *husart) |
Header file of USART HAL module.
Copyright (c) 2017 STMicroelectronics. All rights reserved.
This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.