/*----------------------------------------------------------   
 * 项目名称:

     STC12C5Axx AD采集程序

 * 功能描述:

     1、

 * 版权信息:

     (c) 飞翼电子, 2017.

 * 历史版本:
     2017-04-10:
       - 初始版本 V1.0.0;

 * 配置说明:
     MCU:             STC12C5A60S2
     开发板:       	  
     晶振:      	  外部晶振：11.0592MHz
     扩展模块:  	  -
     软件:            Keil.C51.V9.01

 * 备注:
     - 将开发板的串口与电脑串口连接

----------------------------------------------------------*/   
#ifndef _ADC_H_
#define _ADC_H_

/*Define ADC operation const for ADC_CONTR*/
#define ADC_POWER   0x80            //ADC power control bit
#define ADC_FLAG    0x10            //ADC complete flag
#define ADC_START   0x08            //ADC start control bit
#define ADC_SPEEDLL 0x00            //420 clocks
#define ADC_SPEEDL  0x20            //280 clocks
#define ADC_SPEEDH  0x40            //140 clocks
#define ADC_SPEEDHH 0x60            //70 clocks

void OpenADC_CHx(unsigned char ch);
void CloseADC_CHx(unsigned char ch);
unsigned int GetADCResult(unsigned char ch);
void GetADCResult_Number(unsigned char ch,unsigned char* ptr);
void GetADCResult_Char(unsigned char ch,unsigned char* ptr);
unsigned char GetADCResult_High(unsigned char ch);
unsigned char GetADCResult_Low(unsigned char ch);
void Delay(unsigned int n);

#endif

