?? codec.h
字號:
/*H***************************************************************************** $Archive:: $* $Revision:: $* $Date:: $* $Author:: $** DESCRIPTION:** USAGE/LIMITATIONS:** NOTES: Supports the Burr-Brown PCM3002 Stero Audio Codec using a McBSP* and CPLD. The CPLD handles all mode transactions and supplies* the BCKIN and LRCIN. The McBSP supplies audio data using the* BCKIN as CLKR/CLKX and LRCIN as FSR/FSX. McBSP should be * configured as follows:* 32 Bit Data * 16 MSB==0, 16 LSB==Data DX* 16 MSB==Data, 16 LSB==X DR* MSB first* FSX/FSR active low* CLKXP falling* CLKRP rising** The CPLD creates a LRCIN with a 32 BCKIN high time and 32* BCKIN low time. The PCM3002 captures the last N data bits* prior to a LRCIN edge transition. The PCM3002 sends* N data bits following a LRCIN edge transition.**H***************************************************************************/#ifndef codec_h#define codec_h/*---- compilation control switches ----------------------------------------*//****************************************************************************** INCLUDE FILES (minimize nesting of header files)*****************************************************************************//*---- system and platform files -------------------------------------------*//*---- program files -------------------------------------------------------*//****************************************************************************** FILE CONTENT*****************************************************************************//****************************************************************************** FUNCTIONAL AREA DETAIL*****************************************************************************//*---- context -------------------------------------------------------------*/#define MODE_REG0 0#define MODE_REG1 1#define MODE_REG2 2#define MODE_REG3 3#define MR0_LDL 0x0100#define MR0_AL 0x00FF#define MR0_DEFAULT 0x00FF#define MR1_LDR 0x0100#define MR1_AR 0x00FF#define MR1_DEFAULT 0x00FF#define MR2_PDAD 0x0100#define MR2_BYPS 0x0080#define MR2_PDDA 0x0040#define MR2_ATC 0x0020#define MR2_IZD 0x0010#define MR2_OUT 0x0008#define MR2_DEM_44KH_ON 0x0000#define MR2_DEM_OFF 0x0002#define MR2_DEM_48KHZ_ON 0x0004#define MR2_DEM_32KHZ_ON 0x0006#define MR2_MUT 0x0001#define MR2_DEFAULT MR2_DEM_OFF#define MR3_LOP 0x0020#define MR3_FMT_16B_R 0x0000 #define MR3_FMT_20B_R 0x0004 #define MR3_FMT_20B_L 0x0008 #define MR3_FMT_20B_I2S 0x000C #define MR3_LRP 0x0002#define MR3_DEFAULT 0x0000#define LEFT_CHANNEL 1 // Left channel only#define RIGHT_CHANNEL 2 // Right channel only#define BOTH_CHANNEL 3 // Both left and right channel/*---- data descriptions ---------------------------------------------------*/typedef struct _codec_config { int ModeReg0; int ModeReg1; int ModeReg2; int ModeReg3;}CODEC_CONFIG;typedef struct _audio_sample{ int LChOut; int RChOut; int LChIn; int RChIn;}AUDIO_SAMPLE;/*---- global function prototypes ------------------------------------------*/#ifdef GLOBAL #undef GLOBAL#endif#ifdef codec_c #define GLOBAL #else #define GLOBAL extern#endifGLOBAL int CODEC_SetConfiguration( CODEC_CONFIG *pCodeConfig );GLOBAL int CODEC_WriteMode( int ModeReg, int ModeVal );GLOBAL int CODEC_AudioSample( AUDIO_SAMPLE * pAudioSample );GLOBAL void CODEC_PlayTone( int Number, int TonePlayBk, int LR_Channel );#endif /* cpld_h --------- END OF FILE ------------------------------------*/
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -