//--------------------------------------------------------------------------//
// UART header stuff																//
//--------------------------------------------------------------------------//
#include <services/services.h>				// system services
#include <drivers/adi_dev.h>				// device manager includes
#include <drivers/uart/adi_uart.h>				// uart driver includes

#include "ezkitutilities.h"	// EZ-Kit utilities

#include <stdio.h>
#include <string.h>

extern void SendChar(unsigned char c);		// Transmits a character via UART
extern void SendString(unsigned char s[]);	// Transmits a String via UART
extern void HextoASCII(u8	HexValue);	// Converts Hex Value to ASCII equivalent

//#define USE_DEFERRED_CALLBACKS	// enables deferred callbacks


#ifndef  __Talkthrough_DEFINED
	#define __Talkthrough_DEFINED

	
	
//--------------------------------------------------------------------------//
// ADC DAC header stuff																//
//--------------------------------------------------------------------------//
#include <sys\exception.h>
#include <cdefBF537.h>

//--------------------------------------------------------------------------//
// Symbolic constants														//
//--------------------------------------------------------------------------//
// names for registers in AD1854/AD187 converters
#define INTERNAL_ADC_L0			0
#define INTERNAL_ADC_R0			1
#define INTERNAL_DAC_L0			0
#define INTERNAL_DAC_R0			1


#define delay 0xf00

// SPORT0 word length
#define SLEN_24	0x0017

// DMA flow mode
#define FLOW_1					0x1000


//--------------------------------------------------------------------------//
// Global variables															//
//--------------------------------------------------------------------------//
extern int iChannel0LeftIn;
extern int iChannel0RightIn;
extern int iChannel0LeftOut;
extern int iChannel0RightOut;

extern int iRxBuffer1[];
extern int iTxBuffer1[];

//--------------------------------------------------------------------------//
// Prototypes																//
//--------------------------------------------------------------------------//
// in file Initialize.c
extern void Init_Flags(void);
extern void Audio_Reset(void);
extern void Init_Sport0(void);
extern void Init_DMA(void);
extern void Init_Interrupts(void);
extern void Enable_DMA_Sport0(void);

// in file Process_data.c
extern void Process_Data(void);

// in file ISRs.c
EX_INTERRUPT_HANDLER(Sport0_RX_ISR);

#endif //__Talkthrough_DEFINED

//--------------------------------------------------------------------------//
// Profiler specific header stuff																//
//--------------------------------------------------------------------------//
#define BAUD_RATE	(57600)

void initProfiler();

