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

📄 bf535 talkthrough.h

📁 This directory contains an example ADSP-BF535 subroutine that demonstrates the initialization of t
💻 H
字号:
#ifndef  __BF535_TALKTHROUGH_DEFINED
	#define __BF535_TALKTHROUGH_DEFINED

//--------------------------------------------------------------------------//
// Header files																//
//--------------------------------------------------------------------------//
#include <sys\exception.h>
#include <signal.h>
#include <cdefbf535.h>
#include <ccblkfn.h>

//--------------------------------------------------------------------------//
// Symbolic constants														//
//--------------------------------------------------------------------------//
// names used for array sCodec_Regs
enum eCodec_Registers
{
	RESET					= 0x0000,
	MASTER_VOLUME			= 0x0200,
	HEADPHONES_VOLUME		= 0x0400,
	MASTER_VOLUME_MONO		= 0x0600,
	PC_BEEP					= 0x0a00,
	PHONE_VOLUME			= 0x0c00,
	MIC_VOLUME				= 0x0e00,
	LINE_IN_VOLUME			= 0x1000,
	CD_VOLUME				= 0x1200,
	VIDEO_VOLUME			= 0x1400,
	AUX_VOLUME				= 0x1600,
	PCM_OUT_VOLUME			= 0x1800,
	RECORD_SELECT_CONTROL	= 0x1a00,
	RECORD_GAIN				= 0x1c00,
	GENERAL_PURPOSE			= 0x2000,
	THREE_D_CONTROL			= 0x2200,
	SUBSECTION_READY		= 0x2600,
	EXTENDED_AUDIO_ID		= 0x2800,
	EXTENDED_AUDIO_CTL		= 0x2a00,
	PCM_DAC_RATE_1			= 0x2c00,
	PCM_DAC_RATE_0			= 0x3200,
	JACK_SENSE				= 0x7200,
	SERIAL_CONFIGURATION	= 0x7400,
	MISC_CONTROL_BITS		= 0x7600,
	VENDOR_ID_1				= 0x7c00,
	VENDOR_ID_2				= 0x7e00
};

// names for slots in AC97 frame
enum eAC97_Slots
{
	SLOT_TAG				= 0,
	SLOT_COMMAND_ADDRESS	= 1,
	SLOT_COMMAND_DATA		= 2,
	SLOT_PCM_LEFT			= 3,
	SLOT_PCM_RIGHT			= 4
};

// size of array sCodec_Regs
#define SIZE_OF_CODEC_REGS	50

// size of DMA descriptor
#define DESCRIPTOR_SIZE		8

// number of words per audio frame
#define AC97_FRAME_SIZE		16

//--------------------------------------------------------------------------//
// Global variables															//
//--------------------------------------------------------------------------//
extern volatile short sLeft_Channel_In, sRight_Channel_In;
extern volatile short sLeft_Channel_Out, sRight_Channel_Out;
extern volatile short sAC97_Tag_In, sAC97_Tag_Out;
extern volatile short sCodec_Regs[];
extern volatile short sSPORT0_RX_Descriptor[], sSPORT0_TX_Descriptor[];
extern volatile short sSPORT0_RX_Buffer[], sSPORT0_TX_Buffer[];
extern volatile short sNew_Sample_Received;
extern void (*pSPORT0_RX_ISR_Handling)(void);

//--------------------------------------------------------------------------//
// Prototypes																//
//--------------------------------------------------------------------------//
// in file "Initialisation.c"
void Init_Flags(void);
void Init_SPORT0(void);
void Init_Interrupts(void);
void Init_Codec(void);

// in file "Process Audio Data.c"
void SPORT0_RX_Dummy_Handler(void);
void Wait_For_Codec_Init(void);
void Process_Audio_Data(void);

// in file "ISRs.c"
EX_INTERRUPT_HANDLER(SPORT0_RX_ISR);
EX_INTERRUPT_HANDLER(SPORT0_TX_ISR);

#endif //__BF535_TALKTHROUGH_DEFINED

⌨️ 快捷键说明

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