]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso/NXP_Code/component/uart/uart.h
commit 9f316c246baafa15c542a5aea81a94f26e3d6507
[freertos] / FreeRTOS / Demo / CORTEX_MPU_M33F_NXP_LPC55S69_MCUXpresso / NXP_Code / component / uart / uart.h
index 62dde338b3d36435e2b0e41cf74c2e9ae26ad909..6961883aae445a7c5a9f178b982efe9a02ae952b 100644 (file)
@@ -9,67 +9,92 @@
 #ifndef __HAL_UART_ADAPTER_H__\r
 #define __HAL_UART_ADAPTER_H__\r
 \r
+#if defined(FSL_RTOS_FREE_RTOS)\r
+#include "FreeRTOS.h"\r
+#endif\r
+\r
+/*!\r
+ * @addtogroup UART_Adapter\r
+ * @{\r
+ */\r
+\r
 /*******************************************************************************\r
  * Definitions\r
  ******************************************************************************/\r
 \r
+/*! @brief Enable or disable UART adapter non-blocking mode (1 - enable, 0 - disable) */\r
 #ifdef DEBUG_CONSOLE_TRANSFER_NON_BLOCKING\r
-#define UART_ADAPTER_NON_BLOCKING_MODE \\r
-    (1U) /* Enable or disable Uart adapter non-blocking mode (1 - enable, 0 - disable) */\r
+#define UART_ADAPTER_NON_BLOCKING_MODE (1U)\r
 #else\r
 #ifndef SERIAL_MANAGER_NON_BLOCKING_MODE\r
-#define UART_ADAPTER_NON_BLOCKING_MODE \\r
-    (0U) /* Enable or disable Uart adapter non-blocking mode (1 - enable, 0 - disable) */\r
+#define UART_ADAPTER_NON_BLOCKING_MODE (0U)\r
 #else\r
 #define UART_ADAPTER_NON_BLOCKING_MODE SERIAL_MANAGER_NON_BLOCKING_MODE\r
 #endif\r
 #endif\r
 \r
+#if defined(__GIC_PRIO_BITS)\r
+#define HAL_UART_ISR_PRIORITY (25U)\r
+#else\r
+#if defined(configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY)\r
+#define HAL_UART_ISR_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY)\r
+#else\r
+/* The default value 3 is used to support different ARM Core, such as CM0P, CM4, CM7, and CM33, etc.\r
+ * The minimum number of priority bits implemented in the NVIC is 2 on these SOCs. The value of mininum\r
+ * priority is 3 (2^2 - 1). So, the default value is 3.\r
+ */\r
+#define HAL_UART_ISR_PRIORITY (3U)\r
+#endif\r
+#endif\r
+\r
+#ifndef HAL_UART_ADAPTER_LOWPOWER\r
+#define HAL_UART_ADAPTER_LOWPOWER (0U)\r
+#endif /* HAL_UART_ADAPTER_LOWPOWER */\r
+\r
 #if (defined(UART_ADAPTER_NON_BLOCKING_MODE) && (UART_ADAPTER_NON_BLOCKING_MODE > 0U))\r
-#define HAL_UART_HANDLE_SIZE (90U)\r
+#define HAL_UART_HANDLE_SIZE (90U + HAL_UART_ADAPTER_LOWPOWER * 16U)\r
 #else\r
-#define HAL_UART_HANDLE_SIZE (4U)\r
+#define HAL_UART_HANDLE_SIZE (4U + HAL_UART_ADAPTER_LOWPOWER * 16U)\r
 #endif\r
 \r
-#define HAL_UART_TRANSFER_MODE                                                               \\r
-    (0U) /*!< Whether enable transactional function of the uart. (0 - disable, 1 - enable) \ \\r
-            */\r
+/*! @brief Whether enable transactional function of the UART. (0 - disable, 1 - enable) */\r
+#define HAL_UART_TRANSFER_MODE (0U)\r
 \r
 typedef void *hal_uart_handle_t;\r
 \r
-/*! @brief uart status */\r
+/*! @brief UART status */\r
 typedef enum _hal_uart_status\r
 {\r
-    kStatus_HAL_UartSuccess = kStatus_Success,                      /*!< Successfully */\r
-    kStatus_HAL_UartTxBusy = MAKE_STATUS(kStatusGroup_HAL_UART, 1), /*!< TX busy */\r
-    kStatus_HAL_UartRxBusy = MAKE_STATUS(kStatusGroup_HAL_UART, 2), /*!< RX busy */\r
-    kStatus_HAL_UartTxIdle = MAKE_STATUS(kStatusGroup_HAL_UART, 3), /*!< HAL uart transmitter is idle. */\r
-    kStatus_HAL_UartRxIdle = MAKE_STATUS(kStatusGroup_HAL_UART, 4), /*!< HAL uart receiver is idle */\r
+    kStatus_HAL_UartSuccess = kStatus_Success,                       /*!< Successfully */\r
+    kStatus_HAL_UartTxBusy  = MAKE_STATUS(kStatusGroup_HAL_UART, 1), /*!< TX busy */\r
+    kStatus_HAL_UartRxBusy  = MAKE_STATUS(kStatusGroup_HAL_UART, 2), /*!< RX busy */\r
+    kStatus_HAL_UartTxIdle  = MAKE_STATUS(kStatusGroup_HAL_UART, 3), /*!< HAL UART transmitter is idle. */\r
+    kStatus_HAL_UartRxIdle  = MAKE_STATUS(kStatusGroup_HAL_UART, 4), /*!< HAL UART receiver is idle */\r
     kStatus_HAL_UartBaudrateNotSupport =\r
         MAKE_STATUS(kStatusGroup_HAL_UART, 5), /*!< Baudrate is not support in current clock source */\r
     kStatus_HAL_UartProtocolError = MAKE_STATUS(\r
         kStatusGroup_HAL_UART,\r
         6),                                                        /*!< Error occurs for Noise, Framing, Parity, etc.\r
-                                                                        For transcational transfer, The up layer needs to abort the transfer and then starts again */\r
-    kStatus_HAL_UartError = MAKE_STATUS(kStatusGroup_HAL_UART, 7), /*!< Error occurs on HAL uart */\r
+                                                                        For transactional transfer, The up layer needs to abort the transfer and then starts again */\r
+    kStatus_HAL_UartError = MAKE_STATUS(kStatusGroup_HAL_UART, 7), /*!< Error occurs on HAL UART */\r
 } hal_uart_status_t;\r
 \r
-/*! @brief uart parity mode. */\r
+/*! @brief UART parity mode. */\r
 typedef enum _hal_uart_parity_mode\r
 {\r
     kHAL_UartParityDisabled = 0x0U, /*!< Parity disabled */\r
-    kHAL_UartParityEven = 0x1U,     /*!< Parity even enabled */\r
-    kHAL_UartParityOdd = 0x2U,      /*!< Parity odd enabled */\r
+    kHAL_UartParityEven     = 0x1U, /*!< Parity even enabled */\r
+    kHAL_UartParityOdd      = 0x2U, /*!< Parity odd enabled */\r
 } hal_uart_parity_mode_t;\r
 \r
-/*! @brief uart stop bit count. */\r
+/*! @brief UART stop bit count. */\r
 typedef enum _hal_uart_stop_bit_count\r
 {\r
     kHAL_UartOneStopBit = 0U, /*!< One stop bit */\r
     kHAL_UartTwoStopBit = 1U, /*!< Two stop bits */\r
 } hal_uart_stop_bit_count_t;\r
 \r
-/*! @brief uart configuration structure. */\r
+/*! @brief UART configuration structure. */\r
 typedef struct _hal_uart_config\r
 {\r
     uint32_t srcClock_Hz;                   /*!< Source clock */\r
@@ -83,10 +108,10 @@ typedef struct _hal_uart_config
                            Invalid instance value will cause initialization failure. */\r
 } hal_uart_config_t;\r
 \r
-/*! @brief uart transfer callback function. */\r
+/*! @brief UART transfer callback function. */\r
 typedef void (*hal_uart_transfer_callback_t)(hal_uart_handle_t handle, hal_uart_status_t status, void *callbackParam);\r
 \r
-/*! @brief uart transfer structure. */\r
+/*! @brief UART transfer structure. */\r
 typedef struct _hal_uart_transfer\r
 {\r
     uint8_t *data;   /*!< The buffer of data to be transfer.*/\r
@@ -107,44 +132,44 @@ extern "C" {
  */\r
 \r
 /*!\r
-* @brief Initializes a uart instance with the uart handle and the user configuration structure.\r
-*\r
-* This function configures the uart module with user-defined settings. The user can configure the configuration\r
-* structure. The parameter handle is a pointer to point to a memory space of size #HAL_UART_HANDLE_SIZE allocated by the\r
-* caller.\r
-* Example below shows how to use this API to configure the uart.\r
-*  @code\r
-*   uint8_t g_UartHandleBuffer[HAL_UART_HANDLE_SIZE];\r
-*   hal_uart_handle_t g_UartHandle = &g_UartHandleBuffer[0];\r
-*   hal_uart_config_t config;\r
-*   config.srcClock_Hz = 48000000;\r
-*   config.baudRate_Bps = 115200U;\r
-*   config.parityMode = kHAL_UartParityDisabled;\r
-*   config.stopBitCount = kHAL_UartOneStopBit;\r
-*   config.enableRx = 1;\r
-*   config.enableTx = 1;\r
-*   config.instance = 0;\r
-*   HAL_UartInit(g_UartHandle, &config);\r
-*  @endcode\r
-*\r
-* @param handle Pointer to point to a memory space of size #HAL_UART_HANDLE_SIZE allocated by the caller.\r
-* @param config Pointer to user-defined configuration structure.\r
-* @retval kStatus_HAL_UartBaudrateNotSupport Baudrate is not support in current clock source.\r
-* @retval kStatus_HAL_UartSuccess uart initialization succeed\r
-*/\r
+ * @brief Initializes a UART instance with the UART handle and the user configuration structure.\r
+ *\r
+ * This function configures the UART module with user-defined settings. The user can configure the configuration\r
+ * structure. The parameter handle is a pointer to point to a memory space of size #HAL_UART_HANDLE_SIZE allocated by\r
+ * the caller. Example below shows how to use this API to configure the UART.\r
+ *  @code\r
+ *   uint32_t g_UartHandleBuffer[((HAL_UART_HANDLE_SIZE + sizeof(uint32_t) - 1) / sizeof(uitn32_t))];\r
+ *   hal_uart_handle_t g_UartHandle = (hal_uart_handle_t)&g_UartHandleBuffer[0];\r
+ *   hal_uart_config_t config;\r
+ *   config.srcClock_Hz = 48000000;\r
+ *   config.baudRate_Bps = 115200U;\r
+ *   config.parityMode = kHAL_UartParityDisabled;\r
+ *   config.stopBitCount = kHAL_UartOneStopBit;\r
+ *   config.enableRx = 1;\r
+ *   config.enableTx = 1;\r
+ *   config.instance = 0;\r
+ *   HAL_UartInit(g_UartHandle, &config);\r
+ *  @endcode\r
+ *\r
+ * @param handle Pointer to point to a memory space of size #HAL_UART_HANDLE_SIZE allocated by the caller.\r
+ * The handle should be 4 byte aligned, because unaligned access does not support on some devices.\r
+ * @param config Pointer to user-defined configuration structure.\r
+ * @retval kStatus_HAL_UartBaudrateNotSupport Baudrate is not support in current clock source.\r
+ * @retval kStatus_HAL_UartSuccess UART initialization succeed\r
+ */\r
 hal_uart_status_t HAL_UartInit(hal_uart_handle_t handle, hal_uart_config_t *config);\r
 \r
 /*!\r
- * @brief Deinitializes a uart instance.\r
+ * @brief Deinitializes a UART instance.\r
  *\r
- * This function waits for TX complete, disables TX and RX, and disables the uart clock.\r
+ * This function waits for TX complete, disables TX and RX, and disables the UART clock.\r
  *\r
- * @param handle uart handle pointer.\r
- * @retval kStatus_HAL_UartSuccess uart de-initialization succeed\r
+ * @param handle UART handle pointer.\r
+ * @retval kStatus_HAL_UartSuccess UART de-initialization succeed\r
  */\r
 hal_uart_status_t HAL_UartDeinit(hal_uart_handle_t handle);\r
 \r
-/* @} */\r
+/*! @}*/\r
 \r
 /*!\r
  * @name Blocking bus Operations\r
@@ -161,7 +186,7 @@ hal_uart_status_t HAL_UartDeinit(hal_uart_handle_t handle);
  * cannot be used at the same time.\r
  * And, the function #HAL_UartTransferAbortReceive cannot be used to abort the transmission of this function.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @param data Start address of the buffer to store the received data.\r
  * @param length Size of the buffer.\r
  * @retval kStatus_HAL_UartError An error occurred while receiving data.\r
@@ -180,15 +205,16 @@ hal_uart_status_t HAL_UartReceiveBlocking(hal_uart_handle_t handle, uint8_t *dat
  * cannot be used at the same time.\r
  * And, the function #HAL_UartTransferAbortSend cannot be used to abort the transmission of this function.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @param data Start address of the data to write.\r
  * @param length Size of the data to write.\r
  * @retval kStatus_HAL_UartSuccess Successfully sent all data.\r
  */\r
 hal_uart_status_t HAL_UartSendBlocking(hal_uart_handle_t handle, const uint8_t *data, size_t length);\r
 \r
-/* @} */\r
+/*! @}*/\r
 \r
+#if (defined(UART_ADAPTER_NON_BLOCKING_MODE) && (UART_ADAPTER_NON_BLOCKING_MODE > 0U))\r
 #if (defined(HAL_UART_TRANSFER_MODE) && (HAL_UART_TRANSFER_MODE > 0U))\r
 \r
 /*!\r
@@ -202,11 +228,11 @@ hal_uart_status_t HAL_UartSendBlocking(hal_uart_handle_t handle, const uint8_t *
 /*!\r
  * @brief Installs a callback and callback parameter.\r
  *\r
- * This function is used to install the callback and callback parameter for uart module.\r
- * When any status of the uart changed, the driver will notify the upper layer by the installed callback\r
+ * This function is used to install the callback and callback parameter for UART module.\r
+ * When any status of the UART changed, the driver will notify the upper layer by the installed callback\r
  * function. And the status is also passed as status parameter when the callback is called.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @param callback The callback function.\r
  * @param callbackParam The parameter of the callback function.\r
  * @retval kStatus_HAL_UartSuccess Successfully install the callback.\r
@@ -220,16 +246,16 @@ hal_uart_status_t HAL_UartTransferInstallCallback(hal_uart_handle_t handle,
  *\r
  * This function receives data using an interrupt method. This is a non-blocking function, which\r
  * returns directly without waiting for all data to be received.\r
- * The receive request is saved by the uart driver.\r
+ * The receive request is saved by the UART driver.\r
  * When the new data arrives, the receive request is serviced first.\r
- * When all data is received, the uart driver notifies the upper layer\r
+ * When all data is received, the UART driver notifies the upper layer\r
  * through a callback function and passes the status parameter @ref kStatus_UART_RxIdle.\r
  *\r
  * @note The function #HAL_UartReceiveBlocking and the function #HAL_UartTransferReceiveNonBlocking\r
  * cannot be used at the same time.\r
  *\r
- * @param handle uart handle pointer.\r
- * @param transfer uart transfer structure, see #hal_uart_transfer_t.\r
+ * @param handle UART handle pointer.\r
+ * @param transfer UART transfer structure, see #hal_uart_transfer_t.\r
  * @retval kStatus_HAL_UartSuccess Successfully queue the transfer into transmit queue.\r
  * @retval kStatus_HAL_UartRxBusy Previous receive request is not finished.\r
  * @retval kStatus_HAL_UartError An error occurred.\r
@@ -241,14 +267,14 @@ hal_uart_status_t HAL_UartTransferReceiveNonBlocking(hal_uart_handle_t handle, h
  *\r
  * This function sends data using an interrupt method. This is a non-blocking function, which\r
  * returns directly without waiting for all data to be written to the TX register. When\r
- * all data is written to the TX register in the ISR, the uart driver calls the callback\r
+ * all data is written to the TX register in the ISR, the UART driver calls the callback\r
  * function and passes the @ref kStatus_UART_TxIdle as status parameter.\r
  *\r
  * @note The function #HAL_UartSendBlocking and the function #HAL_UartTransferSendNonBlocking\r
  * cannot be used at the same time.\r
  *\r
- * @param handle uart handle pointer.\r
- * @param transfer uart transfer structure. See #hal_uart_transfer_t.\r
+ * @param handle UART handle pointer.\r
+ * @param transfer UART transfer structure. See #hal_uart_transfer_t.\r
  * @retval kStatus_HAL_UartSuccess Successfully start the data transmission.\r
  * @retval kStatus_HAL_UartTxBusy Previous transmission still not finished; data not all written to TX register yet.\r
  * @retval kStatus_HAL_UartError An error occurred.\r
@@ -260,7 +286,7 @@ hal_uart_status_t HAL_UartTransferSendNonBlocking(hal_uart_handle_t handle, hal_
  *\r
  * This function gets the number of bytes that have been received.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @param count Receive bytes count.\r
  * @retval kStatus_HAL_UartError An error occurred.\r
  * @retval kStatus_Success Get successfully through the parameter \p count.\r
@@ -268,12 +294,12 @@ hal_uart_status_t HAL_UartTransferSendNonBlocking(hal_uart_handle_t handle, hal_
 hal_uart_status_t HAL_UartTransferGetReceiveCount(hal_uart_handle_t handle, uint32_t *count);\r
 \r
 /*!\r
- * @brief Gets the number of bytes written to the uart TX register.\r
+ * @brief Gets the number of bytes written to the UART TX register.\r
  *\r
- * This function gets the number of bytes written to the uart TX\r
+ * This function gets the number of bytes written to the UART TX\r
  * register by using the interrupt method.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @param count Send bytes count.\r
  * @retval kStatus_HAL_UartError An error occurred.\r
  * @retval kStatus_Success Get successfully through the parameter \p count.\r
@@ -289,7 +315,7 @@ hal_uart_status_t HAL_UartTransferGetSendCount(hal_uart_handle_t handle, uint32_
  * @note The function #HAL_UartTransferAbortReceive cannot be used to abort the transmission of\r
  * the function #HAL_UartReceiveBlocking.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @retval kStatus_Success Get successfully abort the receiving.\r
  */\r
 hal_uart_status_t HAL_UartTransferAbortReceive(hal_uart_handle_t handle);\r
@@ -303,12 +329,12 @@ hal_uart_status_t HAL_UartTransferAbortReceive(hal_uart_handle_t handle);
  * @note The function #HAL_UartTransferAbortSend cannot be used to abort the transmission of\r
  * the function #HAL_UartSendBlocking.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @retval kStatus_Success Get successfully abort the sending.\r
  */\r
 hal_uart_status_t HAL_UartTransferAbortSend(hal_uart_handle_t handle);\r
 \r
-/* @} */\r
+/*! @}*/\r
 \r
 #else\r
 \r
@@ -323,11 +349,11 @@ hal_uart_status_t HAL_UartTransferAbortSend(hal_uart_handle_t handle);
 /*!\r
  * @brief Installs a callback and callback parameter.\r
  *\r
- * This function is used to install the callback and callback parameter for uart module.\r
+ * This function is used to install the callback and callback parameter for UART module.\r
  * When non-blocking sending or receiving finished, the adapter will notify the upper layer by the installed callback\r
  * function. And the status is also passed as status parameter when the callback is called.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @param callback The callback function.\r
  * @param callbackParam The parameter of the callback function.\r
  * @retval kStatus_HAL_UartSuccess Successfully install the callback.\r
@@ -341,15 +367,15 @@ hal_uart_status_t HAL_UartInstallCallback(hal_uart_handle_t handle,
  *\r
  * This function receives data using an interrupt method. This is a non-blocking function, which\r
  * returns directly without waiting for all data to be received.\r
- * The receive request is saved by the uart adapter.\r
+ * The receive request is saved by the UART adapter.\r
  * When the new data arrives, the receive request is serviced first.\r
- * When all data is received, the uart adapter notifies the upper layer\r
+ * When all data is received, the UART adapter notifies the upper layer\r
  * through a callback function and passes the status parameter @ref kStatus_UART_RxIdle.\r
  *\r
  * @note The function #HAL_UartReceiveBlocking and the function #HAL_UartReceiveNonBlocking\r
  * cannot be used at the same time.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @param data Start address of the data to write.\r
  * @param length Size of the data to write.\r
  * @retval kStatus_HAL_UartSuccess Successfully queue the transfer into transmit queue.\r
@@ -363,45 +389,45 @@ hal_uart_status_t HAL_UartReceiveNonBlocking(hal_uart_handle_t handle, uint8_t *
  *\r
  * This function sends data using an interrupt method. This is a non-blocking function, which\r
  * returns directly without waiting for all data to be written to the TX register. When\r
- * all data is written to the TX register in the ISR, the uart driver calls the callback\r
+ * all data is written to the TX register in the ISR, the UART driver calls the callback\r
  * function and passes the @ref kStatus_UART_TxIdle as status parameter.\r
  *\r
  * @note The function #HAL_UartSendBlocking and the function #HAL_UartSendNonBlocking\r
  * cannot be used at the same time.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @param data Start address of the data to write.\r
  * @param length Size of the data to write.\r
  * @retval kStatus_HAL_UartSuccess Successfully start the data transmission.\r
  * @retval kStatus_HAL_UartTxBusy Previous transmission still not finished; data not all written to TX register yet.\r
  * @retval kStatus_HAL_UartError An error occurred.\r
  */\r
-hal_uart_status_t HAL_UartSendNonBlocking(hal_uart_handle_t handle, const uint8_t *data, size_t length);\r
+hal_uart_status_t HAL_UartSendNonBlocking(hal_uart_handle_t handle, uint8_t *data, size_t length);\r
 \r
 /*!\r
  * @brief Gets the number of bytes that have been received.\r
  *\r
  * This function gets the number of bytes that have been received.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @param count Receive bytes count.\r
  * @retval kStatus_HAL_UartError An error occurred.\r
  * @retval kStatus_Success Get successfully through the parameter \p count.\r
  */\r
-hal_uart_status_t HAL_UartGetReceiveCount(hal_uart_handle_t handle, uint32_t *count);\r
+hal_uart_status_t HAL_UartGetReceiveCount(hal_uart_handle_t handle, uint32_t *reCount);\r
 \r
 /*!\r
- * @brief Gets the number of bytes written to the uart TX register.\r
+ * @brief Gets the number of bytes written to the UART TX register.\r
  *\r
- * This function gets the number of bytes written to the uart TX\r
+ * This function gets the number of bytes written to the UART TX\r
  * register by using the interrupt method.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @param count Send bytes count.\r
  * @retval kStatus_HAL_UartError An error occurred.\r
  * @retval kStatus_Success Get successfully through the parameter \p count.\r
  */\r
-hal_uart_status_t HAL_UartGetSendCount(hal_uart_handle_t handle, uint32_t *count);\r
+hal_uart_status_t HAL_UartGetSendCount(hal_uart_handle_t handle, uint32_t *seCount);\r
 \r
 /*!\r
  * @brief Aborts the interrupt-driven data receiving.\r
@@ -412,7 +438,7 @@ hal_uart_status_t HAL_UartGetSendCount(hal_uart_handle_t handle, uint32_t *count
  * @note The function #HAL_UartAbortReceive cannot be used to abort the transmission of\r
  * the function #HAL_UartReceiveBlocking.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @retval kStatus_Success Get successfully abort the receiving.\r
  */\r
 hal_uart_status_t HAL_UartAbortReceive(hal_uart_handle_t handle);\r
@@ -426,26 +452,51 @@ hal_uart_status_t HAL_UartAbortReceive(hal_uart_handle_t handle);
  * @note The function #HAL_UartAbortSend cannot be used to abort the transmission of\r
  * the function #HAL_UartSendBlocking.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
  * @retval kStatus_Success Get successfully abort the sending.\r
  */\r
 hal_uart_status_t HAL_UartAbortSend(hal_uart_handle_t handle);\r
 \r
-/* @} */\r
+/*! @}*/\r
 \r
+#endif\r
 #endif\r
 \r
 /*!\r
- * @brief uart IRQ handle function.\r
+ * @brief Prepares to enter low power consumption.\r
  *\r
- * This function handles the uart transmit and receive IRQ request.\r
+ * This function is used to prepare to enter low power consumption.\r
  *\r
- * @param handle uart handle pointer.\r
+ * @param handle UART handle pointer.\r
+ * @retval kStatus_HAL_UartSuccess Successful operation.\r
+ * @retval kStatus_HAL_UartError An error occurred.\r
+ */\r
+hal_uart_status_t HAL_UartEnterLowpower(hal_uart_handle_t handle);\r
+\r
+/*!\r
+ * @brief Restores from low power consumption.\r
+ *\r
+ * This function is used to restore from low power consumption.\r
+ *\r
+ * @param handle UART handle pointer.\r
+ * @retval kStatus_HAL_UartSuccess Successful operation.\r
+ * @retval kStatus_HAL_UartError An error occurred.\r
+ */\r
+hal_uart_status_t HAL_UartExitLowpower(hal_uart_handle_t handle);\r
+\r
+#if (defined(UART_ADAPTER_NON_BLOCKING_MODE) && (UART_ADAPTER_NON_BLOCKING_MODE > 0U))\r
+/*!\r
+ * @brief UART IRQ handle function.\r
+ *\r
+ * This function handles the UART transmit and receive IRQ request.\r
+ *\r
+ * @param handle UART handle pointer.\r
  */\r
 void HAL_UartIsrFunction(hal_uart_handle_t handle);\r
+#endif\r
 \r
 #if defined(__cplusplus)\r
 }\r
 #endif\r
-\r
+/*! @}*/\r
 #endif /* __HAL_UART_ADAPTER_H__ */\r