@danielmartynek
Tried to perform the below operation, but still unable to get the SPI transaction correct on the bus:
Command byte is 0x8F, expected 1 byte response from slave device.
Code snippet:
while((LPSPI1->SR & LPSPI_SR_TDF_MASK)>>LPSPI_SR_MBF_SHIFT!=0);
/* Reset FIFO */
LPSPI1->CR |= LPSPI_CR_RRF(1)|LPSPI_CR_RTF(1);
LPSPI1->CR |= LPSPI_CR_RRF(1)|LPSPI_CR_RTF(1);
LPSPI1->SR = 0x3F00;
/* Check for FIFO availablity */
while((LPSPI1->SR & LPSPI_SR_TDF_MASK)>>LPSPI_SR_TDF_SHIFT==0);
LPSPI1->TCR = LPSPI_TCR_CPOL(1) | LPSPI_TCR_CPHA(1)|LPSPI_TCR_LSBF(0)|LPSPI_TCR_CONT(1)
|LPSPI_TCR_PRESCALE(2)
|LPSPI_TCR_PCS(0)
|LPSPI_TCR_FRAMESZ(7)|LPSPI_TCR_RXMSK(1);
/* Send cmd byte of 0x8F */
LPSPI1->TDR = 0x8F;
/* Send command with TXMSK for response */
while((LPSPI1->SR & LPSPI_SR_TDF_MASK)>>LPSPI_SR_TDF_SHIFT==0);
LPSPI1->TCR = LPSPI_TCR_CPOL(1) | LPSPI_TCR_CPHA(1)|LPSPI_TCR_LSBF(0)|LPSPI_TCR_CONTC(1)|LPSPI_TCR_CONT(1)
|LPSPI_TCR_PRESCALE(2)
|LPSPI_TCR_PCS(0)
|LPSPI_TCR_FRAMESZ(7)|LPSPI_TCR_RXMSK(0)|LPSPI_TCR_TXMSK(1);
/* End of transfer */
while((LPSPI1->SR & LPSPI_SR_TDF_MASK)>>LPSPI_SR_TDF_SHIFT==0);
LPSPI1->TCR = ((LPSPI1->TCR) & (~LPSPI_TCR_CONTC_MASK));
Logic analyser Capture:

Can you please let me know why isn’t the CS extending for the TXMSK byte?