Tool/software:
Hi,
I know that on other platforms the SPI is normally blocking for the transmission and then I can read out that the transmission is done and go to the next transmission. For the C2000 uC, I cannot find any similar feature and I don't know how I should check, that the SPI transmit is done (Note that I don't want to have blocking SPI receive, since when there is no device, it just blocks forever).
So, what I need is like:
static void spi_read_data(uint8_t *data_tx, uint8_t *data_rx, uint16_t datasize, uint32_t SPI_BASE) { uint16_t i = 0; for (i = 0; i < datasize; i++) { SPI_writeDataNonBlocking(SPI_BASE, (data_tx[i]<<8)); //Shift data because of 16bit TI data structure } for (i = 0; i < datasize; i++) { data_rx[i] = SPI_readDataNonBlocking(SPI_BASE); } //Wait for transfer done while(??? What comes Here for blocking transmit only ???); }
How can I achieve that?