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

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

?? usb.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 5 頁
字號:
}

//*****************************************************************************
//
//! Clears the status bits in this endpoint in device mode.
//!
//! \param ulBase specifies the USB module base address.
//! \param ulEndpoint is the endpoint to access.
//! \param ulFlags are the status bits that will be cleared.
//!
//! This function will clear the status of any bits that are passed in the
//! \e ulFlags parameter.  The \e ulFlags parameter can take the value returned
//! from the USBEndpointStatus() call.
//!
//! \note This function should only be called in device mode.
//!
//! \return None.
//
//*****************************************************************************
void
USBDevEndpointStatusClear(unsigned long ulBase, unsigned long ulEndpoint,
                          unsigned long ulFlags)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);
    ASSERT((ulEndpoint == USB_EP_0) || (ulEndpoint == USB_EP_1) ||
           (ulEndpoint == USB_EP_2) || (ulEndpoint == USB_EP_3) ||
           (ulEndpoint == USB_EP_4) || (ulEndpoint == USB_EP_5) ||
           (ulEndpoint == USB_EP_6) || (ulEndpoint == USB_EP_7) ||
           (ulEndpoint == USB_EP_8) || (ulEndpoint == USB_EP_9) ||
           (ulEndpoint == USB_EP_10) || (ulEndpoint == USB_EP_11) ||
           (ulEndpoint == USB_EP_12) || (ulEndpoint == USB_EP_13) ||
           (ulEndpoint == USB_EP_14) || (ulEndpoint == USB_EP_15));

    //
    // If this is endpoint 0 then the bits have different meaning and map into
    // the TX memory location.
    //
    if(ulEndpoint == USB_EP_0)
    {
        //
        // Set the Serviced RxPktRdy bit to clear the RxPktRdy.
        //
        if(ulFlags & USB_DEV_EP0_OUT_PKTRDY)
        {
            HWREGB(ulBase + USB_O_CSRL0) |= USB_CSRL0_RXRDYC;
        }

        //
        // Set the serviced Setup End bit to clear the SetupEnd status.
        //
        if(ulFlags & USB_DEV_EP0_SETUP_END)
        {
            HWREGB(ulBase + USB_O_CSRL0) |= USB_CSRL0_SETENDC;
        }

        //
        // Clear the Sent Stall status flag.
        //
        if(ulFlags & USB_DEV_EP0_SENT_STALL)
        {
            HWREGB(ulBase + USB_O_CSRL0) &= ~(USB_DEV_EP0_SENT_STALL);
        }
    }
    else
    {
        //
        // Clear out any TX flags that were passed in.  Only
        // USB_DEV_TX_SENT_STALL and USB_DEV_TX_UNDERRUN should be cleared.
        //
        HWREGB(ulBase + USB_O_TXCSRL1 + EP_OFFSET(ulEndpoint)) &=
            ~(ulFlags & (USB_DEV_TX_SENT_STALL | USB_DEV_TX_UNDERRUN));

        //
        // Clear out valid RX flags that were passed in.  Only
        // USB_DEV_RX_SENT_STALL, USB_DEV_RX_DATA_ERROR, and USB_DEV_RX_OVERRUN
        // should be cleared.
        //
        HWREGB(ulBase + USB_O_RXCSRL1 + EP_OFFSET(ulEndpoint)) &=
            ~((ulFlags & (USB_DEV_RX_SENT_STALL | USB_DEV_RX_DATA_ERROR |
                          USB_DEV_RX_OVERRUN)) >> USB_RX_EPSTATUS_SHIFT);
    }
}

//*****************************************************************************
//
//! Sets the value data toggle on an endpoint in host mode.
//!
//! \param ulBase specifies the USB module base address.
//! \param ulEndpoint specifies the endpoint to reset the data toggle.
//! \param bDataToggle specifies whether to set the state to DATA0 or DATA1.
//! \param ulFlags specifies whether to set the IN or OUT endpoint.
//!
//! This function is used to force the state of the data toggle in host mode.
//! If the value passed in the \e bDataToggle parameter is \b false, then the
//! data toggle will be set to the DATA0 state, and if it is \b true it will be
//! set to the DATA1 state.  The \e ulFlags parameter can be \b USB_EP_HOST_IN
//! or \b USB_EP_HOST_OUT to access the desired portion of this endpoint.  The
//! \e ulFlags parameter is ignored for endpoint zero.
//!
//! \note This function should only be called in host mode.
//!
//! \return None.
//
//*****************************************************************************
void
USBHostEndpointDataToggle(unsigned long ulBase, unsigned long ulEndpoint,
                          tBoolean bDataToggle, unsigned long ulFlags)
{
    unsigned long ulDataToggle;

    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);
    ASSERT((ulEndpoint == USB_EP_0) || (ulEndpoint == USB_EP_1) ||
           (ulEndpoint == USB_EP_2) || (ulEndpoint == USB_EP_3) ||
           (ulEndpoint == USB_EP_4) || (ulEndpoint == USB_EP_5) ||
           (ulEndpoint == USB_EP_6) || (ulEndpoint == USB_EP_7) ||
           (ulEndpoint == USB_EP_8) || (ulEndpoint == USB_EP_9) ||
           (ulEndpoint == USB_EP_10) || (ulEndpoint == USB_EP_11) ||
           (ulEndpoint == USB_EP_12) || (ulEndpoint == USB_EP_13) ||
           (ulEndpoint == USB_EP_14) || (ulEndpoint == USB_EP_15));

    //
    // The data toggle defaults to DATA0.
    //
    ulDataToggle = 0;

    //
    // See if the data toggle should be set to DATA1.
    //
    if(bDataToggle)
    {
        //
        // Select the data toggle bit based on the endpoint.
        //
        if(ulEndpoint == USB_EP_0)
        {
            ulDataToggle = USB_CSRH0_DT;
        }
        else if(ulFlags == USB_EP_HOST_IN)
        {
            ulDataToggle = USB_RXCSRH1_DT;
        }
        else
        {
            ulDataToggle = USB_TXCSRH1_DT;
        }
    }

    //
    // Set the data toggle based on the endpoint.
    //
    if(ulEndpoint == USB_EP_0)
    {
        //
        // Set the write enable and the bit value for endpoint zero.
        //
        HWREGB(ulBase + USB_O_CSRH0) =
            ((HWREGB(ulBase + USB_O_CSRH0) &
              ~(USB_CSRH0_DTWE | USB_CSRH0_DT)) |
             (ulDataToggle | USB_CSRH0_DTWE));
    }
    else if(ulFlags == USB_EP_HOST_IN)
    {
        //
        // Set the Write enable and the bit value for an IN endpoint.
        //
        HWREGB(ulBase + USB_O_RXCSRH1 + EP_OFFSET(ulEndpoint)) =
            ((HWREGB(ulBase + USB_O_RXCSRH1 + EP_OFFSET(ulEndpoint)) &
              ~(USB_RXCSRH1_DTWE | USB_RXCSRH1_DT)) |
             (ulDataToggle | USB_RXCSRH1_DTWE));
    }
    else
    {
        //
        // Set the Write enable and the bit value for an OUT endpoint.
        //
        HWREGB(ulBase + USB_O_TXCSRH1 + EP_OFFSET(ulEndpoint)) =
            ((HWREGB(ulBase + USB_O_TXCSRH1 + EP_OFFSET(ulEndpoint)) &
              ~(USB_TXCSRH1_DTWE | USB_TXCSRH1_DT)) |
             (ulDataToggle | USB_TXCSRH1_DTWE));
    }
}

//*****************************************************************************
//
//! Sets the Data toggle on an endpoint to zero.
//!
//! \param ulBase specifies the USB module base address.
//! \param ulEndpoint specifies the endpoint to reset the data toggle.
//! \param ulFlags specifies whether to access the IN or OUT endpoint.
//!
//! This function will cause the controller to clear the data toggle for an
//! endpoint.  This call is not valid for endpoint zero and can be made with
//! host or device controllers.
//!
//! The \e ulFlags parameter should be one of \b USB_EP_HOST_OUT,
//! \b USB_EP_HOST_IN, \b USB_EP_DEV_OUT, or \b USB_EP_DEV_IN.
//!
//! \return None.
//
//*****************************************************************************
void
USBEndpointDataToggleClear(unsigned long ulBase, unsigned long ulEndpoint,
                           unsigned long ulFlags)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);
    ASSERT((ulEndpoint == USB_EP_1) || (ulEndpoint == USB_EP_2) ||
           (ulEndpoint == USB_EP_3) || (ulEndpoint == USB_EP_4) ||
           (ulEndpoint == USB_EP_5) || (ulEndpoint == USB_EP_6) ||
           (ulEndpoint == USB_EP_7) || (ulEndpoint == USB_EP_8) ||
           (ulEndpoint == USB_EP_9) || (ulEndpoint == USB_EP_10) ||
           (ulEndpoint == USB_EP_11) || (ulEndpoint == USB_EP_12) ||
           (ulEndpoint == USB_EP_13) || (ulEndpoint == USB_EP_14) ||
           (ulEndpoint == USB_EP_15));

    //
    // See if the transmit or receive data toggle should be cleared.
    //
    if(ulFlags & (USB_EP_HOST_OUT | USB_EP_DEV_IN))
    {
        HWREGB(ulBase + USB_O_TXCSRL1 + EP_OFFSET(ulEndpoint)) |=
            USB_TXCSRL1_CLRDT;
    }
    else
    {
        HWREGB(ulBase + USB_O_RXCSRL1 + EP_OFFSET(ulEndpoint)) |=
            USB_RXCSRL1_CLRDT;
    }
}

//*****************************************************************************
//
//! Stalls the specified endpoint in device mode.
//!
//! \param ulBase specifies the USB module base address.
//! \param ulEndpoint specifies the endpoint to stall.
//! \param ulFlags specifies whether to stall the IN or OUT endpoint.
//!
//! This function will cause to endpoint number passed in to go into a stall
//! condition.  If the \e ulFlags parameter is \b USB_EP_DEV_IN then the stall
//! will be issued on the IN portion of this endpoint.  If the \e ulFlags
//! parameter is \b USB_EP_DEV_OUT then the stall will be issued on the OUT
//! portion of this endpoint.
//!
//! \note This function should only be called in device mode.
//!
//! \return None.
//
//*****************************************************************************
void
USBDevEndpointStall(unsigned long ulBase, unsigned long ulEndpoint,
                    unsigned long ulFlags)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);
    ASSERT((ulFlags & ~(USB_EP_DEV_IN | USB_EP_DEV_OUT)) == 0)
    ASSERT((ulEndpoint == USB_EP_0) || (ulEndpoint == USB_EP_1) ||
           (ulEndpoint == USB_EP_2) || (ulEndpoint == USB_EP_3) ||
           (ulEndpoint == USB_EP_4) || (ulEndpoint == USB_EP_5) ||
           (ulEndpoint == USB_EP_6) || (ulEndpoint == USB_EP_7) ||
           (ulEndpoint == USB_EP_8) || (ulEndpoint == USB_EP_9) ||
           (ulEndpoint == USB_EP_10) || (ulEndpoint == USB_EP_11) ||
           (ulEndpoint == USB_EP_12) || (ulEndpoint == USB_EP_13) ||
           (ulEndpoint == USB_EP_14) || (ulEndpoint == USB_EP_15));

    //
    // Determine how to stall this endpoint.
    //
    if(ulEndpoint == USB_EP_0)
    {
        //
        // Perform a stall on endpoint zero.
        //
        HWREGB(ulBase + USB_O_CSRL0) |=
            (USB_CSRL0_STALL | USB_CSRL0_RXRDYC);
    }
    else if(ulFlags == USB_EP_DEV_IN)
    {
        //
        // Perform a stall on an IN endpoint.
        //
        HWREGB(ulBase + USB_O_TXCSRL1 + EP_OFFSET(ulEndpoint)) |=
            USB_TXCSRL1_STALL;
    }
    else
    {
        //
        // Perform a stall on an OUT endpoint.
        //
        HWREGB(ulBase + USB_O_RXCSRL1 + EP_OFFSET(ulEndpoint)) |=
            USB_RXCSRL1_STALL;
    }
}

//*****************************************************************************
//
//! Clears the stall condition on the specified endpoint in device mode.
//!
//! \param ulBase specifies the USB module base address.
//! \param ulEndpoint specifies which endpoint to remove the stall condition.
//! \param ulFlags specifies whether to remove the stall condition from the IN
//! or the OUT portion of this endpoint.
//!
//! This function will cause the endpoint number passed in to exit the stall
//! condition.  If the \e ulFlags parameter is \b USB_EP_DEV_IN then the stall
//! will be cleared on the IN portion of this endpoint.  If the \e ulFlags
//! parameter is \b USB_EP_DEV_OUT then the stall will be cleared on the OUT
//! portion of this endpoint.
//!
//! \note This function should only be called in device mode.
//!
//! \return None.
//
//*****************************************************************************
void
USBDevEndpointStallClear(unsigned long ulBase, unsigned long ulEndpoint,
                         unsigned long ulFlags)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);
    ASSERT((ulEndpoint == USB_EP_0) || (ulEndpoint == USB_EP_1) ||
           (ulEndpoint == USB_EP_2) || (ulEndpoint == USB_EP_3) ||
           (ulEndpoint == USB_EP_4) || (ulEndpoint == USB_EP_5) ||
           (ulEndpoint == USB_EP_6) || (ulEndpoint == USB_EP_7) ||
           (ulEndpoint == USB_EP_8) || (ulEndpoint == USB_EP_9) ||
           (ulEndpoint == USB_EP_10) || (ulEndpoint == USB_EP_11) ||
           (ulEndpoint == USB_EP_12) || (ulEndpoint == USB_EP_13) ||
           (ulEndpoint == USB_EP_14) || (ulEndpoint == USB_EP_15));
    ASSERT((ulFlags & ~(USB_EP_DEV_IN | USB_EP_DEV_OUT)) == 0)

    //
    // Determine how to clear the stall on this endpoint.
    //
    if(ulEndpoint == USB_EP_0)
    {
        //
        // Clear the stall on endpoint zero.
        //
        HWREGB(ulBase + USB_O_CSRL0) &= ~USB_CSRL0_STALLED;
    }
    else if(ulFlags == USB_EP_DEV_IN)
    {
        //
        // Clear the stall on an IN endpoint.
        //
        HWREGB(ulBase + USB_O_TXCSRL1 + EP_OFFSET(ulEndpoint)) &=
            ~(USB_TXCSRL1_STALL | USB_TXCSRL1_STALLED);

        //
        // Reset the data toggle.
        //
        HWREGB(ulBase + USB_O_TXCSRL1 + EP_OFFSET(ulEndpoint)) |=
            USB_TXCSRL1_CLRDT;
    }
    else
    {
        //
        // Clear the stall on an OUT endpoint.
        //
        HWREGB(ulBase + USB_O_RXCSRL1 + EP_OFFSET(ulEndpoint)) &=
            ~(USB_RXCSRL1_STALL | USB_RXCSRL1_STALLED);

        //
        // Reset the data toggle.
        //
        HWREGB(ulBase + USB_O_RXCSRL1 + EP_OFFSET(ulEndpoint)) |=
            USB_TXCSRL1_CLRDT;
    }
}

//*****************************************************************************
//
//! Connects the USB controller to the bus in device mode.
//!
//! \param ulBase specifies the USB module base address.
//!

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
67194成人在线观看| 一区二区三区在线不卡| 中文字幕一区二区三| 亚洲图片欧美视频| 成人动漫一区二区三区| 欧美精品在线一区二区| 国产精品久久久爽爽爽麻豆色哟哟| 亚洲成人一二三| 95精品视频在线| 日韩欧美久久一区| 亚洲大片在线观看| 一本一道久久a久久精品综合蜜臀| 777午夜精品免费视频| 亚洲免费av高清| av网站一区二区三区| 精品国产精品网麻豆系列| 午夜久久电影网| 在线免费观看视频一区| 国产精品久久久久久福利一牛影视| 蜜臀精品一区二区三区在线观看| 日本韩国一区二区三区视频| 国产欧美一二三区| 国产成人免费视频网站| 精品人伦一区二区色婷婷| 五月天亚洲精品| 欧美视频一区在线观看| 一区二区三区欧美日韩| aaa欧美日韩| 国产精品美女久久久久久久 | 一区二区三区精品在线观看| 粉嫩高潮美女一区二区三区| 精品剧情在线观看| 久久9热精品视频| 精品国产123| 紧缚捆绑精品一区二区| 欧美精品一区二区三区久久久| 五月天激情综合| 911精品国产一区二区在线| 日韩国产一二三区| 欧美一卡在线观看| 美女久久久精品| 精品国产免费人成在线观看| 国产一区二区美女| 欧美激情一区在线观看| 成人av免费在线| 一区二区三区四区蜜桃| 制服丝袜亚洲色图| 国产一区欧美二区| 亚洲国产成人一区二区三区| 91影院在线免费观看| 亚洲男人的天堂在线观看| 91国偷自产一区二区三区观看| 一区二区三区鲁丝不卡| 67194成人在线观看| 国产在线播放一区| 国产精品二区一区二区aⅴ污介绍| 99精品一区二区| 亚洲成人久久影院| 精品国产一区a| 91在线精品一区二区三区| 亚洲欧美国产高清| 日韩午夜激情免费电影| 国产精一品亚洲二区在线视频| 国产精品国产自产拍高清av| 欧美日韩一区二区在线观看| 另类人妖一区二区av| 18成人在线观看| 日韩一区二区免费视频| 成年人国产精品| 日本美女一区二区三区视频| 国产精品久久久久久久久晋中| 欧美三级中文字| 国产成人丝袜美腿| 日本不卡一二三区黄网| 国产精品水嫩水嫩| 欧美日韩电影在线| 成人精品一区二区三区中文字幕| 亚洲最快最全在线视频| 国产亚洲欧洲997久久综合| 欧美在线免费观看视频| 国产iv一区二区三区| 无码av免费一区二区三区试看| 国产丝袜美腿一区二区三区| 欧美高清一级片在线| www.亚洲激情.com| 国内精品久久久久影院一蜜桃| 一区二区三区四区视频精品免费| 日本一区二区三区视频视频| 欧美一区二区三区啪啪| 在线亚洲高清视频| 成人h动漫精品一区二区| 久久精品999| 午夜激情综合网| 亚洲精品中文字幕乱码三区| 久久久www成人免费无遮挡大片| 69精品人人人人| 欧美日韩一区二区在线观看| 91网址在线看| www.久久久久久久久| 国产麻豆精品一区二区| 久久电影网电视剧免费观看| 日韩中文字幕麻豆| 午夜一区二区三区在线观看| 亚洲美女免费在线| 国产精品成人一区二区艾草 | 粉嫩绯色av一区二区在线观看 | 午夜精品福利一区二区三区av| 亚洲欧美日韩在线| 中文字幕av资源一区| 国产亚洲午夜高清国产拍精品| 日韩免费视频一区二区| 91精品国产入口在线| 3d成人动漫网站| 91精品黄色片免费大全| 欧美美女激情18p| 欧美日韩精品一区二区三区| 精品污污网站免费看| 在线观看91精品国产入口| 色综合网色综合| 色噜噜偷拍精品综合在线| 色av成人天堂桃色av| 一本色道久久综合亚洲aⅴ蜜桃| 99久久国产综合精品色伊| 91视频在线观看| 欧美三级欧美一级| 欧美顶级少妇做爰| 日韩欧美在线网站| 久久日韩粉嫩一区二区三区| 久久婷婷色综合| 中文字幕在线观看一区二区| 亚洲日本韩国一区| 一区二区三区资源| 日韩中文字幕91| 国产一区不卡视频| 成人国产在线观看| 在线看一区二区| 欧美一区二区三区四区在线观看 | 欧美久久高跟鞋激| 欧美大白屁股肥臀xxxxxx| 精品少妇一区二区三区免费观看| 国产视频一区在线播放| 日韩伦理免费电影| 日日夜夜一区二区| 国产成人免费在线观看不卡| 99久久精品免费精品国产| 欧美色综合影院| 精品国产91久久久久久久妲己 | 奇米色777欧美一区二区| 国内精品在线播放| 色综合色综合色综合| 欧美刺激午夜性久久久久久久| 国产精品国产三级国产三级人妇| 亚洲精品成人a在线观看| 青青草精品视频| 99综合电影在线视频| 在线不卡欧美精品一区二区三区| 久久精品欧美一区二区三区麻豆 | 亚洲品质自拍视频网站| 香蕉久久夜色精品国产使用方法| 国产精品1区2区3区| 欧美视频一区在线观看| 国产亚洲精品7777| 视频一区二区三区入口| 成人免费va视频| 欧美一卡二卡三卡| 亚洲色欲色欲www| 国产乱对白刺激视频不卡| 欧美体内she精高潮| 中文字幕av一区 二区| 麻豆成人av在线| 欧美午夜电影在线播放| 国产精品日韩成人| 麻豆91精品91久久久的内涵| 91久久线看在观草草青青| 国产亚洲综合在线| 奇米精品一区二区三区在线观看| 色成年激情久久综合| 国产精品盗摄一区二区三区| 国产一区二区久久| 欧美剧情片在线观看| 洋洋av久久久久久久一区| 97超碰欧美中文字幕| 久久精品一级爱片| 国产一区二区剧情av在线| 欧美一区2区视频在线观看| 亚洲国产wwwccc36天堂| 日本精品裸体写真集在线观看| 国产精品美女久久久久高潮 | 日韩 欧美一区二区三区| 在线观看日韩毛片| 亚洲视频免费看| 99免费精品在线观看| 国产精品免费观看视频| 成人在线视频一区| 国产三级三级三级精品8ⅰ区| 久久99热狠狠色一区二区| 日韩一卡二卡三卡| 另类小说欧美激情| 久久综合狠狠综合久久激情| 国产综合久久久久久鬼色|