AliOS Things API HAL SOC ADC Guide - Shaofa/AliOS-Things-Certification-Manual GitHub Wiki
int32_t hal_adc_init(adc_dev_t *adc)
-
Description
Initialises an ADC interface, Prepares an ADC hardware interface for sampling
-
Parameters
IN/OUT NAME DESC [in] adc the interface which should be initialised -
Returns
0 : on success, EIO : if an error occurred with any step
int32_t hal_adc_value_get(adc_dev_t *adc, void *output, uint32_t timeout)
-
Description
Takes a single sample from an ADC interface
-
Parameters
IN/OUT NAME DESC [in] adc the interface which should be sampled [out] output pointer to a variable which will receive the sample [in] timeout ms timeout -
Returns
0 : on success, EIO : if an error occurred with any step
int32_t hal_adc_finalize(adc_dev_t *adc)
-
Description
De-initialises an ADC interface, Turns off an ADC hardware interface
-
Parameters
IN/OUT NAME DESC [in] adc the interface which should be de-initialised -
Returns
0 : on success, EIO : if an error occurred with any step