BC1.2Sink(PortableDevice) Functionality in CCg3pA

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
PrRe_3492461
Level 4
Level 4
First like received 50 sign-ins 50 replies posted

Hi RajathB_01​/Cypress Community,

This is a follow up to the thread "CCG3PA as a BC1.2 Sink(Portable Device)".

My requirement is to know the function/functions which BC1.2 state machine executes whenever CCG3PA gets a BC1.2 interrupt.

Do CCG3PA validate for Vbus along with D+/D- lines changes as well for generating a BC1.2 interrupt (* in our case we'll provide a continuous Vbus to ccg3pa) or

what are the required conditions needed for CCG3PA to generate a BC1.2 interrupt ?

whenever CCg3pa gets a BC1.2 interrupt I want to toggle a GPIO to generate an interrupt for my internal requirement.

I was using "bc_pd_event_handler(port,evt)",

"bc_fsm_sink_cdp_connected(uint8_t c_port, bc_fsm_evt_t evt)",  "bc_fsm_sink_sdp_connected(uint8_t c_port, bc_fsm_evt_t evt)",

" bc_fsm_sink_dcp_connected(uint8_t c_port, bc_fsm_evt_t evt)", "bc_fsm_sink_primary_charger_detect(uint8_t c_port, bc_fsm_evt_t evt)", and trying to toggle a GPIO in above functions, I observed BC1.2 interrupt generation is inconsistent.

(*Note:was toggling gpio in only one function at a time in each run).

I was using those functions as per my understanding in code flow and as per "CCGx_Power_SDK_API_Guide.pdf" document.

Is my understanding of Code flow is correct and

How / where Do I track the DUTs State machine whether Is it a CDP / DCP /SDP ??

How can I meet my requirement to toggle GPIO whenever CCG3PA gets an BC1.2 interrupt ??

We've this dependency for going on to production, So expecting the problem to be resolved ASAP.

Regards,

Pranay.

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

Hi Pranay,

1. You just need a standard BC1.2 Charger attached on Type-C port, it will generated BC1.2 interrupt.

2. From the legacy battery charging states, you can see that we have defined DCP, SDP, and CDP @ file battery_charging.h.

pastedImage_0.png

But, the firmware is only identified DCP and SDP, there is no possible to go to CDP states.

And then, You can check the function:

static void bc_fsm_sink_secondary_charger_detect(uint8_t c_port, bc_fsm_evt_t evt)

static void bc_fsm_sink_primary_charger_detect(uint8_t c_port, bc_fsm_evt_t evt)

static void bc_fsm_sink_start(uint8_t cport, bc_fsm_evt_t evt)

static void bc_fsm_sink_apple_charger_detect(uint8_t c_port, bc_fsm_evt_t evt)

You can see that the CCG3PA will check Apple Charging at first if the Apple sink is set as support. And then, go to BC1.2 charging detection.

3. If you want to set flag to present whether CCg3PA is enter DCP or SDP, you can add the GPIO flag here.

static void bc_fsm_sink_secondary_charger_detect(uint8_t c_port, bc_fsm_evt_t evt)

pastedImage_1.png

Best Regards,

Lisa

View solution in original post

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

Hi Pranay,

1. You just need a standard BC1.2 Charger attached on Type-C port, it will generated BC1.2 interrupt.

2. From the legacy battery charging states, you can see that we have defined DCP, SDP, and CDP @ file battery_charging.h.

pastedImage_0.png

But, the firmware is only identified DCP and SDP, there is no possible to go to CDP states.

And then, You can check the function:

static void bc_fsm_sink_secondary_charger_detect(uint8_t c_port, bc_fsm_evt_t evt)

static void bc_fsm_sink_primary_charger_detect(uint8_t c_port, bc_fsm_evt_t evt)

static void bc_fsm_sink_start(uint8_t cport, bc_fsm_evt_t evt)

static void bc_fsm_sink_apple_charger_detect(uint8_t c_port, bc_fsm_evt_t evt)

You can see that the CCG3PA will check Apple Charging at first if the Apple sink is set as support. And then, go to BC1.2 charging detection.

3. If you want to set flag to present whether CCg3PA is enter DCP or SDP, you can add the GPIO flag here.

static void bc_fsm_sink_secondary_charger_detect(uint8_t c_port, bc_fsm_evt_t evt)

pastedImage_1.png

Best Regards,

Lisa

0 Likes