15 static void ResumeMCU (
void);
17 #ifdef USB_DEVICE_LOW_PWR_MODE_SUPPORT
18 static void LeaveLowPowerMode (
void);
36 __IO RESUME_STATE State = RESUME_OFF;
37 __IO uint8_t ESOFcount = 0;
38 __IO uint8_t SuspendEnabled = 1;
39 __IO uint8_t RemoteWakeupOn = 0;
54 static void ResumeMCU (
void)
59 #ifdef USB_DEVICE_LOW_PWR_MODE_SUPPORT
70 #ifdef USB_DEVICE_LOW_PWR_MODE_SUPPORT
77 static void LeaveLowPowerMode (
void)
82 RCC_HSEConfig(RCC_HSE_ON);
85 while(RCC_GetBitState(RCC_FLAG_HSESTB) == RESET);
88 RCC_PLL_Enable(ENABLE);
91 while(RCC_GetBitState(RCC_FLAG_PLLSTB) == RESET);
94 RCC_CK_SYSConfig(RCC_SYSCLKSOURCE_PLLCLK);
97 while(RCC_GetCK_SYSSource() != 0x08);
100 NVIC_SystemLowPowerConfig(NVIC_LOWPOWER_SLEEPONEXIT, DISABLE);
115 #ifdef USB_DEVICE_LOW_PWR_MODE_SUPPORT
121 PWR_DEEPSLEEPMode_Entry(PWR_LDO_LOWPOWER, PWR_DEEPSLEEPENTRY_WFI);
150 if (ResumeValue != RESUME_ESOF) State = ResumeValue;
154 case RESUME_EXTERNAL:
155 if (RemoteWakeupOn == 0)
167 case RESUME_INTERNAL:
void USBD_Suspend(void)
Set usb device to suspend mode.
Power management header file.
void USBD_Resume(RESUME_STATE ResumeValue)
Resume state machine handling.