Control CCG3 via HPI

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
HoKa
Level 1
Level 1
5 sign-ins First solution authored First reply posted

Hello Cypress-Team,

we want to change PDOs dynamically at runtime in our project via the HPI interface to get the best fitted power negotiation between sink and source. I think this should be possible, but I did not find any code examples or a detailed description of the HPOI interface.

Here my questions:

1. Is it possible to change PDOs dynamically at runtime?

2. Are there any existing code examples for this purpose?

3. Is there a more detailed HPI interface description?

 

BR Holger

0 Likes
1 Solution
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hello Holger,

Please kindly refer my comments as below.

1. Is it possible to change PDOs dynamically at runtime?

>> Yes, it is possible. Not only by HPI interface, you could change it in firmware directly by adding a pieces of codes. And trigger the PDOs change as per your design. 

2. Are there any existing code examples for this purpose?

>> 1) HPI do not have example code could be shared. 

2) The example code for PDO change could be refer below:

void change_pdos(void)
{
pd_do_t SRC_PDO[2];

SRC_PDO[0].val = 0x0B0190F0;
SRC_PDO[1].val = 0x0002D0DE;
/* New 5V/2.4A(0B0190F0);9V/2.22A(0002D0DE) add PDO */
// SRC_PDO[2].val = 0x0004B064;
// SRC_PDO[3].val = 0xC0761E3C;
// SRC_PDO[4].val = 0xC0DC1E3C;

/**
* @brief This function updates the source PDOs at runtime thereby overriding
* the source PDOs in the configuration table.
* @param port Port index.
* @param count Count of PDOs.
* @param pdo Pointer to the PDO array.
* @return CCG_STAT_SUCCESS if operation is successful, CCG_STAT_BAD_PARAM
* otherwise.
*/
dpm_update_src_cap(0, 2, SRC_PDO);

/**
* @brief This function updates the source PDO mask at runtime thereby
* overriding the source PDO mask in the configuration table.
* @param port Port index.
* @param mask PDO mask.
* @return CCG_STAT_SUCCESS if operation is successful, CCG_STAT_BAD_PARAM
* otherwise.
*/
dpm_update_src_cap_mask (0, 0x03);

dpm_pd_command (0, DPM_CMD_SRC_CAP_CHNG, NULL,NULL); //Send PD command about the changes in source capabilities
}

3. Is there a more detailed HPI interface description?

>> The HPI specification could get it from local Cypress/Infineon FAE, please feel free to contact them.

 

Best Regards,

Lisa

View solution in original post

0 Likes
3 Replies