AnsweredAssumed Answered

Analog devices SPORT API's usage

Question asked by bhanu on Jun 22, 2013
Latest reply on Jul 8, 2013 by CraigG

HI,

    I am using SPORT to interface to a AMBE codec in one of the project, initially we are trying to check the SPORT transmit port to funcitoning on the BF537 exlite kit . we are using the sample applicaiton provided in the cross core IDE for SPORT in callback mode.while running the code the control is struck at the while loop which means the operation or call back has not been received. do we need to initialize anything further. I am pasting the same code for reference. Also there is an argnument difference in the API and the examples.

 

 

int main(void)

{

/* SPORT driver handle */

ADI_SPORT_HANDLE hDevice;

/* driver API result code */

ADI_SPORT_RESULT eResult;

/* Initialize managed drivers and/or services */

adi_initComponents();

/*

ADI_SPORT_RESULT adi_sport_Open(

uint32_t nDeviceNum,

ADI_SPORT_DIRECTION eDirection,

ADI_SPORT_MODE eMode,

void *pMemory,

uint32_t nMemSize,

ADI_SPORT_HANDLE *const phDevice

)

*/

/* open the SPORT driver */

eResult = adi_sport_Open(0,ADI_SPORT_DIR_TX, ADI_SPORT_SERIAL_MODE, DeviceMemory,ADI_SPORT_DMA_MEMORY_SIZE,&hDevice);

/*

* Use the driver API's to configure SPORT

*

* adi_sport_ConfigData();

* adi_sport_ConfigClock();

* adi_sport_ConfigFrameSync();

*/

  

  

  

/* Enable the DMA mode */

eResult = adi_sport_EnableDMAMode(hDevice,true);

/* Register a callback for the DMA */

eResult = adi_sport_RegisterCallback(hDevice, SportCallback, NULL);

/* submit the sport buffers */

eResult = adi_sport_SubmitBuffer(hDevice,nBufferTx0,SIZE_OF_TX_BUFFER);

eResult = adi_sport_SubmitBuffer(hDevice,nBufferTx1,SIZE_OF_TX_BUFFER);

eResult = adi_sport_Enable(hDevice,true);

while(!bComplete)

{

/* do other processing here while SPORT is processing */

}

/* Disable the device */

eResult = adi_sport_Enable(hDevice,false);

/* close the SPORT driver */

eResult = adi_sport_Close(hDevice);

return 0;

}

Outcomes