- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
Could you help me?
I use CYPD3120 for my project.
I want create basic program with dynamically update sink power capability, when I press button.
My schematic in attachment.
Thank you!
Best regards,
Nazar Melnichek
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
You can refer to the following example code:
void change_pdos(void)
{
pd_do_t SRC_PDO[4];
if ( //read pin status register somewhat way == false)
{
SRC_PDO[0].val = 0x0001912C; //5V 3A (This value can check on xml file created by EZ-PD Configuration Utility)
SRC_PDO[1].val = 0x0002D0D2; //9V 2.1A
SRC_PDO[2].val = 0x0004B12C; //15V 3A
SRC_PDO[3].val = 0x0006412C; //20V 3A
dpm_update_src_cap(0, 4, SRC_PDO);
dpm_update_src_cap_mask (0, 0x0F);
dpm_pd_command (0, DPM_CMD_SRC_CAP_CHNG, NULL,NULL); //Send PD command about the changes in source capabilities
}
}
CY_ISR(GPIO_ISR_handler)
{
//clear any active interrupts on corresponds pin for interrupt
change_pdos();
}
Regards,
Eddie