/* Set the device and all the used Endpoints addresses.  */
void USB_SetDeviceAddress(uint8_t Val)
/* Set the device and all the used Endpoints addresses.  */
void USB_SetDeviceAddress(uint8_t Val)
{
    uint32_t i;
    uint32_t nEP = Device_Table.TotalEndpoint;
    for (i = 0; i < nEP; i++)
    {
        _SetEPAddress((uint8_t)i, (uint8_t)i);
    }
    _SetDADDR(Val | ADDR_EFUC);
}