Skip to content

AliOS Things API HAL SOC ADC Guide

librae8226 edited this page Mar 1, 2018 · 1 revision

API INDEX


1-hal_adc_init

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

2-hal_adc_value_get

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

3-hal_adc_finalize

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

Clone this wiki locally