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

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

?? gpio.c

?? 飛利浦LM3S系列ARM的庫文件,在進行arm開發時所必須的庫文件,直接加到工程中,一般不必修改.
?? C
?? 第 1 頁 / 共 3 頁
字號:
//! - \b GPIO_PIN_TYPE_OD_WPU
//! - \b GPIO_PIN_TYPE_OD_WPD
//! - \b GPIO_PIN_TYPE_ANALOG
//!
//! where \b GPIO_PIN_TYPE_STD* specifies a push-pull pin, \b GPIO_PIN_TYPE_OD*
//! specifies an open-drain pin, \b *_WPU specifies a weak pull-up, \b *_WPD
//! specifies a weak pull-down, and \b GPIO_PIN_TYPE_ANALOG specifies an
//! analog input (for the comparators).
//!
//! The pins are specified using a bit-packed byte, where each bit that is
//! set identifies the pin to be accessed, and where bit 0 of the byte
//! represents GPIO port pin 0, bit 1 represents GPIO port pin 1, etc.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPadConfigSet(unsigned long ulPort, unsigned char ucPins,
                 unsigned long ulStrength, unsigned long ulPinType)
{
    //
    // Check the arguments.
    //
    ASSERT((ulPort == GPIO_PORTA_BASE) || (ulPort == GPIO_PORTB_BASE) ||
           (ulPort == GPIO_PORTC_BASE) || (ulPort == GPIO_PORTD_BASE) ||
           (ulPort == GPIO_PORTE_BASE));
    ASSERT((ulStrength == GPIO_STRENGTH_2MA) ||
           (ulStrength == GPIO_STRENGTH_4MA) ||
           (ulStrength == GPIO_STRENGTH_8MA) ||
           (ulStrength == GPIO_STRENGTH_8MA_SC));
    ASSERT((ulPinType == GPIO_PIN_TYPE_STD) ||
           (ulPinType == GPIO_PIN_TYPE_STD_WPU) ||
           (ulPinType == GPIO_PIN_TYPE_STD_WPD) ||
           (ulPinType == GPIO_PIN_TYPE_OD) ||
           (ulPinType == GPIO_PIN_TYPE_OD_WPU) ||
           (ulPinType == GPIO_PIN_TYPE_OD_WPD) ||
           (ulPinType == GPIO_PIN_TYPE_ANALOG))

    //
    // Set the output drive strength.
    //
    HWREG(ulPort + GPIO_O_DR2R) = ((ulStrength & 1) ?
                                   (HWREG(ulPort + GPIO_O_DR2R) | ucPins) :
                                   (HWREG(ulPort + GPIO_O_DR2R) & ~(ucPins)));
    HWREG(ulPort + GPIO_O_DR4R) = ((ulStrength & 2) ?
                                   (HWREG(ulPort + GPIO_O_DR4R) | ucPins) :
                                   (HWREG(ulPort + GPIO_O_DR4R) & ~(ucPins)));
    HWREG(ulPort + GPIO_O_DR8R) = ((ulStrength & 4) ?
                                   (HWREG(ulPort + GPIO_O_DR8R) | ucPins) :
                                   (HWREG(ulPort + GPIO_O_DR8R) & ~(ucPins)));
    HWREG(ulPort + GPIO_O_SLR) = ((ulStrength & 8) ?
                                  (HWREG(ulPort + GPIO_O_SLR) | ucPins) :
                                  (HWREG(ulPort + GPIO_O_SLR) & ~(ucPins)));

    //
    // Set the pin type.
    //
    HWREG(ulPort + GPIO_O_ODR) = ((ulPinType & 1) ?
                                  (HWREG(ulPort + GPIO_O_ODR) | ucPins) :
                                  (HWREG(ulPort + GPIO_O_ODR) & ~(ucPins)));
    HWREG(ulPort + GPIO_O_PUR) = ((ulPinType & 2) ?
                                  (HWREG(ulPort + GPIO_O_PUR) | ucPins) :
                                  (HWREG(ulPort + GPIO_O_PUR) & ~(ucPins)));
    HWREG(ulPort + GPIO_O_PDR) = ((ulPinType & 4) ?
                                  (HWREG(ulPort + GPIO_O_PDR) | ucPins) :
                                  (HWREG(ulPort + GPIO_O_PDR) & ~(ucPins)));
    HWREG(ulPort + GPIO_O_DEN) = ((ulPinType & 8) ?
                                  (HWREG(ulPort + GPIO_O_DEN) | ucPins) :
                                  (HWREG(ulPort + GPIO_O_DEN) & ~(ucPins)));
}

//*****************************************************************************
//
//! Gets the pad configuration for the specified pin of the selected GPIO
//! port.
//!
//! \param ulPort base address of the selected GPIO port
//! \param ucPin pin number of the specified pin, relative to the selected
//! GPIO port.
//! \param pulStrength pointer to storage for the output drive strength
//! \param pulPinType pointer to storage for the output drive type
//!
//! This function gets the pad configuration for a specified pin on the
//! selected GPIO port. The values returned in \e eStrength and \e eOutType
//! correspond to the values used in GPIOPadConfigSet(). This function also
//! works for pins configured as input pins; however, the only meaningful
//! data returned is whether the pin is terminated with a pull-up or
//! down resistor.
//!
//! \return None
//
//*****************************************************************************
void
GPIOPadConfigGet(unsigned long ulPort, unsigned char ucPin,
                 unsigned long *pulStrength, unsigned long *pulPinType)
{
    unsigned long ulTemp1, ulTemp2, ulTemp3, ulTemp4;

    //
    // Check the arguments.
    //
    ASSERT((ulPort == GPIO_PORTA_BASE) || (ulPort == GPIO_PORTB_BASE) ||
           (ulPort == GPIO_PORTC_BASE) || (ulPort == GPIO_PORTD_BASE) ||
           (ulPort == GPIO_PORTE_BASE));
    ASSERT(ucPin < 8);

    //
    // Convert from a pin number to a bit position.
    //
    ucPin = (1 << ucPin);

    //
    // Get the drive strength for this pin.
    //
    ulTemp1 = HWREG(ulPort + GPIO_O_DR2R);
    ulTemp2 = HWREG(ulPort + GPIO_O_DR4R);
    ulTemp3 = HWREG(ulPort + GPIO_O_DR8R);
    ulTemp4 = HWREG(ulPort + GPIO_O_SLR);
    *pulStrength = (((ulTemp1 & ucPin) ? 1 : 0) | ((ulTemp2 & ucPin) ? 2 : 0) |
                    ((ulTemp3 & ucPin) ? 4 : 0) | ((ulTemp4 & ucPin) ? 8 : 0));

    //
    // Get the pin type.
    //
    ulTemp1 = HWREG(ulPort + GPIO_O_ODR);
    ulTemp2 = HWREG(ulPort + GPIO_O_PUR);
    ulTemp3 = HWREG(ulPort + GPIO_O_PDR);
    ulTemp4 = HWREG(ulPort + GPIO_O_DEN);
    *pulPinType = (((ulTemp1 & ucPin) ? 1 : 0) | ((ulTemp2 & ucPin) ? 2 : 0) |
                   ((ulTemp3 & ucPin) ? 4 : 0) | ((ulTemp4 & ucPin) ? 8 : 0));
}

//*****************************************************************************
//
//! Enables interrupts for the specified pins of the selected GPIO port.
//!
//! \param ulPort base address of the selected GPIO port
//! \param ucPins bit-packed representation of the specified pins
//!
//! Unmasks the interrupt for the specified pins.
//!
//! The pins are specified using a bit-packed byte, where each bit that is
//! set identifies the pin to be accessed, and where bit 0 of the byte
//! represents GPIO port pin 0, bit 1 represents GPIO port pin 1, etc.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPinIntEnable(unsigned long ulPort, unsigned char ucPins)
{
    //
    // Check the arguments.
    //
    ASSERT((ulPort == GPIO_PORTA_BASE) || (ulPort == GPIO_PORTB_BASE) ||
           (ulPort == GPIO_PORTC_BASE) || (ulPort == GPIO_PORTD_BASE) ||
           (ulPort == GPIO_PORTE_BASE));

    //
    // Enable the interrupts.
    //
    HWREG(ulPort + GPIO_O_IM) |= ucPins;
}

//*****************************************************************************
//
//! Disables interrupts for the specified pins of the selected GPIO port.
//!
//! \param ulPort base address of the selected GPIO port
//! \param ucPins bit-packed representation of the specified pins
//!
//! Masks the interrupt for the specified pins.
//!
//! The pins are specified using a bit-packed byte, where each bit that is
//! set identifies the pin to be accessed, and where bit 0 of the byte
//! represents GPIO port pin 0, bit 1 represents GPIO port pin 1, etc.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPinIntDisable(unsigned long ulPort, unsigned char ucPins)
{
    //
    // Check the arguments.
    //
    ASSERT((ulPort == GPIO_PORTA_BASE) || (ulPort == GPIO_PORTB_BASE) ||
           (ulPort == GPIO_PORTC_BASE) || (ulPort == GPIO_PORTD_BASE) ||
           (ulPort == GPIO_PORTE_BASE));

    //
    // Disable the interrupts.
    //
    HWREG(ulPort + GPIO_O_IM) &= ~(ucPins);
}

//*****************************************************************************
//
//! Gets interrupt status for all the pins of the selected GPIO port.
//!
//! \param ulPort base address of the selected GPIO port
//! \param bMasked specifies whether masked or raw interrupt
//! status is returned
//!
//! If \e bMasked is set as \b true, then the masked interrupt status is
//! returned; otherwise, the raw interrupt status will be returned.
//!
//! \return Returns a bit-packed byte, where each bit that is set identifies
//! an active masked or raw interrupt, and where bit 0 of the byte
//! represents GPIO port pin 0, bit 1 represents GPIO port pin 1, etc. Bits
//! 31:8 should be ignored.
//
//*****************************************************************************
long
GPIOPinIntStatus(unsigned long ulPort, tBoolean bMasked)
{
    //
    // Check the arguments.
    //
    ASSERT((ulPort == GPIO_PORTA_BASE) || (ulPort == GPIO_PORTB_BASE) ||
           (ulPort == GPIO_PORTC_BASE) || (ulPort == GPIO_PORTD_BASE) ||
           (ulPort == GPIO_PORTE_BASE));

    //
    // Return the interrupt status.
    //
    if(bMasked)
    {
        return(HWREG(ulPort + GPIO_O_MIS));
    }
    else
    {
        return(HWREG(ulPort + GPIO_O_RIS));
    }
}

//*****************************************************************************
//
//! Clears the interrupt for the specified pins of the selected GPIO port.
//!
//! \param ulPort base address of the selected GPIO port
//! \param ucPins bit-packed representation of the specified pins
//!
//! Clears the interrupt for the specified pins.
//!
//! The pins are specified using a bit-packed byte, where each bit that is
//! set identifies the pin to be accessed, and where bit 0 of the byte
//! represents GPIO port pin 0, bit 1 represents GPIO port pin 1, etc.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPinIntClear(unsigned long ulPort, unsigned char ucPins)
{
    //
    // Check the arguments.
    //
    ASSERT((ulPort == GPIO_PORTA_BASE) || (ulPort == GPIO_PORTB_BASE) ||
           (ulPort == GPIO_PORTC_BASE) || (ulPort == GPIO_PORTD_BASE) ||
           (ulPort == GPIO_PORTE_BASE));

    //
    // Clear the interrupts.
    //
    HWREG(ulPort + GPIO_O_ICR) = ucPins;
}

//*****************************************************************************
//
//! Registers an interrupt.handler for the selected GPIO port.
//!
//! \param ulPort base address of the selected GPIO port
//! \param pfIntHandler pointer to the GPIO port interrupt.handling function
//!
//! This function will ensure that the interrupt.handler specified by \e
//! pfIntHandler is called when an interrupt is detected from the selected
//! GPIO port. This function will also enable the corresponding GPIO
//! interrupt in the interrupt controller; individual pin interrupts and
//! interrupt sources must be enabled with GPIOPinIntEnable().
//!
//! \sa IntRegister() for important information about registering interrupt
//! handlers.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPortIntRegister(unsigned long ulPort, void (*pfIntHandler)(void))
{
    //
    // Check the arguments.
    //
    ASSERT((ulPort == GPIO_PORTA_BASE) || (ulPort == GPIO_PORTB_BASE) ||
           (ulPort == GPIO_PORTC_BASE) || (ulPort == GPIO_PORTD_BASE) ||
           (ulPort == GPIO_PORTE_BASE));

    //
    // Get the interrupt number associated with the specified GPIO.
    //
    ulPort = GPIOGetIntNumber(ulPort);

    //
    // Register the interrupt.handler.
    //
    IntRegister(ulPort, pfIntHandler);

    //
    // Enable the GPIO interrupt.
    //
    IntEnable(ulPort);
}

//*****************************************************************************
//
//! Removes an interrupt.handler for the selected GPIO port.
//!
//! \param ulPort base address of the selected GPIO port
//!
//! This function will unregister the interrupt.handler for the specified
//! GPIO port.  This function will also disable the corresponding
//! GPIO port interrupt in the interrupt controller; individual GPIO interrupts
//! and interrupt sources must be disabled with GPIOPinIntDisable().
//!
//! \sa IntRegister() for important information about registering interrupt
//! handlers.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPortIntUnregister(unsigned long ulPort)
{
    //
    // Check the arguments.
    //
    ASSERT((ulPort == GPIO_PORTA_BASE) || (ulPort == GPIO_PORTB_BASE) ||
           (ulPort == GPIO_PORTC_BASE) || (ulPort == GPIO_PORTD_BASE) ||
           (ulPort == GPIO_PORTE_BASE));

    //
    // Get the interrupt number associated with the specified GPIO.
    //
    ulPort = GPIOGetIntNumber(ulPort);

    //
    // Disable the GPIO interrupt.
    //
    IntDisable(ulPort);

    //
    // Unregister the interrupt.handler.
    //

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产乱人伦精品一区二区在线观看| 7777精品伊人久久久大香线蕉超级流畅| eeuss鲁一区二区三区| 欧美卡1卡2卡| 国产三级精品三级| 日韩1区2区日韩1区2区| 99国产精品久久久久久久久久 | 日本一二三不卡| 天天色 色综合| 一本色道综合亚洲| 国产日韩欧美精品在线| 日韩av中文在线观看| 色哟哟一区二区在线观看| 久久久国产一区二区三区四区小说| 亚洲影视在线观看| 成人av电影在线播放| 26uuuu精品一区二区| 婷婷夜色潮精品综合在线| 色悠久久久久综合欧美99| 国产精品网站导航| 国产精品996| 久久亚洲影视婷婷| 久久精品国产澳门| 91精品国产综合久久国产大片| **欧美大码日韩| k8久久久一区二区三区| 久久久99精品久久| 狠狠v欧美v日韩v亚洲ⅴ| 欧美一区二区三区啪啪| 丝袜美腿高跟呻吟高潮一区| 色国产综合视频| 一区二区三区在线视频观看| 99精品久久久久久| 日韩毛片在线免费观看| 国产 日韩 欧美大片| 黄网站免费久久| 国产日韩欧美激情| 亚洲欧美日韩在线不卡| eeuss影院一区二区三区| 国产精品高清亚洲| 色综合天天综合在线视频| 国产精品第五页| 色婷婷久久久亚洲一区二区三区| 国产精品成人免费精品自在线观看| kk眼镜猥琐国模调教系列一区二区 | 中文字幕在线观看一区| 粉嫩av亚洲一区二区图片| 国产精品欧美久久久久无广告| www.亚洲在线| 亚洲大尺度视频在线观看| 91精品国产欧美日韩| 精品一区中文字幕| 国产精品不卡在线观看| 日本道免费精品一区二区三区| 亚洲午夜久久久久久久久久久| 欧美一级一区二区| 国产精品一线二线三线精华| 中文字幕亚洲一区二区va在线| 色婷婷综合激情| 日本v片在线高清不卡在线观看| 欧美成人一区二区三区在线观看| 国产乱码精品一品二品| 一区二区中文字幕在线| 欧美电影在线免费观看| 韩国三级中文字幕hd久久精品| 国产精品激情偷乱一区二区∴| 欧美视频在线播放| 国产一区二区导航在线播放| 国产精品美女久久久久久久久| 欧美三级电影在线看| 国产精品一区二区在线观看不卡| 亚洲免费av高清| 欧美成人激情免费网| 91女人视频在线观看| 日本欧美在线看| 亚洲欧美综合色| 日韩精品中午字幕| 色素色在线综合| 国产一区二区看久久| 亚洲成人av电影在线| 日本一区二区不卡视频| 日韩一区二区不卡| 色哟哟精品一区| 国产麻豆成人传媒免费观看| 一区二区高清免费观看影视大全 | 久久99久久99| 亚洲精品午夜久久久| 日韩精品在线网站| 欧美性色欧美a在线播放| 丁香桃色午夜亚洲一区二区三区| 亚洲r级在线视频| 日韩理论电影院| 久久九九久久九九| 欧美一区二区三区啪啪| 欧美视频完全免费看| jvid福利写真一区二区三区| 国产精品自拍网站| 日本在线不卡视频一二三区| 亚洲男帅同性gay1069| 国产清纯白嫩初高生在线观看91| 日韩一区二区三区精品视频| 欧美亚洲一区二区三区四区| 成人av网站在线观看免费| 久久国产乱子精品免费女| 亚洲一区二区三区中文字幕| 国产精品传媒在线| 国产欧美一区视频| 久久午夜老司机| 久久久亚洲精品石原莉奈| 日韩一区二区视频在线观看| 91九色最新地址| 欧洲国产伦久久久久久久| 91蜜桃在线免费视频| 成人精品电影在线观看| 福利电影一区二区| 国产大片一区二区| 成人一级视频在线观看| 国产宾馆实践打屁股91| 丁香一区二区三区| 91在线视频观看| 99久久综合精品| 99久久精品国产精品久久| 91免费精品国自产拍在线不卡| 91色视频在线| 欧美日韩大陆在线| 日韩一区二区影院| 久久精品人人爽人人爽| 久久精品欧美日韩精品| 国产精品免费看片| 亚洲天堂网中文字| 亚洲综合av网| 奇米在线7777在线精品| 蜜桃视频第一区免费观看| 国产综合成人久久大片91| 国产精品1024| 色欧美乱欧美15图片| 欧美人动与zoxxxx乱| 精品久久五月天| 国产亲近乱来精品视频| 自拍av一区二区三区| 亚洲一线二线三线久久久| 午夜激情一区二区三区| 精品一二线国产| 91视频免费看| 日韩欧美成人一区| 国产精品网站一区| 日韩中文字幕区一区有砖一区| 韩国在线一区二区| 色一情一伦一子一伦一区| 制服丝袜亚洲播放| 国产精品三级视频| 亚洲一区二区三区四区在线| 美女视频一区在线观看| 成人动漫在线一区| 91精品国产91久久综合桃花| 欧美国产国产综合| 亚洲综合色区另类av| 韩国女主播一区| 在线看一区二区| 久久综合九色综合久久久精品综合| 亚洲欧美日韩综合aⅴ视频| 精品一二三四区| 欧美日韩精品一区二区三区四区| 久久新电视剧免费观看| 亚洲高清免费视频| 成人激情av网| 精品美女在线播放| 亚洲国产精品视频| a在线欧美一区| 久久综合久久鬼色中文字| 亚洲3atv精品一区二区三区| 国产成人欧美日韩在线电影| 欧美高清一级片在线| 亚洲精品视频免费观看| 成人免费高清视频| 欧美xxx久久| 肉肉av福利一精品导航| 色呦呦国产精品| 国产精品久久久久久久久果冻传媒 | 欧美精品一区二区三区在线| 亚洲国产精品欧美一二99| aaa亚洲精品| 国产精品久久影院| 成人综合婷婷国产精品久久| 精品日韩一区二区| 日韩高清不卡一区| 欧美精品第1页| 婷婷六月综合亚洲| 欧美浪妇xxxx高跟鞋交| 亚洲国产一区二区a毛片| 色婷婷久久99综合精品jk白丝 | 一区二区三区四区国产精品| 国产高清精品在线| 精品99一区二区| 麻豆精品视频在线| 日韩美女视频一区二区在线观看| 日本欧美加勒比视频| 宅男噜噜噜66一区二区66| 亚洲一区中文在线| 欧美日韩国产综合一区二区 |