/* See mss_uart.h for details of how to use this function.  */
void MSS_UART_irq_tx(mss_uart_instance_t *this_uart, const uint8_t *pbuff, uint32_t tx_size)
/* See mss_uart.h for details of how to use this function.  */
void MSS_UART_irq_tx(mss_uart_instance_t *this_uart, const uint8_t *pbuff, uint32_t tx_size)
{
    ASSERT((this_uart == &g_mss_uart0) || (this_uart == &g_mss_uart1));
    ASSERT(pbuff != ((uint8_t *)0));
    ASSERT(tx_size > 0u);
    if((tx_size > 0u) && ( pbuff != ((uint8_t *)0)) &&
      ((this_uart == &g_mss_uart0) || (this_uart == &g_mss_uart1)))
    {
        this_uart->tx_buffer = pbuff;
        this_uart->tx_buff_size = tx_size;
        this_uart->tx_idx = (uint16_t)0;
        NVIC_ClearPendingIRQ(this_uart->irqn);
        this_uart->tx_handler = default_tx_handler;
        set_bit_reg8(&this_uart->hw_reg->IER,ETBEI);
        NVIC_EnableIRQ(this_uart->irqn);
    }
}