Solved
UCPD sink on STM32G4
Is it possible to implement UCPD sink on a stm32G4 without RTOS. What all does that entail? What are the pros and cons?
Is it possible to implement UCPD sink on a stm32G4 without RTOS. What all does that entail? What are the pros and cons?
Hi @RMas
However, consider that we do not recommend building applications without RTOS in case full compliance with USB PD and Type-C specifications is required. And the code should be
for (port = 0; port < USBPD_PORT_COUNT; port++)
{
if ((HAL_GetTick() - DPM_Sleep_start[port]) >= DPM_Sleep_time[port])
{
DPM_Sleep_time[port] =
#ifdef _DRP
USBPD_PE_StateMachine_DRP(port);
#elif _SRC
USBPD_PE_StateMachine_SRC(port);
#elif _SNK
USBPD_PE_StateMachine_SNK(port);
#endif /* _DRP */
DPM_Sleep_start[port] = HAL_GetTick() + 1;
}
}
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.