//-----------------------------------------------------------------------------
// Includes
//-----------------------------------------------------------------------------
#include <C8051F310.h> // SFR declarations
#include <stdio.h>
#define IR_CUSTOMER_CODE 0xcd32
#define IR_POWER_KEY 0x81
#define setbit(x,y) ((x)|=(1<<(y))) //将X的第Y位置1
#define clrbit(x,y) ((x)&=~(1<<(y))) //将X的第Y位清0
#define revbit(x,y) ((x)^=(1<<(y))) //将X的第Y位取反
//-----------------------------------------------------------------------------
// Global Constants
//-----------------------------------------------------------------------------
#define SYSCLK 24500000/8 // SYSCLK in Hz (24.5 MHz internal
// oscillator / 8)
// the internal oscillator has a
// tolerance of +/- 2%
#define BAUDRATE 9600 // Baud rate of UART in bps
sbit LED = P3^3; // LED='1' means ON
sbit sigin = P2 ^ 3; // IR in pin
int xdata rdata[65];
//-----------------------------------------------------------------------------
// Function Prototypes
//---------------------------------------------------------------------------
C8051F310 红外解码程序
最新推荐文章于 2020-12-19 12:21:17 发布