cancel
Showing results for 
Search instead for 
Did you mean: 

Knowledge Base Articles

Enabling Cable Discovery in CCGx Power SDK Firmware– KBA231210

ChaitanyaV_61
Employee

Enabling Cable Discovery in CCGx Power SDK Firmware– KBA231210

Author: ShifangZ_26           Version: **

Question:
How can I enable cable discovery in the CCGx Power SDK Firmware?

Answer:
Cable discovery needs VCONN support as a prerequisite. Follow these steps to enable VCONN support:

1. Add VCONN circuits into CCGx design.

    1. 3.3 V-5.0 V (@650-mA minimum) power source should be supplied for VCONN source.
    2. VCONN_CTRL_CCx should be wired to unused GPIOs.

P MOS FETs on VCONN circuits should be of small capacities (both On or Off states) (<600 pF) and Continuous Drain Current (>1 W at 3.3 V).

pastedImage_5.png

2. Enable cable discovery with EZ-PD configuration and update config.c in the firmware project.

pastedImage_14.png

3. Add VCONN control functions into the project and register them into Application callback functions for the DPM.

a. Add two pins named VCONN_CC1 and VCONN_CC2 into TopDesign.cysch for VCONN support.

b. VCONN control functions are as follows:

#define VCONN_SUPPORT_ENABLE    (1)

#if VCONN_SUPPORT_ENABLE

#define VCONN_SWITCH_ON_VALUE  (0)

#define VCONN_SWITCH_OFF_VALUE (1)

void pb_vconn_enable(uint8_t port, uint8_t channel)

{

    if (channel == CC_CHANNEL_1)

    {

        VCONN_CC1_Write(VCONN_SWITCH_ON_VALUE);

    }

    else

    {

        VCONN_CC2_Write(VCONN_SWITCH_ON_VALUE);

    }

    /* Reset RX Protocol for cable */

    dpm_prot_reset_rx(port, SOP_PRIME);

    dpm_prot_reset_rx(port, SOP_DPRIME);

}

void pb_vconn_disable(uint8_t port, uint8_t channel)

{

    if (channel == CC_CHANNEL_1)

    {

        VCONN_CC1_Write(VCONN_SWITCH_OFF_VALUE);

    }

    else

    {

        VCONN_CC2_Write(VCONN_SWITCH_OFF_VALUE);

    }

}

bool pb_vconn_is_present(uint8_t port)

{

    bool state;

   

    if (dpm_get_info(port)->rev_pol == 0)

    {

        state = VCONN_CC1_Read();

    }

    else

    {

        state = VCONN_CC2_Read();

    }

   

    if (state == VCONN_SWITCH_ON_VALUE)

    {

        return true;

    }

    return false;

}

#endif /* VCONN_SUPPORT_ENABLE */

c. Register the updated functions into Application callback functions for the DPM.

pastedImage_36.png

0 Likes
Version history
Revision #:
1 of 1
Last update:
‎Sep 23, 2020 11:42 PM
Updated by:
 
Contributors