/* Sends an amount of data in non blocking mode.  */
static ald_status_t __uart_send_by_it(ald_uart_handle_t *hperh)
/* Sends an amount of data in non blocking mode.  */
static ald_status_t __uart_send_by_it(ald_uart_handle_t *hperh)
{
    if ((hperh->state & ALD_UART_STATE_TX_MASK) == 0x0)
        return ALD_BUSY;
    hperh->perh->TXBUF = (uint8_t)(*hperh->tx_buf++ & 0x00FF);
    hperh->tx_count++;
    if (hperh->tx_count >= hperh->tx_size)
    {
        ald_uart_interrupt_config(hperh, ALD_UART_IT_TFEMPTY, DISABLE);
        ald_uart_interrupt_config(hperh, ALD_UART_IT_TBC, ENABLE);
    }
    return ALD_OK;
}