- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I want to disable PD (no PDOs advertised, port disabled) based on an ADC reading.
What is the correct way to do this using the CCGx API?
- dpm_stop(PORT) does indeed disable the port... but it also seems to disable the ADC measurement.
- dpm_disable(PORT) does not seem to do anything at all (port is not disabled).
Is there another way to disable the port using the API?
Thanks for your help,
m
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mike,
The best API function to use in this case would be
app_disable_pd_port(uint8_t port, dpm_typec_cmd_cbk_t cbk); //@file app.c
You will have to create a dummy callback function (to do nothing) since we don't require a callback here (you cannot pass NULL).
The periodic VBUS measurement will be disabled inevitably, but you can use this API to access the VBUS ADC:
vbus_get_value(uint8_t port); //@file app.c
You can use lower level functions like dpm_stop(port) and pd_hal_measure_vbus(port) but it is not recommended unless you know you how to call them from the correct place. dpm_disable(port) only disables PD on the port, the port is still functional.
Regards,
Rajath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Which CCGx are you using?
Are you measuring from the ADC to re-enable the port? Is it VBUS ADC you are using?
Regards,
Rajath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rajath,
Thanks for your questions.
I'm using a CCG3PA. Yes, I want to measure from the ADC to re-enable the port.
The ADC is on a GPIO, P1.3/DM1.
Thank you,
mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Mike,
The best API function to use in this case would be
app_disable_pd_port(uint8_t port, dpm_typec_cmd_cbk_t cbk); //@file app.c
You will have to create a dummy callback function (to do nothing) since we don't require a callback here (you cannot pass NULL).
The periodic VBUS measurement will be disabled inevitably, but you can use this API to access the VBUS ADC:
vbus_get_value(uint8_t port); //@file app.c
You can use lower level functions like dpm_stop(port) and pd_hal_measure_vbus(port) but it is not recommended unless you know you how to call them from the correct place. dpm_disable(port) only disables PD on the port, the port is still functional.
Regards,
Rajath