原创 cy68013a 自动切换USB1.1/USB2.0 实例

2011-11-24 18:28 1709 9 9 分类: MCU/ 嵌入式

BOOL DR_SetConfiguration(void)   // Called when a Set Configuration command is received

{
if( EZUSB_HIGHSPEED() ) 
{ // FX2 enumerated at high speed 
// SYNCDELAY; // 
EP6AUTOINLENH = 0x02; // 0x02,set AUTOIN commit length to 512 bytes 
SYNCDELAY; // 
EP6AUTOINLENL = 0x00; 
SYNCDELAY; 
// enum_high_speed = TRUE; 
else 
{ // FX2 enumerated at full speed 
// SYNCDELAY;
 
EP6AUTOINLENH = 0x00; // set AUTOIN commit length to 64 bytes 
SYNCDELAY; 
EP6AUTOINLENL = 0x40; 
SYNCDELAY; 
// enum_high_speed = FALSE; 
 
 
   Configuration = SETUPDAT[2];
   return(TRUE);            // Handled by user code
}

文章评论0条评论)

登录后参与讨论
我要评论
0
9
关闭 站长推荐上一条 /2 下一条