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

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

?? gpio.c

?? freertosV4.40 是一種small的嵌入式系統。利于嵌入式開好者入門學習嵌入式操作系統。通過對于源碼的學習可以很好的掌握freertos的運行機制。
?? C
?? 第 1 頁 / 共 3 頁
字號:
//!
//! 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.
//
//*****************************************************************************
#if defined(GROUP_padconfigset) || defined(BUILD_ALL) || defined(DOXYGEN)
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)));
}
#endif

//*****************************************************************************
//
//! 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
//
//*****************************************************************************
#if defined(GROUP_padconfigget) || defined(BUILD_ALL) || defined(DOXYGEN)
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));
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_pinintenable) || defined(BUILD_ALL) || defined(DOXYGEN)
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;
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_pinintdisable) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_pinintstatus) || defined(BUILD_ALL) || defined(DOXYGEN)
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));
    }
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_pinintclear) || defined(BUILD_ALL) || defined(DOXYGEN)
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;
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_portintregister) || defined(BUILD_ALL) || defined(DOXYGEN)
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);
}
#endif

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
#if defined(GROUP_portintunregister) || defined(BUILD_ALL) || defined(DOXYGEN)
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.
    //
    IntUnregister(ulPort);
}
#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
洋洋av久久久久久久一区| 欧美激情中文字幕| 亚洲国产中文字幕| 精品视频一区二区三区免费| 亚洲一区二区五区| 日韩欧美一二三| 韩国精品久久久| 中文字幕免费不卡| 91久久线看在观草草青青| 亚洲成精国产精品女| 日韩美女视频一区二区在线观看| 久久成人综合网| 国产色产综合色产在线视频| 色综合久久中文综合久久97| 天天亚洲美女在线视频| 久久日一线二线三线suv| 99久久免费精品高清特色大片| 一区二区在线电影| 日韩欧美一区二区免费| 99在线视频精品| 视频一区视频二区中文字幕| 国产网红主播福利一区二区| 欧美性感一区二区三区| 久久精品久久精品| 亚洲人成网站在线| 日韩欧美在线综合网| 成人app在线| 免费观看久久久4p| 亚洲人成精品久久久久久| 欧美一区二区视频观看视频| jlzzjlzz亚洲日本少妇| 麻豆91免费看| 亚洲视频免费在线观看| 精品国内片67194| 91丨九色丨国产丨porny| 卡一卡二国产精品| 一区二区国产视频| 久久精品一二三| 欧美一区二区三区日韩| 99在线精品一区二区三区| 久久精品国产澳门| 一区二区三区高清| 亚洲国产精品ⅴa在线观看| 91精品婷婷国产综合久久性色| 成人永久aaa| 黄色成人免费在线| 日韩极品在线观看| 亚洲欧美欧美一区二区三区| 久久午夜色播影院免费高清| 91精品国产91久久久久久最新毛片 | 国产成人精品免费视频网站| 亚洲成人免费影院| 国产精品福利一区二区三区| 久久免费偷拍视频| 日韩一区二区三| 欧美精品乱码久久久久久按摩 | 337p粉嫩大胆噜噜噜噜噜91av| 欧美天天综合网| 2023国产一二三区日本精品2022| 色综合久久久久| thepron国产精品| 国产传媒欧美日韩成人| 久久精品久久久精品美女| 日本欧美在线看| 婷婷丁香激情综合| 婷婷六月综合网| 亚洲午夜激情网页| 日韩精品专区在线影院观看| 91麻豆精品国产91久久久久久| 欧美日韩一区不卡| 精品污污网站免费看| 91久久精品一区二区三| 色综合天天综合网国产成人综合天| 欧美亚洲国产一区二区三区va | 91久久线看在观草草青青| 97se亚洲国产综合自在线不卡| 懂色av中文字幕一区二区三区| 国产精品2024| 国v精品久久久网| 成人精品小蝌蚪| 成人自拍视频在线观看| 成人夜色视频网站在线观看| 国产99久久久国产精品免费看| 国产成人av资源| 成人亚洲一区二区一| av一二三不卡影片| 色婷婷一区二区| 欧美日韩亚洲国产综合| 欧美精品第1页| 精品美女一区二区| 久久久99精品免费观看不卡| 国产精品天美传媒沈樵| 亚洲人成精品久久久久久| 亚洲一二三区在线观看| 蜜桃av噜噜一区| 国产一区二区在线观看视频| 粉嫩一区二区三区在线看| 91视频免费看| 9191久久久久久久久久久| 欧美成人午夜电影| 中文字幕一区在线| 亚洲午夜久久久久| 麻豆免费精品视频| 成人午夜免费电影| 91成人看片片| 欧美α欧美αv大片| 日韩一区在线免费观看| 亚洲18女电影在线观看| 国产精品综合二区| 欧美在线制服丝袜| 欧美mv和日韩mv的网站| 中文字幕亚洲不卡| 青草国产精品久久久久久| 成人午夜激情在线| 欧美片网站yy| 欧美激情一区二区三区| 亚洲人成亚洲人成在线观看图片| 亚洲午夜久久久久中文字幕久| 国产一区二区三区免费播放| 97精品国产97久久久久久久久久久久| 欧美日韩高清一区| 欧美国产禁国产网站cc| 五月综合激情婷婷六月色窝| 国产成人在线观看免费网站| 欧美三级日本三级少妇99| 国产亚洲综合在线| 日日噜噜夜夜狠狠视频欧美人 | 日本午夜精品视频在线观看 | 久久婷婷国产综合精品青草| 日日夜夜免费精品| thepron国产精品| 精品少妇一区二区三区免费观看 | 日本一区二区三区国色天香 | 国产成人三级在线观看| 欧美日韩中文字幕一区| 欧美韩国日本一区| 蜜臂av日日欢夜夜爽一区| 欧美亚洲国产bt| 欧美极品aⅴ影院| 激情图区综合网| 欧美日韩aaaaa| 亚洲精品中文字幕在线观看| 国产大陆亚洲精品国产| 欧美一激情一区二区三区| 亚洲激情第一区| av一本久道久久综合久久鬼色| 欧美成人一区二区| 视频一区二区国产| 欧美午夜精品久久久久久超碰 | 国产精品视频看| 国产一区二区毛片| 欧美一区二视频| 五月天精品一区二区三区| 91福利视频久久久久| 亚洲女厕所小便bbb| 99久久精品国产网站| 国产婷婷色一区二区三区| 国产一区二区三区精品欧美日韩一区二区三区 | 欧美色大人视频| 亚洲精品v日韩精品| 色婷婷久久99综合精品jk白丝| 国产精品免费av| 99久久综合精品| 亚洲色图一区二区三区| 91网站在线观看视频| 亚洲视频免费在线| 色哟哟精品一区| 一区二区三区在线视频播放| 日本精品视频一区二区| 一区二区理论电影在线观看| 欧美亚洲动漫另类| 亚洲成人免费av| 中国av一区二区三区| 成人av集中营| 亚洲人123区| 欧美性色黄大片| 日本va欧美va精品| 91精品国产美女浴室洗澡无遮挡| 免费亚洲电影在线| 国产午夜亚洲精品不卡| www.激情成人| 亚洲午夜激情av| 欧美va在线播放| 成人高清av在线| 亚洲人123区| 国产精品理论片在线观看| 国产视频一区在线播放| 国产一区二区三区在线观看免费| 久久久久久久久久久久久夜| 国产伦精品一区二区三区在线观看| 久久精品视频免费| 91亚洲午夜精品久久久久久| 亚洲第一在线综合网站| 日韩美一区二区三区| 丰满亚洲少妇av| 亚洲一级二级三级在线免费观看| 日韩一区二区三区免费看| 国产高清久久久| 亚洲国产日韩在线一区模特| 日韩一本二本av|