2 Replies Latest reply on Jun 17, 2020 11:40 AM by zapa_4702046

    CY4532 EVK  get  request  info from  USB type C / USB type A device to be charged

    zapa_4702046

      if  run from SDK  examples in PSoC  creator  follwing  examples   on CY4532 CYPD3171:   CCG3PA Car Charger (CLA), or  CCG3PA Power Bank

       

      I want to get info about request of USB type C device to be charged such as: voltage and current

      I want to get info about request of USB type A device to be charge such as: voltage and type of charge for example  see table

       

      see attached file

       

      USB type A device to be charge -type of charge.png

      example  of  devices to be charged

       

      device to be charge.png

       

       

       

      Q:  if  I will run  Power Bank (PB) Demo or CCG3PA Car Charger (CLA)    from PSoC  creator  I will  able  get info  which I describe  above  if yes  which API  I should use  in order getting  this info ?  (  in SDK i saw to structs which  was reassemble to this info  but  i wanna get accurate answer )

       

      note :  in CCGx_Power_SDK_API_Guide.pdf 5.37 dpm_status_t Struct  and 5.15  app_status_t Struct   psink volt and current   but  i didnt find  any fileds  which regarding  to qc types in USB type A

        • 1. Re: CY4532 EVK  get  request  info from  USB type C / USB type A device to be charged
          ShifangZ_26

          Hi ,

           

          For the Type-C voltage and current:

          >> There are two difference understanding/requirements based on this:

          1. Voltage and current is the voltage and current on power negotiation contract. The API and code example is:

                  const    dpm_status_t *dpm_stat = dpm_get_info(0);

                  if(dpm_stat -> contract_exist == true)

                  {

                      voltage = dpm_stat->contract.max_volt / 100;

                      current = dpm_stat->contract.cur_pwr / 5;

                  }

          2. If the voltage and current you are looking for is real time voltage and current. The API and code example is:

          Voltage = pd_hal_measure_vbus(0);

          Current = pd_hal_measure_vbus_cur(0);

           

          For the Type-A voltage and current.

          1. If the voltage and current is based on the charging protocol, the current value cannot be read out from QC charging protocol, for others, we can get it from the API:

          Voltage: type_a_set_voltage(uint16_t volt_mV);

          And you also could insert the code when the voltage or current setting have been changed, the hit of marco define is defined in @file battery_charging.h.

           

          2. For the real time voltage and current.

          You need add additional hardware to achieve that, for example, wired Type-A voltage to VBUS_C_MON pin for VBUS voltage monitor, you could read out the voltage from API pd_hal_measure_vbus(1) after switch the ADC internal correctly.

          And current read back, the gl_type_a_status.cur_vbus_a is the one you could read back, but this is based on CY4532 hardware. If you changed hardware or design difference hardware, this define is faked.

           

          Best Regards,

          Lisa

          • 2. Re: CY4532 EVK  get  request  info from  USB type C / USB type A device to be charged
            zapa_4702046

            thanks  for  the elaborate information

            my application run on CYPD3175   - CCG3PA Power Adapter with Direct Feedback Control

            1) the measurement  of voltage and current of device to be charge  are  the same answer ?

            2)  maybe  i miss understood  QC type on TYPE A  devices to be charged   possible  get  info  when they are plugin  ?

            3) Voltage: type_a_set_voltage(uint16_t volt_mV);   this is set function  not get ?  

             

            two additional questions :

             

            i didn't  find  any API  regardless to  pin VBUS_C_MON_DISCHARGE   is there any functionality ?

            i didn't  find  any  API  regardless  to pin VBUS_P_CTRL    it is possible  to control it   mean change logic level  with API  from SDK ?