//--------------------------------------------------------------------------
// Step 1: Wait for the reset pin to rise.
//--------------------------------------------------------------------------
CP2200_RST_High();//将cp2200的复位脚置高
//--------------------------------------------------------------------------
// Step 2 + 3: Wait for oscillator and self initializaion to complete
//--------------------------------------------------------------------------
// Read and write the RAM at 0x7FF in the transmit buffer
// we can verify the send/rev buffer normal
RAMADDRH = 0x07;
RAMADDRL = 0xFF;
RAMTXDATA = 0x00;
if(RAMTXDATA != 0x00)
{
return MEM_ERROR;
}
RAMTXDATA = 0xFF;
if(RAMTXDATA != 0xFF)
{
return MEM_ERROR;
}
/* Init has completed */
//--------------------------------------------------------------------------
// Step 4: Disable Interrupts For Events that will not be monitored
//--------------------------------------------------------------------------
// Disable All Interrupts except for the packet received interrupt
INT0EN = 0x03; //关中断 允许接收缓冲区满和数据包已接收中断
INT1EN = 0x00;
// Clear all Interrupt Flags by reading the self-clearing status registers
temp_char = INT0;
temp_char = INT1;