Trigger for CYPD3120

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
lock attach
Attachments are accessible only for community members.
NaMe_2085021
Level 4
Level 4
25 replies posted 10 replies posted 10 questions asked

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

0 Likes
1 Solution
YiZ_31
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

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

View solution in original post

0 Likes
5 Replies