Please let me know what address are you referring to here. Is it the internal address of the SPI flash device or is it something else. Kindly, let me know about your SPI device.
It's not for SPI Flash. It used to control a slave device with SPI. The device use 10-bit addresses and 8-bit data.
SPI does not use addressing for the device on its whole rather it uses the SS lines. It is only the internal addressing that may be needed in case of Flash devices. Please let me know what addressing you are referring to. Is it an internal address to the device?
I know this controller is a single-master controller with a single automated SSN control.
We want to use FX3-SPI for control a device with 10-bit address and 8bit data.
The tenth bit sent by the master indicates the type of transfer: high for a write command , low for a read command.
And most significant bit first.
Could FX3 support 10-bit address and 8bit data SPI format??
How to config for it?
Could we change the "spiConfig.wordLen" for the different data bits(10-bit/8bit) of the following example code ??
/* SPI initialization for application. */
CyFxSpiInit (uint32_t clk, uint8_t len)
CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
/* Start the SPI module and configure the master. */
status = CyU3PSpiInit();
if (status != CY_U3P_SUCCESS)
/* Start the SPI master block. Run the SPI clock at 8MHz
* and configure the word length to 8 bits. Also configure
* the slave select using FW. */
CyU3PMemSet ((uint8_t *)&spiConfig, 0, sizeof(spiConfig));
spiConfig.isLsbFirst = CyFalse;
spiConfig.cpol = CyTrue;
spiConfig.ssnPol = CyFalse;
spiConfig.cpha = CyTrue;
spiConfig.leadTime = CY_U3P_SPI_SSN_LAG_LEAD_HALF_CLK;
spiConfig.lagTime = CY_U3P_SPI_SSN_LAG_LEAD_HALF_CLK;
spiConfig.ssnCtrl = CY_U3P_SPI_SSN_CTRL_FW;
spiConfig.clock = clk;//8000000 = 8MHz
spiConfig.wordLen = len;
status = CyU3PSpiSetConfig (&spiConfig, NULL);
Yes, the word length can be modified to suit the 10bit data transfer. Also, it has to be noted that while using CyFxSpiTransmitWords() API, the data buffer must be padded up to the next nearest byte (16-bits in your case) and the byte count must be set to next higher value (2 in your case)