/* Parameters: ch FEC channel duplex enet_MII_FULL_DUPLEX or enet_MII_HALF_DUPLEX  */
void enet_duplex(int ch, ENET_DUPLEX duplex)
/* Parameters: ch FEC channel duplex enet_MII_FULL_DUPLEX or enet_MII_HALF_DUPLEX  */
void enet_duplex(int ch, ENET_DUPLEX duplex)
{
    switch (duplex)
    {
        case MII_HDX:
            ENET_RCR |= ENET_RCR_DRT_MASK;
            ENET_TCR &= (uint32_t)~ENET_TCR_FDEN_MASK;
            break;
        case MII_FDX:
        default:
            ENET_RCR &= ~ENET_RCR_DRT_MASK;
            ENET_TCR |= ENET_TCR_FDEN_MASK;
            break;
    }
}