Hi,
I'm using the SPI_MasterTransfereGetCount() function to detect when a none-blocking transfer is completed:
/* transfere a block of data */
SPI_MasterTransferNonBlocking(BCC_SPI_SPI_BASE, &spi_master_handle, &xfer);
/* Wait until transfer is finished. */
while ( (kStatus_NoTransferInProgress != SPI_MasterTransferGetCount(BCC_SPI_SPI_BASE, &spi_master_handle, &count)) && (timeout > 0U))
{
timeout--;
}
Debugging the problem I found that the following line is incorrect:
status_t SPI_MasterTransferGetCount(SPI_Type *base, spi_master_handle_t *handle, size_t *count)
{
assert(handle);
status_t status = kStatus_Success;
// if (handle->state != kStatus_SPI_Busy) /* wrong */
if (handle->state != kSPI_Busy) /* correct */
{
status = kStatus_NoTransferInProgress;
}
else
{ /* Return remaing bytes in different cases */
if (handle->rxData)
{
*count = handle->transferSize - handle->rxRemainingBytes;
}
else
{
*count = handle->transferSize - handle->txRemainingBytes;
}
}
return status;
}
Hi Wolfgang:
Thanks for your feedback and I will issue a internal ticket to software team.
Regards
Daniel