I downloaded the loopback project from the Lyrtech, but because I'm not good at coding,
I don't know where I should edit..
All I want is, I have to get input 2channel and output 1 channel control..
for example,
in1= 2*ADC_ch1;
in2= 0.5*ADC_ch2;
out1=in1+in2;
And the basic loopback program is 4ch in-->4ch out. (to the same number, 1-->1, 2-->2, 3-->3, 4-->4)
Could you let me know?
in the analogloopback main.c, should i edit the section below?
interrupt void dmax_isr( void )
{
unsigned PP;
volatile unsigned *GPTransferEntry;
static int *pDac = (int *)dmaxDacBuffer[0];
static int *pAdc = (int *)dmaxAdcBuffer[0];
// Verify if a DAC transfer completed
if( hDmaxDac->regs->DTCR0 & (1<<DAC_TCC) )
{
hDmaxDac->regs->DTCR0 = (1<<DAC_TCC);
// Save the pointer of the audio buffer that has just been transmitted
GPTransferEntry = (unsigned *)&hDmaxDac->regs->HiPriorityEventTable;
GPTransferEntry += ((*(hDmaxDac->hiTableEventEntryPtr)>>8)&0x07F);
PP = GPTransferEntry[2] >> 31;
pDac = (int *)dmaxDacBuffer[!PP];
}
// Verify if a ADC transfer completed
if( hDmaxAdc->regs->DTCR0 & (1<<ADC_TCC) )
{
hDmaxAdc->regs->DTCR0 = (1<<ADC_TCC);
// Save the pointer of the audio buffer that has just been filled
GPTransferEntry = (unsigned *)&hDmaxAdc->regs->HiPriorityEventTable;
GPTransferEntry += ((*(hDmaxAdc->hiTableEventEntryPtr)>>8)&0x07F);
PP = GPTransferEntry[2] >> 31;
pAdc = (int *)dmaxAdcBuffer[!PP];
// Copy new samples in transmit buffer
memcpy( pDac, pAdc, FRAME_SIZE*NUM_CHANNEL*2*sizeof(int) );
}
}