- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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".
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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