cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

waxi_1305956
New Contributor

I have a problem,i use the fx3 chip,and i use the spi with the DMA mode ,i enable both transfer and receive,i want to know can i transfer and receive only one word every time?

   

     status = CyU3PDmaChannelSetupRecvBuffer (&glSpiRxHandle, &buf_p);

   

     CyU3PDmaChannelSetupSendBuffer (&glSpiTxHandle,&s_buf);
     CyU3PSpiSetBlockXfer (1, 1);
     status = CyU3PDmaChannelWaitForCompletion(&glSpiTxHandle,CY_FX_USB_SPI_TIMEOUT);
     status = CyU3PDmaChannelWaitForCompletion(&glSpiTxHandle,CY_FX_USB_SPI_TIMEOUT);
     CyU3PSpiDisableBlockXfer (CyTrue, CyTrue);

0 Likes
2 Replies
Anonymous
Not applicable

You can refer to UsbSpiDmaMode example given in the FX3 SDK. Can you tell me what is the size of word? 16 or 32? CyU3PDmaChannelSetupRecvBuffer has a restriction of 32bytes multiple when the DCache is enabled. 

   

Attach you firmware for reference.

0 Likes
waxi_1305956
New Contributor

thanks for you answer,the word is 8bit,is there some ways to transfer and receive one byte?

0 Likes