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

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

?? gpio.c

?? 基于 Cortex-M3 (ARM) 內核使用之 uC/OS-II 作業系統,此例程可移植于 Cortex-M3 (ARM)內核的微處理器上的應用,于 Keil MDK 3.15b以上 工程編譯,而
?? C
?? 第 1 頁 / 共 3 頁
字號:
    IntUnregister(ulPort);
}

//*****************************************************************************
//
//! Reads the values present at 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
//!
//! The values at the specified pins are read, as specified by \e ucPins.
//! Values are returned for both input and output pins, and the value
//! for pins that are not specified by \e ucPins are set to 0.
//!
//! 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 Returns a bit-packed byte providing the state of the specified
//! pin, where bit 0 of the byte represents GPIO port pin 0, bit 1 represents
//! GPIO port pin 1, etc. Any bit that is not specified by \e ucPins
//! is returned as a 0. Bits 31:8 should be ignored.
//
//*****************************************************************************
long
GPIOPinRead(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));

    //
    // Return the pin value(s).
    //
    return(HWREG(ulPort + (GPIO_O_DATA + (ucPins << 2))));
}

//*****************************************************************************
//
//! Writes a value at 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
//! \param ucVal value to write to the specified pins
//!
//! Writes the corresponding bit values to the output pins specified
//! by \e ucPins. Writing to a pin configured as an input pin has no
//! effect.
//!
//! 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
GPIOPinWrite(unsigned long ulPort, unsigned char ucPins, unsigned char ucVal)
{
    //
    // Check the arguments.
    //
    ASSERT((ulPort == GPIO_PORTA_BASE) || (ulPort == GPIO_PORTB_BASE) ||
           (ulPort == GPIO_PORTC_BASE) || (ulPort == GPIO_PORTD_BASE) ||
           (ulPort == GPIO_PORTE_BASE));

    //
    // Write the pins.
    //
    HWREG(ulPort + (GPIO_O_DATA + (ucPins << 2))) = ucVal;
}

//*****************************************************************************
//
//! Configures pin(s) for use as an analog comparator input.
//!
//! \param ulPort base address of the selected GPIO port
//! \param ucPins bit-packed representation of the specified pins
//!
//! The analog comparator input pins must be properly configured for the analog
//! comparator to function correctly.  This function provides the proper
//! configuration for those pins.
//!
//! \note This cannot be used to turn any pin into an analog comparator input;
//! it only configures an analog comparator pin for proper operation.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPinTypeComparator(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));

    //
    // Make the pin(s) be inputs.
    //
    GPIODirModeSet(ulPort, ucPins, GPIO_DIR_MODE_IN);

    //
    // Set the pad(s) for analog operation.
    //
    GPIOPadConfigSet(ulPort, ucPins, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_ANALOG);
}

//*****************************************************************************
//
//! Configures pin(s) for use by the I2C peripheral.
//!
//! \param ulPort base address of the selected GPIO port
//! \param ucPins bit-packed representation of the specified pins
//!
//! The I2C pins must be properly configured for the I2C peripheral to function
//! correctly.  This function provides the proper configuration for those pins.
//!
//! \note This cannot be used to turn any pin into an I2C pin; it only
//! configures an I2C pin for proper operation.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPinTypeI2C(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));

    //
    // Make the pin(s) be peripheral controlled.
    //
    GPIODirModeSet(ulPort, ucPins, GPIO_DIR_MODE_HW);

    //
    // Set the pad(s) for open-drain operation with a weak pull-up.
    //
    GPIOPadConfigSet(ulPort, ucPins, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_OD_WPU);
}

//*****************************************************************************
//
//! Configures pin(s) for use by the PWM peripheral.
//!
//! \param ulPort base address of the selected GPIO port
//! \param ucPins bit-packed representation of the specified pins
//!
//! The PWM pins must be properly configured for the PWM peripheral to function
//! correctly.  This function provides a typical configuration for those pins;
//! other configurations may work as well depending upon the board setup (for
//! example, using the on-chip pull-ups).
//!
//! \note This cannot be used to turn any pin into a PWM pin; it only
//! configures a PWM pin for proper operation.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPinTypePWM(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));

    //
    // Make the pin(s) be peripheral controlled.
    //
    GPIODirModeSet(ulPort, ucPins, GPIO_DIR_MODE_HW);

    //
    // Set the pad(s) for standard push-pull operation.
    //
    GPIOPadConfigSet(ulPort, ucPins, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
}

//*****************************************************************************
//
//! Configures pin(s) for use by the QEI peripheral.
//!
//! \param ulPort base address of the selected GPIO port
//! \param ucPins bit-packed representation of the specified pins
//!
//! The QEI pins must be properly configured for the QEI peripheral to function
//! correctly.  This function provides a typical configuration for those pins;
//! other configurations may work as well depending upon the board setup (for
//! example, not using the on-chip pull-ups).
//!
//! \note This cannot be used to turn any pin into a QEI pin; it only
//! configures a QEI pin for proper operation.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPinTypeQEI(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));

    //
    // Make the pin(s) be peripheral controlled.
    //
    GPIODirModeSet(ulPort, ucPins, GPIO_DIR_MODE_HW);

    //
    // Set the pad(s) for standard push-pull operation with a weak pull-up.
    //
    GPIOPadConfigSet(ulPort, ucPins, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
}

//*****************************************************************************
//
//! Configures pin(s) for use by the SSI peripheral.
//!
//! \param ulPort base address of the selected GPIO port
//! \param ucPins bit-packed representation of the specified pins
//!
//! The SSI pins must be properly configured for the SSI peripheral to function
//! correctly.  This function provides a typical configuration for those pins;
//! other configurations may work as well depending upon the board setup (for
//! example, using the on-chip pull-ups).
//!
//! \note This cannot be used to turn any pin into a SSI pin; it only
//! configures a SSI pin for proper operation.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPinTypeSSI(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));

    //
    // Make the pin(s) be peripheral controlled.
    //
    GPIODirModeSet(ulPort, ucPins, GPIO_DIR_MODE_HW);

    //
    // Set the pad(s) for standard push-pull operation.
    //
    GPIOPadConfigSet(ulPort, ucPins, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
}

//*****************************************************************************
//
//! Configures pin(s) for use by the Timer peripheral.
//!
//! \param ulPort base address of the selected GPIO port
//! \param ucPins bit-packed representation of the specified pins
//!
//! The CCP pins must be properly configured for the timer peripheral to
//! function correctly.  This function provides a typical configuration for
//! those pins; other configurations may work as well depending upon the board
//! setup (for example, using the on-chip pull-ups).
//!
//! \note This cannot be used to turn any pin into a timer pin; it only
//! configures a timer pin for proper operation.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPinTypeTimer(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));

    //
    // Make the pin(s) be peripheral controlled.
    //
    GPIODirModeSet(ulPort, ucPins, GPIO_DIR_MODE_HW);

    //
    // Set the pad(s) for standard push-pull operation.
    //
    GPIOPadConfigSet(ulPort, ucPins, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
}

//*****************************************************************************
//
//! Configures pin(s) for use by the UART peripheral.
//!
//! \param ulPort base address of the selected GPIO port
//! \param ucPins bit-packed representation of the specified pins
//!
//! The UART pins must be properly configured for the UART peripheral to
//! function correctly.  This function provides a typical configuration for
//! those pins; other configurations may work as well depending upon the board
//! setup (for example, using the on-chip pull-ups).
//!
//! \note This cannot be used to turn any pin into a UART pin; it only
//! configures a UART pin for proper operation.
//!
//! \return None.
//
//*****************************************************************************
void
GPIOPinTypeUART(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));

    //
    // Make the pin(s) be peripheral controlled.
    //
    GPIODirModeSet(ulPort, ucPins, GPIO_DIR_MODE_HW);

    //
    // Set the pad(s) for standard push-pull operation.
    //
    GPIOPadConfigSet(ulPort, ucPins, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD);
}

//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99视频精品全部免费在线| 欧美色视频在线| 偷拍自拍另类欧美| 久久久久国产精品人| 欧美网站一区二区| 99精品久久免费看蜜臀剧情介绍| 婷婷久久综合九色国产成人 | 97aⅴ精品视频一二三区| 日韩不卡在线观看日韩不卡视频| 欧美激情中文不卡| 欧美一区二区视频在线观看| 91极品美女在线| 风间由美一区二区av101| 久久99精品久久久久久久久久久久| 亚洲精品成人少妇| 国产精品人成在线观看免费 | 国产91富婆露脸刺激对白| 五月天精品一区二区三区| 亚洲精品日韩综合观看成人91| 久久午夜国产精品| 日韩欧美中文字幕精品| 欧美日韩一二区| 欧洲色大大久久| a美女胸又www黄视频久久| 久久99国内精品| 奇米精品一区二区三区四区| 亚洲在线视频网站| 亚洲综合免费观看高清完整版 | 欧美精品乱码久久久久久 | 国产+成+人+亚洲欧洲自线| 麻豆国产精品一区二区三区 | 日本不卡不码高清免费观看| 一级特黄大欧美久久久| 亚洲欧美另类在线| 亚洲女同一区二区| 一区二区在线电影| 一区二区三区中文在线观看| 亚洲欧美日韩国产一区二区三区 | 欧美tk—视频vk| 日韩欧美综合在线| 欧美成人国产一区二区| 日韩欧美国产午夜精品| 欧美一区二区黄色| 日韩欧美一级二级| 久久久欧美精品sm网站| 国产欧美日韩在线看| 国产精品网曝门| 亚洲少妇30p| 亚洲一区中文在线| 青青国产91久久久久久| 老司机精品视频导航| 国产精品资源在线看| 成人免费视频视频在线观看免费 | 不卡视频在线看| 91丝袜美腿高跟国产极品老师 | 欧美色男人天堂| 91麻豆精品国产自产在线| 91精品国产色综合久久ai换脸 | 亚洲va欧美va天堂v国产综合| 亚洲高清久久久| 日韩国产在线观看一区| 精品一区二区日韩| va亚洲va日韩不卡在线观看| 97久久精品人人爽人人爽蜜臀| 欧美午夜不卡视频| 欧美一区二区三区在线| 久久久777精品电影网影网| 日本一区二区免费在线| 亚洲人成影院在线观看| 日韩精品乱码免费| 高清国产午夜精品久久久久久| 99精品桃花视频在线观看| 欧美日韩高清一区二区三区| 精品欧美久久久| 成人欧美一区二区三区1314| 亚洲一区二区精品久久av| 日本午夜一本久久久综合| 国产精品亚洲一区二区三区妖精 | 韩国欧美一区二区| 91在线看国产| 日韩精品影音先锋| 国产精品久久久久久久午夜片 | 久久精品亚洲一区二区三区浴池 | 日韩一级视频免费观看在线| 国产欧美日韩亚州综合| 天天做天天摸天天爽国产一区| 国产在线国偷精品产拍免费yy| 91同城在线观看| 精品sm捆绑视频| 亚洲一区二区三区小说| 国产真实乱偷精品视频免| 91精彩视频在线观看| 久久精品男人天堂av| 亚洲国产精品嫩草影院| 成人一区二区三区视频 | 欧美日韩一区二区三区免费看 | 五月婷婷综合网| 成人免费视频app| 91精品国产综合久久久久久| 国产精品久久毛片av大全日韩| 蜜桃精品视频在线| 欧美影院午夜播放| 国产精品久99| 国产精品综合久久| 欧美一区二区三区人| 伊人色综合久久天天人手人婷| 国产成人免费视频一区| 欧美一级在线观看| 亚洲高清视频中文字幕| 91麻豆精品国产自产在线| 依依成人综合视频| www.av精品| 国产精品美女一区二区三区| 蜜臀99久久精品久久久久久软件| 色婷婷av一区二区三区大白胸| 中文字幕欧美日韩一区| 国产精品456| 精品国产sm最大网站免费看| 日韩精彩视频在线观看| 欧美午夜免费电影| 亚洲综合色网站| 色av成人天堂桃色av| 国产精品国产三级国产aⅴ入口 | 国产一区二区在线电影| 欧美一区永久视频免费观看| 亚洲国产另类精品专区| 在线观看日韩国产| 亚洲女人的天堂| 91视频.com| 亚洲老妇xxxxxx| 色老头久久综合| 夜夜操天天操亚洲| 欧美性猛交一区二区三区精品| 亚洲女爱视频在线| 欧洲视频一区二区| 性久久久久久久久久久久| 欧美在线一区二区三区| 亚洲国产日韩一区二区| 欧美日韩国产在线观看| 日韩黄色免费网站| 日韩女优毛片在线| 极品少妇xxxx精品少妇偷拍| 久久久综合激的五月天| 国产电影一区二区三区| 国产精品三级电影| 一道本成人在线| 午夜电影久久久| 精品国产免费视频| 国产成人鲁色资源国产91色综 | 日韩欧美国产综合一区 | 成人av免费在线观看| 亚洲三级免费观看| 欧美亚洲另类激情小说| 天天影视涩香欲综合网| 欧美一区二区高清| 国产高清精品网站| 亚洲欧洲日韩在线| 欧美日韩精品电影| 久久成人免费网站| 国产精品久久久久9999吃药| 在线精品视频免费观看| 青青国产91久久久久久 | 欧美激情在线观看视频免费| 99v久久综合狠狠综合久久| 亚洲综合一区二区三区| 日韩欧美一二区| 成人免费视频一区二区| 亚洲一线二线三线视频| wwww国产精品欧美| 91在线观看免费视频| 日韩精品亚洲专区| 亚洲国产精品精华液ab| 欧美日韩国产乱码电影| 国产一区二区三区免费| 亚洲综合免费观看高清在线观看| 日韩欧美一级特黄在线播放| 成人性生交大片免费看在线播放| 亚洲精品国产品国语在线app| 欧美一级在线观看| 91亚洲国产成人精品一区二区三 | 国内精品不卡在线| 亚洲精品一二三| 欧美www视频| 色婷婷av一区二区三区gif| 久久精品72免费观看| 一区二区高清在线| 国产丝袜美腿一区二区三区| 欧美偷拍一区二区| 国产98色在线|日韩| 亚洲成人激情自拍| 国产精品麻豆一区二区| 日韩午夜av电影| 色婷婷综合激情| 成人永久免费视频| 久久精品国产99国产精品| 亚洲高清免费一级二级三级| 国产精品人成在线观看免费| 日韩精品一区在线| 欧美日韩性生活| 91老师国产黑色丝袜在线|