/* Get USB Device Last Frame Number Parameters: None Return Value: Frame Number  */
uint32_t USBD_GetFrame(void)
/* Get USB Device Last Frame Number Parameters: None Return Value: Frame Number  */
uint32_t USBD_GetFrame(void)
{
    uint32_t val;
    if ((UDPHS->UDPHS_FNUM & (1UL << 31)) == 0) {
        if (USBD_HighSpeed) {
            val = UDPHS->UDPHS_FNUM & 0x7FFFFFFF;
        } else {
            val = (UDPHS->UDPHS_FNUM & UDPHS_FNUM_FRAME_NUMBER_Msk) >> 3;
        }
    } else {
        val = 0xFFFFFFFF;
    }
    return (val);
}