ΣSigmaStudio Ask AI Русский Log in

Callback prototype in SPI driver DMA example BF706 is incorrect.

Processors & DSP oldfoxsoftware Nov 7, 2016 00:00 2 replies Original on forum ↗
Subscribe
oldfoxsoftware Question
Nov 7, 2016 00:00

At least it does not reflect the newest ADI SPI library for the BF706. The callback function is shown as

void SpiCallback(void* pHandle, uint32_t u32Arg, void* pArg)
{
ADI_SPI_HANDLE pDevice = (ADI_SPI_HANDLE *)pHandle;
ADI_SPI_EVENT event = (ADI_SPI_EVENT)u32Arg;
uint16_t *data = (uint16_t*)pArg;

switch (event) {
case ADI_SPI_TRANSCEIVER_PROCESSED:
bComplete = true;
break;
default:
break;
}
}

but the parameters should be:

void SpiCallback(void* pArg, uint32_t u32Arg, void* pBuf)
{
// There is no handle among the parameters.
// ADI_SPI_HANDLE pDevice = (ADI_SPI_HANDLE *)pHandle;
ADI_SPI_EVENT event = (ADI_SPI_EVENT)u32Arg;
uint16_t *data = (uint16_t*)pArg;

switch (event) {
case ADI_SPI_TRANSCEIVER_PROCESSED:
bComplete = true;
break;
default:
break;
}
}

The compiler does not complain because the switched arguments are of the same type.

ADIApproved Reply
Dec 7, 2016 00:00

Hi,

Can please let us know from where you got the spi library file that you mentioned so that we can assist better

Best Regards,

Kader

EZAdministrator Reply
Aug 2, 2018 00:00

This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

Thank you,
EZ Admin