This project is built in PSoC Creator 3.3 which can be found in the PSoC Creator software archive:
https://www.cypress.com/documentation/software-and-drivers/psoc-creator-software-archive

For programming instructions, refer to the DC2654A Demo Manual.


To build this project from the CCG3 SDK examples:
--- Start a new project from the CYPD3125-40LQXI_notebook example.
        1. In PSoC Creator 3.3, go to File -> New -> Project.
        2. Target hardware should be EZ-PD CCGx SDK (CCG3). Click Next.
        3. For the project template, start from a code example. Click Next.
        4. Choose CYPD3125-40LQXI_notebook. Click Next.
        5. Under workspace, select create new workspace. Set the other fields as desired. Click Finish.
--- In Workspace Explorer, click TopDesign.cysch to display it.
        1. Double-click the the HPI_IF slave I2C block:
            a. Change it to a master.
            b. Set data rate to 400kbps.
            c. Name it "I2C_master".
            d. Click Apply and close the dialog.
        2. From the Component Catalog, drag in a new Ports and Pins -> Digital Input Pin. Double-click it, then:
            a. Change the name to SMBALERTB.
            b. Under Type, check Digital Input, but uncheck HW connection.
            c. Click Apply and close the dialog.
        3. From the Component Catalog, drag in a new Ports and Pins -> Digital Output Pin. Double-click it, then:
            a. Change the name to PGOOD_LED.
            b. Un-check HW Connection.
            c. set to open drain (drives low) with initial drive state to high (1).
            d. Click Apply and close the dialog.
--- In Workspace Explorer, click [Project_Name].cydwr to display it.
        1. Change SMBALERTB to pin 38.
        2. Change PGOOD_LED to pin 7.
--- New files:
        1. Wrote the following for this specific project and placed them in [Workspace_Name]\[Project_Name].cydsn\src\dc2654a:
            - led.c
            - led.h
            - smbalert.c
            - smbalert.h
--- Create a variable Power Delivery Object (PDO) in EZ-PD Configuration Utility.
        1. For further information on how to create a PDO, consult documentation.
        2. Export PDO files for a variable sink device to [Workspace_Name]\PDO, name it 'variable_sinkonly_3p2A_7V_20V'.
--- Add files to the project in the Workspace Explorer:
        1. Right click Header Files/solution -> Add -> Existing Item and select all .h files from the ...\src\dc2654a folder.
        2. Right click Source Files/solution -> Add -> Existing Item and select all .c files from the ...\src\dc2654a folder.
        3. Right click Source Files/solution/config.c and select Remove From [Project_Name].
        4. Right click Source Files/solution and select Add -> Existing item and select [Workspace_Name]\PDO\variable_sinkonly_3p2A_7V_20V.c.
--- At the top of the main window, change the drop-down box from 'Debug' to 'Release'.
--- Go to Project -> Build Settings:
        1. At the top of the dialog, set Configuration to 'Release (Active)'.
        2. In the tree to the left, go to ARM GCC... -> Compiler -> General -> Additional Include Directories and add:
            - .\src\dc2654a
--- Modify files as needed for application:
        1. [Workspace_Name]\[Project_Name].cydsn\common\main.c
        2. [Workspace_Name]\[Project_Name].cydsn\src\app\psink.c
        3. [Workspace_Name]\[Project_Name].cydsn\src\app\pdo.c
        4. [Workspace_Name]\[Project_Name].cydsn\config.h
