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

📄 adsp-bf533-ez-kit.h

📁 AD BF-532DSP中实现Fir滤波器的示例
💻 H
字号:
#ifndef  __BF533_EZ_KIT_DRIVER
#define  __BF533_EZ_KIT_DRIVER

//--------------------------------------------------------------------------//
// Header files																//
//--------------------------------------------------------------------------//
#include <sys\exception.h>
#include <cdefBF533.h>
#include <ccblkfn.h>
//--------------------------------------------------------------------------//
// Typedefs  																//
//--------------------------------------------------------------------------//

typedef unsigned char	UCHAR;
typedef unsigned short	USHORT;
typedef unsigned int	UINT;

/******************************************************************************


	ADSP-BF533 Support
	
	
*****************************************************************************/
USHORT	Setup_Blackfin(void);

// Begin C Definitions
#define RST_7171 		0x2 	    // encoder reset bit #2 in flashA portA
#define CFG_FLASH 		0x1      	// configure flash flag
#define en_async_mem 	0xf   		// field in asynch mem ctrl reg
#define amb0_timing 	0x7bb0
#define amb1_timing 	0x7bb0
#define amb2_timing 	0x7bb0
#define amb3_timing 	0x7bb0

#define flashA_sram 	0x20240000	// base addr
#define flashA_csio 	0x20270000	// base addr
#define portA_data_out 	0x04	// offset
#define portB_data_out 	0x05	// offset
#define portA_data_dir 	0x06	// offset
#define portB_data_dir 	0x07	// offset

/******************************************************************************


	AD1836 Support
	
	
*****************************************************************************/
#define 	AUDIO_BLOCK_SIZE	(17)

extern short * AD1836_Block_L;
extern short * AD1836_Block_R;
extern bool	 AD1836_buffer_ready;

// C Prototypes 
void	Setup_AD1836( void(*function)(short *,short *) );
void	Open_AD1836(void);



//--------------------------------------------------------------------------//
// Prototypes																//
//--------------------------------------------------------------------------//
void	Setup_ADP7171(void);
void 	Setup_PPI(void);
void 	Setup_VideoFrame_DMA( UCHAR * frame_start, USHORT X_pels, USHORT Y_pels);



char Set_RTC(	UINT Days, 
				UINT Hours, 
				UINT Minutes, 
				UINT Seconds	);

char Set_RTC_Alarm(	UINT Days, 
					UINT Hours, 
					UINT Minutes, 
					UINT Seconds	);

char Set_RTC_Stopwatch(	UINT Hours, 
						UINT Minutes, 
						UINT Seconds	);


typedef struct
{
	USHORT csel;
	USHORT ssel;
	USHORT msel;
	UCHAR  bypass;
	UCHAR  pwdn;
	UCHAR  stopck;
	UCHAR  pll_off;
	UCHAR  df;
}	cPLL_Config;
	
extern cPLL_Config	EZKIT_594C_118S;	
extern cPLL_Config	EZKIT_594C_99S;	

USHORT	Set_PLL_Frequencies( cPLL_Config * C );
				
char Set_PLL_DIV(	USHORT CSEL, 
					USHORT SSEL	);
					
char Set_PLL_CTL(	USHORT msel, 
					UCHAR bypass, 
					UCHAR pwdn, 
					UCHAR stopck, 
					UCHAR pll_off, 
					UCHAR df	);
					
char Set_PLL(USHORT CCLK, USHORT SCLK); 
             
             
//--------------------------------------------------------------------------//
// Symbolic constants														//
//--------------------------------------------------------------------------//
// addresses for Port B in Flash A
#define pFlashA_PortA_Dir	(volatile UCHAR *)0x20270006
#define pFlashA_PortA_Data	(volatile UCHAR *)0x20270004

// names for codec registers, used for sCodec1836TxRegs[]
#define DAC_CONTROL_1		0x0000
#define DAC_CONTROL_2		0x1000
#define DAC_VOLUME_0		0x2000
#define DAC_VOLUME_1		0x3000
#define DAC_VOLUME_2		0x4000
#define DAC_VOLUME_3		0x5000
#define DAC_VOLUME_4		0x6000
#define DAC_VOLUME_5		0x7000
#define ADC_0_PEAK_LEVEL	0x8000
#define ADC_1_PEAK_LEVEL	0x9000
#define ADC_2_PEAK_LEVEL	0xA000
#define ADC_3_PEAK_LEVEL	0xB000
#define ADC_CONTROL_1		0xC000
#define ADC_CONTROL_2		0xD000
#define ADC_CONTROL_3		0xE000

// names for slots in ad1836 audio frame
#define INTERNAL_ADC_L0			0
#define INTERNAL_ADC_R0			2
#define INTERNAL_DAC_L0			0
#define INTERNAL_DAC_R0			2
#define INTERNAL_ADC_L1			1
#define INTERNAL_ADC_R1			3
#define INTERNAL_DAC_L1			1
#define INTERNAL_DAC_R1			3

// size of array sCodec1836TxRegs
#define CODEC_1836_REGS_LENGTH	11

// SPI transfer mode
#define TIMOD_DMA_TX 0x0003

// SPORT0 word length
#define SLEN_24	0x0017

// DMA flow mode
#define FLOW_1	0x1000


//--------------------------------------------------------------------------//
// Global variables															//
//--------------------------------------------------------------------------//
extern int iChannel0LeftIn;
extern int iChannel0RightIn;
extern int iChannel0LeftOut;
extern int iChannel0RightOut;
extern int iChannel1LeftIn;
extern int iChannel1RightIn;
extern int iChannel1LeftOut;
extern int iChannel1RightOut;
extern volatile short sCodec1836TxRegs[];
extern volatile int iRxBuffer1[];
extern volatile int iTxBuffer1[];


#endif

⌨️ 快捷键说明

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