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

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

?? gpio.c

?? FreeRTOS V4.2.1,增加了AVR32 UC3 和 LPC2368 的支持
?? C
?? 第 1 頁 / 共 3 頁
字號:
//*****************************************************************************
//
// gpio.c - API for GPIO ports
//
// Copyright (c) 2005,2006 Luminary Micro, Inc.  All rights reserved.
//
// Software License Agreement
//
// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
// exclusively on LMI's Stellaris Family of microcontroller products.
//
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  Any use in violation
// of the foregoing restrictions may subject the user to criminal sanctions
// under applicable laws, as well as to civil liability for the breach of the
// terms and conditions of this license.
//
// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
//
// This is part of revision 991 of the Stellaris Driver Library.
//
//*****************************************************************************

//*****************************************************************************
//
//! \addtogroup gpio_api
//! @{
//
//*****************************************************************************

#include "../hw_gpio.h"
#include "../hw_ints.h"
#include "../hw_memmap.h"
#include "../hw_types.h"
#include "debug.h"
#include "gpio.h"
#include "interrupt.h"

//*****************************************************************************
//
//! \internal
//! Get GPIO interrupt number.
//!
//! \param ulPort base address of the selected GPIO port
//!
//! Given a GPIO base address, returns the corresponding interrupt number.
//!
//! \return Returns a GPIO interrupt number, or -1 if \e ulPort is invalid.
//
//*****************************************************************************
#if defined(GROUP_getintnumber) || defined(BUILD_ALL)
long
GPIOGetIntNumber(unsigned long ulPort)
{
    unsigned int ulInt;

    //
    // Determine the GPIO interrupt number for the given module.
    //
    switch(ulPort)
    {
        case GPIO_PORTA_BASE:
        {
            ulInt = INT_GPIOA;
            break;
        }

        case GPIO_PORTB_BASE:
        {
            ulInt = INT_GPIOB;
            break;
        }

        case GPIO_PORTC_BASE:
        {
            ulInt = INT_GPIOC;
            break;
        }

        case GPIO_PORTD_BASE:
        {
            ulInt = INT_GPIOD;
            break;
        }

        case GPIO_PORTE_BASE:
        {
            ulInt = INT_GPIOE;
            break;
        }

        default:
        {
            return(-1);
        }
    }

    //
    // Return GPIO interrupt number.
    //
    return(ulInt);
}
#else
extern long GPIOGetIntNumber(unsigned long ulPort);
#endif

//*****************************************************************************
//
//! Sets the direction and mode of 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 ulPinIO pin direction and/or mode
//!
//! This function will set the specified pins on the selected GPIO port
//! as either an input or output under software control, or it will set the
//! pin to be under hardware control.
//!
//! The parameter \e ulPinIO is an enumerated data type that can be one of
//! the following values:
//!
//! - \b GPIO_DIR_MODE_IN
//! - \b GPIO_DIR_MODE_OUT
//! - \b GPIO_DIR_MODE_HW
//!
//! where \b GPIO_DIR_MODE_IN specifies that the pin will be programmed as
//! a software controlled input, \b GPIO_DIR_MODE_OUT specifies that the pin
//! will be programmed as a software controlled output, and
//! \b GPIO_DIR_MODE_HW specifies that the pin will be placed under
//! hardware control.
//!
//! 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_dirmodeset) || defined(BUILD_ALL) || defined(DOXYGEN)
void
GPIODirModeSet(unsigned long ulPort, unsigned char ucPins,
               unsigned long ulPinIO)
{
    //
    // 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((ulPinIO == GPIO_DIR_MODE_IN) || (ulPinIO == GPIO_DIR_MODE_OUT) ||
           (ulPinIO == GPIO_DIR_MODE_HW));

    //
    // Set the pin direction and mode.
    //
    HWREG(ulPort + GPIO_O_DIR) = ((ulPinIO & 1) ?
                                  (HWREG(ulPort + GPIO_O_DIR) | ucPins) :
                                  (HWREG(ulPort + GPIO_O_DIR) & ~(ucPins)));
    HWREG(ulPort + GPIO_O_AFSEL) = ((ulPinIO & 2) ?
                                    (HWREG(ulPort + GPIO_O_AFSEL) | ucPins) :
                                    (HWREG(ulPort + GPIO_O_AFSEL) &
                                     ~(ucPins)));
}
#endif

//*****************************************************************************
//
//! Gets the direction and mode of a 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.
//!
//! This function gets the direction and control mode for a specified pin on
//! the selected GPIO port. The pin can be configured as either an input or
//! output under software control, or it can be under hardware control. The
//! type of control and direction are returned as an enumerated data type.
//!
//! \return Returns one of the enumerated data types described for
//! GPIODirModeSet().
//
//*****************************************************************************
#if defined(GROUP_dirmodeget) || defined(BUILD_ALL) || defined(DOXYGEN)
unsigned long
GPIODirModeGet(unsigned long ulPort, unsigned char ucPin)
{
    unsigned long ulDir, ulAFSEL;

    //
    // 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;

    //
    // Return the pin direction and mode.
    //
    ulDir = HWREG(ulPort + GPIO_O_DIR);
    ulAFSEL = HWREG(ulPort + GPIO_O_AFSEL);
    return(((ulDir & ucPin) ? 1 : 0) | ((ulAFSEL & ucPin) ? 2 : 0));
}
#endif

//*****************************************************************************
//
//! Sets the interrupt type 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
//! \param ulIntType specifies the type of interrupt trigger mechanism
//!
//! This function sets up the various interrupt trigger mechanisms for the
//! specified pins on the selected GPIO port.
//!
//! The parameter \e ulIntType is an enumerated data type that can be one of
//! the following values:
//!
//! - \b GPIO_FALLING_EDGE
//! - \b GPIO_RISING_EDGE
//! - \b GPIO_BOTH_EDGES
//! - \b GPIO_LOW_LEVEL
//! - \b GPIO_HIGH_LEVEL
//!
//! where the different values describe the interrupt detection mechanism
//! (edge or level) and the particular triggering event (falling, rising,
//! or both edges for edge detect, low or high for level detect).
//!
//! 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.
//!
//! \note In order to avoid any spurious interrupts, the user must
//! ensure that the GPIO inputs remain stable for the duration of
//! this function.
//!
//! \return None.
//
//*****************************************************************************
#if defined(GROUP_inttypeset) || defined(BUILD_ALL) || defined(DOXYGEN)
void
GPIOIntTypeSet(unsigned long ulPort, unsigned char ucPins,
               unsigned long ulIntType)
{
    //
    // 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((ulIntType == GPIO_FALLING_EDGE) ||
           (ulIntType == GPIO_RISING_EDGE) ||
           (ulIntType == GPIO_BOTH_EDGES) ||
           (ulIntType == GPIO_LOW_LEVEL) ||
           (ulIntType == GPIO_HIGH_LEVEL));

    //
    // Set the pin interrupt type.
    //
    HWREG(ulPort + GPIO_O_IBE) = ((ulIntType & 1) ?
                                  (HWREG(ulPort + GPIO_O_IBE) | ucPins) :
                                  (HWREG(ulPort + GPIO_O_IBE) & ~(ucPins)));
    HWREG(ulPort + GPIO_O_IS) = ((ulIntType & 2) ?
                                 (HWREG(ulPort + GPIO_O_IS) | ucPins) :
                                 (HWREG(ulPort + GPIO_O_IS) & ~(ucPins)));
    HWREG(ulPort + GPIO_O_IEV) = ((ulIntType & 4) ?
                                  (HWREG(ulPort + GPIO_O_IEV) | ucPins) :
                                  (HWREG(ulPort + GPIO_O_IEV) & ~(ucPins)));
}
#endif

//*****************************************************************************
//
//! Gets the interrupt type 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.
//!
//! This function gets the interrupt type for a specified pin on the selected
//! GPIO port. The pin can be configured as a falling edge, rising edge, or
//! both edge detected interrupt, or it can be configured as a low level or
//! high level detected interrupt. The type of interrupt detection mechanism
//! is returned as an enumerated data type.
//!
//! \return Returns one of the enumerated data types described for
//! GPIOIntTypeSet().
//
//*****************************************************************************
#if defined(GROUP_inttypeget) || defined(BUILD_ALL) || defined(DOXYGEN)
unsigned long
GPIOIntTypeGet(unsigned long ulPort, unsigned char ucPin)
{
    unsigned long ulIBE, ulIS, ulIEV;

    //
    // 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;

    //
    // Return the pin interrupt type.
    //
    ulIBE = HWREG(ulPort + GPIO_O_IBE);
    ulIS = HWREG(ulPort + GPIO_O_IS);
    ulIEV = HWREG(ulPort + GPIO_O_IEV);
    return(((ulIBE & ucPin) ? 1 : 0) | ((ulIS & ucPin) ? 2 : 0) |
           ((ulIEV & ucPin) ? 4 : 0));
}
#endif

//*****************************************************************************
//
//! Sets the pad configuration for the specified pins of the selected GPIO
//! port.
//!
//! \param ulPort is the base address of the GPIO port.
//! \param ucPins bit-packed representation of the specified pins.
//! \param ulStrength specifies the output drive strength.
//! \param ulPinType specifies the pin type.
//!
//! This function sets the drive strength and type for the specified pins
//! on the selected GPIO port.  For pins configured as input ports, the
//! pad is configured as requested, but the only real effect on the input
//! is the configuration of the pull-up or pull-down termination.
//!
//! The parameter \e ulStrength can be one of the following values:
//!
//! - \b GPIO_STRENGTH_2MA
//! - \b GPIO_STRENGTH_4MA
//! - \b GPIO_STRENGTH_8MA
//! - \b GPIO_STRENGTH_8MA_SC
//!
//! where \b GPIO_STRENGTH_xMA specifies either 2, 4, or 8 mA output drive
//! strength, and \b GPIO_OUT_STRENGTH_8MA_SC specifies 8 mA output drive with
//! slew control.
//!
//! The parameter \e ulPinType can be one of the following values:
//!
//! - \b GPIO_PIN_TYPE_STD
//! - \b GPIO_PIN_TYPE_STD_WPU
//! - \b GPIO_PIN_TYPE_STD_WPD
//! - \b GPIO_PIN_TYPE_OD
//! - \b GPIO_PIN_TYPE_OD_WPU
//! - \b GPIO_PIN_TYPE_OD_WPD
//! - \b GPIO_PIN_TYPE_ANALOG

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费高清在线| 日韩av中文字幕一区二区三区| 日本va欧美va精品发布| 日韩一区二区影院| 国产成人午夜片在线观看高清观看| ㊣最新国产の精品bt伙计久久| 欧美专区亚洲专区| 久草在线在线精品观看| 中文字幕中文乱码欧美一区二区| 欧美日韩国产精品成人| 国产成人精品免费网站| 国产成人99久久亚洲综合精品| 亚洲va国产va欧美va观看| 国产三级精品三级| 日韩一区二区在线观看| 精品国内片67194| 欧美综合一区二区三区| 欧美日韩亚洲综合在线| 成人午夜视频网站| 91一区二区三区在线播放| 国产一区二区免费在线| 爽好久久久欧美精品| 亚洲精品国产第一综合99久久| 久久欧美一区二区| 在线播放欧美女士性生活| 92国产精品观看| 成人影视亚洲图片在线| 91毛片在线观看| 欧美男人的天堂一二区| 久久色成人在线| 2023国产精华国产精品| 中文字幕在线不卡视频| 午夜伊人狠狠久久| 国产一区福利在线| 色欧美乱欧美15图片| 成人h版在线观看| 国产成a人亚洲| 91福利在线看| 欧美日韩国产三级| 久久综合九色综合欧美就去吻| 亚洲视频免费看| 亚洲人成亚洲人成在线观看图片| 国产精品初高中害羞小美女文| 亚洲444eee在线观看| 国产91对白在线观看九色| 欧美精品123区| 最新欧美精品一区二区三区| 麻豆国产一区二区| 国产精品亚洲午夜一区二区三区| 国产精品一区二区久久精品爱涩| 在线视频你懂得一区二区三区| 久久这里只精品最新地址| 亚洲一区二区三区激情| 日韩电影在线观看一区| 色婷婷综合久久久中文一区二区| 久久久www免费人成精品| 丝袜美腿高跟呻吟高潮一区| 色婷婷av一区二区三区之一色屋| 久久久久综合网| 男女男精品网站| 欧美手机在线视频| 欧美顶级少妇做爰| 麻豆高清免费国产一区| 91国产免费观看| 国产精品美女久久久久久| 国产精品福利一区二区| 国内精品国产成人国产三级粉色 | 色美美综合视频| 欧美经典一区二区| 久久免费偷拍视频| 麻豆免费精品视频| 欧美一区二区三区视频在线| 久久久久久97三级| 精品中文av资源站在线观看| 欧美成人猛片aaaaaaa| 中文字幕在线观看不卡视频| 丰满白嫩尤物一区二区| 国产婷婷色一区二区三区| 亚洲情趣在线观看| 91一区一区三区| 一区二区三区四区在线播放| 精品午夜久久福利影院| 日韩美一区二区三区| 亚洲精品大片www| 在线精品视频小说1| 亚洲一区在线免费观看| 欧美精品一级二级| 日韩国产在线观看| 精品久久久久一区二区国产| 国产一区福利在线| 亚洲天堂a在线| 欧美三区在线视频| 久久综合综合久久综合| 91黄色免费版| 亚洲国产wwwccc36天堂| 色综合天天综合在线视频| 26uuu亚洲综合色| 国产成人av福利| 一区二区三区在线观看视频| 欧日韩精品视频| 91在线观看地址| 一区二区三区四区中文字幕| 日韩三级精品电影久久久| 国产精品一级片| 亚洲丝袜美腿综合| 欧美一区二区三区四区五区| 国产成人精品1024| 亚洲一区在线视频观看| 久久亚洲欧美国产精品乐播| 91婷婷韩国欧美一区二区| 日本一区中文字幕| 欧美国产日韩一二三区| 欧美日韩久久不卡| 国产精品资源站在线| 亚洲午夜国产一区99re久久| 久久综合色婷婷| 欧美性videosxxxxx| 国产一区二区不卡老阿姨| 亚洲精品国产一区二区精华液| 精品久久一二三区| 欧美少妇一区二区| 床上的激情91.| 蜜臀99久久精品久久久久久软件| 国产精品视频yy9299一区| 日韩亚洲欧美在线观看| 91丨porny丨中文| 国产精品自拍毛片| 免费观看一级特黄欧美大片| 亚洲精品五月天| 中文字幕av一区二区三区高| 日韩一区二区三区免费看 | 日本久久电影网| 国产99久久精品| 老司机精品视频线观看86| 亚洲综合小说图片| 18欧美乱大交hd1984| 精品国产精品一区二区夜夜嗨| 在线免费不卡视频| 99re成人精品视频| 成人午夜伦理影院| 国产麻豆成人传媒免费观看| 免费高清不卡av| 丝袜美腿高跟呻吟高潮一区| 亚洲一区免费在线观看| 日韩毛片在线免费观看| 亚洲国产岛国毛片在线| 国产偷国产偷精品高清尤物| 久久综合狠狠综合| 精品国产免费一区二区三区香蕉| 欧美一区二区三区四区视频| 欧美肥大bbwbbw高潮| 欧美日韩日日摸| 欧美日韩国产a| 91精品国产综合久久小美女| 国产一区91精品张津瑜| 国产又粗又猛又爽又黄91精品| 极品美女销魂一区二区三区免费| 麻豆精品一区二区av白丝在线| 蜜桃精品视频在线观看| 麻豆一区二区三| 国产精品资源在线观看| 国产99久久久精品| 91首页免费视频| 日本高清视频一区二区| 欧美日韩久久久| 精品国产污污免费网站入口| 久久亚洲精品小早川怜子| 国产欧美一区二区三区网站 | 欧美日韩一区高清| 欧美电影在哪看比较好| 欧美电影免费观看高清完整版在线 | 久久se精品一区精品二区| 黄网站免费久久| 国产激情视频一区二区三区欧美| 成人污污视频在线观看| 日本道在线观看一区二区| 欧美一区二区人人喊爽| 国产亚洲成aⅴ人片在线观看| 亚洲欧洲99久久| 午夜影院在线观看欧美| 国产在线精品一区二区| 91毛片在线观看| 欧美一级片在线观看| 国产精品网站在线观看| 亚洲二区视频在线| 国产原创一区二区| 在线免费观看日韩欧美| 亚洲精品一区二区三区精华液 | 亚洲午夜精品17c| 国模少妇一区二区三区| 91一区一区三区| 精品乱人伦一区二区三区| 亚洲欧美另类图片小说| 久久黄色级2电影| 在线观看国产日韩| 国产欧美综合在线观看第十页| 亚洲va国产天堂va久久en| 懂色中文一区二区在线播放| 91麻豆精品国产无毒不卡在线观看 | 911国产精品|