Post Go back to editing

ADSP-BF706 with audio codec CS4272 via SPORT

Hello,

I am trying to get data from audio codec CS4272 via SPORT. CS4272 works in stand alone master mode, so it's generating all clocks it self, Frame clock, Serial clock and also master clock. data in I2S format, you can see it on picture.

Now codec Frame clock(LRCK on picture) is connected to ADSP-BF706 SPT1_AFS pin directly, SCLK connected to SPT1_ACLK, and SDATA pin connected to SPT1_AD0. Could you please help me and explain How to configure SPORT correctly to get data from both channels? i Will provide some code that i did myself but it's not working properly.

#define SPORT_MEM_SIZE (ADI_SPORT_INT_MEMORY_SIZE)

ADI_SPORT_HANDLE          hDeviceRx;

unsigned char sport_handlerRx[SPORT_MEM_SIZE];

adi_sport_Open(1U,ADI_HALF_SPORT_A,ADI_SPORT_DIR_RX, ADI_SPORT_I2S_MODE, sport_handlerRx,(uint32_t)(SPORT_MEM_SIZE),&hDeviceRx)

adi_sport_ConfigData(hDeviceRx,ADI_SPORT_DTYPE_ZERO_FILL,3U,false,false,false)

adi_sport_ConfigClock(hDeviceRx,0,false ,true,false)

adi_sport_ConfigFrameSync(hDeviceRx,0,false,false ,false,false,false,false)

#define SIZE_OF_RX_BUFFER  4U

uint8_t nBufferRx0[SIZE_OF_RX_BUFFER];

adi_sport_SubmitBuffer(hDeviceRx,nBufferRx0,SIZE_OF_RX_BUFFER)

adi_sport_RegisterCallback(hDeviceRx,SPORTCallbackRx,NULL)  //

adi_sport_Enable(hDeviceRx,true)

As you can see i made all config functions. 

BUT now call back function is called only once, when i need it to be called every time when i get data, HOW to do that correctly?

Than how to configure buffers and DATA types to get data correctly, AND how to read data from that buffers when i get to callback function?

P.S. working with BF706 EZ-KIT board. Code written in CCES.

Best regards

Roman