1 /******************************************************************************
2 ** File Name: adc_drvapi.h *
5 ** Copyright: 2002 Spreatrum, Incoporated. All Rights Reserved. *
6 ** Description: This file defines the basic input and output operations *
7 ** on hardware, it can be treated as a hardware abstract *
9 ******************************************************************************
11 ******************************************************************************
13 ** ------------------------------------------------------------------------- *
14 ** DATE NAME DESCRIPTION * ** 06/12/2010 hao.liu Create. *
15 ******************************************************************************/
17 #ifndef _ADC_DRVAPI_H_
18 #define _ADC_DRVAPI_H_
20 #define ADC_SCALE_3V 0
21 #define ADC_SCALE_1V2 1
31 ADC_CHANNEL_VCHGSEN = 6,
32 ADC_CHANNEL_VCHGBG = 7,
33 ADC_CHANNEL_ISENSE = 8,
35 ADC_CHANNEL_TPYU = 10,
36 ADC_CHANNEL_TPXR = 11,
37 ADC_CHANNEL_TPXL = 12,
38 ADC_CHANNEL_DCDCCORE = 13,
39 ADC_CHANNEL_DCDCARM = 14,
40 ADC_CHANNEL_DCDCMEM = 15,
41 ADC_CHANNEL_DCDCLDO = 16,
42 ADC_CHANNEL_VBATBK = 17,
43 ADC_CHANNEL_HEADMIC = 18,
44 ADC_CHANNEL_LDO0 = 19, /* ldo rf/abb/cama */
45 ADC_CHANNEL_LDO1 = 20, /* ldo v3v/v28/vsim0/vsim1/cammot/sd0/usb/dvdd18/v25 */
46 ADC_CHANNEL_LDO2 = 21, /* ldo camio/camcore/cmmb1v2/cmmb1v8/v18/sd1/sd3/ */
49 typedef enum{false, true} bool;
51 #ifdef CONFIG_MACH_SP6810A
52 #define ADC_CHANNEL_TEMP 0
54 #define ADC_CHANNEL_TEMP 1
63 int32_t ADC_GetValues(adc_channel id, bool scale, uint8_t num, int32_t * p_buf);
64 int32_t ADC_GetValue(adc_channel adcSource, bool scale);
70 #endif // _ADC_DRVAPI_H_