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

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

?? usb.c

?? KEIL驅動 各方面各 你的看法女士的煩惱 方看到你
?? C
?? 第 1 頁 / 共 5 頁
字號:
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);
    ASSERT((ulEndpoint == USB_EP_1) || (ulEndpoint == USB_EP_2) ||
           (ulEndpoint == USB_EP_3));

    //
    // Determine if a transmit or receive endpoint is being configured.
    //
    if(ulFlags & USB_EP_DEV_IN)
    {
        //
        // Set the maximum packet size.
        //
        HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_TXMAXP1) =
            ulMaxPacketSize;

        //
        // The transmit control value is zero unless options are enabled.
        //
        ulRegister = 0;

        //
        // Allow auto setting of TxPktRdy when max packet size has been loaded
        // into the FIFO.
        //
        if(ulFlags & USB_EP_AUTO_SET)
        {
            ulRegister |= USB_TXCSRH1_AUTOSET;
        }

        //
        // Configure the DMA mode.
        //
        if(ulFlags & USB_EP_DMA_MODE_1)
        {
            ulRegister |= USB_TXCSRH1_DMAEN | USB_TXCSRH1_DMAMOD;
        }
        else if(ulFlags & USB_EP_DMA_MODE_0)
        {
            ulRegister |= USB_TXCSRH1_DMAEN;
        }

        //
        // Enable isochronous mode if requested.
        //
        if((ulFlags & USB_EP_MODE_MASK) == USB_EP_MODE_ISOC)
        {
            ulRegister |= USB_TXCSRH1_ISO;
        }

        //
        // Write the transmit control value.
        //
        HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_TXCSRH1) =
            (unsigned char)ulRegister;

        //
        // Reset the Data toggle to zero.
        //
        HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_TXCSRL1) =
            USB_TXCSRL1_CLRDT;
    }
    else
    {
        //
        // Set the MaxPacketSize.
        //
        HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_RXMAXP1) =
            ulMaxPacketSize;

        //
        // The receive control value is zero unless options are enabled.
        //
        ulRegister = 0;

        //
        // Allow auto clearing of RxPktRdy when packet of size max packet
        // has been unloaded from the FIFO.
        //
        if(ulFlags & USB_EP_AUTO_CLEAR)
        {
            ulRegister = USB_RXCSRH1_AUTOCL;
        }

        //
        // Configure the DMA mode.
        //
        if(ulFlags & USB_EP_DMA_MODE_1)
        {
            ulRegister |= USB_RXCSRH1_DMAEN | USB_RXCSRH1_DMAMOD;
        }
        else if(ulFlags & USB_EP_DMA_MODE_0)
        {
            ulRegister |= USB_RXCSRH1_DMAEN;
        }

        //
        // Enable isochronous mode if requested.
        //
        if(USB_EP_MODE_ISOC & (ulFlags & USB_EP_MODE_MASK))
        {
            ulRegister |= USB_RXCSRH1_ISO;
        }

        //
        // Write the receive control value.
        //
        HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_RXCSRH1) =
            (unsigned char)ulRegister;

        //
        // Reset the Data toggle to zero.
        //
        HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_RXCSRL1) =
            USB_RXCSRL1_CLRDT;
    }
}

//*****************************************************************************
//
//! Gets the current configuration for an endpoint.
//!
//! \param ulBase specifies the USB module base address.
//! \param ulEndpoint is the endpoint to access.
//! \param pulMaxPacketSize is a pointer which will be written with the
//! maximum packet size for this endpoint.
//! \param pulFlags is a pointer which will be written with the current
//! endpoint settings. On entry to the function, this pointer must contain
//! either \b USB_EP_DEV_IN or \b USB_EP_DEV_OUT to indicate whether the IN or
//! OUT endpoint is to be queried.
//!
//! This function will return the basic configuration for an endpoint in device
//! mode. The values returned in \e *pulMaxPacketSize and \e *pulFlags are
//! equivalent to the \e ulMaxPacketSize and \e ulFlags previously passed to
//! USBDevEndpointConfig for this endpoint.
//!
//! \note This function should only be called in device mode.
//!
//! \return None.
//
//*****************************************************************************
void
USBDevEndpointConfigGet(unsigned long ulBase, unsigned long ulEndpoint,
                        unsigned long *pulMaxPacketSize,
                        unsigned long *pulFlags)
{
    unsigned long ulRegister;

    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);
    ASSERT(pulMaxPacketSize && pulFlags);
    ASSERT((ulEndpoint == USB_EP_1) || (ulEndpoint == USB_EP_2) ||
           (ulEndpoint == USB_EP_3));

    //
    // Determine if a transmit or receive endpoint is being queried.
    //
    if(*pulFlags & USB_EP_DEV_IN)
    {
        //
        // Clear the flags other than the direction bit.
        //
        *pulFlags = USB_EP_DEV_IN;

        //
        // Get the maximum packet size.
        //
        *pulMaxPacketSize = (unsigned long)HWREGB(ulBase +
                                                  EP_OFFSET(ulEndpoint) +
                                                  USB_O_TXMAXP1);

        //
        // Get the current transmit control register value.
        //
        ulRegister = (unsigned long)HWREGB(ulBase + EP_OFFSET(ulEndpoint) +
                                           USB_O_TXCSRH1);

        //
        // Are we allowing auto setting of TxPktRdy when max packet size has
        // been loaded into the FIFO?
        //
        if(ulRegister & USB_TXCSRH1_AUTOSET)
        {
            *pulFlags |= USB_EP_AUTO_SET;
        }

        //
        // Get the DMA mode.
        //
        if(ulRegister & USB_TXCSRH1_DMAEN)
        {
            if(ulRegister & USB_TXCSRH1_DMAMOD)
            {
                *pulFlags |= USB_EP_DMA_MODE_1;
            }
            else
            {
                *pulFlags |= USB_EP_DMA_MODE_0;
            }
        }

        //
        // Are we in isochronous mode?
        //
        if(ulRegister & USB_TXCSRH1_ISO)
        {
            *pulFlags |= USB_EP_MODE_ISOC;
        }
        else
        {
            //
            // The hardware doesn't differentiate between bulk, interrupt
            // and control mode for the endpoint so we just set something
            // that isn't isochronous.  This ensures that anyone modifying
            // the returned flags in preparation for a call to
            // USBDevEndpointConfig will not see an unexpected mode change.
            // If they decode the returned mode, however, they may be in for
            // a surprise.
            //
            *pulFlags |= USB_EP_MODE_BULK;
        }
    }
    else
    {
        //
        // Clear the flags other than the direction bit.
        //
        *pulFlags = USB_EP_DEV_OUT;

        //
        // Get the MaxPacketSize.
        //
        *pulMaxPacketSize = (unsigned long)HWREGB(ulBase +
                                                  EP_OFFSET(ulEndpoint) +
                                                  USB_O_RXMAXP1);

        //
        // Get the current receive control register value.
        //
        ulRegister = (unsigned long)HWREGB(ulBase + EP_OFFSET(ulEndpoint) +
                                           USB_O_RXCSRH1);

        //
        // Are we allowing auto clearing of RxPktRdy when packet of size max
        // packet has been unloaded from the FIFO?
        //
        if(ulRegister & USB_RXCSRH1_AUTOCL)
        {
            *pulFlags |= USB_EP_AUTO_CLEAR;
        }

        //
        // Get the DMA mode.
        //
        if(ulRegister & USB_RXCSRH1_DMAEN)
        {
            if(ulRegister & USB_RXCSRH1_DMAMOD)
            {
                *pulFlags |= USB_EP_DMA_MODE_1;
            }
            else
            {
                *pulFlags |= USB_EP_DMA_MODE_0;
            }
        }

        //
        // Are we in isochronous mode?
        //
        if(ulRegister & USB_RXCSRH1_ISO)
        {
            *pulFlags |= USB_EP_MODE_ISOC;
        }
        else
        {
            //
            // The hardware doesn't differentiate between bulk, interrupt
            // and control mode for the endpoint so we just set something
            // that isn't isochronous.  This ensures that anyone modifying
            // the returned flags in preparation for a call to
            // USBDevEndpointConfig will not see an unexpected mode change.
            // If they decode the returned mode, however, they may be in for
            // a surprise.
            //
            *pulFlags |= USB_EP_MODE_BULK;
        }
    }
}

//*****************************************************************************
//
//! Sets the FIFO configuration for an endpoint.
//!
//! \param ulBase specifies the USB module base address.
//! \param ulEndpoint is the endpoint to access.
//! \param ulFIFOAddress is the starting address for the FIFO.
//! \param ulFIFOSize is the size of the FIFO in bytes.
//! \param ulFlags specifies what information to set in the FIFO configuration.
//!
//! This function will set the starting FIFO RAM address and size of the FIFO
//! for a given endpoint.  Endpoint zero does not have a dynamically
//! configurable FIFO so this function should not be called for endpoint zero.
//! The \e ulFIFOSize parameter should be one of the values in the
//! \b USB_FIFO_SZ_ values.  If the endpoint is going to use double buffering
//! it should use the values with the \b _DB at the end of the value.  For
//! example, use \b USB_FIFO_SZ_16_DB to configure an endpoint to have a 16
//! byte double buffered FIFO.  If a double buffered FIFO is used, then the
//! actual size of the FIFO will be twice the size indicated by the
//! \e ulFIFOSize parameter.  This means that the \b USB_FIFO_SZ_16_DB value
//! will use 32 bytes of the USB controller's FIFO memory.
//!
//! The \e ulFIFOAddress value should be a multiple of 8 bytes and directly
//! indicates the starting address in the USB controller's FIFO RAM.  For
//! example, a value of 64 indicates that the FIFO should start 64 bytes into
//! the USB controller's FIFO memory.  The \e ulFlags value specifies whether
//! the endpoint's OUT or IN FIFO should be configured.  If in host mode, use
//! \b USB_EP_HOST_OUT or \b USB_EP_HOST_IN, and if in device mode use
//! \b USB_EP_DEV_OUT or \b USB_EP_DEV_IN.
//!
//! \return None.
//
//*****************************************************************************
void
USBFIFOConfigSet(unsigned long ulBase, unsigned long ulEndpoint,
                 unsigned long ulFIFOAddress, unsigned long ulFIFOSize,
                 unsigned long ulFlags)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);
    ASSERT((ulEndpoint == USB_EP_1) || (ulEndpoint == USB_EP_2) ||
           (ulEndpoint == USB_EP_3));

    //
    // See if the transmit or receive FIFO is being configured.
    //
    if(ulFlags & (USB_EP_HOST_OUT | USB_EP_DEV_IN))
    {
        //
        // Set the transmit FIFO location and size for this endpoint.
        //
        USBIndexWrite(ulBase, ulEndpoint >> 4, USB_O_TXFIFOSZ, ulFIFOSize, 1);
        USBIndexWrite(ulBase, ulEndpoint >> 4, USB_O_TXFIFOADD,
                      ulFIFOAddress >> 3, 2);
    }
    else
    {
        //
        // Set the receive FIFO location and size for this endpoint.
        //
        USBIndexWrite(ulBase, ulEndpoint >> 4, USB_O_RXFIFOSZ, ulFIFOSize, 1);
        USBIndexWrite(ulBase, ulEndpoint >> 4, USB_O_RXFIFOADD,
                      ulFIFOAddress >> 3, 2);
    }
}

//*****************************************************************************
//
//! Returns the FIFO configuration for an endpoint.
//!
//! \param ulBase specifies the USB module base address.
//! \param ulEndpoint is the endpoint to access.
//! \param pulFIFOAddress is the starting address for the FIFO.
//! \param pulFIFOSize is the size of the FIFO in bytes.
//! \param ulFlags specifies what information to retrieve from the FIFO
//! configuration.
//!
//! This function will return the starting address and size of the FIFO for a
//! given endpoint.  Endpoint zero does not have a dynamically configurable
//! FIFO so this function should not be called for endpoint zero.  The
//! \e ulFlags parameter specifies whether the endpoint's OUT or IN FIFO should
//! be read.  If in host mode, the \e ulFlags parameter should be
//! \b USB_EP_HOST_OUT or \b USB_EP_HOST_IN, and if in device mode the
//! \e ulFlags parameter should be either \b USB_EP_DEV_OUT or
//! \b USB_EP_DEV_IN.
//!
//! \return None.
//
//*****************************************************************************
void
USBFIFOConfigGet(unsigned long ulBase, unsigned long ulEndpoint,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看精品一区| 中文字幕精品在线不卡| 国产精品女主播在线观看| 日日夜夜一区二区| 欧美日韩三级一区二区| 亚洲图片有声小说| 欧美在线一区二区| 亚洲成人黄色小说| 成人久久久精品乱码一区二区三区 | 国产欧美中文在线| 国产乱子轮精品视频| www精品美女久久久tv| 麻豆精品一区二区av白丝在线| 日韩欧美一级片| 国产精品自拍av| 国产精品国产三级国产普通话三级| 国产a区久久久| 亚洲一区二区黄色| 91麻豆精品久久久久蜜臀| 极品美女销魂一区二区三区免费| 久久久久久久免费视频了| 国产大陆亚洲精品国产| 亚洲一区电影777| 91麻豆精品国产| 国产成人免费在线观看| 一区二区三区四区在线| 69堂成人精品免费视频| 成人小视频在线观看| 亚洲色欲色欲www| 久久精品一区二区| 欧美日韩黄色一区二区| 国产精品自拍毛片| 三级欧美在线一区| 亚洲色图制服诱惑| 国产女同互慰高潮91漫画| 欧美日韩一区不卡| 91免费观看国产| 精品一区免费av| 蜜桃视频一区二区三区在线观看| 日本一区二区三区四区在线视频| 欧美精品日韩综合在线| 91首页免费视频| 波多野结衣视频一区| 激情深爱一区二区| 久久精品国产亚洲a| 午夜精彩视频在线观看不卡| 国产精品对白交换视频| 久久九九久精品国产免费直播| 欧美日韩在线免费视频| 91小视频在线免费看| 白白色亚洲国产精品| 国产suv一区二区三区88区| 精品一区二区三区影院在线午夜| 天天综合天天综合色| 天堂成人免费av电影一区| 日日摸夜夜添夜夜添亚洲女人| 亚洲国产成人av| 免费精品视频最新在线| 九九视频精品免费| 国产综合成人久久大片91| 久久机这里只有精品| 国产真实乱对白精彩久久| 国产成人av电影免费在线观看| 高清视频一区二区| 一本大道久久a久久精二百| 欧美色视频在线| 日韩精品一区二区三区老鸭窝 | 99在线精品视频| 欧美日韩午夜影院| 国产亚洲一区字幕| 亚洲激情六月丁香| 久久99蜜桃精品| 97精品电影院| 日韩一区二区在线观看视频| 国产欧美一二三区| 亚洲午夜久久久久久久久久久| 美女视频一区二区三区| 不卡av在线网| 久久综合99re88久久爱| 有坂深雪av一区二区精品| 日本欧美韩国一区三区| 91在线国产观看| 26uuu国产一区二区三区| 一区二区久久久久| 国产亚洲一本大道中文在线| 水蜜桃久久夜色精品一区的特点| 9191国产精品| 欧美成人一区二区三区片免费| 亚洲图片激情小说| 国产麻豆视频一区| 欧美一二三区精品| 天堂va蜜桃一区二区三区漫画版| 不卡av在线免费观看| 久久久一区二区三区捆绑**| 午夜欧美一区二区三区在线播放| 9l国产精品久久久久麻豆| 国产亚洲污的网站| 粉嫩av一区二区三区粉嫩| 欧美精品一区二区久久久| 三级久久三级久久久| 91精品国产美女浴室洗澡无遮挡| 中文字幕国产一区| 国产91精品露脸国语对白| 亚洲精品在线网站| 国产精品一二三在| 国产精品理论片| av一二三不卡影片| 亚洲女子a中天字幕| 精品视频在线免费观看| 亚洲一区二区三区四区中文字幕| 在线看国产一区二区| 樱桃国产成人精品视频| 在线精品视频免费观看| 香港成人在线视频| 精品国产乱码久久久久久图片| 蜜桃久久av一区| 国产精品网站在线观看| 99久久综合狠狠综合久久| 一区二区三区日韩欧美| 91精品欧美一区二区三区综合在| 精品无人码麻豆乱码1区2区 | 日韩欧美另类在线| 国产凹凸在线观看一区二区 | 26uuu亚洲| 色播五月激情综合网| 美腿丝袜在线亚洲一区| 欧美激情一区二区三区| 欧美日韩在线直播| 丁香婷婷综合色啪| 免费成人美女在线观看.| 国产精品美女久久久久久久久久久 | 欧美一区二区在线免费播放| 国产福利精品一区二区| 亚洲成人av中文| 国产精品免费看片| 欧美一区二区三区婷婷月色| 色综合一区二区| 国产经典欧美精品| 狠狠久久亚洲欧美| 日韩电影在线观看一区| 亚洲一区二区三区三| 国产精品全国免费观看高清 | 日本不卡一区二区三区| 亚洲精品ww久久久久久p站| 国产亚洲成年网址在线观看| 日韩一区二区免费视频| 欧美一区二区三区四区五区| 欧美理论在线播放| 3atv在线一区二区三区| 欧美午夜电影一区| 欧美日韩一区视频| 欧美色欧美亚洲另类二区| 欧美综合一区二区三区| 91成人看片片| 欧美理论在线播放| 欧美一级欧美三级在线观看| 制服.丝袜.亚洲.另类.中文| 欧美日韩国产美| 精品国产乱码久久久久久闺蜜| 精品国产一区二区在线观看| 久久久久国产精品麻豆| 欧美激情一区二区三区不卡| 综合欧美亚洲日本| 亚洲成人精品影院| 国产福利一区二区| 欧美视频在线不卡| 欧美v国产在线一区二区三区| 国产亚洲一区二区在线观看| 国产精品久久三| 日韩中文字幕亚洲一区二区va在线| 日本欧美韩国一区三区| 成人精品视频一区二区三区尤物| aaa欧美日韩| 久久久久久久久久电影| 一二三区精品视频| 国产麻豆精品久久一二三| 91日韩精品一区| 精品国产免费久久| 亚洲国产成人va在线观看天堂 | 亚洲欧美精品午睡沙发| 美腿丝袜亚洲色图| 色婷婷久久久久swag精品| 欧美成人aa大片| 亚洲成a人在线观看| 99国产精品视频免费观看| 欧美xxxx在线观看| 全部av―极品视觉盛宴亚洲| 成人激情免费电影网址| 亚洲精品一区二区三区99| 一区二区三区精品在线| 成人18视频在线播放| 久久看人人爽人人| 国产一区二区美女| 精品久久久久久无| 日本不卡高清视频| 精品国产一区二区国模嫣然| 日韩成人伦理电影在线观看| 欧美视频在线观看一区二区| 亚洲精品乱码久久久久久黑人| 波多野结衣一区二区三区|