/*****************************************************************************
Copyright(c) 2007 Analog Devices, Inc.  All Rights Reserved. This software is 
proprietary and confidential to Analog Devices, Inc. and its licensors.
******************************************************************************

$RCSfile: audio_codec.h,v $
$Revision: 1.1 $
$Date: 2008/03/17 14:50:34 $

Project:	Audio Kit
Title:		audio_codec.h
Author(s):	SS
Revised by: 
Description:
		This file contains functions to setup and configure the audio codec. 
		The audio related functions are specifically for AD1938A 
		chip on Audio extender card and BF537 EZKit.

References:
	AD1938 Preliminary Technical Data
	ADSP-BF537 Hardware reference
	ADSP-BF537 EZ-Kit Lite Schematic



*****************************************************************************/

#ifndef _AUDIO_CODEC_H
#define _AUDIO_CODEC_H

//#include <codec.h>
#if defined (CODEC_AD1938)
//#define ADAC_BUFFER_SIZE	8192
#define ADAC_BUFFER_SIZE	4096
#define CHANNEL_NUMBER		8// multi channel
#elif defined(CODEC_AD1836)
#define ADAC_BUFFER_SIZE	8192
#define CHANNEL_NUMBER		1
#elif defined(CODEC_AD1854)
#define ADAC_BUFFER_SIZE	8192
#define CHANNEL_NUMBER		1
#endif

#define     ROOT_DIR 			"..\\"	 		// path to where the demo is installed
#define     AUDIO_DIR	        "Media\\Audio\\"	// audio files
#define	    AUDIO_LIST_FILE 	"audio_list.txt" // list of audio files to decode
#define     MAX_FILE_NAME_LEN		50
#define     MAX_PATH_NAME_LEN		200







#define ADI_DEC_MAX_NUM_TAGS	6


// Define audio output FIFO size in bytes
#define     FIFO_BUFFER_SIZE        (ADI_AACD_MAX_OUTPUT_PCM_SAMPLES_PER_CHAN<<3)

// Define number of FIFOs to use
#define     NUM_FIFO_BUFFERS        8






//extern int do_decode(void);
int do_decode(void);
void install_audiodriver(void);

#if defined (CODEC_AD1938)
void ConfigureMDMA(void);
void CopyFifoToDACbuf(char *pSrc, char *pDest,unsigned long num_of_bytes);
void Read1938AReg(ADI_DEV_DEVICE_HANDLE DevHandler);	
#endif


#endif // #ifndef _AUDIO_CODEC_H

