Yes, it's accomplished by CCGX HOST SDK API. You can refer to 6.13 app/swap.h File Reference of CCGX_FW_API_GUIDE:
Hi EddieZ_31, I did not find the CC Pin related API in the app/swap.h The API here is only PR_swap, DR_swap and Vconn_swap. Regards, Manu
Rp/Rd defines the role of the device as source/sink. The swap of role is accomplished by the functions I mentioned above.
I connect the CCG4-4236 to laptop use type c cable, which cable is special cable (have cc1/cc2 both).
And verify cc1/cc2 automatic switching using the following combination. When i swap to port0 cc1, it can work but i swap to cc2, it's not work.
// disable/enable ccx
// cc communication status machine
// port disable/enable
You can use pd_typec_dis_rd to control Rd of CC pin, but CYP4236 do not support individual control of Rd on CC1 & CC2. You can control Rp individually on each CC pin.
thank for report.
If API is not support individual control of Rd on CC1 & CC2. how could i design hardware to achieve automatic swap?
eg. using MCU gpio to control switch port0 cc1/cc2 to Rd
CCG4 do not support this kind of control. There is no solution for now. Thank you for understanding.