Multiple channels with GPADC Adapter

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
2 posts / 0 new
Last post
hatfieej
Offline
Last seen:1 year 11 months ago
加入:2019-02-20 20:03
Multiple channels with GPADC Adapter

Can the GPADC adapter be configured to read multiple inputs? It looks like it relies on the internaldynamic_datavariable. Using that, it appears the adapter will only handle one input. Is there another way?

Device:
PM_Dialog
Offline
Last seen:3 hours 43 min ago
工作人员
加入:2018-02-08 11:03
Hi hatfieej,

Hi hatfieej,

You are not able to configure the GPADC adapter in order to read multiple inputs at the same time. If you would like to read from different GPIOs, you could reconfigure the GPIO that you would like to read. There is not any sample code on that, but you can set a flag and change the .port and .pin items in ad_gpadc_io_conf_t bus_GPADC structure. So, every time that you open the adapter, the GPIO will be reconfigured and every time the that you close the adapter the GPIO will be reset. If you check the source code of ad_gpadc_open() and ad_gpadc_close() you will see that the ad_gpadc_check_and_apply_config(). In ad_gpadc_check_and_apply_config() the ad_gpadc_gpio_io_config() is called in order to configure the ADC pins. Be aware that if you would like to change the items of the ad_gpadc_io_conf_t structure dynamically, you should remove the “const” structure type.

Thanks, PM_Dialog