2021-08-30 09:33 AM
I work with STM32G4 and USB PD.
I have a question about voltage and current control. How is voltage and current controlled during operation so that the values do not go beyond the limits specified in the profile definition?
I found only one place in the code where this is controlled - in the void function DPM_ManageAlert (void). Is it being done elsewhere?
2021-09-21 08:29 AM
Dear @ADoro.2
Mainly the voltage control is done in the applications we delivered. Main power functions are located in usbpd_pwr_if.c:
For the CAD state machine (file usbpd_cad_hw_if.c), we need to regularly check the VBUS Status (during SRC/SNK attachment or when SNK is attached to port partner every 10ms).
VBUS level is also checked during hard reset procedure through 'USBPD_DPM_IsPowerReady -> USBPD_PWR_IF_SupplyReady' function.
Regards,
Yohann