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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ledbutton.c

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

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

Description:
            This is a little demo to show how to use the EZ-Kit utilities 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 Debounce_Time = 500; //value in ms

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

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_LAST_BUTTON - EZ_FIRST_BUTTON + 1)];

// interrupt service
static u8 IntMgrData[ADI_INT_SECONDARY_MEMORY * (EZ_LAST_BUTTON - EZ_FIRST_BUTTON)];


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

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

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

    Function:       ButtonCallback

    Description:    This function is a callback used to process the
                    push buttons on the EZ-Kit when they are generating
                    interrupts.

                    See the appropriate section in main() for how to set
                    up interrupt driven push buttons.

                    This function lights the LED corresponding to the button
                    that was pushed.


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

static void ButtonCallback(   // call back function specific for UART0
    void *ClientHandle,
    u32  Event,
    void *pArg)
{

    u32 Button; // button that was pushed

    // get the button that was pushed
    Button = (u32)ClientHandle;

    // light only the LED corresponding to the button that was pressed
    ezTurnOffAllLEDs();
    ezTurnOnLED((Button - EZ_FIRST_BUTTON) + EZ_FIRST_LED);

    // return
}

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

    Function:       PolledPushButtons

    Description:    This function illustrates how to use the push buttons
            on the EZ-Kit by polling them.

            To use polling, all one has to do is initialize the
            buttons which really just configures the Programmable
            Flag registers of the processor.

            This demo simply turns on the LED corresponding to the
            button that was pressed.  When the last button is
            pressed, the demo moves on to the next part.

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

void PolledPushButtons(void) {


    // counter
    volatile u32 i;

    // turn off all LEDs
    ezTurnOffAllLEDs();

    // LOOP
    while (1) {

        // FOR (all buttons except the last one)
        for (i = EZ_FIRST_BUTTON; i < EZ_LAST_BUTTON; i++) {

            // IF (the button is pushed)
            if (ezIsButtonPushed(i)) {

                // clear the latch for the button
                ezClearButton(i);

                // turn off all LEDs except the one corresponding to the button that was pushed
                ezTurnOffAllLEDs();
                ezTurnOnLED((i - EZ_FIRST_BUTTON) + EZ_FIRST_LED);

            // ENDIF
            }

        // ENDFOR
        }

        // IF (the last button is pushed)
        if (ezIsButtonPushed(EZ_LAST_BUTTON)) {

            // clear the latch for the last button and move on to the next part of the demo
            ezClearButton(EZ_LAST_BUTTON);
            break;

        // ENDIF
        }

    // ENDLOOP
    }

    // turn off all LEDs
    ezTurnOffAllLEDs();

    ezDelay(Debounce_Time);

    // return
}





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

    Function:   InterruptDrivenPushButtons

    Description:    This function illustrates how to use the push buttons
            on the EZ-Kit by using interrupts.

            To use interrupt driven push buttons, the following
            steps need performed:
                o initialize the Interrupt Manager since we'll
                    be using interrupts
                o initialize the push buttons (if not already initialized)
                o hook an interrupt handler onto the IVG that the
                    programmable flags are configured to
                o configure the SIC to pass the flag interrupts
                    to the CEC
                o use the EZ-Kit utility to enable the push button
                    interrupts

            The operation of this demo is identical to the polled
            demo except we're using interrupts this time.

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

void InterruptDrivenPushButtons(void) {


    u32 IVG;

    // counter
    volatile u32 i;


    // turn off all LEDs
    ezTurnOffAllLEDs();

    // install callbacks for each button
    for (i = EZ_FIRST_BUTTON; i <= EZ_LAST_BUTTON; i++) {
        ezClearButton(i);
        adi_flag_InstallCallback(ezButtonToFlag[i], FLAG_PERIPHERAL_ID, ADI_FLAG_TRIGGER_RISING_EDGE, TRUE, (void*)i, NULL, ButtonCallback);
    }

    // LOOP
    while (1) {

        // all the processing is done in the callback function
        // when the last is pushed we'll move on to the next part
        // of the demo

        // rather than do anything fancy to detect the last button, we'll just
        // peek and see if the LED corresponding to the last button is lit
        if (ezIsLEDOn(EZ_LAST_BUTTON - EZ_FIRST_BUTTON + EZ_FIRST_LED)) {
            break;
        }

    // ENDLOOP
    }

    // remove callbacks for each push button
    for (i = EZ_FIRST_BUTTON; i <= EZ_LAST_BUTTON; i++) {
        adi_flag_RemoveCallback(ezButtonToFlag[i]);
        
    }

    // turn off all LEDs
    ezTurnOffAllLEDs();

    ezDelay(Debounce_Time);

    // return
}




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

    Function:       LEDs

    Description:    This function illustrates how to use the LED functions
                    in the EZ-Kit utilities.

                    This demo shows how to turn LED's on, off and cycle
                    through them. It also uses polled push buttons.

                    The demo first turns off all LED's.  Then each time
                    the first button is pressed, the LED corresponding to the
                    first button is toggled.  When the second button is
                    pressed, all LED's are cycled until either the first
                    button is pressed again or until the last button is
                    pressed, at which point we move on to the next part
                    of the demo.

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

void LEDs(void) {

    // counter
    volatile u32 i;

    // turn off all LEDs
    ezTurnOffAllLEDs();

    // LOOP
    while (1) {

        // close this demo when the last push button is pressed
        if (ezIsButtonPushed(EZ_LAST_BUTTON)) {
            ezClearButton(EZ_LAST_BUTTON);      // clear the last button's latch
            break;
        }

        // IF (first button is pressed)
        if (ezIsButtonPushed(EZ_FIRST_BUTTON)) {

            // clear the first button's latch
            ezClearButton(EZ_FIRST_BUTTON);

            // toggle the first LED
            ezToggleLED(EZ_FIRST_LED);

        // ENDIF
        }

        // IF (the second button is pressed)
        if (ezIsButtonPushed(EZ_FIRST_BUTTON + 1)) {

            // clear the second button's latch
            ezClearButton(EZ_FIRST_BUTTON + 1);

            // turn off all LEDs
            ezTurnOffAllLEDs();

            // LOOP
            while (1) {

                // cycle LEDs till some other button is pressed
                ezCycleLEDs();

                // delay so we can see the LED's cycle
                for (i = 0; i < 3000000; i++) ;

                // keep looping till the first or last button pressed
                if (ezIsButtonPushed(EZ_FIRST_BUTTON) || ezIsButtonPushed(EZ_LAST_BUTTON)) break;

            // ENDLOOP
            }

        // ENDIF
        }

    // ENDLOOP
    }

    // turn off all LEDs
    ezTurnOffAllLEDs();

    ezDelay(Debounce_Time);

    // return
}




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

    Function:       main

    Description:    This function is main function of the demo.  It
                    doesn't do anything other than initialize flash
                    on the EZ-Kit and then call the demo subroutines.

                    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 i; //loop variable

    // initialize the EZ-Kit
    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));

    // initialize Buttons being used
    for (i = EZ_FIRST_BUTTON; i < EZ_NUM_BUTTONS; i++){
        ezInitButton(i);
    }
    // initialize LEDS being used
    for (i = EZ_FIRST_LED; i < EZ_NUM_LEDS; i++){
        ezInitLED(i);
    }
    
    // show how to use polled push buttons
    PolledPushButtons();

    // show how to use interrupt-driven push buttons
    InterruptDrivenPushButtons();

    // show how to use the LEDs
    LEDs();

    // terminate the flag service
    adi_flag_Terminate();

    // terminate the Interrupt Manager
    adi_int_Terminate();

    // that's all folks!
}



?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
自拍偷拍亚洲欧美日韩| 中文字幕一区二区三区不卡在线| 成人午夜视频在线观看| 亚洲高清视频中文字幕| 国产日韩精品久久久| 欧美三级视频在线| 处破女av一区二区| 久久国产视频网| 一区二区三区免费网站| 国产亚洲短视频| 91精品婷婷国产综合久久| av亚洲精华国产精华精华| 激情文学综合丁香| 天堂一区二区在线免费观看| 伊人性伊人情综合网| 国产免费久久精品| 久久综合色天天久久综合图片| 欧美性猛交xxxxxx富婆| 99国产欧美另类久久久精品| 韩国成人在线视频| 久久99国产精品麻豆| 日韩中文欧美在线| 亚洲国产成人va在线观看天堂| 国产精品久久久久久福利一牛影视| 日韩你懂的在线观看| 欧美高清hd18日本| 欧美性猛交xxxx黑人交| 欧美亚洲综合另类| 一本久道中文字幕精品亚洲嫩| 成人免费三级在线| 从欧美一区二区三区| 国产69精品久久久久毛片| 国产一区二区视频在线播放| 久久精工是国产品牌吗| 久久不见久久见免费视频7 | 首页亚洲欧美制服丝腿| 亚洲欧美国产高清| 亚洲欧美另类小说视频| 中文字幕在线不卡| 国产精品成人一区二区艾草| 亚洲欧洲国产专区| 中文字幕一区二区视频| 日韩毛片视频在线看| 亚洲欧美一区二区三区孕妇| 亚洲欧美视频在线观看| 亚洲在线观看免费视频| 香蕉久久一区二区不卡无毒影院 | 亚洲天堂中文字幕| 亚洲三级免费观看| 亚洲视频电影在线| 亚洲综合色网站| 亚洲国产成人tv| 久久精品国产免费| 国产在线一区二区| 成人av在线网| 色婷婷综合久久久中文字幕| 日本电影欧美片| 欧美久久一区二区| 日韩精品一区二区三区三区免费| 日韩欧美一区二区不卡| 国产午夜精品福利| 综合精品久久久| 亚洲韩国一区二区三区| 久久精品噜噜噜成人av农村| 国产老妇另类xxxxx| 91玉足脚交白嫩脚丫在线播放| 一本大道av伊人久久综合| 欧美日韩你懂得| 精品国产精品一区二区夜夜嗨| 国产日韩欧美激情| 亚洲乱码中文字幕| 日韩 欧美一区二区三区| 国产精品综合网| 色呦呦国产精品| 欧美一区二区久久| 国产日本欧洲亚洲| 亚洲高清免费观看高清完整版在线观看 | 亚洲高清一区二区三区| 美国十次了思思久久精品导航| 国内精品国产成人| 在线视频国内一区二区| 精品国产乱码久久久久久闺蜜 | 国产精品久久99| 亚洲成人动漫av| 国产成人在线看| 欧美在线一区二区| 国产午夜精品久久久久久久| 午夜久久电影网| 国产白丝精品91爽爽久久| 欧美日韩的一区二区| 国产欧美综合在线| 午夜欧美电影在线观看| a美女胸又www黄视频久久| 91精品国产乱码| 亚洲美女免费在线| 国产一区二区在线电影| 欧美精品黑人性xxxx| 国产精品伦一区| 久久国产日韩欧美精品| 欧美网站大全在线观看| 国产精品成人免费在线| 精品一区二区在线观看| 在线观看www91| 中文乱码免费一区二区| 久久成人免费电影| 欧美日本在线看| 亚洲视频小说图片| 国产99久久久精品| 91精品国产一区二区三区香蕉| 亚洲欧美日韩人成在线播放| 国产精品羞羞答答xxdd| 日韩一区二区视频| 亚洲在线视频免费观看| 97精品电影院| 国产精品沙发午睡系列990531| 久久er精品视频| 日韩一区二区电影在线| 亚洲成精国产精品女| 91免费小视频| 中文字幕一区二区不卡| 国产不卡视频在线播放| 国产拍揄自揄精品视频麻豆| 国产一区二区在线观看视频| 精品日本一线二线三线不卡| 欧美96一区二区免费视频| 欧美午夜精品电影| 亚洲综合精品自拍| 色激情天天射综合网| 亚洲视频一区在线观看| 色综合婷婷久久| 亚洲天堂免费看| 99久久99久久精品国产片果冻| 欧美极品另类videosde| 国产精品一区二区无线| 久久久久97国产精华液好用吗| 精一区二区三区| 2020国产成人综合网| 国产乱子轮精品视频| 久久久av毛片精品| 成人性视频免费网站| 国产精品午夜春色av| 成人精品视频.| 综合久久国产九一剧情麻豆| 91在线精品一区二区| 亚洲综合在线第一页| 欧美色综合天天久久综合精品| 亚洲电影视频在线| 91.com视频| 精品在线一区二区| 国产日韩成人精品| 91丨porny丨首页| 亚洲麻豆国产自偷在线| 欧美在线高清视频| 日韩成人午夜精品| 久久精品一区二区三区不卡 | 天堂蜜桃一区二区三区| 日韩欧美在线网站| 国产精品911| 一区二区三区在线看| 9191成人精品久久| 国产精品18久久久久久久久久久久 | 色综合久久88色综合天天| 亚洲成年人网站在线观看| 精品国产91久久久久久久妲己 | 亚洲欧洲精品一区二区三区不卡| 95精品视频在线| 日韩成人免费电影| 国产女人aaa级久久久级| 日本韩国精品在线| 日韩电影免费在线看| 国产精品免费人成网站| 欧美色图激情小说| 精品一区在线看| 亚洲三级在线看| 欧美一区二区三区四区高清| 国产精品亚洲午夜一区二区三区| 亚洲精品久久久久久国产精华液| 欧美高清视频一二三区| 大白屁股一区二区视频| 亚洲国产高清不卡| 奇米一区二区三区| 日本道色综合久久| 亚洲另类春色国产| 日韩一区二区三区三四区视频在线观看| 精品一区二区三区在线视频| 17c精品麻豆一区二区免费| 欧美日本不卡视频| 成人av免费在线观看| 日本aⅴ精品一区二区三区| 国产精品狼人久久影院观看方式| 欧美调教femdomvk| 国产a久久麻豆| 午夜久久久久久久久| 国产精品萝li| 精品久久久久久久久久久久久久久久久| 99久久精品国产网站| 免费观看在线色综合| 亚洲精品日韩一| 国产午夜精品一区二区| 91麻豆精品国产91久久久资源速度 |