ATMEL公司AT89C51SND1为主控制器MP3源代码
源代码在线查看: dac_drv.h
/*H**************************************************************************
* NAME: dac_drv.h
*----------------------------------------------------------------------------
* Copyright (c) 2003 Atmel.
*----------------------------------------------------------------------------
* RELEASE: snd1c-refd-nf-4_0_3
* REVISION: 1.7
*----------------------------------------------------------------------------
* 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 "config.h" /* system definition */
#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
extern Byte mp3_volume;
//#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_set_vol(mp3_volume); 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_ */