Change the default role with GPIO on CYPD4236

Announcements

Live Webinar: USB-C adoption. Simple & Cost-efficient solutions | April 18th @9am or 5pm CEST. Register now !

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MaLi_3529141
Level 3
Level 3
25 replies posted 25 sign-ins 10 replies posted

Dear ,

We have some applications that need to use gpio to switch default roles :

(1) UFP , Power Sink.

(2) DFP , Power Source.

Chip model: CYPD4236-40LQXI

Code example : CYPD4236-40LQXI_dock

Questions:

(1) Can I achieve this without using PR_SWAP and DR_SWAP?Is there a reference example?

(2) In this Code example(CYPD4236-40LQXI_dock),  the default is UFP/Power Sink.How to change the preset to DFP/ Power Source?

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hi ,

(1) Can I achieve this without using PR_SWAP and DR_SWAP?Is there a reference example?

>> Yes, you can.

The relates API is :

/**

* @brief Change the PD port configuration at runtime.

*

* This function allows changing the PD port configuration parameters like port

* role, default port role, DRP toggle enable and Try.Src enable at runtime.

* These changes are only allowed while the corresponding PD port is disabled.

*

* @param port USB-PD port to be configured.

* @param role New port role selection (0 = Sink, 1 = Source, 2 = Dual Role).

* @param dflt_role New default port role selection (0 = Sink, 1 = Source).

* @param toggle_en New value for DRP toggle enable flag.

* @param try_src_snk_en New value for Try.SRC/ TRY.SNK enable flag( 0 =

* Both Try.SRC and TRY.SNK are disabled, 1 = Try.SRC is enabled,

* 2 = TRY.SNK is enabled).

* @return CCG_STAT_SUCCESS if operation is successful, CCG_STAT_BAD_PARAM

* if port index is not correct or other parameters are not correct,

* CCG_STAT_FAILURE if port is not disabled.

*/

ccg_status_t dpm_update_port_config(uint8_t port, uint8_t role, uint8_t dflt_role,

                               uint8_t toggle_en, uint8_t try_src_snk_en);

(2) In this Code example(CYPD4236-40LQXI_dock),  the default is UFP/Power Sink.How to change the preset to DFP/ Power Source?

>> You can change the configuration via EZ-PD configuration Utility. And set the port role as attached file.

Best Regards,

Lisa

View solution in original post

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hi ,

(1) Can I achieve this without using PR_SWAP and DR_SWAP?Is there a reference example?

>> Yes, you can.

The relates API is :

/**

* @brief Change the PD port configuration at runtime.

*

* This function allows changing the PD port configuration parameters like port

* role, default port role, DRP toggle enable and Try.Src enable at runtime.

* These changes are only allowed while the corresponding PD port is disabled.

*

* @param port USB-PD port to be configured.

* @param role New port role selection (0 = Sink, 1 = Source, 2 = Dual Role).

* @param dflt_role New default port role selection (0 = Sink, 1 = Source).

* @param toggle_en New value for DRP toggle enable flag.

* @param try_src_snk_en New value for Try.SRC/ TRY.SNK enable flag( 0 =

* Both Try.SRC and TRY.SNK are disabled, 1 = Try.SRC is enabled,

* 2 = TRY.SNK is enabled).

* @return CCG_STAT_SUCCESS if operation is successful, CCG_STAT_BAD_PARAM

* if port index is not correct or other parameters are not correct,

* CCG_STAT_FAILURE if port is not disabled.

*/

ccg_status_t dpm_update_port_config(uint8_t port, uint8_t role, uint8_t dflt_role,

                               uint8_t toggle_en, uint8_t try_src_snk_en);

(2) In this Code example(CYPD4236-40LQXI_dock),  the default is UFP/Power Sink.How to change the preset to DFP/ Power Source?

>> You can change the configuration via EZ-PD configuration Utility. And set the port role as attached file.

Best Regards,

Lisa

0 Likes