Announcements
IMPORTANT: Cypress Developer Community is transitioning on October 20th. To learn more and be prepared for this change, check out our latest announcement.
cancel
Showing results for 
Search instead for 
Did you mean: 

USB EZ-PD Type-C

MaLi_3529141
New Contributor II

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
ShifangZ_26
Moderator
Moderator

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
ShifangZ_26
Moderator
Moderator

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