/* Receives datas through the UART DMA. 
@method UART_ReceiveBuf  */
uint32_t UART_ReceiveBuf(UART_TypeDef *UARTx, uint8_t *buf, uint32_t len)
/* Receives datas through the UART DMA. 
@method UART_ReceiveBuf  */
uint32_t UART_ReceiveBuf(UART_TypeDef *UARTx, uint8_t *buf, uint32_t len)
{
    _ASSERT(IS_UART(UARTx));
    _ASSERT(NULL != buf);
    _ASSERT(len < 0xfffff);
    uint32_t rcv_len = 0;
    while ((UART_ReceiveDataLen(UARTx) > 0) && (rcv_len < len))
    {
        buf[rcv_len++] = UARTx->RX_DATA.bit.VAL;
    }
    return rcv_len;
}