/* note This must be called after all the ENET initilization. And should be called when the ENET receive/transmit is required.  */
void ENET_QOS_UpdateRxDescriptor(enet_qos_rx_bd_struct_t *rxDesc, void *buffer1, void *buffer2, bool intEnable, bool doubleBuffEnable)
/* note This must be called after all the ENET initilization. And should be called when the ENET receive/transmit is required.  */
void ENET_QOS_UpdateRxDescriptor(enet_qos_rx_bd_struct_t *rxDesc, void *buffer1, void *buffer2, bool intEnable, bool doubleBuffEnable)
{
    assert(rxDesc != NULL);
    uint32_t control = ENET_QOS_RXDESCRIP_RD_OWN_MASK | ENET_QOS_RXDESCRIP_RD_BUFF1VALID_MASK;
    if (intEnable)
    {
        control |= ENET_QOS_RXDESCRIP_RD_IOC_MASK;
    }
    if (doubleBuffEnable)
    {
        control |= ENET_QOS_RXDESCRIP_RD_BUFF2VALID_MASK;
    }
    if (buffer1 != NULL)
    {
        rxDesc->buff1Addr = (uint32_t)(uintptr_t)(uint8_t *)buffer1;
    }
    if (buffer2 != NULL)
    {
        rxDesc->buff2Addr = (uint32_t)(uintptr_t)(uint8_t *)buffer2;
    }
    else
    {
        rxDesc->buff2Addr = 0;
    }
    rxDesc->reserved = 0;
    __DMB();
    rxDesc->control = control;
}