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

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

?? usb_init.c

?? 飛思卡爾MC9S12uf32的一些實用驅(qū)動程序
?? C
字號:
/******************************************************************************
*                                                  
*  (c) copyright Freescale Semiconductor Hong Kong Ltd 2004
*  ALL RIGHTS RESERVED
*                                                                       
*******************************************************************************  
** THIS  CODE IS ONLY INTENDED AS AN EXAMPLE FOR DEMONSTRATING THE FREESCALE **
** MICROCONTROLLERS.  IT  HAS ONLY BEEN GIVEN A MIMIMUM LEVEL OF TEST. IT IS **
** PROVIDED  'AS  SEEN'  WITH  NO  GUARANTEES  AND  NO  PROMISE  OF SUPPORT. **
*******************************************************************************  
*                                                                           
* FILE:        usb_init.c	 REVISION 0.1
*  
* DESCRIPTION: This module handles the USB state machine & command processor
*              applicaton tasks for the system
*
* NOTES:       All modules remain at their reset addresses
*                                                  
* UPDATED HISTORY:
*
* REV   YYYY.MM.DD  AUTHOR        DESCRIPTION OF CHANGE
* ---   ----------  ------        --------------------- 
* 0.0   2003.03.01  Vincent Ko    Initial version
* 0.1   2004.04.12  Derek Lau     Demo version
*
******************************************************************************/                                                                        
/* Freescale  is  not  obligated  to  provide  any  support, upgrades or new */
/* releases  of  the Software. Freescale may make changes to the Software at */
/* any time, without any obligation to notify or provide updated versions of */
/* the  Software  to you. Freescale expressly disclaims any warranty for the */
/* Software.  The  Software is provided as is, without warranty of any kind, */
/* either  express  or  implied,  including, without limitation, the implied */
/* warranties  of  merchantability,  fitness  for  a  particular purpose, or */
/* non-infringement.  You  assume  the entire risk arising out of the use or */
/* performance of the Software, or any systems you design using the software */
/* (if  any).  Nothing  may  be construed as a warranty or representation by */
/* Freescale  that  the  Software  or  any derivative work developed with or */
/* incorporating  the  Software  will  be  free  from  infringement  of  the */
/* intellectual property rights of third parties. In no event will Freescale */
/* be  liable,  whether in contract, tort, or otherwise, for any incidental, */
/* special,  indirect, consequential or punitive damages, including, but not */
/* limited  to,  damages  for  any loss of use, loss of time, inconvenience, */
/* commercial loss, or lost profits, savings, or revenues to the full extent */
/* such  may be disclaimed by law. The Software is not fault tolerant and is */
/* not  designed,  manufactured  or  intended by Freescale for incorporation */
/* into  products intended for use or resale in on-line control equipment in */
/* hazardous, dangerous to life or potentially life-threatening environments */
/* requiring  fail-safe  performance,  such  as  in the operation of nuclear */
/* facilities,  aircraft  navigation  or  communication systems, air traffic */
/* control,  direct  life  support machines or weapons systems, in which the */
/* failure  of  products  could  lead  directly to death, personal injury or */
/* severe  physical  or  environmental  damage  (High  Risk Activities). You */
/* specifically  represent and warrant that you will not use the Software or */
/* any  derivative  work of the Software for High Risk Activities.           */
/* Freescale  and the Freescale logos are registered trademarks of Freescale */
/* Semiconductor Inc.                                                        */ 
/*****************************************************************************/

#include	"FreescaleDef.h"			// Get my definitions (Constants & Macros)
#include	"UF32reg.h"			// Get the UF32 registers.
#include	"mk_extern.h"		// Get Mini-Kernel global prototypes

//#include 	"ATA_extern.h"
#include	"usb_includes.h"	// Get USB module Configuration
#include	"usb_extern.h"		// Get External variable


// code is placed in the main code area.
#pragma CODE_SEG	DEFAULT
//#pragma CODE_SEG	CodeForceToPseudo_ROM2									 

// ===========================================================
//   IQUE_Module_Init() -
//  
//		Enable the IQUE module
//
// ===========================================================
void IQUE_Module_Init(void)
{
	IQUECR = (1<<CH34DBE)+(1<<IQUERST)+(1<<IQUEEN);	// Enable IQUECR
//	QC12DTR = (1<<DTHE)+(1<<DRHE);		// Enable force handshake
	QC34DTR = (1<<DTHE)+(1<<DRHE);		// Enable force handshake
};

// ===========================================================
//   USB_ModuleInit() -
//  
//		Enable the USB module
//
// ===========================================================

void USB_ModuleInit(void) 
{
	mSetBit(MCE, UMCR);		// Enable Module Clock
//	UMCR = 0x4002;				// bit 11-Normal PHY operation
	UMCRL = 0x02;				// bit 11-Normal PHY operation
								// bit 4-SET_DESCRIPTOR not supported
								// bit 3-High speed
								// bit 2-Remote Wakeup supported
								// bit 1-self powered device
								// bit 0-SYNC_FRAME command not supported 
	
//	while (mCheckBit(LOCK,CRGFLG)==0x00);
//	mSetBit(PLLSEL, CLKSEL);	// Select PHY clock as system clock

	UMSR1 = (1<<USSC) + (1<<URSC);

	UIMR = 0x3801;				// bit0 Enable SETUPIE
								// bit1 Enable SETOVRIE
								// bit2 Enable SOFIE
								// bit11 Enable URSCIE
								// bit12 Disable USSCIE
								// bit13 Enable SETECRIE

//	mClearBit(RESUMEIE, UIMR); // Make sure resume interrupt mask is off
		
//	PORTT = 0x00;				// Initialise PTI 
//	DDRT  = 0x0f;				// Put PTI to outpu t
//	mSetBit(ON_LED, PORTT);	// Put light LED
			
};

//#pragma CODE_SEG	DEFAULT

// ===========================================================
//   USB_InitCBITransport() -
//  
//		Configurate 1 x 512 bytes BULK in, 1 x 512 Bytes BULK out
//		and 1 x 2 bytes interrupt endpoint.
//
// ===========================================================

/*
void USB_InitCBITransport(void) {

	// Support Single Configuration and Single Interface
	UEPCSELR_h = 0x08;			// config UNCIR
	UNCIR_h = 0x0000;
	UNCIR_l = 0x0011;
	
	// Support No Alternative Setting
	UEPCSELR_h = 0x09;			// config UNASR
	UNASR_h = 0x0000;
	UNASR_l = 0x0000;
	
	// Physical Endpoint # 1 - Control 
	UEPCSELR_h = 0x01;			// config physical endpoint 1
	UPECFGR_h  = 0x0200;		// packet size = 64
	UPECFGR_l  = 0x0000;		// Alternate setting = 0
								// Interface = 0
								// Configuration = 0
								// Type = control
								// Dir = IO
								// EPnum = 0
	UEPCSR0 = 0x3000;			// Clear DVALID, Clear TFRC, Enable TCIE
	UEPCSR1 = 0x3000;			// Clear DVALID, Clear TFRC, Enable TCIE
							
	// Physical Endpoint # 5 - BULK IN with 512 byte buffer
	UEPCSELR_h = 0x05;
	UPECFGR_h  = 0x1000;		// packet size = 512
	UPECFGR_l  = 0x00d1;		// Alternate setting = 0
								// Interface = 0
								// Configuration = 1
								// Type = BULK
								// Dir = IN
								// EPnum = 1
	UEPCSR5A = 0x7800;			// Clear DVALID, Enable NACK, Clear TFRC, Enable TCIE
	UEPCSR5B = 0x1000;			// Enable TERRIE
	// Setup QUE Channel 2 for BULK OUT endpoint
	QC3CR = 0xb4;				// Q2VIE enable
								// Q2FIE enable
								// Q2EN enable
								// 256 block size
								// 16 bit transfer
								// No passthrough
	QC3SZB = 0x12;				// 2 block of 256 bytes
								// Base at %0010 offset
	QC3REQ = 0x01;				// Channel 3 set to USB TX
	EP_Resource[Config1][EndPt1] = PHY5;	// Set QUE Buffer 1 for Config1 EP1 

	// Physical Endpoint # 4 - BULK OUT with 512 byte buffer
	UEPCSELR_h = 0x04;
	UPECFGR_h  = 0x1000;		// packet size = 512
	UPECFGR_l  = 0x00c2;		// Alternate setting = 0
								// Interface = 0
								// Configuration = 1
								// Type = BULK
								// Dir = OUT
								// EPnum = 2
	UEPCSR4A = 0x3800;			// Clear DVALID, Clear TFRC, Enable TCIE
	UEPCSR4B = 0x1000;			// Enable  TERRIE
	// Setup QUE Channel 1 for BULK OUT endpoint
	QC1CR = 0xb4;				// Q1VIE enable
								// Q1FIE enable
								// Q1EN enable
								// No passthrough
								// 256 block size
								// 16 bit transfer
								// No passthrough
	QC1SZB = 0x10;				// 2 block of 256 bytes
								// Base at %0000 offset
	QC1REQ = 0x00;				// Channel 1 set to USB RX
	EP_Resource[Config1][EndPt2] = PHY4;	// Set QUE Buffer 1 for Config1 EP2 


	// Physical Endpoint # 2 - INTERRUPT IN with 2 byte buffer
	UEPCSELR_h = 0x02;
	UPECFGR_h  = 0x0010;		// packet size = 2
	UPECFGR_l  = 0x00f3;		// Alternate setting = 0
								// Interface = 0
								// Configuration = 1
								// Type = INTERRUPT
								// Dir = IN
								// EPnum = 3
	EP_Resource[Config1][EndPt3] = PHY2;		// Set Physical Endpoint 2 for Config1 EP3 
	UEPCSR2 = 0x3000;			// Clear DVALID, Clear TFRC, Enable TCIE

};
*/
// ===========================================================
//   USB_InitBulkOnlyTransport() -
//  
//		Configurate 1 x 64 bytes BULK in and 1 x 64 Bytes BULK out.
//
// ===========================================================

void USB_InitBulkOnlyTransport(void) 
{
	if (gUSBFullSpeed)
		gUSBPacketSize = 32;	// 32 word
	
	else
		gUSBPacketSize = 256;	// 256 word
		
	// Support Single Configuration and Single Interface
	UEPCSELR_h	= 0x08;			// config UNCIR
	UNCIR_h		= 0x0000;
	UNCIR_l		= 0x0011;
	
	// Support No Alternative Setting
	UEPCSELR_h	= 0x09;			// config UNASR
	UNASR_h		= 0x0000;
	UNASR_l		= 0x0000;
	
	// Physical Endpoint # 1 - Control 
	UEPCSELR_h	= 0x01;			// config physical endpoint 1
	UPECFGR_h	= 0x0200;		// packet size = 64
	UPECFGR_l	= 0x0000;		// Alternate setting = 0
								// Interface = 0
								// Configuration = 0
								// Type = control
								// Dir = IO
								// EPnum = 0
	UEPCSR0		= 0x3000;		// Clear DVALID, Clear TFRC, Enable TCIE
	UEPCSR1		= 0x3000;		// Clear DVALID, Clear TFRC, Enable TCIE
							
	UEPCSR5A 	= 0x7800;		// Enable SNACK, Clear TFRC, Enable TCIE
	UEPCSR5B 	= 0x0000;		// Disable TERRIE

	// Setup QUE Channel 2 for BULK IN endpoint
	if (gUSBFullSpeed)
	{
		UEPCSELR_h = 0x05;		// Physical EP5 (IN)
		UPECFGR_h  = 0x8200;	// packet size = 64
		UPECFGR_l  = 0x00d1;	// Alternate setting = 0
								// Interface = 0
								// Configuration = 1
								// Type = BULK
								// Dir = IN
								// EPnum = 1
		QC3CR = (1<<QnEN)+(1<<QnSML)+(1<<Qn16EN)+(1<<QnPRST);
								// Q3VIE disable
								// Q3FIE disable
								// Q3EN enable
								// 256 bytes block size
								// 16 bit transfer
								// passthrough mode

		QC3SZB 	= 0x3f;			// 4 block of 16 bytes (FS), base 0x20f0
		UEPCSELR_h = 0x04;		// Physical EP4 (OUT)
		UPECFGR_h = 0x8200;		// packet size = 64
		UPECFGR_l  = 0x00c1;	// Alternate setting = 0
								// Interface = 0
								// Configuration = 1
								// Type = BULK
								// Dir = OUT
		QC1CR	= (1<<QnEN)+(1<<QnSML)+(1<<Qn16EN)+(1<<QnPRST);
		QC1SZB	= 0x30;			// 4 block of 16 bytes (FS), base 0x2000

	}
	else
	{
		UEPCSELR_h = 0x05;		// Physical EP5 (IN)
		UPECFGR_h  = 0x9000;	// packet size = 512
		UPECFGR_l  = 0x00d1;	// Alternate setting = 0
								// Interface = 0
								// Configuration = 1
								// Type = BULK
								// Dir = IN
								// EPnum = 1

		QC3CR = (1<<QnEN)+(1<<Qn16EN)+(1<<QnPRST);	
								// Q3VIE disable
								// Q3FIE disable
								// Q3EN enable
								// 256 bytes block size
								// 16 bit transfer
								// passthrough mode

		QC3SZB	= 0x12;			// 2 block 0f 256 bytes (HS), base 0x2000
		UEPCSELR_h = 0x04;		// Physical EP4 (IN)
		UPECFGR_h = 0x9000;		// packet size = 512
		UPECFGR_l  = 0x00c1;		// Alternate setting = 0
		
		QC1CR  = (1<<QnEN)+(1<<Qn16EN)+(1<<QnPRST);
		QC1SZB = 0x10;			// 2 block of 256 bytes (HS)
	}
								
	QC3REQ = 0x01;				// Channel 3 set to USB TX
	
	
	EP_Resource[Config1][EndPt1] = PHY5;	// Set QUE Buffer 1 for Config1 EP1 


	do
		UEPCSR4A = (1<<TFRC)+(1<<USBTCIE)+(1<<CTERR);	// Clear DVALID, Clear TFRC, Enable TCIE
	while (UEPCSR4A != (1<<USBTCIE)+(1<<CTERR));
	
	UEPCSR4B = (1<<USBTERRIE);		// Enable SPKTIE, TERRIE

	QC1REQ = 0x00;				// Channel 1 set to USB RX
	EP_Resource[Config1][EndPt2] = PHY4;	// Set QUE Buffer 1 for Config1 EP2 

};


//
// The end of file usb_init.c 
// *********************************************************************************

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美老肥妇做.爰bbww| 欧美日韩三级一区| 一区二区三区日韩在线观看| 91精品国产91久久久久久一区二区 | 欧美国产欧美综合| 欧美日韩一级黄| 成人a区在线观看| 激情久久五月天| 午夜久久久久久久久| 综合久久久久久| 欧美精品一区二区蜜臀亚洲| 欧美日韩国产综合一区二区三区| 日韩欧美一二三四区| 色婷婷一区二区| 国产在线视频不卡二| 日日摸夜夜添夜夜添精品视频| 最新热久久免费视频| 欧美精品一区二区久久婷婷| 88在线观看91蜜桃国自产| 日本高清不卡视频| 一本高清dvd不卡在线观看| 粉嫩一区二区三区性色av| 五月激情丁香一区二区三区| 亚洲精品成人少妇| 国产精品久久二区二区| 久久九九全国免费| 国产亚洲一区字幕| wwwwxxxxx欧美| 欧美大片一区二区| 日韩久久久精品| 在线电影一区二区三区| 欧美精品九九99久久| 欧美日韩一区二区三区四区五区| 一本色道久久综合精品竹菊| 91在线视频免费91| 91免费观看视频在线| 日本高清视频一区二区| 91在线porny国产在线看| 91原创在线视频| 日本丰满少妇一区二区三区| 在线区一区二视频| 欧美日韩中文字幕一区二区| 欧美在线观看视频一区二区| 欧美中文一区二区三区| 欧美日韩一本到| 欧美日韩久久久一区| 69av一区二区三区| 欧美日韩高清一区二区| 91精品婷婷国产综合久久性色| 这里只有精品免费| 精品国产乱码久久久久久图片| 2017欧美狠狠色| 国产日韩精品久久久| 国产精品色眯眯| 亚洲人成网站影音先锋播放| 亚洲激情图片qvod| 亚洲v日本v欧美v久久精品| 日韩国产在线观看| 激情久久久久久久久久久久久久久久| 国产精品亚洲成人| 91视频在线观看免费| 欧美日韩色综合| 亚洲精品在线观看视频| 国产精品免费aⅴ片在线观看| 亚洲欧美日韩小说| 婷婷综合在线观看| 国产高清久久久| 91色九色蝌蚪| 欧美大白屁股肥臀xxxxxx| 久久日韩粉嫩一区二区三区| 国产精品色眯眯| 亚洲aⅴ怡春院| 极品美女销魂一区二区三区免费 | 黑人巨大精品欧美黑白配亚洲| 国产白丝精品91爽爽久久 | 亚洲精品在线网站| 日韩一区欧美一区| 日韩不卡手机在线v区| 国产一区二区三区精品视频| 91网站在线播放| 欧美一区二区三区视频在线| 国产精品久久毛片av大全日韩| 亚洲一级在线观看| 国产精品66部| 欧美日韩卡一卡二| 18欧美亚洲精品| 免费久久99精品国产| 91在线观看一区二区| 日韩欧美国产1| 亚洲免费观看高清完整版在线观看熊 | 亚洲黄色片在线观看| 精品一二线国产| 在线一区二区三区四区五区| 精品免费日韩av| 亚洲五月六月丁香激情| 国产激情一区二区三区四区| 欧美挠脚心视频网站| 国产精品日韩精品欧美在线| 久久综合综合久久综合| 欧洲精品一区二区| 亚洲国产电影在线观看| 蜜桃av一区二区| 在线观看网站黄不卡| 欧美激情综合网| 麻豆国产欧美日韩综合精品二区| 在线亚洲一区二区| 国产精品少妇自拍| 国产成人免费视频一区| 精品久久国产字幕高潮| 无吗不卡中文字幕| 欧美色综合久久| 自拍偷拍欧美精品| 不卡一区在线观看| 国产亚洲精久久久久久| 久久国产精品72免费观看| 欧美日韩免费不卡视频一区二区三区| 国产女同性恋一区二区| 国产综合久久久久久鬼色| 91精品国产综合久久小美女| 亚洲综合激情另类小说区| 久久亚洲一区二区三区四区| 亚洲成人一区二区在线观看| 91蝌蚪porny成人天涯| 1000精品久久久久久久久| 国产成人自拍网| 久久婷婷色综合| 激情六月婷婷综合| 精品1区2区在线观看| 韩国一区二区三区| 久久久久久日产精品| 国产一区二区三区美女| 国产亚洲人成网站| 国产精品99久久久| 中文字幕的久久| 成人av电影在线观看| 国产精品久久久久aaaa| 不卡一区二区中文字幕| 亚洲精品久久久蜜桃| 日本道精品一区二区三区| 亚洲自拍另类综合| 欧美精品丝袜中出| 美女视频黄频大全不卡视频在线播放 | 日本韩国一区二区| 一区二区三区精品视频在线| 91精品1区2区| 日日摸夜夜添夜夜添国产精品| 欧美一区二区三区免费大片| 麻豆传媒一区二区三区| 亚洲精品在线免费播放| 成人午夜电影小说| 一区二区三区日韩精品| 欧美视频一区二区三区| 美国毛片一区二区| 国产免费久久精品| 97se狠狠狠综合亚洲狠狠| 一区二区三区中文在线观看| 欧美日韩大陆在线| 韩国毛片一区二区三区| 国产精品国产三级国产普通话99| 色偷偷久久一区二区三区| 亚洲成a人片综合在线| 精品国产91久久久久久久妲己| 成人禁用看黄a在线| 亚洲一区二区三区在线看| 91精品国产品国语在线不卡| 国产老女人精品毛片久久| 亚洲欧美日本在线| 欧美一级片在线| 成人午夜私人影院| 亚洲午夜久久久久久久久久久| 欧美一区二区三区电影| 成人黄色一级视频| 性感美女极品91精品| 精品日韩99亚洲| 日本韩国精品在线| 精品一区二区精品| 一区二区高清视频在线观看| 精品日韩欧美在线| 91九色最新地址| 国产精品1024| 亚洲成av人影院| 中文字幕精品一区二区精品绿巨人 | 天天色天天操综合| 欧美韩国日本综合| 91精品欧美综合在线观看最新| 成人性生交大片免费看中文网站| 亚洲第四色夜色| 国产精品丝袜91| 日韩一区二区在线观看视频 | 欧美高清在线一区| 欧美一区二区三区四区久久 | 91女人视频在线观看| 麻豆久久一区二区| 亚洲一区视频在线| 久久精品水蜜桃av综合天堂| 欧美日韩精品欧美日韩精品| 成人黄色软件下载| 国产精品一品二品| 蜜桃精品视频在线| 午夜一区二区三区视频|