/* The R_ETHER_CheckWrite() function verifies that data transmission has completed.  */
ether_return_t R_ETHER_CheckWrite(uint32_t channel)
/* The R_ETHER_CheckWrite() function verifies that data transmission has completed.  */
ether_return_t R_ETHER_CheckWrite(uint32_t channel)
{
    ether_return_t ret;
    volatile struct st_edmac R_BSP_EVENACCESS_SFR * pedmac_adr;
    const ether_control_t * pether_ch;
    uint32_t phy_access;
    if (ETHER_CHANNEL_MAX <= channel)
    {
        ret = ETHER_ERR_INVALID_CHAN;
    }
    else
    {
        pether_ch = g_eth_control_ch[channel].pether_control;
        phy_access = g_eth_control_ch[channel].phy_access;
        pedmac_adr = pether_ch[phy_access].pedmac;
        while (0 != pedmac_adr->EDTRR.BIT.TR)
        {
        }
        ret = ETHER_SUCCESS;
    }
    return ret;
}