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

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

?? usb.c

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

    //
    // Disable connection to the USB bus.
    //
    HWREGB(ulBase + USB_O_POWER) &= (~USB_POWER_SOFTCONN);
}

//*****************************************************************************
//
//! Sets the address in device mode.
//!
//! \param ulBase specifies the USB module base address.
//! \param ulAddress is the address to use for a device.
//!
//! This function will set the device address on the USB bus.  This address was
//! likely received via a SET ADDRESS command from the host controller.
//!
//! \note This function should only be called in device mode.
//!
//! \return None.
//
//*****************************************************************************
void
USBDevAddrSet(unsigned long ulBase, unsigned long ulAddress)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);

    //
    // Set the function address in the correct location.
    //
    HWREGB(ulBase + USB_O_FADDR) = (unsigned char)ulAddress;
}

//*****************************************************************************
//
//! Returns the current device address in device mode.
//!
//! \param ulBase specifies the USB module base address.
//!
//! This function will return the current device address.  This address was set
//! by a call to USBDevAddrSet().
//!
//! \note This function should only be called in device mode.
//!
//! \return The current device address.
//
//*****************************************************************************
unsigned long
USBDevAddrGet(unsigned long ulBase)
{
    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);

    //
    // Return the function address.
    //
    return(HWREGB(ulBase + USB_O_FADDR));
}

//*****************************************************************************
//
//! Sets the base configuration for a host endpoint.
//!
//! \param ulBase specifies the USB module base address.
//! \param ulEndpoint is the endpoint to access.
//! \param ulMaxPayload is the maximum payload for this endpoint.
//! \param ulNAKPollInterval is the either the NAK timeout limit or the polling
//! interval depending on the type of endpoint.
//! \param ulTargetEndpoint is the endpoint that the host endpoint is
//! targeting.
//! \param ulFlags are used to configure other endpoint settings.
//!
//! This function will set the basic configuration for the transmit or receive
//! portion of an endpoint in host mode.  The \e ulFlags parameter determines
//! some of the configuration while the other parameters provide the rest.  The
//! \e ulFlags parameter determines whether this is an IN endpoint
//! (USB_EP_HOST_IN or USB_EP_DEV_IN) or an OUT endpoint (USB_EP_HOST_OUT or
//! USB_EP_DEV_OUT), whether this is a Full speed endpoint (USB_EP_SPEED_FULL)
//! or a Low speed endpoint (USB_EP_SPEED_LOW).
//!
//! The \b USB_EP_MODE_ flags control the type of the endpoint.
//! - \b USB_EP_MODE_CTRL is a control endpoint.
//! - \b USB_EP_MODE_ISOC is an isochronous endpoint.
//! - \b USB_EP_MODE_BULK is a bulk endpoint.
//! - \b USB_EP_MODE_INT is an interrupt endpoint.
//!
//! The \e ulNAKPollInterval parameter has different meanings based on the
//! \b USB_EP_MODE value and whether or not this call is being made for
//! endpoint zero or another endpoint.  For endpoint zero or any Bulk
//! endpoints, this value always indicates the number of frames to allow a
//! device to NAK before considering it a timeout.  If this endpoint is an
//! isochronous or interrupt endpoint, this value is the polling interval for
//! this endpoint.
//!
//! For interrupt endpoints the polling interval is simply the number of
//! frames between polling an interrupt endpoint.  For isochronous endpoints
//! this value represents a polling interval of 2 ^ (\e ulNAKPollInterval - 1)
//! frames.  When used as a NAK timeout, the \e ulNAKPollInterval value
//! specifies 2 ^ (\e ulNAKPollInterval - 1) frames before issuing a time out.
//! There are two special time out values that can be specified when setting
//! the \e ulNAKPollInterval value.  The first is \b MAX_NAK_LIMIT which is the
//! maximum value that can be passed in this variable.  The other is
//! \b DISABLE_NAK_LIMIT which indicates that there should be no limit on the
//! number of NAKs.
//!
//! The \b USB_EP_DMA_MODE_ flags enables the type of DMA used to access the
//! endpoint's data FIFOs.  The choice of the DMA mode depends on how the DMA
//! controller is configured and how it is being used.  See the ``Using USB
//! with the uDMA Controller'' section for more information on DMA
//! configuration.
//!
//! When configuring the OUT portion of an endpoint, the \b USB_EP_AUTO_SET bit
//! is specified to cause the transmission of data on the USB bus to start
//! as soon as the number of bytes specified by \e ulMaxPayload have been
//! written into the OUT FIFO for this endpoint.
//!
//! When configuring the IN portion of an endpoint, the \b USB_EP_AUTO_REQUEST
//! bit can be specified to trigger the request for more data once the FIFO has
//! been drained enough to fit \e ulMaxPayload bytes.  The \b USB_EP_AUTO_CLEAR
//! bit can be used to clear the data packet ready flag automatically once the
//! data has been read from the FIFO.  If this is not used, this flag must be
//! manually cleared via a call to USBDevEndpointStatusClear() or
//! USBHostEndpointStatusClear().
//!
//! \note This function should only be called in host mode.
//!
//! \return None.
//
//*****************************************************************************
void
USBHostEndpointConfig(unsigned long ulBase, unsigned long ulEndpoint,
                      unsigned long ulMaxPayload,
                      unsigned long ulNAKPollInterval,
                      unsigned long ulTargetEndpoint, unsigned long ulFlags)
{
    unsigned long ulRegister;

    //
    // Check the arguments.
    //
    ASSERT(ulBase == USB0_BASE);
    ASSERT((ulEndpoint == USB_EP_0) || (ulEndpoint == USB_EP_1) ||
           (ulEndpoint == USB_EP_2) || (ulEndpoint == USB_EP_3));
    ASSERT(ulNAKPollInterval <= MAX_NAK_LIMIT);

    //
    // Endpoint zero is configured differently than the other endpoints, so see
    // if this is endpoint zero.
    //
    if(ulEndpoint == USB_EP_0)
    {
        //
        // Set the NAK timeout.
        //
        HWREGB(ulBase + USB_O_NAKLMT) = ulNAKPollInterval;

        //
        // Set the transfer type information.
        //
        HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_TYPE0) =
            ((ulFlags & USB_EP_SPEED_FULL) ? USB_TYPE0_SPEED_FULL :
             USB_TYPE0_SPEED_LOW);
    }
    else
    {
        //
        // Start with the target endpoint.
        //
        ulRegister = ulTargetEndpoint;

        //
        // Set the speed for the device using this endpoint.
        //
        if(ulFlags & USB_EP_SPEED_FULL)
        {
            ulRegister |= USB_TXTYPE1_SPEED_FULL;
        }
        else
        {
            ulRegister |= USB_TXTYPE1_SPEED_LOW;
        }

        //
        // Set the protocol for the device using this endpoint.
        //
        switch(ulFlags & USB_EP_MODE_MASK)
        {
            //
            // The bulk protocol is being used.
            //
            case USB_EP_MODE_BULK:
            {
                ulRegister |= USB_TXTYPE1_PROTO_BULK;
                break;
            }

            //
            // The isochronous protocol is being used.
            //
            case USB_EP_MODE_ISOC:
            {
                ulRegister |= USB_TXTYPE1_PROTO_ISOC;
                break;
            }

            //
            // The interrupt protocol is being used.
            //
            case USB_EP_MODE_INT:
            {
                ulRegister |= USB_TXTYPE1_PROTO_INT;
                break;
            }

            //
            // The control protocol is being used.
            //
            case USB_EP_MODE_CTRL:
            {
                ulRegister |= USB_TXTYPE1_PROTO_CTRL;
                break;
            }
        }

        //
        // See if the transmit or receive endpoint is being configured.
        //
        if(ulFlags & USB_EP_HOST_OUT)
        {
            //
            // Set the transfer type information.
            //
            HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_TXTYPE1) =
                ulRegister;

            //
            // Set the NAK timeout or polling interval.
            //
            HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_TXINTERVAL1) =
                ulNAKPollInterval;

            //
            // Set the Maximum Payload per transaction.
            //
            HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_TXMAXP1) =
                ulMaxPayload;

            //
            // Set the transmit control value to zero.
            //
            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;
            }

            //
            // Write out the transmit control value.
            //
            HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_TXCSRH1) =
                (unsigned char)ulRegister;
        }
        else
        {
            //
            // Set the transfer type information.
            //
            HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_RXTYPE1) =
                ulRegister;

            //
            // Set the NAK timeout or polling interval.
            //
            HWREGB(ulBase + EP_OFFSET(ulEndpoint) + USB_O_RXINTERVAL1) =
                ulNAKPollInterval;

            //
            // Set the receive control value to zero.
            //
            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;
            }

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

//*****************************************************************************
//
//! Sets the configuration for an endpoint.
//!
//! \param ulBase specifies the USB module base address.
//! \param ulEndpoint is the endpoint to access.
//! \param ulMaxPacketSize is the maximum packet size for this endpoint.
//! \param ulFlags are used to configure other endpoint settings.
//!
//! This function will set the basic configuration for an endpoint in device
//! mode.  Endpiont zero does not have a dynamic configuration, so this
//! function should not be called for endpoint zero.  The \e ulFlags parameter
//! determines some of the configuration while the other parameters provide the
//! rest.
//!
//! The \b USB_EP_MODE_ flags define what the type is for the given endpoint.
//!
//! - \b USB_EP_MODE_CTRL is a control endpoint.
//! - \b USB_EP_MODE_ISOC is an isochronous endpoint.
//! - \b USB_EP_MODE_BULK is a bulk endpoint.
//! - \b USB_EP_MODE_INT is an interrupt endpoint.
//!
//! The \b USB_EP_DMA_MODE_ flags determines the type of DMA access to the
//! endpoint data FIFOs.  The choice of the DMA mode depends on how the DMA
//! controller is configured and how it is being used.  See the ``Using USB
//! with the uDMA Controller'' section for more information on DMA
//! configuration.
//!
//! When configuring an IN endpoint, the \b USB_EP_AUTO_SET bit can be
//! specified to cause the automatic transmission of data on the USB bus as
//! soon as \e ulMaxPacketSize bytes of data are written into the FIFO for
//! this endpoint.  This is commonly used with DMA as no interaction is
//! required to start the transmission of data.
//!
//! When configuring an OUT endpoint, the \b USB_EP_AUTO_REQUEST bit is
//! specified to trigger the request for more data once the FIFO has been
//! drained enough to receive \e ulMaxPacketSize more bytes of data.  Also for
//! OUT endpoints, the \b USB_EP_AUTO_CLEAR bit can be used to clear the data
//! packet ready flag automatically once the data has been read from the FIFO.
//! If this is not used, this flag must be manually cleared via a call to
//! USBDevEndpointStatusClear().  Both of these settings can be used to remove
//! the need for extra calls when using the controller in DMA mode.
//!
//! \note This function should only be called in device mode.
//!
//! \return None.
//
//*****************************************************************************
void
USBDevEndpointConfig(unsigned long ulBase, unsigned long ulEndpoint,
                     unsigned long ulMaxPacketSize, unsigned long ulFlags)
{
    unsigned long ulRegister;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区二区在线观看视频播放| 日韩毛片一二三区| 毛片av一区二区三区| 91精品在线免费观看| 日本三级亚洲精品| xf在线a精品一区二区视频网站| 美国十次了思思久久精品导航| 欧美一区二区久久| 国产精品一区二区视频| 亚洲国产精品t66y| 91久久国产最好的精华液| 天堂久久久久va久久久久| 精品国免费一区二区三区| 国产成人免费在线观看| 国产精品美女久久福利网站| 91免费视频观看| 免费在线观看日韩欧美| 国产日产亚洲精品系列| 色婷婷一区二区| 蜜桃视频在线一区| 国产精品久久久久一区| 欧美午夜精品久久久| 美脚の诱脚舐め脚责91| 国产精品福利影院| 91.xcao| 国产不卡视频一区| 午夜一区二区三区视频| 久久久亚洲精品石原莉奈| 不卡av免费在线观看| 偷拍自拍另类欧美| 国产亚洲综合色| 欧美色图激情小说| 国产精品一区二区三区99| 一级中文字幕一区二区| 2020国产精品自拍| 欧美日韩一级视频| 福利一区二区在线| 日韩激情一二三区| 亚洲三级在线免费观看| 2020国产精品| 51精品视频一区二区三区| 不卡的av网站| 国产乱码精品一区二区三区av | 日韩一区二区视频| 不卡视频在线看| 麻豆91精品91久久久的内涵| 亚洲男女毛片无遮挡| 国产亚洲欧美日韩在线一区| 欧美日韩国产中文| 91在线精品一区二区三区| 精品在线视频一区| 无码av免费一区二区三区试看 | 91福利精品视频| 精品一区二区三区在线播放| 亚洲影视在线观看| 亚洲乱码国产乱码精品精可以看| 久久夜色精品一区| 日韩午夜在线播放| 欧美久久久影院| 欧美四级电影网| 欧洲av一区二区嗯嗯嗯啊| av电影天堂一区二区在线| 国产一区二区伦理| 久久不见久久见免费视频7 | 免费成人深夜小野草| 一区二区三区视频在线看| 一区免费观看视频| 日本一区二区成人| 国产欧美一区视频| 国产欧美日韩在线看| 国产三级久久久| 国产三级一区二区三区| 久久一区二区视频| 中文字幕av一区二区三区免费看| 国产欧美一区二区精品性色超碰| 久久久www成人免费毛片麻豆| 精品国产制服丝袜高跟| 日韩精品一区二区三区在线播放 | 欧美日韩视频在线观看一区二区三区 | 精品区一区二区| 日韩精品中文字幕一区| 精品成人免费观看| 精品粉嫩超白一线天av| 久久亚洲综合色一区二区三区| 精品久久久三级丝袜| 久久久久久9999| 国产精品网站在线观看| 亚洲人妖av一区二区| 尤物在线观看一区| 亚洲成av人**亚洲成av**| 蜜桃av一区二区| 国产一区999| 91女人视频在线观看| 日本乱人伦aⅴ精品| 88在线观看91蜜桃国自产| 日韩欧美一级二级| 国产精品三级电影| 亚洲一二三区在线观看| 欧美aaa在线| 成人小视频在线| 欧美性三三影院| 精品久久国产老人久久综合| 日本一区二区三区免费乱视频| 国产精品久久久久久久久免费相片 | 国产在线不卡一区| av在线综合网| 在线不卡免费欧美| 国产日韩影视精品| 亚洲精品国产成人久久av盗摄| 日韩中文字幕麻豆| 国产高清成人在线| 欧美日韩国产大片| 久久久精品综合| 一二三四区精品视频| 激情文学综合插| 色婷婷综合久久久久中文一区二区 | 精品免费日韩av| 成人欧美一区二区三区视频网页 | 一本色道久久加勒比精品| 欧美剧在线免费观看网站| 国产午夜精品久久久久久久| 亚洲一区二区三区视频在线播放 | 成人午夜精品在线| 欧美剧情片在线观看| 国产精品久久久久一区| 蜜桃视频在线观看一区二区| 99久精品国产| 精品国产一区二区三区不卡 | 日韩av在线发布| av在线综合网| 欧美精品一区二区三区在线播放| 亚洲猫色日本管| 韩国三级电影一区二区| 欧美色综合网站| 亚洲日本丝袜连裤袜办公室| 久久成人久久鬼色| 欧美日韩在线亚洲一区蜜芽| 国产精品毛片久久久久久久| 另类的小说在线视频另类成人小视频在线 | 久久久精品免费观看| 亚洲国产sm捆绑调教视频| 不卡视频免费播放| 久久综合久久久久88| 人妖欧美一区二区| 欧美色偷偷大香| 亚洲欧美aⅴ...| 成人国产亚洲欧美成人综合网| 日韩欧美亚洲国产另类| 亚洲高清视频的网址| 97se亚洲国产综合自在线不卡| 久久欧美中文字幕| 麻豆精品一区二区综合av| 欧美日韩视频专区在线播放| 伊人一区二区三区| 99re热视频这里只精品| 国产精品成人在线观看| 国内成+人亚洲+欧美+综合在线| 欧美日韩国产综合视频在线观看 | 亚洲va国产天堂va久久en| 成人av中文字幕| 久久蜜桃av一区二区天堂| 麻豆精品精品国产自在97香蕉| 欧美视频一区二区三区在线观看| 亚洲少妇最新在线视频| 成人精品免费看| 中文字幕第一区综合| 国产一区在线精品| 精品噜噜噜噜久久久久久久久试看| 午夜精品久久久久久久99樱桃| 91亚洲男人天堂| 亚洲欧洲精品一区二区精品久久久 | 51精品久久久久久久蜜臀| 一区二区三区在线视频观看| 色综合一区二区三区| 亚洲另类一区二区| 在线观看免费成人| 亚洲gay无套男同| 在线成人午夜影院| 麻豆成人久久精品二区三区小说| 51精品国自产在线| 日韩av电影天堂| 91精品国产综合久久福利| 蜜臀av一级做a爰片久久| 日韩午夜在线观看| 国产mv日韩mv欧美| 自拍偷在线精品自拍偷无码专区| 99视频精品免费视频| 亚洲图片另类小说| 欧美亚洲动漫制服丝袜| 视频一区中文字幕| 日韩欧美一级二级三级久久久| 国产一区二区三区电影在线观看| 中文字幕二三区不卡| 在线视频综合导航| 日韩国产成人精品| 欧美精品一区二区三区蜜桃| 国产成人精品一区二| 亚洲视频小说图片| 欧美日本韩国一区| 国产一区二区三区|