/************* 用户系统配置 **************/
#define MAIN_Fosc 12000000L //定义主时钟, 模拟串口和红外接收会自动适应。5~36MHZ
#define D_TIMER0 125 //选择定时器时间, us, 红外接收要求在60us~250us之间
#define User_code 0xFD02 //定义红外接收用户码
#define DECVICE_ADD 0x55<<1
/************* 以下宏定义用户请勿修改 **************/
#include "reg51.H"
#include "string.H"
#define uchar unsigned char
#define uint unsigned int
//#define freq_base (MAIN_Fosc / 1200)
//#define Timer0_Reload (65536 - (D_TIMER0 * freq_base / 10000))
/************* 本地常量声明 **************/
/************* 本地变量声明 **************/
sbit SDA = P3^0; //SDA
sbit SCL = P3^1; //SCL
bit PreState;
bit NowState;
bit START_flag;
bit STOP_flag;
//uchar IR_SampleCnt; //采样计数
uchar NN;
uchar DEVICE_ADR; //器件地址
uchar WORD_ADR; //内存地址
uchar REC_DATA; //接收到的内容
unsigned int *send_ptr;//
code unsigned AA0[9] = {0x70,0x2c,0x6e,0x2a,0x00,0x00,0x00,0xc0}; //
code unsigned AA8[2] = {0xff,0x2c}; //
//code unsigned AA0[9] = {0x70,0x2c,0x6e,0x2a,0x00,0x00,0x00,0xc0}; //
code unsigned A00[33] = {0xed,0xcf,0x48,0xe6,0x89,0xe8,0x0c,0xe8,
0x97,0xaf,0xd2,0x40,0x6d,0xc2,0xc4,0x04,
0xca,0xd5,0xea,0xa7,0xae,0x43,0x37,0xe2,
0x12,0x05,0x3b,0x59,0xb7,0xfb,0x3d,0xa5
}; //
code unsigned A20[33] = {0xCB,0x85,0x8b,0x54,0x6d,0x97,0x3c,0x05,
0x46,0x0f,0x45,0xb4,0xd1,0x0a,0xb8,0x9b,
0xdf,0xa2,0x43,0x8d,0xe6,0x7a,0x6f,0xf8,
0x7f,0xaa,0x52,0x37,0xa6,0x8f,0xdc,0x71
}; /