freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

20xx基于單片機(jī)制作mp3播放器畢業(yè)論文-閱讀頁

2025-06-21 17:54本頁面
  

【正文】 (0x17)define FADDEN (0x1)define CONFG (0x11)define DIR (0x17) //UEPSTAXdefine RXOUTB1 (0x16)define STALLRQ (0x15)define TXRDY (0x14)define STLCRC (0x13)define RXSETUP (0x12)define RXOUTB0 (0x11)define TXCMP (0x10)//USB 請(qǐng)求的bRequert的含意宏define get_status 0x00 //取得狀態(tài)define clear_feature 0x01 //清除特性define reserved 0x02 //保留define set_feature 0x03 //設(shè)置特性define set_address 0x05 //設(shè)置地址define get_descriptor 0x06 //取得描述符define get_configuration 0x08 //取得配置define set_configuration 0x09 //設(shè)置配置define get_interface 0x0a //取得接口define set_interface 0x0b //設(shè)置接口/****/void AtmelUSBInit() //用于USB的PLL時(shí)鐘20M晶振時(shí)如下設(shè)置{ int data i。 //設(shè)置PLL時(shí)鐘 PLLCON |= (0x3amp。 PLLRDIV = (0x3ffamp。 USBCLK=0。=(~PLLRES)。 USBCONamp。 //關(guān)閉USB并復(fù)位USB for(i=0。i++)。 //開啟USB控制器} void EpEnable(void) //初始化USB端點(diǎn){ UEPNUM=0x00。 UEPNUM=0x01。 UEPNUM=0x02。 UEPRST=0x07。 UEPIEN=0x07。 USBADDR=FEN。 UEPNUM=EpNum。 } UEPSTAXamp。 //清除相關(guān)位 return(i)。 UEPNUM=EpNum。 //控制方向 while(nLength) UEPDATX=Data[i++]。 //開始發(fā)送 while(!(UEPSTAXamp。 UEPSTAXamp。 //清除TXCMP}//以下用于對(duì)端點(diǎn)進(jìn)行處理void Set_Address(unsigned char EpNum) //設(shè)置USB地址1127{ WriteEp(0,0,0)。 USBADDR|=FEN。 //地址使能}//設(shè)備描述符code unsigned char Device_Descriptor[18] = { 0x12, //0x12 0x01, //DEVICE descriptor 0x10, 0x01, //spec rev level (BCD) 0x0, //device class 0x0, //device subclass 0x0, //device protocol 0x20, //max packet size 0x05, 0x82, //National39。s product ID 0x00, 0x00, //National39。//配置描述符code unsigned char Configuration_Descriptor_All[32] = { 9, //Size of Descriptor in Bytes 2, //Configuration Descriptor (0x02) 0x20, //Total length in bytes of data returned LSB 0x00, //MSB 1, //Number of Interfaces 1, //Value to use as an argument to select this configuration 0, //Index of String Descriptor describing this configuration 0x80, 0xfa, //Maximum Power Consumption in 2mA units 9, 4, 0, //the index of the interface descriptor Number of Interface 0, //Value used to select alternative setting 2, //EndPoint Number Used in this Descriptor 8, //Class Code (Assigned by USB Org) 6, //interface subclass1=RBC,2=SFF,3=QIC,4=UFI,5=SFF,6=SCSI 0x50, //bulk 0nly Transport 0, //Index of String Descriptor Describing this interface //Bulkin Endpoint 0x07, //length of this desc. 0x05, //ENDPOINT descriptor TYPE 0x81, //address (IN) Endpoint 4 84 0x02, //attributes (BULK) 0x40, 0x00, //max packet size (64) 0x0, //Does not apply to Bulk endpoints //Bulkout Endpoint 0x07, //length of this desc. 0x05, //ENDPOINT descriptor TYPE 0x02, //address (OUT) Endpoint 5 05 0x02, //attributes (BULK) 0x40, 0x00, //max packet size (64) 0x0 //Does not apply to Bulk endpoints }。if((DesType==0x02)amp。(nLength==0x09)) //取端口描述符 WriteEp(0,9,Configuration_Descriptor_All)。amp。 WriteEp(0,2,amp。 } if((DesType==0x02)amp。(nLength==0x20)) WriteEp(0,32,Configuration_Descriptor_All)。 UEPCONX=0x80。 UEPCONX=0x86。 UEPCONX=0x82。=(~CONFG)。 //狀態(tài)傳送階段之前完成指定操作 } else if(wValue == 1) { UEPNUM=0x00。 UEPNUM=0x01。 UEPNUM=0x02。 USBCON|=CONFG。 //狀態(tài)傳送階段之前完成指定操作 }}void Ep0() //端點(diǎn)0處理主函數(shù){ unsigned char data DT[32]={0,}。 i = ReadEp(0,DT)。 0x60)==0) amp。 i) { switch (DT[1]) { case set_address :Set_Address(DT[2])。 //設(shè)置地址 case get_descriptor :Get_Descriptor(DT[3],DT[6])。 //取描述符 case set_configuration :Set_Configuration(DT[2])。 //設(shè)置配置 default :。 } } else if(DT[0]==0xa1) //非標(biāo)準(zhǔn)USB請(qǐng)求 { WriteEp(0,0,0)。 //bCSWStatus 00=good state.typedef struct _STRUCT_CBW{ unsigned char CBWCB[12]。struct_CBW data bulk_CBW。 UEPNUM=EpNum。 //...設(shè)置為In模式 for(i=0。i++) UEPDATX=Data[i]。 //發(fā)送數(shù)據(jù)}void TransmitCSW() //向Host返回CSW{ WriteEpBulk(1, sizeof(bulk_CSW), bulk_CSW)。TXCMP)) 。=(~(TXCMP))。}void main_txdone() //數(shù)據(jù)發(fā)送完畢給出回復(fù){ UEPSTAXamp。 //清除TXCMP TransmitCSW()。L39。I39。T39。 39。M39。P39。339。 39。P39。l39。a39。y39。e39。r39。 39。V39。139。.39。039。 //Product Revision Level //SCSIRead_Format_capacities命令的返回?cái)?shù)據(jù) code unsigned char B_Read_Format_capacities[] = {0x00, 0x00, 0x00, 0x10, //capacity list header 0x00, 0x00, 0x07, 0xf5, 0x01, 0x00, 0x02, 0x00, //capacity descriptor //Number of Blocks =2037,unformatted media,blocklength = 512Bytes 0x00, 0x00, 0x07, 0xfd, 0x00, 0x00, 0x02, 0x00 //Formattable Capacity Descriptors
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1