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

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

?? gpio.c

?? 基于 Cortex-M3 (ARM) 內(nèi)核使用之 uC/OS-II 作業(yè)系統(tǒng),此例程可移植于 Cortex-M3 (ARM)內(nèi)核的微處理器上的應(yīng)用,于 Keil MDK 3.15b以上 工程編譯,而
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
//! - \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.
    //

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人欧美一区二区三区小说| 久久成人免费日本黄色| 亚洲一区二区免费视频| 国产精品资源在线| 欧美日韩高清一区二区| 中文字幕一区免费在线观看| 日产国产高清一区二区三区| 91小视频在线| 欧美xxxxxxxxx| 亚洲一区二区在线播放相泽| 国产91精品在线观看| 日韩一级片在线观看| 亚洲国产视频一区| av电影天堂一区二区在线| 精品免费日韩av| 青青草原综合久久大伊人精品优势 | 亚洲综合久久久久| www.一区二区| 欧美极品少妇xxxxⅹ高跟鞋| 另类综合日韩欧美亚洲| 欧美剧情片在线观看| 亚洲男人的天堂在线观看| 国产在线国偷精品免费看| 欧美高清视频不卡网| 一区二区在线电影| 色综合天天性综合| 久久久久国产精品麻豆ai换脸| 日韩av不卡在线观看| 欧美日韩日日骚| 亚洲综合视频在线观看| 99re成人在线| 亚洲欧美区自拍先锋| 盗摄精品av一区二区三区| 久久精品亚洲精品国产欧美kt∨| 国精产品一区一区三区mba桃花| 日韩欧美在线网站| 奇米一区二区三区av| 日韩午夜小视频| 裸体健美xxxx欧美裸体表演| 欧美大度的电影原声| 国产一区二区不卡在线| 日韩精品一区二区三区三区免费| 久久99久久久欧美国产| www久久久久| 成人三级伦理片| 国产精品美日韩| 色婷婷综合久久久久中文一区二区 | 久久午夜羞羞影院免费观看| 麻豆成人久久精品二区三区红 | 欧美人xxxx| 免费xxxx性欧美18vr| 26uuu亚洲| 风间由美一区二区av101| 国产三级欧美三级日产三级99 | 91老司机福利 在线| 亚洲精品免费播放| 欧美日本在线观看| 国内精品在线播放| 国产精品美女一区二区三区 | 中文字幕一区二区三区在线播放| 91一区二区在线观看| 日日夜夜免费精品| 久久精品一区二区三区四区| 99热精品国产| 日本女人一区二区三区| 国产精品午夜免费| 91精品免费在线观看| 成人免费福利片| 亚洲成人av免费| 久久综合精品国产一区二区三区| 97久久精品人人澡人人爽| 午夜一区二区三区在线观看| 日韩欧美不卡一区| 91丨porny丨国产入口| 日韩中文字幕麻豆| 亚洲欧洲另类国产综合| 91精品国产91久久综合桃花| zzijzzij亚洲日本少妇熟睡| 免费高清不卡av| 亚洲欧美偷拍另类a∨色屁股| 日韩女优毛片在线| 欧美在线观看视频一区二区三区 | 日韩欧美电影一区| 91美女片黄在线观看91美女| 免费高清成人在线| 一级精品视频在线观看宜春院| 久久久久久久久一| 91 com成人网| 91久久精品一区二区三| 福利一区二区在线| 久久电影网站中文字幕| 婷婷综合另类小说色区| 亚洲视频资源在线| 中文字幕精品在线不卡| 欧美变态tickle挠乳网站| 欧美体内she精视频| 成人av在线资源网站| 久久99精品国产麻豆婷婷洗澡| 亚洲一区欧美一区| 亚洲欧洲99久久| 欧美激情中文不卡| 久久精品水蜜桃av综合天堂| 日韩午夜激情免费电影| 欧美日韩三级一区二区| 欧日韩精品视频| 一本久道久久综合中文字幕| 不卡在线观看av| 国产乱码精品一区二区三区五月婷 | 亚洲日本护士毛茸茸| 欧美国产欧美综合| 久久色中文字幕| 欧美大度的电影原声| 91精品国产福利| 欧美乱妇15p| 欧美日韩在线电影| 欧美日韩和欧美的一区二区| 91豆麻精品91久久久久久| 99久久精品国产一区| 91片黄在线观看| 色婷婷av一区二区三区大白胸 | 成人免费av资源| 粉嫩嫩av羞羞动漫久久久| 国产激情一区二区三区| 九九视频精品免费| 精品一区二区在线视频| 久久精品理论片| 国产精品亚洲视频| 国产成人综合在线| 97国产一区二区| 成人高清免费在线播放| 99久久精品一区| 色久综合一二码| 欧美在线观看视频一区二区三区| 欧美日韩中字一区| 欧美一级一区二区| 久久网这里都是精品| 国产精品久久久久久一区二区三区| 亚洲视频一区二区在线| 亚洲第一在线综合网站| 三级欧美在线一区| 黄色小说综合网站| 本田岬高潮一区二区三区| 色诱亚洲精品久久久久久| 欧美精品免费视频| 精品少妇一区二区三区| 中文一区一区三区高中清不卡| 一区二区三区中文字幕电影| 天使萌一区二区三区免费观看| 久久精品国产久精国产| 成人免费毛片片v| 欧美亚洲免费在线一区| 欧美成人欧美edvon| 国产精品欧美久久久久无广告 | 久久久久久夜精品精品免费| 国产日韩欧美a| 亚洲高清一区二区三区| 久久黄色级2电影| 色悠久久久久综合欧美99| 欧美一级一级性生活免费录像| 国产午夜精品在线观看| 亚洲午夜免费福利视频| 国产精品综合在线视频| 欧美少妇性性性| 国产亚洲欧美色| 天堂va蜜桃一区二区三区| 成人精品一区二区三区四区| 欧美日韩国产成人在线免费| 国产日本欧洲亚洲| 婷婷六月综合网| proumb性欧美在线观看| 日韩视频免费观看高清完整版在线观看 | 亚洲精品菠萝久久久久久久| 久久99久久精品欧美| 色av一区二区| 中文字幕不卡的av| 精品一区二区三区免费观看 | 成人av在线一区二区三区| 日韩欧美在线一区二区三区| 亚洲精品成人悠悠色影视| 国产精品亚洲а∨天堂免在线| 在线综合亚洲欧美在线视频| 亚洲男女一区二区三区| 国产精品一区二区免费不卡| 91精品婷婷国产综合久久| 亚洲激情图片小说视频| 大尺度一区二区| 久久午夜羞羞影院免费观看| 美女国产一区二区三区| 欧美丝袜丝交足nylons| 中文字幕一区二区三区视频| 丁香激情综合五月| 久久久不卡网国产精品一区| 久久国产剧场电影| 欧美一级二级在线观看| 亚州成人在线电影| 欧美日韩亚洲综合一区二区三区| 亚洲黄一区二区三区| 99国产一区二区三精品乱码| 国产精品嫩草影院com| av男人天堂一区|