2 * Analog Input RPP API header file.
6 * @copyright Copyright (C) 2013-2015 Czech Technical University in Prague
8 * @author Carlos Jenkins <carlos@jenkins.co.cr>
16 * ADC module initialization.
18 * Call this method before using this module.
20 * This function is not thread safe. Do not call it from multiple threads.
22 * @return SUCCESS if initialization successful.\n
23 * FAILURE if module already initialized.
25 int8_t rpp_adc_init();
28 #ifdef TARGET_TMS570_RPP
30 * Get the current analog value on the given pin.
32 * The function is thread thread safe.
34 * @param[in] pin The pin number to read [1-16].
36 * @return [0-4095] Value representing the analog value on given pin
37 * (ADC is 12bit resolution).\n
38 * -1 if pin number is out of range.
42 * Get the current analog value on the given pin.
44 * The function is thread safe.
46 * @param[in] pin The pin number to read [1-12].
48 * @return [0-4095] Value representing the analog value on given pin
49 * (ADC is 12bit resolution).\n
50 * -1 if pin number is out of range.
53 int16_t rpp_adc_get(uint8_t pin);
57 * Read and update analog cached values.
59 * The function is thread safe.
61 * @return SUCCESS when transaction was successful.\n
62 * FAILURE if transaction could not be confirmed.
64 int8_t rpp_adc_update();
67 #endif /* __RPP_ADC_H */