AnsweredAssumed Answered

The timing of data transfer and 4-byte data from "spi_polling_b2b_transfer_master.c" sample code.

Question asked by YuChia Chien on Nov 25, 2018
Latest reply on Dec 11, 2018 by Kerry Zhou

The timing of data transfer and 4-byte data from "spi_polling_b2b_transfer_master.c" sample code.

 

I would like to transfer(write and then read the response from slave), the format is both 4-byte.

Is it correct to exchange "uint8_t srcBuff" to "uint32_t srcBuff"?

Should I change the "uint8_t *txData, *rxData" from function SPI_MasterTransferBlocking?

If my polling period is 10 mSec, how to adjust from the example code?

 

 

/*******************************************************************************
* Variables
******************************************************************************/
#define BUFFER_SIZE (64)
static uint8_t srcBuff[BUFFER_SIZE];
static uint8_t destBuff[BUFFER_SIZE];

 

 

status_t SPI_MasterTransferBlocking(SPI_Type *base, spi_transfer_t *xfer)
{
int32_t instance;
uint32_t tx_ctrl = 0, last_ctrl = 0;
uint32_t tmp32, rxRemainingBytes, txRemainingBytes, dataWidth;
uint32_t toReceiveCount = 0;
uint8_t *txData, *rxData;
uint32_t fifoDepth;

Outcomes