Functions
Peripheral Control and State functions
Peripheral Driver » HAL Driver » UART » Functions

UART Peripheral State functions. More...

## Functions
hal_uart_state_t | hal_uart_get_state (uart_handle_t *p_uart)
| Return the UART handle state. More...
uint32_t | hal_uart_get_error (uart_handle_t *p_uart)
| Return the UART handle error code. More...
hal_status_t | hal_uart_suspend_reg (uart_handle_t *p_uart)
| Suspend some registers related to UART configuration before sleep. More...
hal_status_t | hal_uart_resume_reg (uart_handle_t *p_uart)
| Restore some registers related to UART configuration after sleep. This function must be used in conjunction with the hal_uart_suspend_reg(). More...

## Detailed Description

UART Peripheral State functions.

      ==============================================================================
                ##### Peripheral Control and State functions #####
      ==============================================================================
        [..]
        This subsection provides functions allowing to :
          (+) Return the UART handle state.
          (+) Return the UART handle error code

## Function Documentation

## ◆ hal_uart_get_error()

uint32_t hal_uart_get_error | ( | uart_handle_t * | p_uart | ) |

Return the UART handle error code.

Parameters

  [in] | p_uart | Pointer to a UART handle which contains the configuration information for the specified UART module.

Returns
  UART Error Code

## ◆ hal_uart_get_state()

hal_uart_state_t hal_uart_get_state | ( | uart_handle_t * | p_uart | ) |

Return the UART handle state.

Parameters

  [in] | p_uart | Pointer to a UART handle which contains the configuration information for the specified UART module.

Return values

  HAL_UART_STATE_RESET | Peripheral is not initialized.
  HAL_UART_STATE_READY | Peripheral initialized and ready for use.
  HAL_UART_STATE_BUSY | An internal process is ongoing.
  HAL_UART_STATE_BUSY_TX | Data Transmission process is ongoing.
  HAL_UART_STATE_BUSY_RX | Data Reception process is ongoing.
  HAL_UART_STATE_TIMEOUT | Timeout state.
  HAL_UART_STATE_ERROR | Error.

## ◆ hal_uart_resume_reg()

hal_status_t hal_uart_resume_reg | ( | uart_handle_t * | p_uart | ) |

Restore some registers related to UART configuration after sleep. This function must be used in conjunction with the hal_uart_suspend_reg().

Parameters

  [in] | p_uart | Pointer to a UART handle which contains the configuration information for the specified UART module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_uart_suspend_reg()

hal_status_t hal_uart_suspend_reg | ( | uart_handle_t * | p_uart | ) |

Suspend some registers related to UART configuration before sleep.

Parameters

  [in] | p_uart | Pointer to a UART handle which contains the configuration information for the specified UART module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.