⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tda7496.h

📁 GM5621原代码
💻 H
字号:
/*
   $Workfile:   TDA7496.h  $
   $Revision:   1.0  $
   $Date:   May 17 2006 01:08:34  $
*/
#if (USE_AUDIO && USE_GSEL_DRVR_MODEL && (DEV_AUDIO_DECODER == DEV_TDA7496))
#ifndef __TDA7496_H__
   #define __TDA7496_H__
//******************************************************************************
//
//              Copyright (C) 2002.  GENESIS MICROCHIP INC.
//      All rights reserved.  No part of this program may be reproduced.
//
//     Genesis Microchip Inc., 165 Commerce Valley Dr. West
//     Thornhill, Ontario, Canada, L3T 7V8
//
//==============================================================================
//
// MODULE:       TDA7496.h
//
// USAGE:      Header file for "TDA7496" audio decoder
//
//******************************************************************************


//******************************************************************************
//  G L O B A L    D E F I N I T I O N S
//******************************************************************************
WORD TDA7496_AudioDecoderEntry(BYTE func, void *p1, void *p2);


#define AUDIO_INIT			1
#define AUDIO_STANDBY_ON 	1
#define AUDIO_STANDBY_OFF 	0
#define AUDIO_MUTE_ON		1
#define AUDIO_UNMUTE		0
#define PWM1_VOLUME			1


#if (AUDIO_VOLUME_CTRL==PWM1_VOLUME)
	#define AUDIO_VOL_Ctrl_Setup1()		gm_WriteRegByte(PWM1_CONFIG, PWM1_TCLK_DIV|PWM1_CLKSEL)
	#define AUDIO_VOL_Ctrl_Setup2()		gm_WriteRegByte(PWM1_PERIOD, 0xFF)
	#define AUDIO_PWM_PULSE_VALUE(a)	gm_WriteRegByte(PWM1_PULSE,a)
	#define AUDIO_GET_PWM_PULSE_VALUE() gm_ReadRegByte(PWM1_PULSE)
	#define AUDIO_VOL_PWM_MAX	0x60
	#define AUDIO_VOL_PWM_MIN	0x0
#else
	#define AUDIO_VOL_Ctrl_Setup1()
	#define AUDIO_VOL_Ctrl_Setup2()
	#define AUDIO_PWM_PULSE_VALUE(a)	
	#define AUDIO_GET_PWM_PULSE_VALUE() 0
	#define AUDIO_VOL_PWM_MAX	0x0
	#define AUDIO_VOL_PWM_MIN	0x0
#endif

#if (AUDIO_STANDBY_CTRL==6)		//define Audio Standby control pin as GPIO22
	#define AUD_STBY_Ctrl_Setup1()	gm_SetRegBitsByte(RCLK_PLL, SEL_CLK2)  	   //TEST_CLK_EN=1,  VBUFC_RPLL outputs GPO_6
	#define AUD_STBY_Ctrl_Setup2()	gm_SetRegBitsByte(RPLL_TEST_CONTROL, 0x7)  //TEST_CLK_EN=1,  VBUFC_RPLL outputs GPO_6
	#if (AUDIO_STANDBY_POLARITY)		//1: Standby in High level
  	#define AUD_STBY_ON()			gm_SetRegBitsByte(GPOUTPUT2,VBUFC_OUT )
	#define AUD_STBY_OFF()			gm_ClearRegBitsByte(GPOUTPUT2,VBUFC_OUT )
	#else								//0: Standby in Low level
  	#define AUD_STBY_ON()			gm_ClearRegBitsByte(GPOUTPUT2,VBUFC_OUT )
	#define AUD_STBY_OFF()			gm_SetRegBitsByte(GPOUTPUT2,VBUFC_OUT )
	#endif
#else
	#define AUD_STBY_Ctrl_Setup1()	
	#define AUD_STBY_Ctrl_Setup2()	
  	#define AUD_STBY_ON()
	#define AUD_STBY_OFF()
#endif 	//(AUDIO_STANDBY_CTRL)
	

#if (AUDIO_MUTE_CTRL==22)		//define Audio Mute control pin as GPIO6
	#define	AUD_Mute_Ctrl_Setup()	gm_SetRegBitsByte(LBADC_OUT_EN, LBADC_OUT3_EN)
	#if AUDIO_MUTE_POLARITY		//1: Mute in High level
  	#define AUD_Mute_ON()			gm_SetRegBitsByte(GPOUTPUT2, LBADC_OUT3)
	#define AUD_UnMute()			gm_ClearRegBitsByte(GPOUTPUT2, LBADC_OUT3)
	#define AUD_Get_Mute_Status()	(gm_ReadRegByte(GPOUTPUT2)& LBADC_OUT3) ? AUDIO_MUTE_ON : AUDIO_UNMUTE
	#else						//0: Mute in Low level
  	#define AUD_Mute_ON()			gm_ClearRegBitsByte(GPOUTPUT2, LBADC_OUT3)
	#define AUD_UnMute()			gm_SetRegBitsByte(GPOUTPUT2, LBADC_OUT3)
	#define AUD_Get_Mute_Status()	(gm_ReadRegByte(GPOUTPUT2)& LBADC_OUT3) ? AUDIO_UNMUTE : AUDIO_MUTE_ON
	#endif //AUDIO_MUTE_POLARITY	
#else
	#define	AUD_Mute_Ctrl_Setup()
  	#define AUD_Mute_ON()		
	#define AUD_UnMute()		
	#define AUD_Get_Mute_Status()	0
#endif //(AUDIO_MUTE_CTRL)		//define Audio Mute control pin as GPIO22


   
#endif // __TDA7496_H__
#endif //(USE_AUDIO && USE_GSEL_DRVR_MODEL && (DEV_AUDIO_DECODER == DEV_TDA7496))
//*********************************  END  **************************************

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -