/* The Transmit Buffer Empty IRQ is enabled in the following conditions: */
void sci_spi_txi_isr(void)
/* The Transmit Buffer Empty IRQ is enabled in the following conditions: */
void sci_spi_txi_isr(void)
{
    FSP_CONTEXT_SAVE;
    IRQn_Type irq = R_FSP_CurrentIrqGet();
    R_BSP_IrqStatusClear(irq);
    sci_spi_instance_ctrl_t * p_ctrl = (sci_spi_instance_ctrl_t *) R_FSP_IsrContextGet(irq);
    r_sci_spi_transmit(p_ctrl);
    if ((p_ctrl->tx_count == p_ctrl->count) && (NULL == p_ctrl->p_dest))
    {
        p_ctrl->p_reg->SCR = (uint8_t) ((p_ctrl->p_reg->SCR & ~R_SCI0_SCR_TIE_Msk) | R_SCI0_SCR_TEIE_Msk);
    }
    FSP_CONTEXT_RESTORE;
}