/***************************************************************************//**
 *   @file   ADC10bitsDrv.h
 *   @brief  Fichier Entête Initialisation des périphériques de l'ADC
 *   @author Kévin MARCHAND(Kevin.marchand@intelligence-electronique.com)
********************************************************************************
 * Copyright 2014(c) PLCD, Inc.
 *
 * Initialisation des périphériques gérant l'echantillonnage et le buffering
 * de l'acquisition des entrées analogique.
 * 
 *
********************************************************************************
 *   SVN Revision: 1
*******************************************************************************/

#ifndef __ADCDRV1_H__
#define __ADCDRV1_H__ 

#define  MAX_CHNUM	 		32		//!< Highest Analog input number in Channel Scan
#define  SAMP_BUFF_SIZE	 		8		// Size of the input buffer per analog input
#define  NUM_CHS2SCAN			2		// Number of channels enabled for channel scan

#define  NUM_AN1			20
#define  NUM_AN2			21

//extern int BufferA[MAX_CHNUM+1][SAMP_BUFF_SIZE] __attribute__((space(dma),eds));//__attribute__((space(dma),aligned(256)));
//extern int BufferB[MAX_CHNUM+1][SAMP_BUFF_SIZE] __attribute__((space(dma),eds));//__attribute__((space(dma),aligned(256)));
extern __eds__ int BufferA[MAX_CHNUM + 1][SAMP_BUFF_SIZE] __attribute__((space(dma),eds,aligned(256)));
extern __eds__ int BufferB[MAX_CHNUM + 1][SAMP_BUFF_SIZE] __attribute__((space(dma),eds,aligned(256)));
extern unsigned int DmaBufferSwitch;

// Functions
void InitAdc1(void);
void InitTmr3();
void InitDma0(void);
void ProcessADCSamples(unsigned char NoChannel, __eds__ int * AdcBuffer);

#endif
