2014-12-18 11:33 PM
how to transfer 512 bytes?
Send_DATA ((unsigned
char
*)trBuffer, 512);
void
Send_DATA(uint8_t* ptrBuffer, uint16_t Send_length)
{
if
(GetENDPOINT(ENDP1) & EP_DTOG_RX)
// NOT TX ie SW_BUF
{
UserToPMABufferCopy(ptrBuffer, ENDP1_BUF0ADDR, Send_length);
SetEPDblBuf0Count(ENDP1, EP_DBUF_IN, Send_length);
}
else
{
UserToPMABufferCopy(ptrBuffer, ENDP1_BUF1ADDR, Send_length);
SetEPDblBuf1Count(ENDP1, EP_DBUF_IN, Send_length);
}
FreeUserBuffer(ENDP1, EP_DBUF_IN);
// Toggles EP_DTOG_RX / SW_BUF
SetEPTxValid(ENDP1);
packet_sent = 0;
}
Send_DATA ((unsigned
char
*)trBuffer, 512);
buffer is set to isochronous mode
/* Initialize Endpoint 1 (TX) (IN) (EP1_IN)*/
SetEPType(ENDP1, EP_ISOCHRONOUS);
SetEPDoubleBuff(ENDP1);
SetEPDblBuffAddr(ENDP1, ENDP1_BUF0ADDR, ENDP1_BUF1ADDR);
SetEPDblBuffCount(ENDP1, EP_DBUF_IN, 0x200);
ClearDTOG_TX(ENDP1);
// USB PERIPHERAL
ClearDTOG_RX(ENDP1);
// SW_BUF for APPLICATION
ToggleDTOG_RX(ENDP1);
// NOT TX ie SW_BUF
SetEPTxStatus(ENDP1, EP_TX_NAK);
SetEPRxStatus(ENDP1, EP_RX_DIS);
// NOT TX DISABLE
endpoint
/* Endpoint 1 - Standard Descriptor */
0x09,
/* bLength */
USB_ENDPOINT_DESCRIPTOR_TYPE,
/* bDescriptorType */
0x81,
/* bEndpointAddress 1 in endpoint*/
0x05,
/* bmAttributes */
0x00,
/* wMaxPacketSize 512 bytes*/
0x02,
0x01,
/* bInterval */
0x00,
/* bRefresh */
0x00,
/* bSynchAddress */
what I'm doing wrong?