1 /*!
2  * \file      adc.h
3  *
4  * \brief     Generic ADC driver implementation
5  *
6  * \copyright Revised BSD License, see section \ref LICENSE.
7  *
8  * \code
9  *                ______                              _
10  *               / _____)             _              | |
11  *              ( (____  _____ ____ _| |_ _____  ____| |__
12  *               \____ \| ___ |    (_   _) ___ |/ ___)  _ \
13  *               _____) ) ____| | | || |_| ____( (___| | | |
14  *              (______/|_____)_|_|_| \__)_____)\____)_| |_|
15  *              (C)2013-2017 Semtech
16  *
17  * \endcode
18  *
19  * \author    Miguel Luis ( Semtech )
20  *
21  * \author    Gregory Cristian ( Semtech )
22  */
23 #ifndef __ADC_H__
24 #define __ADC_H__
25 
26 #ifdef __cplusplus
27 extern "C"
28 {
29 #endif
30 
31 #include <stdint.h>
32 #include "gpio.h"
33 
34 /*!
35  * ADC object type definition
36  */
37 typedef struct
38 {
39     Gpio_t AdcInput;
40 }Adc_t;
41 
42 /*!
43  * \brief Initializes the ADC input
44  *
45  * \param [IN] obj  ADC object
46  * \param [IN] scl  ADC input pin name to be used
47  */
48 void AdcInit( Adc_t *obj, PinNames adcInput );
49 
50 /*!
51  * \brief DeInitializes the ADC
52  *
53  * \param [IN] obj  ADC object
54  */
55 void AdcDeInit( Adc_t *obj );
56 
57 /*!
58  * \brief Read the analogue voltage value
59  *
60  * \param [IN] obj  ADC object
61  * \param [IN] channel ADC channel
62  * \retval value    Analogue pin value
63  */
64 uint16_t AdcReadChannel( Adc_t *obj, uint32_t channel );
65 
66 #ifdef __cplusplus
67 }
68 #endif
69 
70 #endif // __ADC_H__
71