AnsweredAssumed Answered

SPORT interface not working for BF592 Ez-lite kit

Question asked by aq_blues on May 27, 2015
Latest reply on Oct 30, 2015 by SachinV

Hi,

I am new to ADSP and trying to make this sport interface talk to one of the serial component on our board. But i am unable to understand the API provided. I am just receiving data, so i have this code to setup a dma channel for sport

void sport_init(void)
{


    /* open the SPORT driver */
    eResult = adi_sport_Open(1,ADI_SPORT_DIR_RX, ADI_SPORT_SERIAL_MODE, DeviceMemory,ADI_SPORT_DMA_MEMORY_SIZE,&hDevice);
    /*
     * Use the driver API's to configure SPORT
     */
    bool bLSBFirst = false;
    uint8_t nWordLength = 15; //actual length is SLEN + 1


    uint16_t nClockRatio = 2;
    bool bUseIntlClock = false;
    bool bFallingEdge = true;


    uint16_t nFsDivisor = 2; //ignored if external FS is used
    bool bFSRequired = true;
    bool bInternalFS = false;
    bool bDataFS = false; //ignored in received mode
    bool bActiveLowFS = false;
    bool bLateFS = false;


     eResult = adi_sport_ConfigData(hDevice,ADI_SPORT_DTYPE_ZERO_FILL,bLSBFirst,nWordLength);
     eResult = adi_sport_ConfigClock(hDevice,nClockRatio, bUseIntlClock, bFallingEdge);
     eResult = adi_sport_ConfigFrameSync(hDevice, nFsDivisor, bFSRequired, bInternalFS, bDataFS, bActiveLowFS, bLateFS);






     /* Enable the DMA mode */
     eResult =  adi_sport_EnableDMAMode(hDevice,true);
     //eResult = SubmitBufferDmaMode(hDevice, DeviceMemory,ADI_SPORT_DMA_MEMORY_SIZE);


     /* submit the first  buffers */
    eResult = adi_sport_SubmitBuffer(hDevice,nBufferTx0,SIZE_OF_TX_BUFFER);
    /* submit the second buffer  */
    eResult = adi_sport_SubmitBuffer(hDevice,nBufferTx1,SIZE_OF_TX_BUFFER);
    /* Enable the device */
    eResult = adi_sport_Enable(hDevice,true);

 

and then i do the following to read the data

   while(1)
    {


 while(bBufferComplete == false)
  {
  eResult = adi_sport_IsBufferAvailable(hDevice,&bBufferComplete);
  }


  eResult = adi_sport_GetBuffer(hDevice,&pProcessedBuffer);


  if (counter < TEST_BUFFER_SIZE)
  testBuffer[counter++] = *(uint16_t *)pProcessedBuffer;




  bBufferComplete = false;
     eResult = adi_sport_SubmitBuffer(hDevice,nBufferTx0,SIZE_OF_TX_BUFFER);
  }

 

File is attached as well. But the data reads have occasional 0 in between the data actually on bus.

Any help would be appreciated. Specially if there is any explanation on how these descriptors work.

Thanks in advance,

AQ

Attachments

Outcomes