This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

What is the difference between SPI_config and CSL_FINS?

Dear friends,

I am confused about the functions and macros during SPI read write operations. In CSL_SPI there is an SPI_config function to configure the SPI handle "hSpi" with the defined "spiHwConfig" SPI_Config Structure. During the configuration we set the frame length and character lengths with wLen and frLen like below.

hwConfig.spiClkDiv	= SPI_CLK_DIV;
hwConfig.wLen = SPI_WORD_LENGTH_8;
hwConfig.frLen = SPI_FRAME_LENGTH;
hwConfig.wcEnable = SPI_WORD_IRQ_ENABLE;
hwConfig.fcEnable = SPI_FRAME_IRQ_DISABLE;
hwConfig.csNum = SPI_CS_NUM_0;
hwConfig.dataDelay = SPI_DATA_DLY_0;
hwConfig.csPol = SPI_CSP_ACTIVE_LOW;
hwConfig.clkPol = SPI_CLKP_LOW_AT_IDLE;
hwConfig.clkPh = SPI_CLK_PH_FALL_EDGE;

result = SPI_config(hSpi, &hwConfig);

 However, in the example there is also another operation used with macros to set the frame length, am I missing something?

 CSL_FINS(CSL_SPI_REGS->SPICMD1,SPI_SPICMD1_FLEN,1);   

As far as I understand SPI_read or SPI_write functions uses the configured (hwConfig) to read or write to the SPIDAT buffers. Then what is the meaning to set FLEN in the macro?

Thanks in advance.

Regards.