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

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

?? ?-

?? 基于Luminary的JPEG圖片瀏覽器
??
?? 第 1 頁 / 共 4 頁
字號:
//*****************************************************************************
//
// gpio.c - API for GPIO ports
//
// Copyright (c) 2005-2008 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 microcontroller products.
// 
// The software is owned by LMI and/or its suppliers, and is protected under
// applicable copyright laws.  All rights are reserved.  You may not combine
// this software with "viral" open-source software in order to form a larger
// program.  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 2293 of the Stellaris Peripheral 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
//! Gets the GPIO interrupt number.
//!
//! \param ulPort is the base address of the 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.
//
//*****************************************************************************
static 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;
        }

        case GPIO_PORTF_BASE:
        {
            ulInt = INT_GPIOF;
            break;
        }

        case GPIO_PORTG_BASE:
        {
            ulInt = INT_GPIOG;
            break;
        }

        case GPIO_PORTH_BASE:
        {
            ulInt = INT_GPIOH;
            break;
        }

        default:
        {
            return(-1);
        }
    }

    //
    // Return GPIO interrupt number.
    //
    return(ulInt);
}

//*****************************************************************************
//
//! Sets the direction and mode of the specified pin(s).
//!
//! \param ulPort is the base address of the GPIO port
//! \param ucPins is the bit-packed representation of the pin(s).
//! \param ulPinIO is the pin direction and/or mode.
//!
//! This function will set the specified pin(s) 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 pin(s) 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, and so on.
//!
//! \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) || (ulPort == GPIO_PORTF_BASE) ||
           (ulPort == GPIO_PORTG_BASE) || (ulPort == GPIO_PORTH_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 pin.
//!
//! \param ulPort is the base address of the GPIO port.
//! \param ucPin is the pin number.
//!
//! 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) || (ulPort == GPIO_PORTF_BASE) ||
           (ulPort == GPIO_PORTG_BASE) || (ulPort == GPIO_PORTH_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 pin(s).
//!
//! \param ulPort is the base address of the GPIO port.
//! \param ucPins is the bit-packed representation of the pin(s).
//! \param ulIntType specifies the type of interrupt trigger mechanism.
//!
//! This function sets up the various interrupt trigger mechanisms for the
//! specified pin(s) 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 pin(s) 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, and so on.
//!
//! \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) || (ulPort == GPIO_PORTF_BASE) ||
           (ulPort == GPIO_PORTG_BASE) || (ulPort == GPIO_PORTH_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 a pin.
//!
//! \param ulPort is the base address of the GPIO port.
//! \param ucPin is the pin number.
//!
//! 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) || (ulPort == GPIO_PORTF_BASE) ||
           (ulPort == GPIO_PORTG_BASE) || (ulPort == GPIO_PORTH_BASE));
    ASSERT(ucPin < 8);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产乱码久久久久久久久| 精品国产乱码久久| 欧美电影免费观看高清完整版在线| 91精品久久久久久久99蜜桃| 综合激情成人伊人| 国产综合色在线视频区| 欧美日韩视频在线一区二区| 国产精品久久影院| 国产一区二区调教| 91精品国产综合久久香蕉的特点| 日韩理论在线观看| 成人免费观看av| 国产亚洲va综合人人澡精品| 日产国产欧美视频一区精品| 色噜噜狠狠一区二区三区果冻| 国产精品午夜在线观看| 国产精品影视在线| 精品国产乱码久久久久久1区2区| 免费视频一区二区| 欧美日本一区二区| 亚洲最色的网站| 色偷偷久久一区二区三区| 国产偷国产偷亚洲高清人白洁 | 岛国av在线一区| 欧美成人官网二区| 久久狠狠亚洲综合| 日韩美女在线视频| 久久99精品国产91久久来源| 日韩视频国产视频| 蜜臀av一区二区在线观看 | 91丝袜美女网| 亚洲乱码一区二区三区在线观看| 成人午夜av电影| 欧美国产欧美亚州国产日韩mv天天看完整 | 成人综合婷婷国产精品久久免费| 2020国产精品久久精品美国| 国产一区二区电影| 26uuu精品一区二区| 老汉av免费一区二区三区| 欧美三级电影精品| 免费久久99精品国产| 欧美电影免费观看完整版| 韩国视频一区二区| 91精品国产综合久久久久久漫画| 美国十次了思思久久精品导航| 欧美一区二区大片| 国产成人综合在线观看| 中文字幕亚洲欧美在线不卡| 91小视频免费观看| 午夜精品福利在线| 精品99999| 色综合天天做天天爱| 丝袜亚洲精品中文字幕一区| 日韩免费在线观看| 99久久精品国产网站| 亚洲成av人影院在线观看网| 精品粉嫩aⅴ一区二区三区四区| 国产成人福利片| 亚洲一区二区三区四区五区黄 | 欧美久久久一区| 极品尤物av久久免费看| 中文字幕一区二区三区蜜月| 欧美日韩一区二区三区四区| 国产综合久久久久影院| 亚洲男人的天堂在线aⅴ视频| 欧美日韩国产一级片| 国产suv一区二区三区88区| 亚洲色图欧美在线| 日韩欧美亚洲国产另类| 粉嫩av一区二区三区在线播放 | 欧美成人乱码一区二区三区| 97超碰欧美中文字幕| 麻豆国产欧美一区二区三区| 欧美一区午夜精品| 一本大道综合伊人精品热热| 国产精品私人自拍| 男人的j进女人的j一区| 亚洲人成7777| 国产精品1区二区.| 亚洲乱码国产乱码精品精小说| 久久久久久久精| 九色porny丨国产精品| 国产精品乱码人人做人人爱| 欧美日韩成人一区| 国产成人综合在线观看| 一区二区在线观看视频在线观看| 精品视频1区2区| 国产精品电影一区二区三区| 欧美日韩一区二区三区在线 | av电影在线不卡| 日本不卡不码高清免费观看| 亚洲一级在线观看| 国产精品理论片| 久久精品亚洲麻豆av一区二区| 欧美日韩高清影院| 在线观看一区日韩| 国产凹凸在线观看一区二区| 一区二区成人在线视频 | 91网上在线视频| 91精品国产综合久久香蕉麻豆| 美国精品在线观看| 偷拍与自拍一区| 亚洲国产精品一区二区久久 | 免费在线观看一区| 三级影片在线观看欧美日韩一区二区| 国产精品久久久久9999吃药| 中日韩免费视频中文字幕| 久久久久97国产精华液好用吗 | 日韩三级av在线播放| 欧美另类高清zo欧美| 欧美日韩午夜在线| 欧美日韩不卡视频| 欧美丰满少妇xxxbbb| 欧美妇女性影城| 日韩一区二区在线免费观看| 中日韩av电影| 亚洲一区二区三区小说| 国产午夜精品久久久久久久| 日韩欧美激情在线| 国产天堂亚洲国产碰碰| 成人理论电影网| 成人性色生活片免费看爆迷你毛片| 国产精品99久久不卡二区| 青青草国产成人99久久| 一区二区三区在线观看欧美| 一区二区在线观看不卡| 亚洲bt欧美bt精品| 婷婷综合久久一区二区三区| 婷婷一区二区三区| 亚洲不卡av一区二区三区| 午夜精品福利一区二区三区蜜桃| 日韩高清在线电影| 国产乱码一区二区三区| 大胆欧美人体老妇| 91网站最新网址| 欧美三级电影在线观看| 欧美一区二区三级| 久久精品夜色噜噜亚洲aⅴ| 国产精品成人免费在线| 一区二区三区在线视频免费 | 在线视频中文字幕一区二区| 欧美日韩在线免费视频| 69堂成人精品免费视频| 亚洲精品一线二线三线| 国产欧美日产一区| 亚洲精品高清视频在线观看| 欧美aaaaaa午夜精品| 国产黄色精品网站| 欧美无砖砖区免费| 欧美日韩亚洲综合一区| 欧美sm美女调教| 国产精品久久久久久亚洲伦 | 久久久久久久电影| 一区二区在线观看视频| 国产伦精品一区二区三区视频青涩| 99精品视频一区二区| 日韩精品一区二区三区蜜臀| 亚洲精品乱码久久久久久久久 | 国产成人在线观看| 日韩一区二区精品葵司在线| 国产日韩欧美制服另类| 亚洲成人午夜电影| av在线不卡免费看| 欧美日韩高清一区二区三区| 中文字幕不卡的av| 天堂av在线一区| 91在线观看成人| 久久无码av三级| 五月综合激情婷婷六月色窝| 国产黑丝在线一区二区三区| 日韩欧美国产精品| 亚洲成人一区二区| 色综合亚洲欧洲| 国产精品久久毛片a| 国产麻豆精品95视频| 欧美一卡二卡三卡| 亚洲午夜av在线| 91亚洲大成网污www| 久久久99免费| 麻豆极品一区二区三区| 色婷婷精品大在线视频| 国产精品美女久久久久aⅴ国产馆| 日韩影院在线观看| 色婷婷av一区二区三区之一色屋| 国产欧美一区二区三区沐欲| 久久疯狂做爰流白浆xx| 欧美狂野另类xxxxoooo| 亚洲中国最大av网站| 99国产一区二区三精品乱码| 日本一区二区三级电影在线观看| 久久国产精品99久久久久久老狼 | 欧美日韩综合在线| 亚洲精品videosex极品| 91香蕉视频mp4| 亚洲女厕所小便bbb| 久久久久久影视| 三级久久三级久久| 欧美无砖专区一中文字| 亚洲影院久久精品| 欧美熟乱第一页|