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

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

?? gpio.c

?? 飛利浦LM3S系列ARM的庫文件,在進行arm開發時所必須的庫文件,直接加到工程中,一般不必修改.
?? 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 687 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.
//
//*****************************************************************************
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);
}

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
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)));
}

//*****************************************************************************
//
//! 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().
//
//*****************************************************************************
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));
}

//*****************************************************************************
//
//! 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.
//
//*****************************************************************************
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)));
}

//*****************************************************************************
//
//! 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().
//
//*****************************************************************************
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));
}

//*****************************************************************************
//
//! 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

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲黄色小视频| 一区二区三区在线观看视频| 欧美视频第二页| 97久久超碰国产精品| 成人午夜av电影| 99视频一区二区| av毛片久久久久**hd| 97aⅴ精品视频一二三区| 色综合天天在线| 欧美一a一片一级一片| 欧美性猛交xxxxxxxx| 欧美丝袜第三区| 欧美一区二区三区影视| 欧美一级片免费看| 久久亚洲欧美国产精品乐播| 国产区在线观看成人精品 | 在线不卡欧美精品一区二区三区| 日本乱码高清不卡字幕| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 一区二区三区四区五区视频在线观看| 一区在线中文字幕| 一区二区三区视频在线观看| 午夜视频一区二区三区| 精品一区二区综合| 成人深夜在线观看| 欧美色综合天天久久综合精品| 欧美日韩免费一区二区三区| 欧美成人欧美edvon| 欧美国产一区在线| 亚洲3atv精品一区二区三区| 久久99精品久久久久久国产越南 | 91精品国产一区二区人妖| 精品国产一区二区亚洲人成毛片| 国产精品久久久久影院| 亚洲1区2区3区视频| 国产一区二区三区综合| 一本色道久久综合亚洲91| 欧美一区二区久久| 国产精品成人网| 美国av一区二区| 色综合中文字幕国产 | 久久精品亚洲一区二区三区浴池| 亚洲同性gay激情无套| 美女视频免费一区| 91在线云播放| 久久精品人人做| 日韩电影在线免费看| 成人在线视频首页| 欧美成人性战久久| 亚洲一二三四久久| 91香蕉视频在线| 国产午夜精品一区二区三区嫩草| 亚洲最大成人网4388xx| 国产乱理伦片在线观看夜一区| 欧洲精品在线观看| 国产精品午夜电影| 国产一区二区三区黄视频 | 国产亚洲精品超碰| 蜜臀av性久久久久蜜臀aⅴ流畅| av在线不卡网| 国产精品美女久久福利网站| 久久99精品国产麻豆婷婷洗澡| 欧美色网一区二区| 一区二区在线观看免费| 99综合电影在线视频| 欧美激情自拍偷拍| 国产综合久久久久久鬼色 | 亚洲激情欧美激情| 99热这里都是精品| 国产精品久久一级| 成人网在线免费视频| 中文字幕第一页久久| 国产精品系列在线观看| 久久久亚洲精品石原莉奈 | 国产精品久久久久久久浪潮网站| 国模娜娜一区二区三区| 久久色.com| 美女网站色91| 久久久久久久av麻豆果冻| 国产在线播精品第三| 2019国产精品| 国产成人久久精品77777最新版本 国产成人鲁色资源国产91色综 | 亚洲自拍欧美精品| 欧美日韩国产bt| 偷窥少妇高潮呻吟av久久免费| 欧美日韩在线播放三区| 性久久久久久久| 日韩欧美美女一区二区三区| 免费在线欧美视频| 久久久久久久久久久久久女国产乱 | 91蝌蚪porny九色| 亚洲一区精品在线| 欧美高清dvd| 麻豆精品一二三| 国产精品视频第一区| 91免费精品国自产拍在线不卡| 一区二区三区四区五区视频在线观看| 欧美日韩久久久一区| 国内偷窥港台综合视频在线播放| 国产欧美一区二区三区鸳鸯浴| 91丨porny丨户外露出| 日韩精品高清不卡| 国产欧美日本一区二区三区| 色婷婷亚洲综合| 美脚の诱脚舐め脚责91| 国产精品传媒入口麻豆| 欧美日韩高清一区| 国产成a人亚洲精| 亚洲va欧美va人人爽午夜| 2023国产精品| 欧美日韩免费在线视频| 国产成人av网站| 午夜国产不卡在线观看视频| 久久久国产精品麻豆| 欧美自拍丝袜亚洲| 国产福利一区二区| 亚洲福利视频一区二区| 日本一区二区三区在线观看| 欧美撒尿777hd撒尿| 成人一区二区三区中文字幕| 亚洲成a人片在线不卡一二三区| 国产婷婷一区二区| 欧美放荡的少妇| 99久久婷婷国产综合精品电影 | 欧美性感一区二区三区| 国产精品亚洲一区二区三区在线| 亚洲综合精品久久| 欧美激情一二三区| 精品成人a区在线观看| 欧美三级三级三级爽爽爽| www.av亚洲| 国产传媒欧美日韩成人| 美女网站一区二区| 婷婷亚洲久悠悠色悠在线播放| 国产精品久久久久久亚洲伦| 久久蜜桃香蕉精品一区二区三区| 欧美精品 国产精品| 色猫猫国产区一区二在线视频| 成人免费高清视频在线观看| 精一区二区三区| 六月婷婷色综合| 日本在线播放一区二区三区| 午夜精品久久久久久久蜜桃app| 国产精品久久久久久妇女6080| 欧美精品一区二区三区蜜桃| 日韩女优制服丝袜电影| 日韩视频免费观看高清在线视频| 欧美午夜精品一区二区三区| 在线观看亚洲成人| 在线视频综合导航| 欧美性色黄大片手机版| 欧美撒尿777hd撒尿| 欧美日韩国产一二三| 7777精品伊人久久久大香线蕉完整版| 欧美日韩亚州综合| 欧美久久婷婷综合色| 777亚洲妇女| 日韩三级免费观看| 久久新电视剧免费观看| 国产亚洲欧洲997久久综合| 久久精品人人做人人综合| 欧美激情在线一区二区| 国产精品国产三级国产专播品爱网 | 国产精品久久综合| 综合av第一页| 亚洲电影一区二区三区| 日本中文字幕一区| 狠狠色丁香婷婷综合久久片| 国产白丝网站精品污在线入口| 粉嫩绯色av一区二区在线观看| 国产一区不卡精品| 97久久人人超碰| 欧美巨大另类极品videosbest | 91看片淫黄大片一级| 欧美三级三级三级爽爽爽| 日韩一级高清毛片| 久久久精品天堂| 一区二区三区日韩| 精品在线播放免费| 97国产一区二区| 3d成人动漫网站| 欧美国产精品久久| 亚洲大片在线观看| 丰满放荡岳乱妇91ww| 欧美亚洲一区二区三区四区| 欧美一级精品大片| 国产精品初高中害羞小美女文| 香蕉加勒比综合久久| 国产精品123区| 欧美日本在线看| 国产精品久久久久久亚洲毛片 | 国产在线精品一区二区| 91小视频在线| 日韩一级在线观看| 亚洲精品福利视频网站| 极品少妇一区二区| 日本久久一区二区| 日本一区二区三区电影| 人人精品人人爱| 91视频一区二区|