2022-06-23 07:50 AM
Hi,
Am I allowed to call the USBPD_PE_Request_CtrlMessage(), USBPD_PE_Request_HardReset(), USBPD_CAD_PortEnable() and others from different threads?
I want to request data role swap, power role swap and hard resets from my interface thread.
Thanks!
BR, Christoph
Solved! Go to Solution.
2022-06-24 09:14 AM
Dear @Christoph Rüdisser
I would answer Yes : requests could be sent to the USBPD Stack thanks to calls of the API as USBPD_PE_Request_***(). Requests will be handled by the stack assuming current state allows it.
They could be initiated from a dedicated thread.
You could have a look at the UCPD demonstration code, available in STM32CubeG0 firmware package, that implements a USBPD demonstration. In this demo, once Explicit Contract is established, user could select some actions (requests to be sent to distant port). For example user could trigger a Data Role Swap procedure (DR swap request to be sent to attached device).
In this demo, all calls to USBPD_PE_Request_CtrlMessage() API are done from a Demo dedicated thread.
Demo code available here.
In demo_application.c, some examples of USBPD_PE_Request_CtrlMessage() calls are provided.
Regards
Guenael
2022-06-24 09:14 AM
Dear @Christoph Rüdisser
I would answer Yes : requests could be sent to the USBPD Stack thanks to calls of the API as USBPD_PE_Request_***(). Requests will be handled by the stack assuming current state allows it.
They could be initiated from a dedicated thread.
You could have a look at the UCPD demonstration code, available in STM32CubeG0 firmware package, that implements a USBPD demonstration. In this demo, once Explicit Contract is established, user could select some actions (requests to be sent to distant port). For example user could trigger a Data Role Swap procedure (DR swap request to be sent to attached device).
In this demo, all calls to USBPD_PE_Request_CtrlMessage() API are done from a Demo dedicated thread.
Demo code available here.
In demo_application.c, some examples of USBPD_PE_Request_CtrlMessage() calls are provided.
Regards
Guenael
2022-06-27 06:20 AM
Thanks!