阅读:1839回复:3
usb endpoint pairing 可不可以ep2,4,6同时用?
我把an2131Q的一个例子ep_pair改为ep2,ep4,ep6同时用,可是用control panel 做bulk transfer时,只有ep6可用,为什么?
|
|
|
沙发#
发布于:2003-05-21 17:25
可以啊,我是过
|
|
板凳#
发布于:2003-05-22 09:36
我试了,还是不行,您帮我看看我改的对不对:
void TD_Init(void) // Called once at startup { // Enable endpoint 2,4,6 in, and endpoint 2,4,6out IN07VAL = bmEP2; // Validate all EP\'s OUT07VAL = bmEP2; IN07VAL = bmEP4; OUT07VAL = bmEP4; IN07VAL = bmEP6; OUT07VAL = bmEP6; //Enable double buffering on endpoint 2,4,6in, and endpoint 2,4,6out USBPAIR = 0x3F; //Arm Endpoint 2,4,6 out to recieve data EPIO[OUT2BUF_ID].bytes = 0; EPIO[OUT4BUF_ID].bytes = 0; EPIO[OUT6BUF_ID].bytes = 0; // Setup breakpoint to trigger on TD_Poll() BPADDR = (WORD)TD_Poll; USBBAV |= bmBPEN; // Enable the breakpoint USBBAV &= ~bmBPPULSE; } void TD_Poll(void) // Called repeatedly while the device is idle { BYTE count2, count4, count6, i; if( !(EPIO[OUT2BUF_ID].cntrl & bmEPBUSY) ) // Is there something in the OUT2BUF buffer, if( !(EPIO[IN2BUF_ID].cntrl & bmEPBUSY) ) // Is the IN2BUF available, { count2 = EPIO[OUT2BUF_ID].bytes; // Then loopback the data for(i=0;i<count2;++i) IN2BUF = OUT2BUF; EPIO[OUT2BUF_ID].bytes = 0; EPIO[IN2BUF_ID].bytes = count2; } if( !(EPIO[OUT4BUF_ID].cntrl & bmEPBUSY) ) if( !(EPIO[IN4BUF_ID].cntrl & bmEPBUSY) ) { count4 = EPIO[OUT4BUF_ID].bytes; for(i=0;i<count4;++i) IN4BUF=OUT4BUF; EPIO[OUT4BUF_ID].bytes = 0; EPIO[IN4BUF_ID].bytes = count4; } if( !(EPIO[OUT6BUF_ID].cntrl & bmEPBUSY) ) if( !(EPIO[IN6BUF_ID].cntrl & bmEPBUSY) ) { count6 = EPIO[OUT6BUF_ID].bytes; for(i=0;i<count6;++i) IN6BUF=OUT6BUF; EPIO[OUT6BUF_ID].bytes = 0; EPIO[IN6BUF_ID].bytes = count6; } } 谢谢! |
|
|
地板#
发布于:2003-05-22 10:59
老大,你没写过程序啊???怎么复制语句都用的如此差???
\"IN07VAL = bmEP2; // Validate all EP\'s OUT07VAL = bmEP2; IN07VAL = bmEP4; OUT07VAL = bmEP4; IN07VAL = bmEP6; OUT07VAL = bmEP6; \" 这段是什么??? 最后结果,只有IN07VAL = bmEP6;和OUT07VAL = bmEP6; 要势能2,4,6,应如下IN07VAL |= bmEP6+bmEP2bmEP4; OUT 雷同 |
|