www.pudn.com > EP26_Bulk.zip > IO.c


#include "fx2.h" 
#include "fx2regs.h" 
#include "io.h" 
 
void IO_Init() 
{ 
	PORTECFG &= ~WORK_LED;   
	PORTECFG &= ~CPLD_RST;   
	OEE |= WORK_LED;   
	OEE |= CPLD_RST;      
///////////////////////////// 
	IOE &= ~CPLD_RST;         //CPLD reset 
	IOE |= CPLD_RST; 
	IOE &= ~WORK_LED;         //Word Led Light 
} 
 
void REG_Init() 
{ 
	CPUCS = 0x10; //48Mhz 
	CKCON = (CKCON&(~bmSTRETCH)) | 1; // Set stretch to 0 (after renumeration)	 
}