void TD_Init(void) // Called once at startup
{
CPUCS = ((CPUCS & ~bmCLKSPD) | bmCLKSPD1) ; // set the CPU clock to 48MHz
// set the slave FIFO interface to 48MHz
REVCTL = 0x03;
SYNCDELAY;
EP6CFG = 0xE2; //in端点,双缓冲
EP6FIFOCFG = 0x0D; // 自动输入,16位数据
EP6AUTOINLENH=0x02;
SYNCDELAY;
EP6AUTOINLENL=0X00; //set the packet size 512字节
SYNCDELAY;
EP6FIFOPFH = 0x82; // you can define the programmable flag (FLAGA)
SYNCDELAY; // to be active at the level you wish
EP6FIFOPFL = 0x00;
SYNCDELAY;
// INPKTEND = 0x06; //发送短数据包给上位机
// SYNCDELAY;