📄 auddrv.h
字号:
#ifndef __AUDDRV_H__
#define __AUDDRV_H__
#include "global.h"
#include "user_init.h"
#include "auddef.h"
#include "dsp3_def.h"
#include "dsp3_if.h"
#include "dsp3rom.h"
#include "audkernel.h"
#ifdef MP3_JPEG_COWORK //ycwen 2005/1/21 : this header file is needed
#include "fsNav.h"
#endif
/*======================================*/
/*===== Wave format related =====*/
/*======================================*/
#include "wave_fmt.h"
extern WAVFORMATMACRO wfmt;
extern UINT32 aud_frequency;
extern UINT32 aud_frame_size;
/*======================================*/
/*===== WMA format related =====*/
/*======================================*/
#ifdef SUPPORT_WMA
extern WMAHEADER wma_header;
extern BYTE wmabuf[8];
extern UINT32 ploadlen;
extern BYTE wmambn;
extern BYTE apf;
#endif
extern UINT32 pldcnt;
//#define TEST_BASS_MANAGEMENT //oliver testing
//#define TEST_BASS_COMMAND //oliver testing
/*============================================================*/
#define AUDIF_RampDown_DSP(x) \
do { \
regs0->aud_pcm_ramp_delta = 1; \
regs0->aud_pcm_ramp_cfg = 1; \
} while (0)
#define AUDIF_RampUp_DSP(x) \
do { \
regs0->aud_pcm_ramp_delta = 1; \
regs0->aud_pcm_ramp_cfg = 2; \
} while (0)
//change AUDIF_RampWait_DSP method equals to to delay_srv_10ms(3) to prevent dead loop
#define AUDIF_RampWait_DSP() delay_srv_10ms(3)
/*
#define dsp3_ramp_wait() \
do { \
polling(); \
} while (regs0->aud_pcm_ramp_value>0) \
*/
/***********************************************************************
* RISC Macro & Declaration Session
***********************************************************************/
//#ifdef SUPPORT_RECEIVER
void AUDIF_Init_NewDSPCodec(UINT32 coding_mode);
//#else
//void AUDIF_Init_NewDSPCodec(UINT16 coding_mode);
//#endif
UINT16 AUDIF_Set_FrqMsk(UINT16 mask);
UINT16 AUDIF_Get_FrqMsk(void);
void AUDIF_Set_Channel(int chn);
int AUDIF_AutoDownload_Codec(UINT8 chn);
void AUDIF_Set_CodingMode(UINT32 coding_mode);
void AUDIF_Set_SampleRate(int smp_rate);
void AUDIF_Set_SmpRate(UINT32 freq);
/*======================================*/
/*===== Media Initialization APIs ======*/
/*======================================*/
void AUDIF_Init_DSPCodingMode(void);
void AUDIF_Init_Audio(void);
void AUDIF_Init_CDDA(void);
void AUDIF_Init_DTSCD(void);
void AUDIF_Init_AC3CD(void);
void AUDIF_Init_MIDI(void);
void AUDIF_Init_WMA(void);
void AUDIF_Init_AAC(void);
void AUDIF_Init_MP3(void);
void AUDIF_Init_JPG(void);
/***********************************************************************
* DSP Macro & Declaration Session
***********************************************************************/
/*======================================*/
/*===== Flow Control APIs ======*/
/*======================================*/
int AUDIF_Set_FastForward(BYTE speed);
int AUDIF_Set_Play(void);
int AUDIF_Set_Pause(void);
int AUDIF_Set_Stop(void);
int AUDIF_Set_Continue(void);
void AUDIF_Reset_DSP(void);
void AUDIF_Wait_DSPReady(int dspChanged);
//Audio DSP SPDIF control command ( 0:OFF, 1:PCM, 2:BITSTREAM )
inline int AUDIF_Set_SPDIF(UINT32 mode);
//Audio DSP Output Mode control command
//0x01:Stereo(L/R), 0x02:L/L, 0x03:R/R, 0x04:Auto-L, 0x05:Auto-R,
//0x06:5.1 channel, 0x07:2 channel, 0x08:DownMix Lx,Rx(for ProLogic)
//0x10:RF_MODE-K3, 0x20:LINE_MODE-K2, 0x30:no vocal, 0x40:left vocal,
//0x50:right vocal, 0x60:both vocal
inline int AUDIF_Set_OutputMode(UINT32 outmode, UINT32 outparam);
/*======================================*/
/*===== Volume Related APIs ======*/
/*======================================*/
int AUDIF_Set_Volume(UINT16 x);
int AUDIF_Demute();
//Audio DSP key-shift control command ( 1~15 )
inline int AUDIF_Set_Key(UINT32 keyshift);
//Audio DSP 3D-Surround control command ( 0:off, 1~..:type )
inline int AUDIF_Set_Surround(UINT32 stype);
//Audio DSP set EQ type command (0:standard, 0x0010:user-defined )
inline int AUDIF_Set_EQType(UINT32 eqtype);
//Audio DSP ECHO control command ( level:0(off) (light)1~8(heavy) )
inline int AUDIF_Set_Echo(UINT32 delay, UINT32 decay);
inline int AUDIF_Set_EchoPara(UINT16 x);
//Audio DSP MIC control command
//threshold://(0~0xff:0x55:for Yuxing, 0x35 for small board, 0x25 for large board)
//sensitivity:(1~7:default=1)
//on:threshold=0, sensitivity=0 //off:threshold=0xff, sensitivity=0xff
inline int AUDIF_Set_MICStatus(UINT32 threshold, UINT32 sensitivity);
//Audio DSP MIC Vol(gain) control command ( 0~8(0:off) )
inline int AUDIF_Set_MICVol(UINT32 tblval);
inline int AUDIF_Set_MICVol2(UINT32 tblval);
//Pro LogicII control
inline int AUDIF_Set_ProLogicII(UINT32 mode);
/*======================================*/
/*===== Speaker Related APIs ======*/
/*======================================*/
//Audio DSP Speaker Delay control command
//spk : 1(center spk), 2(surround spk) //delay: time(ms)
inline int AUDIF_Set_SpkDelay(UINT32 spktype, UINT32 delay);
//Audio DSP Front Speaker Gain control command ( 0~8(0:off) )
inline int AUDIF_Set_FSPKGain(UINT32 gainval);
//Audio DSP Center Speaker Gain control command ( 0~8(0:off) )
inline int AUDIF_Set_CSPKGain(UINT32 gainval);
//Audio DSP Surround Speaker Gain control command ( 0~8(0:off) )
inline int AUDIF_Set_SSPKGain(UINT32 gainval);
//Audio DSP 5 Speaker Gain control command ( s:speaker_type x:gain)
inline int AUDIF_Set_5SPKGain(UINT32 spktype, UINT32 gainval);
void AUDIF_Set_SubWoof(UINT8 status); //Audio DSP Sub-woof control command //0:OFF, 1:ON
inline void AUDIF_Set_BassConfig(UINT16 spktype, INT16 setupvalue); //(UINT8 ufront, UINT8 ucenter, UINT8 usurround, UINT8 usub);
inline UINT16 AUDIF_Get_BassConfig(void);
//#define AUDIF_Set_BassMag(x) DSP_AudioIOControl(BASSMANAGEMENT,0,x)
inline int AUDIF_Flush_Buffer(void);
inline int AUDIF_Set_VCDFF2PLAY(void);
/*==============================*/
/*===== WMA related APIs =====*/
/*==============================*/
void AUDIF_WMA_Init_Parm();
/*======================================*/
/*===== Wave format related APIs =====*/
/*======================================*/
void AUDIF_LPCM_Init_Param(UINT32 mode, WAVFORMATMACRO wfmt);
int AUDIF_Init_Wave_Audio(WAVFORMATMACRO wfmt);
/*======================================*/
/*===== Message Queue APIs =====*/
/*======================================*/
#ifdef MESSAGE_QUEUE
INT32 AUDIF_Wait_GeneralAck(void); // wait_genwait_ack();
INT32 AUDIF_Wait_StateTransAck(void); // wait_statewait_ack();
void AUDIF_Polling_MQ(void);
#endif
#endif // __AUDDRV_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -