亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ezkitutilities.c

?? UCOS-II2.76在ADI-BF533上的移植.在UCOS-II網站提供的源碼基礎上修改了幾處匯編代碼.采用2.76版系統內核移植,在DSP++4.0上調試成功
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*********************************************************************************

Copyright(c) 2005 Analog Devices, Inc. All Rights Reserved. 

This software is proprietary and confidential.  By using this software you agree
to the terms of the associated Analog Devices License Agreement.  

$RCSfile: ezkitutilities.c,v $
$Revision: 1.15 $
$Date: 2005/08/30 18:41:29 $

Description:	EZ-Kit utility routines.  This file contains a collection
				of functions that automate typical EZ-Kit functionality, 
				including control of LEDs and push buttons.  
			
*********************************************************************************/


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

Include files

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

#include <services/services.h>		// system service includes
#include <sysreg.h>					// system config definitions
#include "ezkitutilities.h"			// EZ-Kit utility definitions 



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

Button/LED to Flag pin mappings

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

#if defined(__ADSP_EDINBURGH__)			// ADSP-BF533 EZ-Kit specific info
static ADI_FLAG_ID Button[] = {
	/* button[0] (PB1) */ ADI_FLAG_PF8, 	// EZ_FIRST_BUTTON
	/* button[1] (PB2) */ ADI_FLAG_PF9, 
	/* button[2] (PB3) */ ADI_FLAG_PF10, 
	/* button[3] (PB4) */ ADI_FLAG_PF11		// EZ_LAST_BUTTON
};
static ADI_FLAG_ID LED[] = {	//(not used on Edinburgh but needed as placeholder)
	/* led[4] */ ADI_FLAG_PF0, 				// EZ_FIRST_LED
	/* led[5] */ ADI_FLAG_PF0,
	/* led[6] */ ADI_FLAG_PF0,
	/* led[7] */ ADI_FLAG_PF0,
	/* led[8] */ ADI_FLAG_PF0,
	/* led[9] */ ADI_FLAG_PF0				// EZ_LAST_LED
};
#endif

#if defined(__ADSP_BRAEMAR__)			// ADSP-BF537 EZ-Kit specific info
static ADI_FLAG_ID Button[] = {
	/* button[0] (PB1) */ ADI_FLAG_PF2, 	// EZ_FIRST_BUTTON
	/* button[1] (PB2) */ ADI_FLAG_PF3, 
	/* button[2] (PB3) */ ADI_FLAG_PF4, 
	/* button[3] (PB4) */ ADI_FLAG_PF5		// EZ_LAST_BUTTON
};
static ADI_FLAG_ID LED[] = {
	/* led[1] */ ADI_FLAG_PF6, 				// EZ_FIRST_LED
	/* led[2] */ ADI_FLAG_PF7, 
	/* led[3] */ ADI_FLAG_PF8, 
	/* led[4] */ ADI_FLAG_PF9, 
	/* led[5] */ ADI_FLAG_PF10, 
	/* led[6] */ ADI_FLAG_PF11				// EZ_LAST_LED
};
#endif


#if defined(__ADSP_TETON__)
static ADI_FLAG_ID LED[] = {
	/* led[0]  (LED5)  */ ADI_FLAG_PF40, 	// EZ_FIRST_LED
	/* led[1]  (LED6)  */ ADI_FLAG_PF41, 
	/* led[2]  (LED7)  */ ADI_FLAG_PF42, 
	/* led[3]  (LED8)  */ ADI_FLAG_PF43, 
	/* led[4]  (LED9)  */ ADI_FLAG_PF44, 
	/* led[5]  (LED10) */ ADI_FLAG_PF45, 
	/* led[6]  (LED11) */ ADI_FLAG_PF46, 
	/* led[7]  (LED12) */ ADI_FLAG_PF47,
	/* led[8]  (LED13) */ ADI_FLAG_PF32, 
	/* led[9]  (LED14) */ ADI_FLAG_PF33, 
	/* led[10] (LED15) */ ADI_FLAG_PF34, 
	/* led[11] (LED16) */ ADI_FLAG_PF35, 
	/* led[12] (LED17) */ ADI_FLAG_PF36, 
	/* led[13] (LED18) */ ADI_FLAG_PF37, 
	/* led[14] (LED19) */ ADI_FLAG_PF38, 
	/* led[15] (LED20) */ ADI_FLAG_PF39		// EZ_LAST_LED
};

static ADI_FLAG_ID Button[] = {
	/* button[0] (SW6) */ ADI_FLAG_PF5, 	// EZ_FIRST_BUTTON
	/* button[1] (SW7) */ ADI_FLAG_PF6, 
	/* button[2] (SW8) */ ADI_FLAG_PF7, 
	/* button[3] (SW9) */ ADI_FLAG_PF8		// EZ_LAST_BUTTON
};

#endif


#define EZ_NUM_BUTTONS					(sizeof(Button)/sizeof(Button[0]))		// number of buttons
#define EZ_BUTTON_TO_FLAG(ButtonNumber) Button[ButtonNumber-EZ_FIRST_BUTTON]	// converts button number to flag ID

#define EZ_NUM_LEDS						(sizeof(LED)/sizeof(LED[0]))			// number of LEDs
#define EZ_LED_TO_FLAG(LEDNumber) 		LED[LEDNumber-EZ_FIRST_LED]				// converts LED number to flag ID


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

Peripheral ID Macros

This program works on the EZ-Kits.  The macros
below are used to identify which EZ-Kit we're targeting.  Specifically, 
the FLAG_PERIPHERAL_ID macro is set to the peripheral ID to which the 
interrupt driven push buttons are mapped.  See the adi_int.h file
within the system services library (blackfin/include/services) for
more information on peripheral IDs.  

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

#if defined(__ADSP_EDINBURGH__)
#define FLAG_PERIPHERAL_ID	(ADI_INT_PFA)
#endif

#if defined(__ADSP_BRAEMAR__)
#define FLAG_PERIPHERAL_ID	(ADI_INT_PORTFG_A)
#endif

#if defined(__ADSP_TETON__)
#define FLAG_PERIPHERAL_ID	(ADI_INT_PF0_15_A)
#endif


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

Enumerations and defines

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

#if defined(__ADSP_EDINBURGH__)			// the Edinburgh EZ-Kit uses a flash for ports

#define pFlashA_PortA_In	((volatile unsigned char *)0x20270000)	// address of flash A port A input data register
#define pFlashA_PortA_Out	((volatile unsigned char *)0x20270004)	// address of flash A port A output data register
#define pFlashA_PortA_Dir	((volatile unsigned char *)0x20270006)	// address of flash A port A direction register

#define pFlashA_PortB_In	((volatile unsigned char *)0x20270001)	// address of flash A port B input data register
#define pFlashA_PortB_Out	((volatile unsigned char *)0x20270005)	// address of flash A port B output data register
#define pFlashA_PortB_Dir	((volatile unsigned char *)0x20270007)	// address of flash A port B direction register

#define pFlashB_PortA_In	((volatile unsigned char *)0x202E0000)	// address of flash B port A input data register
#define pFlashB_PortA_Out	((volatile unsigned char *)0x202E0004)	// address of flash B port A output data register
#define pFlashB_PortA_Dir	((volatile unsigned char *)0x202E0006)	// address of flash B port A direction register

#define pFlashB_PortB_In	((volatile unsigned char *)0x202E0001)	// address of flash B port B input data register
#define pFlashB_PortB_Out	((volatile unsigned char *)0x202E0005)	// address of flash B port B output data register
#define pFlashB_PortB_Dir	((volatile unsigned char *)0x202E0007)	// address of flash B port B direction register

#endif


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

Miscellaneous defines

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

#if defined(__ADSP_EDINBURGH__)			// ADSP-BF533 EZ-Kit specific info
#define RST_7183 				(0x8) 	    //decoder reset bit #3 in flashA portA
#define PPICLK_ADV7183_SELECT 	(0x10)		//decoder clock to PPI bit #4 in flashA portA
#define ADV7183_OE_MASK 	(0x4)		//ADV7183 /OE = PF2
#define ADV7183_OE			(0)			//Index into Codec flag handler array
#define RST_7171 				(0x4)		// encoder reset
#endif


#if defined(__ADSP_TETON__)
#define ADV7183_RESET		(13)		//decoder reset bit
#define ADV7183_OE 		(2)		//ADV7183 /OE = PF2
#define ADV7183_Reset_Delay   	0x04000000	// For delay after reset
#define ADV7183_Lock   		0x0000ffff	// For startup locktime delay
#define ADV7179_RESET 		(14)		// encoder reset bit
#endif 




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

static functions


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

static void ezInitPower(u8 NumCores);			// initializes power to 600/120
static void ezInitAsync(void);			// configures async memory for use
static void ezInitFlashA(void);			// sets up the flash
static void ezInitLEDs(void);			// initialized LEDs
static void ezInitButtons(void);		// initializes buttons

static void ezTerminateLEDs(void);		// terminates LEDs
static void ezTerminateButtons(void);	// terminates buttons


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

	Function:		ezInit

	Description:	Initializes the Utilities service.  Specifically:
					- configures async memories
					- configures flash (where applicable)
					- configures power to 600/120
					- configures all LEDs
					- configures all pushbuttons
					

*********************************************************************/
void ezInit(u8 NumCores)
{
	
	// configure async memory
#if defined(__ADSP_EDINBURGH__)			// ADSP-BF533 EZ-Kit specific info
	ezInitAsync();
#endif
	
	// configure flash 
#if defined(__ADSP_EDINBURGH__)			// ADSP-BF533 EZ-Kit specific info
	ezInitFlashA();
#endif
	
	// configure power
	ezInitPower(NumCores);

	// configure LEDs
	ezInitLEDs();
	
	// configure buttons
	ezInitButtons();
	
}

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

	Function:		ezTerminate

	Description:	Terminates the utilities.  Specifically
					- terminates LEDs
					- terminates buttons

		
*********************************************************************/
void ezTerminate()
{
	// terminate LEDs
	ezTerminateLEDs();
	
	// terminate buttons
	ezTerminateButtons();
}




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

	Function:		ezEnableVideoDecoder

	Description:	Connects up the bus, sets up the video clocking and
					enables the AD7183.  

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

void ezEnableVideoDecoder(void)			// connects bus, sets up video clock and enables the 7183
{

#if defined(__ADSP_EDINBURGH__)			// ADSP-BF533 EZ-Kit specific info
#define ADV7183_OE_FLAG ADI_FLAG_PF2
	
	unsigned short tempReg;
	
	//The GPIOs of the flash are linked to the ADV7183 reset pin as well as to the 
	//switch that drives the PPI clock. De-assert the ADV7183 reset and link the ADV7183 
	//Clock "LLC1" to the Blackfin PPI clock input.  See EZ-KIT schematics for more details.
	tempReg = *pFlashA_PortA_Out;
	*pFlashA_PortA_Out = tempReg | RST_7183 | PPICLK_ADV7183_SELECT;
	
	//Setup the Blackfin PF registers
#if defined(__ADSP_EDINBURGH__) && (__SILICON_REVISION__==0xffff || __SILICON_REVISION__==0x1)
 		tempReg = *pFIO_INEN;
		*pFIO_INEN = tempReg | ADV7183_OE_MASK;
#endif
	
	// open PF2 and PF13
	adi_flag_Open(ADI_FLAG_PF2);
	adi_flag_Open(ADI_FLAG_PF13);
	
	//Blackfin PF2 pin must be set as output
	adi_flag_SetDirection(ADI_FLAG_PF2, ADI_FLAG_DIRECTION_OUTPUT);
	
	//Set the Blackfin pin PF2 to output enable the ADV7183 data bus	
	adi_flag_Clear(ADI_FLAG_PF2);
	
#endif // Edinburgh


#if defined(__ADSP_TETON__)

 	volatile long delay_time;	

	//Blackfin PF2 pin must be set as output
	adi_flag_SetDirection(ADI_FLAG_PF2, ADI_FLAG_DIRECTION_OUTPUT);

	//Blackfin PF13 pin must be set as output
	adi_flag_SetDirection(ADI_FLAG_PF13, ADI_FLAG_DIRECTION_OUTPUT);
	ssync();
	
	// set bit PF2 to disable ADV7183 outputs
	adi_flag_Set(ADI_FLAG_PF2);
	ssync();

	// clear bit PF13 to reset ADV7183 
	adi_flag_Clear(ADI_FLAG_PF13);
	ssync();

	// set bit PF13 to re-enable ADV7183 
	adi_flag_Set(ADI_FLAG_PF13);
	ssync();

	for (delay_time = 0; delay_time < ADV7183_Reset_Delay; delay_time++)
		asm("nop;");
	
	// clear bit to enable ADV7183 outputs
	adi_flag_Clear(ADI_FLAG_PF2);
	ssync();

	for (delay_time = 0; delay_time < ADV7183_Lock; delay_time++)
		asm("nop;");
				 
#endif   // Teton

}

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

	Function:		ezEnableVideoEncoder

	Description:	Enables the AD7171 or AD7179

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

void ezEnableVideoEncoder(void)		// enables the 7171
{

#if defined(__ADSP_EDINBURGH__)			// ADSP-BF533 EZ-Kit specific info
	*pFlashA_PortA_Out = 0;
	*pFlashA_PortA_Out |= RST_7171;
#endif // Edinburgh


#if defined(__ADSP_TETON__)

	// open PF14
	adi_flag_Open(ADI_FLAG_PF14);
	
	//Blackfin PF14 pin must be set as output
	adi_flag_SetDirection(ADI_FLAG_PF14, ADI_FLAG_DIRECTION_OUTPUT);
	ssync();
 
	// clear bit to reset ADV7179, Blackfin pin PF14 	
	adi_flag_Clear(ADI_FLAG_PF14);
	ssync();

	adi_flag_Set(ADI_FLAG_PF14);
	ssync();


#endif   // Teton

}




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

	Function:	ezDisableVideoEncoder

	Description:	Disables the AD7179.  

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

void ezDisableVideoEncoder(void)
{

#if defined(__ADSP_TETON__)
	adi_flag_Clear(ADI_FLAG_PF14);

	// close PF14
	adi_flag_Close(ADI_FLAG_PF14);
	
	ssync();
#endif
}


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

	Function:		ezDisableVideoDecoder

	Description:	 Disables 7183
*********************************************************************/

void ezDisableVideoDecoder(void)
{

#if defined(__ADSP_EDINBURGH__)			// ADSP-BF533 EZ-Kit specific info
	// do we need to do anything???
#endif // Edinburgh

#if defined(__ADSP_TETON__)

	// set bit PF2 to disable ADV7183 outputs
	adi_flag_Set(ADI_FLAG_PF2);
	ssync();

	// clear bit PF13 to reset ADV7183 
	adi_flag_Clear(ADI_FLAG_PF13);
	ssync();	
#endif

	// close PF2 and PF13
	adi_flag_Close(ADI_FLAG_PF2);
	adi_flag_Close(ADI_FLAG_PF13);
	
}


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

	Function:		ezTurnOnLED

	Description:	Turns an LED on.  

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

void ezTurnOnLED(u32 LEDNumber)	// turns on an LED
{

#if defined(__ADSP_EDINBURGH__)			// ADSP-BF533 EZ-Kit specific info
	switch(LEDNumber) {
		case 4:
			*pFlashA_PortB_Out |= 0x0001;
			break;
		case 5:
			*pFlashA_PortB_Out |= 0x0002;
			break;
		case 6:
			*pFlashA_PortB_Out |= 0x0004;
			break;
		case 7:
			*pFlashA_PortB_Out |= 0x0008;
			break;
		case 8:
			*pFlashA_PortB_Out |= 0x0010;
			break;
		case 9:
			*pFlashA_PortB_Out |= 0x0020;
			break;
	}
#endif // Edinburgh

#if defined(__ADSP_BRAEMAR__) || defined (__ADSP_TETON__) // ADSP-BF537 & BF561 EZ-Kit specific info
	adi_flag_Set(EZ_LED_TO_FLAG(LEDNumber));
#endif // Braemar or teton

}
			


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

	Function:		ezTurnOffLED

	Description:	Turns an LED off.  

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

void ezTurnOffLED(u32 LEDNumber)	// turns on an LED
{

#if defined(__ADSP_EDINBURGH__)			// ADSP-BF533 EZ-Kit specific info
	switch(LEDNumber) {
		case 4:
			*pFlashA_PortB_Out &= ~0x0001;
			break;
		case 5:
			*pFlashA_PortB_Out &= ~0x0002;
			break;
		case 6:
			*pFlashA_PortB_Out &= ~0x0004;
			break;
		case 7:
			*pFlashA_PortB_Out &= ~0x0008;
			break;
		case 8:
			*pFlashA_PortB_Out &= ~0x0010;
			break;
		case 9:
			*pFlashA_PortB_Out &= ~0x0020;
			break;
	}
#endif // Edinburgh

#if defined(__ADSP_BRAEMAR__) || defined (__ADSP_TETON__) // ADSP-BF537 & BF561 EZ-Kit specific info
	adi_flag_Clear(EZ_LED_TO_FLAG(LEDNumber));
#endif // Braemar or Teton

}
			

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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
粉嫩aⅴ一区二区三区四区五区| 亚洲国产精品一区二区www| 精品视频一区二区三区免费| 色综合天天综合网天天看片| 成人av免费在线观看| 国产aⅴ综合色| 99在线热播精品免费| 99久久婷婷国产综合精品| zzijzzij亚洲日本少妇熟睡| 成人av动漫在线| 色综合天天性综合| 欧美这里有精品| 欧美一区二区私人影院日本| 日韩欧美国产一区二区在线播放 | 亚洲欧美另类图片小说| 亚洲日本成人在线观看| 一区二区三区欧美日韩| 亚洲成人激情综合网| 久久国产人妖系列| 成人亚洲一区二区一| 日本高清成人免费播放| 制服丝袜日韩国产| 久久久久久亚洲综合影院红桃| 国产日韩欧美一区二区三区乱码 | 色婷婷久久久综合中文字幕| 欧美美女网站色| 日韩免费观看高清完整版| 中文天堂在线一区| 亚洲国产人成综合网站| 国产一区二区三区最好精华液| 国产成a人亚洲精| 欧美日韩中文精品| 久久在线免费观看| 洋洋av久久久久久久一区| 韩日精品视频一区| 一本到不卡免费一区二区| 制服丝袜一区二区三区| 综合自拍亚洲综合图不卡区| 美国欧美日韩国产在线播放| a4yy欧美一区二区三区| 日韩欧美国产精品一区| 亚洲精品美国一| 激情久久五月天| 欧美在线综合视频| 国产精品美女久久久久高潮| 日韩成人精品在线| 色综合天天综合狠狠| www久久精品| 首页亚洲欧美制服丝腿| 色综合天天性综合| 欧美国产1区2区| 麻豆免费看一区二区三区| 在线免费观看成人短视频| 国产日韩欧美综合一区| 九九精品视频在线看| 欧美日韩aaa| 亚洲免费毛片网站| 不卡的av在线播放| 久久精品日韩一区二区三区| 奇米精品一区二区三区在线观看一| 91一区在线观看| 国产精品免费久久久久| 国产成人精品aa毛片| 精品国产髙清在线看国产毛片| 亚洲综合小说图片| 一本色道久久综合精品竹菊| 国产精品久久久久一区二区三区| 国产精品99久久久久久久女警 | 亚洲免费观看高清完整版在线观看熊| 国产麻豆精品一区二区| 日韩精品一区二区三区四区视频| 天涯成人国产亚洲精品一区av| 欧美专区亚洲专区| 伊人色综合久久天天| 99免费精品视频| 亚洲精品视频在线| 在线免费观看不卡av| 一区二区三区欧美| 欧美日韩一区高清| 亚洲国产视频一区二区| 欧美电影影音先锋| 蜜乳av一区二区| 久久久久国产免费免费| 国产福利91精品| 亚洲欧洲av在线| 91国在线观看| 全国精品久久少妇| 久久婷婷色综合| jlzzjlzz欧美大全| 亚洲午夜精品久久久久久久久| 欧美久久高跟鞋激| 久久成人精品无人区| 国产欧美视频在线观看| 97国产精品videossex| 一二三区精品福利视频| 日韩丝袜情趣美女图片| 国产精品一区二区在线看| 国产精品毛片久久久久久| 欧美综合视频在线观看| 国内精品伊人久久久久影院对白| 国产日韩精品一区二区三区| 一本色道**综合亚洲精品蜜桃冫| 亚洲成人精品影院| 亚洲国产精品av| 欧美日韩一区在线| 国产精品一二二区| 亚洲丰满少妇videoshd| 欧美精品一区二区在线观看| 波多野洁衣一区| 美女mm1313爽爽久久久蜜臀| 中文字幕日韩一区| 日韩欧美一级片| 色综合天天在线| 狠狠色丁香久久婷婷综合丁香| 亚洲色图欧美激情| 久久久久久免费网| 欧美精品黑人性xxxx| 成人av网站免费观看| 免费高清在线视频一区·| 最新成人av在线| 久久九九国产精品| 欧美美女网站色| 色综合久久88色综合天天| 精品亚洲porn| 亚洲高清久久久| 亚洲日本在线视频观看| 久久综合九色综合久久久精品综合| 91久久久免费一区二区| 国产经典欧美精品| 久久66热re国产| 美国毛片一区二区三区| 午夜精品福利一区二区蜜股av | 中文字幕在线视频一区| 精品精品欲导航| 欧美福利一区二区| 在线精品国精品国产尤物884a| 国产成人精品影视| 国内精品久久久久影院色| 日本成人在线看| 天堂av在线一区| 亚洲高清不卡在线观看| 一区二区久久久久| 亚洲欧美视频一区| 国产精品久久久久影视| 国产精品乱人伦| 国产精品欧美一区二区三区| 久久久精品影视| 久久九九影视网| 国产精品免费视频观看| 国产精品久久久久一区| 亚洲天堂精品在线观看| 亚洲日本在线a| 亚洲一区在线观看网站| 亚洲在线成人精品| 午夜天堂影视香蕉久久| 日韩精彩视频在线观看| 日韩高清在线观看| 久久电影网站中文字幕| 国产在线播放一区三区四| 国产 日韩 欧美大片| 不卡的看片网站| 一本色道**综合亚洲精品蜜桃冫 | 欧美mv日韩mv国产| 久久精品一区蜜桃臀影院| 国产精品伦一区| 亚洲精品成人在线| 亚洲一区二区在线免费看| 日韩av一区二区三区四区| 麻豆免费精品视频| 不卡一区二区在线| 91福利在线看| 欧美一区二区三区的| 久久精品人人做人人综合| 国产精品成人午夜| 亚洲自拍另类综合| 黄一区二区三区| 白白色亚洲国产精品| 欧美日韩国产在线观看| 精品久久久网站| 自拍偷在线精品自拍偷无码专区| 一区二区三区在线视频观看| 美日韩黄色大片| www.日韩av| 日韩一区二区不卡| 国产精品久久毛片a| 亚洲福利一区二区| 国产一区二三区| 欧美午夜理伦三级在线观看| 欧美成人a视频| 亚洲精品v日韩精品| 青青草国产精品97视觉盛宴| 福利一区二区在线| 欧美精品vⅰdeose4hd| 中文字幕第一页久久| 蜜臀av一区二区三区| 91久久精品一区二区| 国产女人18水真多18精品一级做 | 久久久久88色偷偷免费 | 欧美性猛交xxxx乱大交退制版| 日韩欧美在线综合网|