ATMEL全套MP3设计资料
源代码在线查看: dac_drv.h
/*H**************************************************************************
* $RCSfile: dac_drv.h,v $
*----------------------------------------------------------------------------
* Copyright (c) 2002 Atmel.
*----------------------------------------------------------------------------
* RELEASE: $Name: DEMO_FAT_1_9_9 $
* REVISION: $Revision: 1.4 $
* FILE_CVSID: $Id: dac_drv.h,v 1.4 2002/08/30 12:16:17 njourdan Exp $
*----------------------------------------------------------------------------
* PURPOSE:
* This file contains the audio dac driver definitions
*****************************************************************************/
#ifndef _DAC_DRV_H_
#define _DAC_DRV_H_
/*_____ I N C L U D E S ____________________________________________________*/
#include "..\board.h" /* board definition */
/*_____ M A C R O S ________________________________________________________*/
/*_____ D E F I N I T I O N ________________________________________________*/
/*_____ D E C L A R A T I O N ______________________________________________*/
#ifdef DAC_L3MODE
//#define Dac_emphasis(b) ((b == TRUE)? (DAC_DEEM = ON) : (DAC_DEEM = OFF))
#define dac_init() dac_l3mode_send(DAC_L3I_ADDR,193);
#define Dac_mute() dac_l3mode_send(DAC_L3I_ADDR,132);
#define Dac_unmute() dac_l3mode_send(DAC_L3I_ADDR,128);
#define Dac_overclock(b) dac_l3mode_send(DAC_L3I_ADDR+2,b?16+6:32+6);
void dac_set_vol (Byte volume);
void dac_l3mode_send (Byte addr,Byte b);
#else // DAC_L3MODE
#define Dac_emphasis(b) ((b == TRUE)? (DAC_DEEM = ON) : (DAC_DEEM = OFF))
#define Dac_mute() (DAC_MUTE=ON);
#define Dac_unmute() (DAC_MUTE=OFF);
#ifdef DAC_CLK
#define Dac_overclock(b) (DAC_CLK= b);
#else
#ifdef DAC_INVCLK
#define Dac_overclock(b) (DAC_INVCLK= ~b);
#endif
#endif
#define Dac_set_SF0() (DAC_SF0= ON);
#define Dac_set_SF1() (DAC_SF1= ON);
#define Dac_clr_SF0() (DAC_SF0= OFF);
#define Dac_clr_SF1() (DAC_SF1= OFF);
#define dac_init() ;
#define dac_set_vol(b) MP3VOL = MP3VOR = b
#endif
#endif /* _DAC_DRV_H_ */