#include "../common/gpTimerConfig.h"

#include <cdefbf561.h>
#include <services/services.h>

T_GP_TIMER_SPEC g_aTIMERspec[] = {
		{
			false,
			0,
			ADI_INT_TIMER0,
			0,
			0x0001,
			0x00001000,
			0x00000001,
			(unsigned long *)TMRS8_ENABLE,
			(unsigned long *)TMRS8_DISABLE,
			pTMRS8_STATUS,
			pTIMER0_CONFIG,		
			pTIMER0_COUNTER,
			pTIMER0_PERIOD,
			pTIMER0_WIDTH,
			0
		},
		{
			false,
			1,
			ADI_INT_TIMER1,
			0,
			0x0002,
			0x00002000,
			0x00000002,
			(unsigned long *)TMRS8_ENABLE,
			(unsigned long *)TMRS8_DISABLE,
			pTMRS8_STATUS,
			pTIMER1_CONFIG,		
			pTIMER1_COUNTER,
			pTIMER1_PERIOD,
			pTIMER1_WIDTH,
			0
		},
		{
			false,
			2,
			ADI_INT_TIMER2,
			0,
			0x0004,
			0x00004000,
			0x00000004,			
			(unsigned long *)TMRS8_ENABLE,
			(unsigned long *)TMRS8_DISABLE,
			pTMRS8_STATUS,
			pTIMER2_CONFIG,		
			pTIMER2_COUNTER,
			pTIMER2_PERIOD,
			pTIMER2_WIDTH,
			0
		},
		{
			false,
			3,
			ADI_INT_TIMER3,
			0,
			0x0008,
			0x00008000,
			0x00000008,			
			(unsigned long *)TMRS8_ENABLE,
			(unsigned long *)TMRS8_DISABLE,
			pTMRS8_STATUS,
			pTIMER3_CONFIG,		
			pTIMER3_COUNTER,
			pTIMER3_PERIOD,
			pTIMER3_WIDTH,
			0
		},
		{
			false,
			4,
			ADI_INT_TIMER4,
			0,
			0x0010,
			0x10000000,
			0x00010000,			
			(unsigned long *)TMRS8_ENABLE,
			(unsigned long *)TMRS8_DISABLE,
			pTMRS8_STATUS,
			pTIMER4_CONFIG,		
			pTIMER4_COUNTER,
			pTIMER4_PERIOD,
			pTIMER4_WIDTH,
			0
		},
		{
			false,
			5,
			ADI_INT_TIMER5,
			0,
			0x0020,
			0x20000000,
			0x00020000,						
			(unsigned long *)TMRS8_ENABLE,
			(unsigned long *)TMRS8_DISABLE,
			pTMRS8_STATUS,
			pTIMER5_CONFIG,		
			pTIMER5_COUNTER,
			pTIMER5_PERIOD,
			pTIMER5_WIDTH,
			0
		},
		{
			false,
			6,
			ADI_INT_TIMER6,
			0,
			0x0040,
			0x40000000,
			0x00040000,						
			(unsigned long *)TMRS8_ENABLE,
			(unsigned long *)TMRS8_DISABLE,
			pTMRS8_STATUS,
			pTIMER6_CONFIG,		
			pTIMER6_COUNTER,
			pTIMER6_PERIOD,
			pTIMER6_WIDTH,
			0
		},
		{
			false,
			7,
			ADI_INT_TIMER7,
			0,
			0x0080,
			0x80000000,
			0x00080000,						
			(unsigned long *)TMRS8_ENABLE,
			(unsigned long *)TMRS8_DISABLE,
			pTMRS8_STATUS,
			pTIMER7_CONFIG,		
			pTIMER7_COUNTER,
			pTIMER7_PERIOD,
			pTIMER7_WIDTH,
			0
		},
		{
			false,
			8,
			ADI_INT_TIMER8,
			0,
			0x0001,
			0x00001000,
			0x00000001,						
			(unsigned long *)TMRS4_ENABLE,
			(unsigned long *)TMRS4_DISABLE,
			pTMRS4_STATUS,
			pTIMER8_CONFIG,		
			pTIMER8_COUNTER,
			pTIMER8_PERIOD,
			pTIMER8_WIDTH,
			0
		},
		{
			false,
			9,
			ADI_INT_TIMER9,
			0,
			0x0002,
			0x00002000,
			0x00000002,						
			(unsigned long *)TMRS4_ENABLE,
			(unsigned long *)TMRS4_DISABLE,
			pTMRS4_STATUS,
			pTIMER9_CONFIG,		
			pTIMER9_COUNTER,
			pTIMER9_PERIOD,
			pTIMER9_WIDTH,
			0
		},
		{
			false,
			10,
			ADI_INT_TIMER10,
			0,
			0x0004,
			0x00004000,
			0x00000004,									
			(unsigned long *)TMRS4_ENABLE,
			(unsigned long *)TMRS4_DISABLE,
			pTMRS4_STATUS,
			pTIMER10_CONFIG,		
			pTIMER10_COUNTER,
			pTIMER10_PERIOD,
			pTIMER10_WIDTH,
			0
		},
		{
			false,
			11,
			ADI_INT_TIMER11,
			0,
			0x0008,
			0x00008000,
			0x00000008,									
			(unsigned long *)TMRS4_ENABLE,
			(unsigned long *)TMRS4_DISABLE,
			pTMRS4_STATUS,
			pTIMER11_CONFIG,		
			pTIMER11_COUNTER,
			pTIMER11_PERIOD,
			pTIMER11_WIDTH,
			0
		}						
	};
	
unsigned int g_nTIMERcount = sizeof(g_aTIMERspec) / sizeof(T_GP_TIMER_SPEC);		//calculate the nr of elements in the array

// for platform specific initialisation
bool timer_platformInit(T_TIMER_PLATFORMINIT_PARAM *pa_aTimerInit) {
	// nothing to do
	return true;
}

