i2c between 2 CCGPA (CYPD3171-24LQXQ)

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
chch_3621411
Level 4
Level 4
First like given

Hello world, so i have a project of 2 port USB-C powerbank,  each port as it own CYPD3171-24LQXQ they work independly but i want to connect them using i2c so the one can tell another "hey i'm sourcing power now or i'm sinking power now".

0 Likes
1 Solution

Hi

If you are using GPIO, you need add additional GPIO into .cysch file and add ISR function and handler function into main.c is okay.

If you are using I2C, you need add I2C contentment into .cysch file and register I2C interrupt in your app_init(). And write interrupt handler function in app.c file.

Best Regards,

Lisa

View solution in original post

0 Likes
5 Replies
ShifangZ_26
Moderator
Moderator
Moderator
10 likes given 250 sign-ins 1000 replies posted

Hi ,

Yes, you can. Each CCG3PA have 2 SCB block, you can use I2C or GPIO of one CCG3PA to alert the other CCG3PA.

For example, you are using GPIO for notify the POWER SOURCE or POWER sink role,  HIGH is POWER SOURCE, LOW is power sink. And the GPIO is output. The other side, the GPIO is input and detect rising or failing edge.

Best Regards,

Lisa

0 Likes

Hello Lisa, thank you for the reply, by the way in what file should i add the code in Solution:main.c or in any other file under app folder ?

Best regard.

0 Likes

Hi

If you are using GPIO, you need add additional GPIO into .cysch file and add ISR function and handler function into main.c is okay.

If you are using I2C, you need add I2C contentment into .cysch file and register I2C interrupt in your app_init(). And write interrupt handler function in app.c file.

Best Regards,

Lisa

0 Likes

Thanks you Lisa, so how do i detect if CYPD3171 is sinking or is source power.

How does the code looks like. Thanks in advance.

0 Likes

Hi ,

There is a API you could use it to check whether the Type-C port is Power source or Power sink.

1. Check whether it is source?

dpm_get_info(TYPEC_PORT_0_IDX)->cur_port_role == PRT_ROLE_SOURCE

2. Check whether it is sink?

dpm_get_info(TYPEC_PORT_0_IDX)->cur_port_role == PRT_ROLE_SINK

Best Regards,

Lisa

0 Likes