cancel
Showing results for 
Search instead for 
Did you mean: 

USB EZ-PD Type-C

NaWo_4517846
New Contributor

Could someone point me in the direction/documentation/example projects of implementing a custom alt mode, particularly in how the DFP initiates entering the mode, preferably automatically after the PD contract finishes negotiating. Taking a look at the "cy_alt_mode" gave me some clues as to the implementation requirements, but beyond defining the SVID, adding it to the al_modes_config.h along with callbacks, and editing the config.c (via the EZ-PD Config Utility)... what more needs implementing?

The UFP is based of the Power Bank project and the DFP is based off the Adapter project, if that matters.

Thanks kindly,
Nathan

0 Likes
1 Solution
ShifangZ_26
Moderator
Moderator

Hi Nathan,

If you could like to implements UFP_D on CCG3PA, below process for your reference.

1. Install latest power SDK.

https://www.cypress.com/documentation/software-and-drivers/ez-pd-ccgx-power-software-development-kit

2. New fill a project based on CYPD3171-24LQXQ_pb example project. Select CYPD3171-24LQXQ_pb example project. And select finish.

3. Disable Type-C and Type-A hardware relates code.

Disable codes:

power_bank.c - (line 49, col 1):

power_bank.c - (line 64, col 1):     

power_bank.c - (line 153, col 1) :

power_bank.c - (line 164, col 18):     return 4500;

power_bank.c - (line 291, col 1):

main.c - (line 586, col 1):

alt_modes_mngr.h - (line 519, col 7):

stack_params.h - (line 72, col 72): #define CCG_TYPE_A_PORT_ENABLE                 (0u)                 

config.h - (line 55, col 57): #define POWER_BANK (0u)

config.h - (line 94, col 81): #define REGULATOR_REQUIRE_STABLE_ON_TIME             (0u)                         

config.h - (line 387, col 58): #define CCG_CABLE_COMP_ENABLE                       (0u)

config.h - (line 399, col 59): #define BATTERY_CHARGING_ENABLE                    (0u) 

config.h - (line 462, col 61): #define VBUS_OVP_ENABLE                             (0u)   

config.h - (line 477, col 61): #define VBUS_UVP_ENABLE                             (0u)   

config.h - (line 498, col 63): #define VBUS_OCP_ENABLE                             (0u)     

config.h - (line 518, col 64): #define VBUS_SCP_ENABLE                             (0u)      

config.h - (line 578, col 60): #define UFP_ALT_MODE_SUPP                           (1u)  

4. Update the files under alt_mode folder. CCG3PA SDK just added 04B4 as SVID for CC bootloadering at initial stage of CCG3PA CC programming.

alt_modes_mngr.c - (line 116, col 1): // static uint8_t get_base_alt_mode_svid_idx(uint16_t svid);   

alt_modes_mngr.c - (line 1178, col 1): //    if (get_base_alt_mode_svid_idx(svid) != MODE_NOT_SUPPORTED)

alt_modes_mngr.c - (line 1316, col 1): // static uint8_t get_base_alt_mode_svid_idx(uint16_t svid)

alt_modes_mngr.c - (line 1319, col 1): //    uint8_t idx, base_am_numb;

alt_modes_mngr.c - (line 1325, col 1): //    base_am_numb = sizeof(reg_alt_mode)/sizeof(reg_am_t);

alt_modes_mngr.c - (line 1327, col 1): //    for (idx = 0; idx < base_am_numb; idx++)

alt_mode\alt_modes_mngr.c - (line 1336, col 1): //        if (reg_alt_mode[idx].svid == svid)

alt_modes_mngr.c - (line 1361, col 7): #if 1 // ICL_CONFIG_DISABLE

alt_modes_mngr.c - (line 1726, col 1): //

\alt_modes_mngr.c - (line 1740, col 1): //  svid_idx = get_base_alt_mode_svid_idx(svid);      

alt_modes_mngr.c - (line 1772, col 27):                     #if 1 // ICL_CONFIG_DISABLE

alt_modes_mngr.c - (line 1925, col 1):

alt_modes_mngr.c - (line 2135, col 6): #if 1//ICL_CONFIG_DISABLE

5. Add a cypins and named with HPD into the CYPD3171xxx.cydwr and it should be assigned to pin#5 of CYPD3171. (Refer below figures.)

6. Add a hard code for DisplayPort Alt Mode pin assignment supported.

#if (PB_CONFIG_TBL !=1)   

    /* Get DP Pin configuration supported from config table. */

    dp_config = get_pd_port_config(port)->dp_config_supported;

#else

       /* Hard code for DP configure support, support CDEF. */

        dp_config = 0x3C;   

#endif

 
7. Open Ez-PD configuration Utility and select power bank application. And change below items step by step.

8. Replace the config.c file in the example project with the file from EZ-PD Configuration Utility.

Best Regards,

Lisa

View solution in original post

0 Likes
1 Reply
ShifangZ_26
Moderator
Moderator

Hi Nathan,

If you could like to implements UFP_D on CCG3PA, below process for your reference.

1. Install latest power SDK.

https://www.cypress.com/documentation/software-and-drivers/ez-pd-ccgx-power-software-development-kit

2. New fill a project based on CYPD3171-24LQXQ_pb example project. Select CYPD3171-24LQXQ_pb example project. And select finish.

3. Disable Type-C and Type-A hardware relates code.

Disable codes:

power_bank.c - (line 49, col 1):

power_bank.c - (line 64, col 1):     

power_bank.c - (line 153, col 1) :

power_bank.c - (line 164, col 18):     return 4500;

power_bank.c - (line 291, col 1):

main.c - (line 586, col 1):

alt_modes_mngr.h - (line 519, col 7):

stack_params.h - (line 72, col 72): #define CCG_TYPE_A_PORT_ENABLE                 (0u)                 

config.h - (line 55, col 57): #define POWER_BANK (0u)

config.h - (line 94, col 81): #define REGULATOR_REQUIRE_STABLE_ON_TIME             (0u)                         

config.h - (line 387, col 58): #define CCG_CABLE_COMP_ENABLE                       (0u)

config.h - (line 399, col 59): #define BATTERY_CHARGING_ENABLE                    (0u) 

config.h - (line 462, col 61): #define VBUS_OVP_ENABLE                             (0u)   

config.h - (line 477, col 61): #define VBUS_UVP_ENABLE                             (0u)   

config.h - (line 498, col 63): #define VBUS_OCP_ENABLE                             (0u)     

config.h - (line 518, col 64): #define VBUS_SCP_ENABLE                             (0u)      

config.h - (line 578, col 60): #define UFP_ALT_MODE_SUPP                           (1u)  

4. Update the files under alt_mode folder. CCG3PA SDK just added 04B4 as SVID for CC bootloadering at initial stage of CCG3PA CC programming.

alt_modes_mngr.c - (line 116, col 1): // static uint8_t get_base_alt_mode_svid_idx(uint16_t svid);   

alt_modes_mngr.c - (line 1178, col 1): //    if (get_base_alt_mode_svid_idx(svid) != MODE_NOT_SUPPORTED)

alt_modes_mngr.c - (line 1316, col 1): // static uint8_t get_base_alt_mode_svid_idx(uint16_t svid)

alt_modes_mngr.c - (line 1319, col 1): //    uint8_t idx, base_am_numb;

alt_modes_mngr.c - (line 1325, col 1): //    base_am_numb = sizeof(reg_alt_mode)/sizeof(reg_am_t);

alt_modes_mngr.c - (line 1327, col 1): //    for (idx = 0; idx < base_am_numb; idx++)

alt_mode\alt_modes_mngr.c - (line 1336, col 1): //        if (reg_alt_mode[idx].svid == svid)

alt_modes_mngr.c - (line 1361, col 7): #if 1 // ICL_CONFIG_DISABLE

alt_modes_mngr.c - (line 1726, col 1): //

\alt_modes_mngr.c - (line 1740, col 1): //  svid_idx = get_base_alt_mode_svid_idx(svid);      

alt_modes_mngr.c - (line 1772, col 27):                     #if 1 // ICL_CONFIG_DISABLE

alt_modes_mngr.c - (line 1925, col 1):

alt_modes_mngr.c - (line 2135, col 6): #if 1//ICL_CONFIG_DISABLE

5. Add a cypins and named with HPD into the CYPD3171xxx.cydwr and it should be assigned to pin#5 of CYPD3171. (Refer below figures.)

6. Add a hard code for DisplayPort Alt Mode pin assignment supported.

#if (PB_CONFIG_TBL !=1)   

    /* Get DP Pin configuration supported from config table. */

    dp_config = get_pd_port_config(port)->dp_config_supported;

#else

       /* Hard code for DP configure support, support CDEF. */

        dp_config = 0x3C;   

#endif

 
7. Open Ez-PD configuration Utility and select power bank application. And change below items step by step.

8. Replace the config.c file in the example project with the file from EZ-PD Configuration Utility.

Best Regards,

Lisa

View solution in original post

0 Likes