Can i trandfer only one word with the spi (DMA mode )of the FX3?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
waxi_1305956
Level 3
Level 3

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

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

0 Likes