#include "io.h"

//如果使用keil仿真调试，不能操作P0.5，P0.6口，否则会运行出错
//P0/P1/P2/P3 口可按位操作,P4/P5 口只能寄存器操作   P5.5为RST口
/*将所有IO寄存器清零*/
void IO_CLR()
{
    P0CR = 0xFF;
    P1CR |= 0xF0;
    P2CR = 0xFF;
    P3CR = 0xFF;
    P4CR = 0xFF;
    P5CR = 0x3F;
	
    P0PCR = 0x00;
    P1PCR &= 0x0F;
    P2PCR = 0x00;
    P3PCR = 0x00;
    P4PCR = 0x00;
    P5PCR = 0x00;
	
		ALFSEL0 = 0x00;
		ALFSEL1 = 0x00;
	
		P0 = 0;
    P2 = 0;
    P3 = 0;
    P4 = 0;
    P5 = 0xFF;
}