#ifndef _ad_H_
#define _ad_H_
#include "stc12c5a60s2.h"
#include <stdio.h>
#include <intrins.h>
#define ADC_POWER 0x80
#define ADC_FLAG 0x10
#define ADC_START 0x08
#define ADC_SPEEDLL 0x00
#define ph_ch 1
#define zhuodu_ch 0
#define UART1_send_const_size 11 //串口发送数据缓冲区数组大小定义
#define unchar unsigned char
#define unint unsigned int
void ADC_Init(void);
void delay2(unsigned int s);
void DelayXus(unsigned char n);
void TimerInit(void);
void InitUART(void);
void UART_1send(void);
void UART_1SendOneByte(unsigned char d);
extern xdata unsigned char sendBuf[UART1_send_const_size]; //串口1发送数据缓冲区数组
extern xdata unsigned char Readph; //ph数据寄存器
extern xdata unsigned char Readzhuodu; //浊度数据寄存器
extern unsigned int ZhuoDu_ADC_service();
extern unsigned int zhuodu_ad_result;
extern unsigned int ADC_service();
extern xdata unsigned int ph_ad_result;
extern xdata unsigned char ch;
extern unsigned char AD_FLAG;
#endif |