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

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

?? usb.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 5 頁
字號:
//*****************************************************************************
//
// usb.c - Driver for the USB Interface.
//
// Copyright (c) 2007-2010 Texas Instruments Incorporated.  All rights reserved.
// Software License Agreement
// 
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
// 
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// 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. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
// 
// This is part of revision 5821 of the Stellaris Peripheral Driver Library.
//
//*****************************************************************************

//*****************************************************************************
//
//! \addtogroup usb_api
//! @{
//
//*****************************************************************************

#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_usb.h"
#include "driverlib/debug.h"
#include "driverlib/interrupt.h"
#include "driverlib/udma.h"
#include "driverlib/usb.h"

//*****************************************************************************
//
// Amount to shift the RX interrupt sources by in the flags used in the
// interrupt calls.
//
//*****************************************************************************
#ifndef DEPRECATED
#define USB_INT_RX_SHIFT        8
#endif
#define USB_INTEP_RX_SHIFT      16

//*****************************************************************************
//
// Amount to shift the status interrupt sources by in the flags used in the
// interrupt calls.
//
//*****************************************************************************
#ifndef DEPRECATED
#define USB_INT_STATUS_SHIFT    24
#endif

//*****************************************************************************
//
// Amount to shift the RX endpoint status sources by in the flags used in the
// calls.
//
//*****************************************************************************
#define USB_RX_EPSTATUS_SHIFT   16

//*****************************************************************************
//
// Converts from an endpoint specifier to the offset of the endpoint's
// control/status registers.
//
//*****************************************************************************
#define EP_OFFSET(Endpoint)     (Endpoint - 0x10)

//*****************************************************************************
//
// Sets one of the indexed registers.
//
// \param ulBase specifies the USB module base address.
// \param ulEndpoint is the endpoint index to target for this write.
// \param ulIndexedReg is the indexed register to write to.
// \param ucValue is the value to write to the register.
//
// This function is used to access the indexed registers for each endpoint.
// The only registers that are indexed are the FIFO configuration registers
// which are not used after configuration.
//
// \return None.
//
//*****************************************************************************
static void
USBIndexWrite(unsigned long ulBase, unsigned long ulEndpoint,
              unsigned long ulIndexedReg, unsigned long ulValue,
              unsigned long ulSize)
{
    unsigned long ulIndex;

    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);
    ASSERT((ulEndpoint == 0) || (ulEndpoint == 1) || (ulEndpoint == 2) ||
           (ulEndpoint == 3));
    ASSERT((ulSize == 1) || (ulSize == 2));

    //
    // Save the old index in case it was in use.
    //
    ulIndex = HWREGB(ulBase + USB_O_EPIDX);

    //
    // Set the index.
    //
    HWREGB(ulBase + USB_O_EPIDX) = ulEndpoint;

    //
    // Determine the size of the register value.
    //
    if(ulSize == 1)
    {
        //
        // Set the value.
        //
        HWREGB(ulBase + ulIndexedReg) = ulValue;
    }
    else
    {
        //
        // Set the value.
        //
        HWREGH(ulBase + ulIndexedReg) = ulValue;
    }

    //
    // Restore the old index in case it was in use.
    //
    HWREGB(ulBase + USB_O_EPIDX) = ulIndex;
}

//*****************************************************************************
//
// Reads one of the indexed registers.
//
// \param ulBase specifies the USB module base address.
// \param ulEndpoint is the endpoint index to target for this write.
// \param ulIndexedReg is the indexed register to write to.
//
// This function is used interally to access the indexed registers for each
// endpoint.  The only registers that are indexed are the FIFO configuration
// registers which are not used after configuration.
//
// \return The value in the register requested.
//
//*****************************************************************************
static unsigned long
USBIndexRead(unsigned long ulBase, unsigned long ulEndpoint,
             unsigned long ulIndexedReg, unsigned long ulSize)
{
    unsigned char ulIndex;
    unsigned char ulValue;

    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);
    ASSERT((ulEndpoint == 0) || (ulEndpoint == 1) || (ulEndpoint == 2) ||
           (ulEndpoint == 3));
    ASSERT((ulSize == 1) || (ulSize == 2));

    //
    // Save the old index in case it was in use.
    //
    ulIndex = HWREGB(ulBase + USB_O_EPIDX);

    //
    // Set the index.
    //
    HWREGB(ulBase + USB_O_EPIDX) = ulEndpoint;

    //
    // Determine the size of the register value.
    //
    if(ulSize == 1)
    {
        //
        // Get the value.
        //
        ulValue = HWREGB(ulBase + ulIndexedReg);
    }
    else
    {
        //
        // Get the value.
        //
        ulValue = HWREGH(ulBase + ulIndexedReg);
    }

    //
    // Restore the old index in case it was in use.
    //
    HWREGB(ulBase + USB_O_EPIDX) = ulIndex;

    //
    // Return the register's value.
    //
    return(ulValue);
}

//*****************************************************************************
//
//! Puts the USB bus in a suspended state.
//!
//! \param ulBase specifies the USB module base address.
//!
//! When used in host mode, this function will put the USB bus in the suspended
//! state.
//!
//! \note This function should only be called in host mode.
//!
//! \return None.
//
//*****************************************************************************
void
USBHostSuspend(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);

    //
    // Send the suspend signaling to the USB bus.
    //
    HWREGB(ulBase + USB_O_POWER) |= USB_POWER_SUSPEND;
}

//*****************************************************************************
//
//! Handles the USB bus reset condition.
//!
//! \param ulBase specifies the USB module base address.
//! \param bStart specifies whether to start or stop signaling reset on the USB
//! bus.
//!
//! When this function is called with the \e bStart parameter set to \b true,
//! this function will cause the start of a reset condition on the USB bus.
//! The caller should then delay at least 20ms before calling this function
//! again with the \e bStart parameter set to \b false.
//!
//! \note This function should only be called in host mode.
//!
//! \return None.
//
//*****************************************************************************
void
USBHostReset(unsigned long ulBase, tBoolean bStart)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);

    //
    // Send a reset signal to the bus.
    //
    if(bStart)
    {
        HWREGB(ulBase + USB_O_POWER) |= USB_POWER_RESET;
    }
    else
    {
        HWREGB(ulBase + USB_O_POWER) &= ~USB_POWER_RESET;
    }
}

//*****************************************************************************
//
//! Handles the USB bus resume condition.
//!
//! \param ulBase specifies the USB module base address.
//! \param bStart specifies if the USB controller is entering or leaving the
//! resume signaling state.
//!
//! When in device mode this function will bring the USB controller out of the
//! suspend state.  This call should first be made with the \e bStart parameter
//! set to \b true to start resume signaling.  The device application should
//! then delay at least 10ms but not more than 15ms before calling this
//! function with the \e bStart parameter set to \b false.
//!
//! When in host mode this function will signal devices to leave the suspend
//! state.  This call should first be made with the \e bStart parameter set to
//! \b true to start resume signaling.  The host application should then delay
//! at least 20ms before calling this function with the \e bStart parameter set
//! to \b false.  This will cause the controller to complete the resume
//! signaling on the USB bus.
//!
//! \return None.
//
//*****************************************************************************
void
USBHostResume(unsigned long ulBase, tBoolean bStart)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);

    //
    // Send a resume signal to the bus.
    //
    if(bStart)
    {
        HWREGB(ulBase + USB_O_POWER) |= USB_POWER_RESUME;
    }
    else
    {
        HWREGB(ulBase + USB_O_POWER) &= ~USB_POWER_RESUME;
    }
}

//*****************************************************************************
//
//! Returns the current speed of the USB device connected.
//!
//! \param ulBase specifies the USB module base address.
//!
//! This function will return the current speed of the USB bus.
//!
//! \note This function should only be called in host mode.
//!
//! \return Returns either \b USB_LOW_SPEED, \b USB_FULL_SPEED, or
//! \b USB_UNDEF_SPEED.
//
//*****************************************************************************
unsigned long
USBHostSpeedGet(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);

    //
    // If the Full Speed device bit is set, then this is a full speed device.
    //
    if(HWREGB(ulBase + USB_O_DEVCTL) & USB_DEVCTL_FSDEV)
    {
        return(USB_FULL_SPEED);
    }

    //
    // If the Low Speed device bit is set, then this is a low speed device.
    //
    if(HWREGB(ulBase + USB_O_DEVCTL) & USB_DEVCTL_LSDEV)
    {
        return(USB_LOW_SPEED);
    }

    //
    // The device speed is not known.
    //
    return(USB_UNDEF_SPEED);
}

//*****************************************************************************
//
//! Returns the status of the USB interrupts.
//!
//! \param ulBase specifies the USB module base address.
//!
//! This function will read the source of the interrupt for the USB controller.
//! There are three groups of interrupt sources, IN Endpoints, OUT Endpoints,
//! and general status changes.  This call will return the current status for
//! all of these interrupts.  The bit values returned should be compared
//! against the \b USB_HOST_IN, \b USB_HOST_OUT, \b USB_HOST_EP0,
//! \b USB_DEV_IN, \b USB_DEV_OUT, and \b USB_DEV_EP0 values.
//!
//! \note This call will clear the source of all of the general status
//! interrupts.
//!
//! \note WARNING: This API cannot be used on endpoint numbers greater than
//! endpoint 3 so USBIntStatusControl() or USBIntStatusEndpoint() should be
//! used instead.
//!
//! \return Returns the status of the sources for the USB controller's

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产一区二区三区免费看| 亚洲欧美一区二区三区极速播放| 欧美吻胸吃奶大尺度电影| 成人激情电影免费在线观看| 国产福利91精品一区| 国产乱妇无码大片在线观看| 国产一区二区导航在线播放| 久久99久久99精品免视看婷婷 | 99riav久久精品riav| 国产精品99久久久久久久vr| 懂色av噜噜一区二区三区av| 国产精品资源在线看| 国产成人精品一区二区三区网站观看| 国产麻豆视频精品| 成人av网站在线观看免费| av亚洲精华国产精华精华| 99精品视频在线观看| 色综合久久久久久久久| 欧美日韩在线电影| 91精品国产综合久久久久久| xfplay精品久久| 国产精品沙发午睡系列990531| 亚洲日本va在线观看| 五月激情综合婷婷| 国产在线视频一区二区三区| 波多野结衣中文字幕一区二区三区| 91蜜桃视频在线| 欧美精品九九99久久| 26uuu精品一区二区在线观看| 国产欧美日韩亚州综合| 一区二区欧美视频| 狂野欧美性猛交blacked| 成人小视频在线| 欧美人妖巨大在线| 国产日韩欧美不卡在线| 一卡二卡欧美日韩| 国产在线麻豆精品观看| 91香蕉视频mp4| 精品国产一区二区三区忘忧草| 国产欧美精品国产国产专区| 亚洲午夜久久久| 国产成人高清在线| 欧美精品第1页| 国产精品传媒入口麻豆| 蜜臀久久99精品久久久久宅男| 成人av电影在线观看| 91精品国产高清一区二区三区 | 94-欧美-setu| 欧美大片在线观看一区| 亚洲欧美激情小说另类| 国产在线国偷精品免费看| 欧美日韩一级视频| 亚洲日本va午夜在线影院| 国产一区二区免费看| 欧美精品粉嫩高潮一区二区| 亚洲欧美偷拍另类a∨色屁股| 久久爱另类一区二区小说| 欧美偷拍一区二区| 亚洲欧美一区二区三区极速播放| 国产一区二区在线观看视频| 欧美疯狂性受xxxxx喷水图片| 亚洲欧洲一区二区在线播放| 国产一区二区美女| 日韩精品一区二区三区视频| 日韩黄色免费电影| 欧美日韩免费一区二区三区| 亚洲色图视频网站| eeuss鲁片一区二区三区| 久久一夜天堂av一区二区三区| 日本aⅴ精品一区二区三区| 91久久精品日日躁夜夜躁欧美| 国产精品家庭影院| 国产91精品一区二区麻豆亚洲| 久久青草欧美一区二区三区| 老司机精品视频一区二区三区| 日韩一区二区三区高清免费看看| 亚洲福利一二三区| 欧美精品丝袜久久久中文字幕| 午夜精品久久久久影视| 欧美日韩一区中文字幕| 亚洲国产欧美日韩另类综合| 精品视频一区二区三区免费| 亚洲第一久久影院| 欧美精品久久久久久久久老牛影院 | 日韩一区二区三区av| 天堂蜜桃91精品| 日韩欧美123| 国产一区二区三区免费观看| 久久精品一二三| 成人综合在线网站| 一区在线中文字幕| 欧美日产国产精品| 国产一区二区三区黄视频| 久久精品视频网| 99精品国产视频| 亚洲成av人片在线观看无码| 欧美zozozo| aaa欧美色吧激情视频| 一区二区三区视频在线观看| 欧美性色欧美a在线播放| 日本在线不卡视频| 久久精品无码一区二区三区| 99久久精品情趣| 首页亚洲欧美制服丝腿| 2024国产精品| 91九色最新地址| 狠狠色狠狠色综合| 亚洲精品免费一二三区| 日韩欧美在线1卡| jvid福利写真一区二区三区| 婷婷综合另类小说色区| xnxx国产精品| 欧美日韩一区在线| 国产一区二区在线看| 亚洲精品国产a| 久久免费视频一区| 欧洲av一区二区嗯嗯嗯啊| 久久激五月天综合精品| 中文字幕在线不卡一区| 欧美精三区欧美精三区| 国产精品一区免费视频| 一区二区三区四区不卡视频| 欧美一级一区二区| 91美女在线看| 国产老妇另类xxxxx| 亚洲丰满少妇videoshd| 国产精品污www在线观看| 欧美一级免费大片| 色婷婷久久久综合中文字幕 | 中文字幕在线播放不卡一区| 91精品国产一区二区| 99久久99久久精品免费观看| 九九九精品视频| 日韩成人一级片| 亚洲激情成人在线| 中文成人综合网| ww久久中文字幕| 亚洲精品一区二区三区精华液| 欧美日韩精品一区二区天天拍小说 | 亚洲国产欧美在线人成| 中文字幕二三区不卡| 久久亚洲精精品中文字幕早川悠里| 在线观看视频一区二区欧美日韩| 成人一级片网址| 国产米奇在线777精品观看| 日日欢夜夜爽一区| 无吗不卡中文字幕| 亚洲香肠在线观看| 亚洲综合久久久久| 亚洲欧美经典视频| 亚洲激情校园春色| 亚洲免费av在线| 亚洲品质自拍视频| 亚洲免费观看在线视频| 亚洲色图欧美激情| 国产精品国模大尺度视频| 国产欧美日韩视频在线观看| 久久奇米777| 中文字幕免费一区| 国产蜜臀97一区二区三区| 日本一区二区免费在线观看视频| 久久久欧美精品sm网站 | 粉嫩av一区二区三区| 国产一区亚洲一区| 成人蜜臀av电影| 91在线观看下载| 在线精品视频免费播放| 欧美在线视频你懂得| 欧美精品少妇一区二区三区| 欧美一区二区三区在线观看视频| 91精品蜜臀在线一区尤物| 日韩三区在线观看| 久久精品视频免费观看| 亚洲欧美在线视频观看| 亚洲香蕉伊在人在线观| 蜜臀av一级做a爰片久久| 国产福利91精品一区| 91视频在线观看免费| 欧美丰满一区二区免费视频| 精品粉嫩超白一线天av| 国产精品乱码一区二三区小蝌蚪| 亚洲一区在线视频观看| 秋霞成人午夜伦在线观看| 国产精品资源网| 欧美三级在线看| 久久久国产精华| 一区二区三区高清不卡| 精品系列免费在线观看| 97精品久久久午夜一区二区三区| 欧美日本一道本| 亚洲欧洲精品一区二区三区| 亚洲成国产人片在线观看| 国产在线播精品第三| 欧美视频中文字幕| 国产午夜一区二区三区| 亚洲成人自拍一区| 成人app在线观看| 日韩欧美国产一区二区在线播放 | 国产在线精品不卡| 欧美日韩免费一区二区三区视频|