Hi Alexis this is what I'm trying to do, but there seems to be a problem with this particular combination as if I do a 10bit transfer I get what I expect 10 bits clocked out per frame with
#define BUFFER_SIZE (2)
static uint8_t srcBuff[BUFFER_SIZE];
static uint8_t destBuff[BUFFER_SIZE];
spi_master_config_t userConfig = {0};
uint32_t srcFreq = 0;
uint32_t i = 0;
uint32_t err = 0;
spi_transfer_t xfer = {0};
for (i = 0; i < BUFFER_SIZE; i++)
{
srcBuff[BUFFER_SIZE] = 0xA5;
}
SPI_MasterGetDefaultConfig(&userConfig);
srcFreq = EXAMPLE_SPI_MASTER_CLK_FREQ;
userConfig.sselNum = (spi_ssel_t)EXAMPLE_SPI_SSEL;
userConfig.sselPol = (spi_spol_t)EXAMPLE_SPI_SPOL;
userConfig.dataWidth = kSPI_Data10Bits;
SPI_MasterInit(EXAMPLE_SPI_MASTER, &userConfig, srcFreq);
//Start Transfer
xfer.txData = srcBuff;
xfer.rxData = destBuff;
xfer.dataSize = 2;
xfer.configFlags = kSPI_FrameAssert;
SPI_MasterTransferBlocking(EXAMPLE_SPI_MASTER, &xfer);
but when I go and just change to 9 bits with userConfig.dataWidth = kSPI_Data9Bits;
it jumps to clocking out 18bits.
So how can I get the elusive 9 bits?
Cheers
Ian