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

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

?? ledbutton_callback.c

?? ADI公司blackfin DSP開發板BF533 EZ-KIT LITE附帶的全部原代碼
?? C
字號:
/*********************************************************************************

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: LEDButton_Callback.c,v $
$Revision: 1.1 $
$Date: 2007/03/28 17:55:36 $

Description:
			This is a little demo to show how to use the flag service for the 
			LEDs and push buttons.  
			
			On the ADSP-BF533 EZ-Kit, the push buttons on the EZ-Kit must be 
			enabled by having switches 1 through 4 turned on on the SW9 DIP switch
			on the board.  

			On the ADSP-BF537 EZ-Kit, the push buttons on the EZ-Kit must be 
			enabled by having switches 1 through 4 turned on on the SW5 DIP switch
			on the board.  

			On the ADSP-BF561 EZ-Kit, the push buttons on the EZ-Kit must be 
			enabled by having switches 1 through 4 turned on on the SW4 DIP switch
			on the board.  

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


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

Include files

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

#include "services\services.h"		// system services
#include "ezkitutilities.h"			// ezkit utilities

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

Globals

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

u32 timedelay = 250; //value in ms

u32 direction;			// direction of the LEDs 1 = Forward, 2 = Reverse

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

Static data

The LEDs and pushbuttons interface with the processor via the programmable
flags.  The EZ-Kit utilities utilize the flag service to control the 
LEDs and pushbuttons.  Because the demo uses interrupts for the 
pushbuttons, we need to give the flag service memory to control the 
interrupts, and the interrupt manager memory for secondary handlers.  Note
that if the flags were using separate IVG levels, we wouldn't need to 
provide the interrupt service with memory.  But because all the flag 
interrupts are ganged up on a single IVG, we need to supply memory for
the secondary handlers (note that one handler is installed as the primary
and the rest are secondary so we need 1 less secondary handler).  

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

// flag service
static u8 FlagServiceData[ADI_FLAG_CALLBACK_MEMORY * (EZ_NUM_BUTTONS + 1)];

// interrupt service
static u8 IntMgrData[ADI_INT_SECONDARY_MEMORY * (EZ_NUM_BUTTONS)];

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

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


/*********************************************************************
	Callback - Function that is called when callback is set

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

void static Callback(void *ClientHandle,u32  Event,void *pArg){

	u32 ButtonNum = (u32)pArg; 		// button that was pushed
	
	// Check to see what button is pressed and set the direction
	if (ButtonNum == ezButtonToFlag[EZ_FIRST_BUTTON])
		direction = 1;
			
	else if (ButtonNum == ezButtonToFlag[EZ_FIRST_BUTTON+1])
		direction = 2;

	//error case
	else
		ezTurnOnAllLEDs;
}

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

	Function:		main

	Description:	This function is main function of the demo.  Everything 
					is done in main to show exactly how to use the flag
					service.
					
					In the unlikely event we get an error somewhere, 
					this demo uses the ezErrorCheck function to light
					all the LEDs and spin in a loop.   

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

void main(void) {
	
	u32 ResponseCount;  		// number of things a service can control
	u32 ReturnValue;			// the return value from calling flag functions
	u32 currentLED;				// Current LED that is on
	u32 i;						// Loop Variable
								
	// configure ezkit
	ezInit(1);

	// initialize the Interrupt Manager
	ezErrorCheck(adi_int_Init(IntMgrData, sizeof(IntMgrData), &ResponseCount, NULL));
	
	// initialize the flag manager because the LEDs and buttons connect via flags
	ezErrorCheck(adi_flag_Init(FlagServiceData, sizeof(FlagServiceData), &ResponseCount, NULL));
	
	// configure push buttons as inputs for button 1
	adi_flag_Open(ezButtonToFlag[0]);
	adi_flag_SetDirection(ezButtonToFlag[0], ADI_FLAG_DIRECTION_INPUT);
	adi_flag_InstallCallback(ezButtonToFlag[0], FLAG_PERIPHERAL_ID, ADI_FLAG_TRIGGER_RISING_EDGE, TRUE, (void*)EZ_FIRST_BUTTON, NULL, Callback);
	
	// configure push buttons as inputs for button 2
	adi_flag_Open(ezButtonToFlag[1]);
	adi_flag_SetDirection(ezButtonToFlag[1], ADI_FLAG_DIRECTION_INPUT);
	adi_flag_InstallCallback(ezButtonToFlag[1], FLAG_PERIPHERAL_ID, ADI_FLAG_TRIGGER_RISING_EDGE, TRUE, (void*)(EZ_FIRST_BUTTON+1), NULL, Callback);
	
	// configure push buttons as inputs for button 3
	adi_flag_Open(ezButtonToFlag[2]);
	adi_flag_SetDirection(ezButtonToFlag[2], ADI_FLAG_DIRECTION_INPUT);
	
	// ADSP-BF533 specific info
	// initialize LEDS being used
#if defined(__ADSP_EDINBURGH__)
    for (i = EZ_FIRST_LED; i < EZ_NUM_LEDS; i++){
        ezInitLED(i);
    }
#endif
	
	// ADSP-BF537 & BF561 EZ-Kit specific info
	// configure all the LEDS on the ADSP-BF537 & BF561 EZ-Kit
#if defined(__ADSP_BRAEMAR__) || defined (__ADSP_TETON__)
 
	//open each flag and set the direction to an ouput
	for (i=EZ_FIRST_LED; i < EZ_LAST_LED +1; i++){
		adi_flag_Open(ezLEDToFlag[i]);
		adi_flag_SetDirection(ezLEDToFlag[i], ADI_FLAG_DIRECTION_OUTPUT);
	}
#endif
	
	//MAIN LOOP
	
	//intitalize current position
	currentLED = EZ_FIRST_LED;
	
	
	//setting direction to 0 causes nothing to happen until a push button is pressed
	direction = 0;
	while (1) {
		
		//once 1st push button is set the LEDS start moving to the right
		if (direction == 1){
			
			//Turn on the LED delay then turning it off and move on
			//
			//LEDS have to be turned on diffently for BF533EZKIT
#if defined(__ADSP_EDINBURGH__)
			ezToggleLED(currentLED);
			ezDelay(timedelay);
			ezToggleLED(currentLED);
#endif

#if defined(__ADSP_TETON__) || defined(__ADSP_BRAEMAR__)
			adi_flag_Toggle(ezLEDToFlag[currentLED]);
			ezDelay(timedelay);
			adi_flag_Toggle(ezLEDToFlag[currentLED]);
	
#endif

			//Once the LED reaches the last in the chain reset currentLED to the first LED
			if (currentLED == EZ_LAST_LED)
				currentLED = EZ_FIRST_LED;
			else{
				currentLED++;
			}
		}
		
		//once 1st push button is set the LEDS start moving to the left
		if (direction == 2){
			
			//Turn on the LED delay then turning it off and move on
			//
			//LEDS have to be turned on diffently for BF533EZKIT
#if defined(__ADSP_EDINBURGH__)
			ezToggleLED(currentLED);
			ezDelay(timedelay);
			ezToggleLED(currentLED);
#endif


#if defined(__ADSP_TETON__) || defined(__ADSP_BRAEMAR__)
			adi_flag_Toggle(ezLEDToFlag[currentLED]);
			ezDelay(timedelay);
			adi_flag_Toggle(ezLEDToFlag[currentLED]);
	
#endif
			//Once the LED reaches the first in the chain reset currentLED to the last LED
			if (currentLED == EZ_FIRST_LED){
				currentLED = EZ_LAST_LED;
			}
				else{
				currentLED--;
			}	
		}
		
		//check if button 3 is pressed and exit if it is pressed
		adi_flag_Sense(ezButtonToFlag[2],&ReturnValue);
		if (ReturnValue){
			break;	
		}
		
	// ENDLOOP
	}
	
	// remove callbacks for each push button
	adi_flag_RemoveCallback(ezButtonToFlag[0]);
	adi_flag_RemoveCallback(ezButtonToFlag[1]);
	
	
	// terminate the flag service
	adi_flag_Terminate();
	
	//terminate the interupt service
	adi_int_Terminate();
	
	// that's all folks!
}


?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本一本大道香蕉久在线精品 | 日韩精品1区2区3区| 欧美一区二区免费观在线| 国产在线精品视频| 亚洲aaa精品| 国产欧美一区二区精品性| 欧美手机在线视频| 成人永久aaa| 日本亚洲三级在线| 一区二区三区日韩欧美| 久久人人超碰精品| 日韩欧美中文一区二区| 色综合久久99| a在线欧美一区| 国产精品资源在线看| 日韩 欧美一区二区三区| 亚洲视频图片小说| 国产亚洲va综合人人澡精品| 欧美中文字幕一区二区三区 | 日韩欧美中文一区| 91美女在线观看| 国产91对白在线观看九色| 免费在线看成人av| 亚洲精品国产视频| 国产欧美在线观看一区| 日韩免费电影网站| 91精品一区二区三区久久久久久| 91社区在线播放| 成人aa视频在线观看| 国产乱码精品一区二区三| 青娱乐精品视频| 亚洲va欧美va国产va天堂影院| 国产精品嫩草久久久久| 国产丝袜美腿一区二区三区| 欧美大片拔萝卜| 日韩一区二区三区四区五区六区| 欧美色综合影院| 欧美制服丝袜第一页| 色激情天天射综合网| 不卡的电视剧免费网站有什么| 国产精品亚洲午夜一区二区三区| 精品在线视频一区| 加勒比av一区二区| 久久97超碰国产精品超碰| 美女视频一区二区| 久久国产人妖系列| 久草中文综合在线| 国产乱人伦偷精品视频不卡 | 国产一区二区三区视频在线播放| 美女视频网站久久| 国产在线国偷精品免费看| 久久99久国产精品黄毛片色诱| 另类小说色综合网站| 美女视频第一区二区三区免费观看网站| 亚洲午夜电影在线观看| 亚洲444eee在线观看| 亚洲va国产va欧美va观看| 日韩和欧美一区二区| 蜜臀久久99精品久久久久宅男 | 国产成人综合精品三级| 丁香六月久久综合狠狠色| 成人激情小说乱人伦| 91在线国内视频| 欧美性猛交xxxx乱大交退制版| 欧美日本在线一区| 精品欧美一区二区久久 | 日本在线观看不卡视频| 日韩在线观看一区二区| 蜜乳av一区二区| 懂色av噜噜一区二区三区av| 成人av网址在线观看| 91香蕉国产在线观看软件| 欧美日韩视频在线观看一区二区三区 | 一区二区在线观看不卡| 一区二区三区四区av| 日本午夜一本久久久综合| 国产尤物一区二区| 色哟哟精品一区| 欧美一级欧美三级在线观看| 国产午夜精品一区二区| 亚洲免费av在线| 蜜臀av一区二区在线观看| 成人禁用看黄a在线| 欧美视频一区二区三区四区 | 国产美女娇喘av呻吟久久| 成人av片在线观看| 7777女厕盗摄久久久| 欧美激情中文字幕| 亚洲成人在线观看视频| 丁香天五香天堂综合| 欧美日韩视频在线第一区| 久久久久久免费网| 亚洲成人动漫av| 成人妖精视频yjsp地址| 欧美裸体bbwbbwbbw| 中文字幕av一区二区三区| 亚洲电影中文字幕在线观看| 激情都市一区二区| 在线观看日产精品| 国产色一区二区| 免费看欧美女人艹b| av一本久道久久综合久久鬼色| 日韩一级高清毛片| 一区二区三区四区乱视频| 国产寡妇亲子伦一区二区| 91小视频免费看| 国产欧美日韩激情| 男女男精品网站| 欧美三区免费完整视频在线观看| 国产亚洲一区二区三区四区| 天天色天天操综合| 91在线免费看| 国产精品丝袜一区| 精品中文字幕一区二区| 欧美电影一区二区| 亚洲免费毛片网站| 粉嫩久久99精品久久久久久夜| 欧美高清视频不卡网| 亚洲欧美日韩国产另类专区| 国产东北露脸精品视频| 欧美一级高清大全免费观看| 一区二区三区中文字幕精品精品| 国产成人av影院| 久久综合久久综合久久| 日韩综合在线视频| 欧美情侣在线播放| 亚洲综合男人的天堂| 91在线小视频| 中文字幕日本不卡| 成人一区二区在线观看| 久久久久国产免费免费 | 久久激五月天综合精品| 欧美精品一二三区| 亚洲成人午夜电影| 欧美日韩免费观看一区二区三区| **性色生活片久久毛片| 丰满亚洲少妇av| 中文字幕+乱码+中文字幕一区| 国产一区视频导航| 精品国产欧美一区二区| 精品亚洲免费视频| 久久日韩粉嫩一区二区三区| 国产精品一区二区久激情瑜伽 | 粉嫩嫩av羞羞动漫久久久 | 色吊一区二区三区| 亚洲精品欧美二区三区中文字幕| www.色精品| 亚洲人一二三区| 日本高清视频一区二区| 一区二区三区欧美视频| 欧美性猛片xxxx免费看久爱| 亚洲国产精品久久久久秋霞影院| 欧美日韩国产片| 日本午夜精品视频在线观看| 欧美大片在线观看| 国产福利精品导航| 国产精品二区一区二区aⅴ污介绍| aaa欧美大片| 亚洲韩国一区二区三区| 欧美美女直播网站| 久久激五月天综合精品| 欧美激情中文不卡| 91黄色免费看| 蜜桃视频一区二区三区| 久久日一线二线三线suv| 风间由美一区二区三区在线观看| 中文字幕二三区不卡| 在线精品视频免费观看| 天堂久久一区二区三区| 欧美r级在线观看| 国产suv精品一区二区6| 亚洲青青青在线视频| 56国语精品自产拍在线观看| 久久99久国产精品黄毛片色诱| 国产精品欧美久久久久无广告| 色综合久久久久久久久久久| 日韩精品色哟哟| 国产亲近乱来精品视频| 欧美午夜视频网站| 极品少妇xxxx精品少妇偷拍| 日韩一区欧美小说| 欧美精品乱人伦久久久久久| 国产美女精品一区二区三区| 一区二区欧美在线观看| 日韩美一区二区三区| av成人老司机| 蜜桃91丨九色丨蝌蚪91桃色| 国产精品日日摸夜夜摸av| 欧美日韩电影一区| 懂色av中文字幕一区二区三区| 午夜精品爽啪视频| 欧美国产日韩一二三区| 911精品国产一区二区在线| 国产.欧美.日韩| 日韩成人一级大片| 中文字幕日本不卡| www成人在线观看| 欧美日韩一区小说| 成人国产精品免费观看动漫| 日本欧美韩国一区三区|