cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 + USB PD + Voltage and Current control

ADoro.2
Associate III

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?

1 REPLY 1
Yohann M.
ST Employee

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