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...
void | hal_uart_suspend_reg (uart_handle_t *p_uart)
| Suspend some registers related to UART configuration before sleep. More...
void | 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...
hal_pm_status_t | hal_pm_uart_suspend (uart_handle_t *p_uart)
| Suspend the specified UART. More...
void | hal_pm_uart_resume (uart_handle_t *p_uart)
| Resume the specified UART. 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_pm_uart_resume()

void hal_pm_uart_resume | ( | uart_handle_t * | p_uart | ) |

Resume the specified UART.

Parameters

  [in] | p_uart | Pointer to a UART handle

Return values

  ::None |

## ◆ hal_pm_uart_suspend()

hal_pm_status_t hal_pm_uart_suspend | ( | uart_handle_t * | p_uart | ) |

Suspend the specified UART.

Parameters

  [in] | p_uart | Pointer to a UART handle

Return values

  HAL_PM_ACTIVE | Device is active, not allow sleep.
  HAL_PM_SLEEP | Allow sleep.

## ◆ 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()

void 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.

## ◆ hal_uart_suspend_reg()

void 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.