cancel
Showing results for 
Search instead for 
Did you mean: 

USB EZ-PD Type-C

Contributor II

my  setup

CLA  project  with boot    on CY4532 EVK  board

limitation :i dont have option to debug   because it is  not noboot project    i do not have option connect UART because all possible GPIO is taken by example

therefore  add  LED  to indicaton  status  USC TYPE A cable

on main board  j8 debug connector add LED on p2.1

on main  board  J9  connecting phone  the charge is  starting  but when i trying  to get info  from type a device  it failed

in callback timer  add  following code

                const bc_status_t* user_param;

                 user_param=bc_get_status(TYPE_A_PORT_ID);

                if (type_a_is_idle())

                {

                    WEIZ_DEBUG_PRINT(WZ_APP_EVENT_FLOW, "[%s] USB Type A connected Charge mode [%d] \r\n", __func__,user_param->cur_mode);

                    gpio_set_value (FW_LED_GPIO_PORT_PIN, false);

                }    

                else

                {

                    WEIZ_DEBUG_PRINT(WZ_APP_EVENT_FLOW, "[%s]USB Type A Disconnected \r\n", __func__);

                    gpio_set_value (FW_LED_GPIO_PORT_PIN, true);

                }

when i plugin  cable  expected  light  off   when unplug  the cable expected  light  on   it never happen

Q1 : what functionality need to add  to see plug/unplug changes on port A

0 Likes
Reply
1 Solution
Moderator
Moderator

Hi,

The Pin 2.1 you are trying to use is being used by the EVK for other purpose. Can you please try using Pin 1.0 (Port 1 Pin 0) instead. Please note that using this pin might affect Type C port functionality and can just be used for verifying your condition. Pin 1.0 is also available from J8 debug connector.

Do let me know whether using this pin solved the issue.

Regards,

Pranava

Best regards,
Pranava

View solution in original post

0 Likes
Reply
2 Replies
Moderator
Moderator

Hi,

The Pin 2.1 you are trying to use is being used by the EVK for other purpose. Can you please try using Pin 1.0 (Port 1 Pin 0) instead. Please note that using this pin might affect Type C port functionality and can just be used for verifying your condition. Pin 1.0 is also available from J8 debug connector.

Do let me know whether using this pin solved the issue.

Regards,

Pranava

Best regards,
Pranava

View solution in original post

0 Likes
Reply
Contributor II

CY4532 EVK   contain  3  ports  USB-PD Type C (j10) which  support  also type A ( line DP0 and DM0 in main board schematics )

the  third one  is line DP1 and DM1   USB-PD type A  stand alone ( J9 )

CCG3PA Car Charger (CLA)   example  CCG3PA Car Charger (CLA) application implements a Type-C PD port controller as well as a Type-A port for charging 

first of all  thanks  for guide me to use P1.0   this  the only GPIO  i could use  for "Debug"    unfortunately  this pin  could  not  define as  UART tx  see datasheet definition (1 – P1.0 Port 1 pin 0: GPIO/UART_1_CTS/I2C_SDA_1[1] / TCPWM_line_0[2], Programmable SCP/OCP/OVP/UVP Fault indication)

Q1 : how  handle  with  type a   inside   port c type ?  how  can get info  from  this line (DP0 and DM0) such as plugin/out ?

Q2: i didnt  find  any real time  app callback for Type A (DP1 DM1) ) following function  used  only in app_init function  type_a_port_disable/enable  therefore i do  not  have any indication  of plugin/out in real time  also  about charge param  as

typedef enum{

    BC_CHARGE_NONE = 0,         /**< No active battery charging modes. */

    BC_CHARGE_DCP,              /**< Dedicated Charging Port as defined by BC 1.2 spec. */

    BC_CHARGE_QC2,              /**< QC2.0 charger. */

    BC_CHARGE_QC3,              /**< QC3.0 charger. */

    BC_CHARGE_AFC,              /**< Adaptive Fast Charging mode. */

    BC_CHARGE_APPLE,            /**< Apple power brick. */

    BC_CHARGE_CDP               /**< Charging Downstream Port as defined by BC 1.2 spec. */

}bc_charge_mode_t;

type_a_get_status  function   supposed  help get info from Type a  in real time  but  i dont  get any  info  when i plugin  to J9 my phone

please advice  how handle port a  stand alone in real time   and also type  which in type c   also in real time

0 Likes
Reply