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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? gpio.c

?? freertosV4.40 是一種small的嵌入式系統(tǒng)。利于嵌入式開(kāi)好者入門學(xué)習(xí)嵌入式操作系統(tǒng)。通過(guò)對(duì)于源碼的學(xué)習(xí)可以很好的掌握f(shuō)reertos的運(yùn)行機(jī)制。
?? C
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
//*****************************************************************************
//
// 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

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产91久久综合桃花| 欧美日韩高清在线播放| 麻豆国产一区二区| 日韩在线一二三区| 一区二区三区欧美在线观看| 亚洲免费看黄网站| 国产精品久久夜| 国产精品二区一区二区aⅴ污介绍| 久久久久久久网| 国产精品萝li| 一区二区三区在线视频免费观看| 亚洲欧美另类小说| 石原莉奈在线亚洲二区| 天天av天天翘天天综合网 | 麻豆精品一区二区综合av| 蜜桃视频一区二区| 六月婷婷色综合| 日本高清不卡一区| 欧美在线看片a免费观看| 欧美色欧美亚洲另类二区| 欧美日韩亚洲综合| 欧美一区二区三区视频免费播放| 日韩精品一区二区三区蜜臀 | www久久久久| 欧美国产激情二区三区| 亚洲欧美一区二区三区孕妇| 亚洲国产你懂的| 日本一不卡视频| 国产乱码字幕精品高清av| 国产一区二区三区不卡在线观看| 成人在线综合网站| 色999日韩国产欧美一区二区| 欧美军同video69gay| 日韩视频一区在线观看| 国产日韩一级二级三级| 亚洲一区在线视频观看| 麻豆极品一区二区三区| 99视频国产精品| 欧美精品国产精品| 国产欧美一区视频| 亚洲一区二区三区三| 精品亚洲国产成人av制服丝袜| 成人app网站| 91精品国产一区二区三区| 亚洲国产成人一区二区三区| 亚洲一本大道在线| 国产成人精品一区二| 欧美日韩国产综合一区二区| 久久久精品中文字幕麻豆发布| 一区二区三区 在线观看视频 | 欧美精品粉嫩高潮一区二区| 久久久精品天堂| 午夜在线成人av| 国产999精品久久久久久绿帽| 色天使久久综合网天天| 久久久久久日产精品| 香蕉加勒比综合久久| av午夜精品一区二区三区| 日韩欧美视频一区| 亚洲主播在线播放| 国产精品1区二区.| 91.麻豆视频| 夜夜嗨av一区二区三区网页 | 日韩免费观看高清完整版| 亚洲欧美自拍偷拍色图| 久久99精品国产91久久来源| 欧美午夜视频网站| 中文字幕中文乱码欧美一区二区| 蜜桃视频免费观看一区| 欧美三级视频在线观看| 亚洲欧美日韩小说| 国产成人在线电影| 日韩视频中午一区| 香蕉成人啪国产精品视频综合网| 91一区二区三区在线播放| 久久久久久久免费视频了| 青青草国产成人av片免费| 欧美性猛交一区二区三区精品| 中文字幕高清不卡| 国产一区二区精品久久91| 日韩午夜在线播放| 午夜亚洲国产au精品一区二区| 91年精品国产| 自拍偷拍国产精品| 不卡的av在线| 亚洲欧洲一区二区三区| 高清不卡在线观看av| 国产亚洲一区字幕| 国产精品一区在线| 久久久久久久久久久久久久久99 | 日本三级亚洲精品| 欧美精品久久久久久久久老牛影院| 一区二区免费视频| bt欧美亚洲午夜电影天堂| 欧美极品少妇xxxxⅹ高跟鞋| 国产精品一区在线观看乱码| 国产午夜亚洲精品不卡| 国产一区二区三区黄视频| 久久亚洲一级片| 国产一区二区精品久久| 国产欧美一区二区精品忘忧草| 国产成人精品亚洲777人妖| 欧美激情中文字幕| 丁香网亚洲国际| 国产精品超碰97尤物18| 色婷婷精品大在线视频| 亚洲亚洲精品在线观看| 91麻豆精品国产91久久久使用方法 | 中文字幕一区免费在线观看| 不卡av在线免费观看| 日韩毛片一二三区| 色偷偷久久人人79超碰人人澡| 亚洲图片有声小说| 91精品国产综合久久香蕉的特点| 日韩va欧美va亚洲va久久| 欧美成人午夜电影| 成人午夜视频福利| 亚洲女与黑人做爰| 欧美精品久久久久久久久老牛影院| 免费观看成人av| 久久久久久久久蜜桃| 成人av动漫网站| 亚洲二区在线视频| 日韩欧美精品三级| 国产aⅴ精品一区二区三区色成熟| 国产精品久久久久影视| 欧美亚洲高清一区| 久久99国产精品免费网站| 国产三级精品视频| 欧美中文一区二区三区| 美国三级日本三级久久99| 国产亚洲综合在线| 欧洲精品一区二区| 精品一区二区精品| 亚洲日本在线观看| 日韩精品资源二区在线| 懂色av一区二区在线播放| 日韩毛片高清在线播放| 欧美一级欧美一级在线播放| 国产盗摄女厕一区二区三区| 亚洲一区二区三区四区五区黄| 欧美成人福利视频| 99久久99久久综合| 蜜桃视频免费观看一区| 成人欧美一区二区三区黑人麻豆| 制服丝袜亚洲精品中文字幕| 国产一区 二区 三区一级| 亚洲综合丝袜美腿| 久久青草国产手机看片福利盒子| 91视频国产资源| 激情综合色播激情啊| 一区二区三区四区av| 久久久久久久久97黄色工厂| 色婷婷综合五月| 国产一区二区三区观看| 亚洲不卡在线观看| 国产免费观看久久| 91精品国产高清一区二区三区| www..com久久爱| 久久精品国产一区二区| 亚洲欧美激情插| 国产日韩欧美激情| 91精品国产高清一区二区三区蜜臀| 成人av手机在线观看| 激情综合网av| 97精品电影院| 极品美女销魂一区二区三区免费| 亚洲一区二区三区国产| 国产丝袜欧美中文另类| 777xxx欧美| 欧美三级视频在线| 91丝袜国产在线播放| 国产成人综合自拍| 日本女人一区二区三区| 亚洲激情综合网| 中文乱码免费一区二区| 欧美tickling挠脚心丨vk| 欧美视频一二三区| 色综合色综合色综合| 丁香天五香天堂综合| 国产激情一区二区三区| 美洲天堂一区二卡三卡四卡视频| 亚洲午夜视频在线| 一区二区三区中文字幕电影| 国产精品色哟哟| 久久久久亚洲综合| 精品伦理精品一区| 91麻豆精品91久久久久久清纯| 在线免费观看日本一区| 色综合久久久久网| 91亚洲国产成人精品一区二三| 国产精品一区二区在线播放 | 精品一区二区免费视频| 天堂成人国产精品一区| 亚洲第一福利视频在线| 一区二区激情小说| 一二三区精品视频| 亚洲最新在线观看| 亚洲一区二区三区四区的| 亚洲一区免费观看|