/* This is to test the functionality of sample based mode (WINDOW=1) of
IIR Accelerator with the GUI Generated C function*/

#include<def21469.h>
#include<Cdef21469.h>
#include<signal.h>

#define WINDOW 1024
#define BIQUADS 6

extern void Init_IIR();

void IIR_DMA_ISR();

float IIR_IP_buff1[WINDOW]={
	
							#include "iir_input.dat"
};

float IIR_OP_buff1[WINDOW];

float IIR_OP1_buff1[WINDOW];



float IIR_CF_buff1[7*BIQUADS]={
	
							#include "iir_coeffs.dat"
};
							
float g={
				#include "gain.dat"
};

int main()
{

	int x;
	
	interrupt(SIG_P0,IIR_DMA_ISR);
	
	Init_IIR();
	
	while(1)
	{
		x++;
	}
		
	return 0;	
}

void IIR_DMA_ISR()
{

		int i;
		
		for(i=0;i<WINDOW;i++)
		IIR_OP1_buff1[i]=IIR_OP_buff1[i]*g;
		
		i=0;	

}