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

正文內(nèi)容

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

2025-06-06 17:54本頁(yè)面
  

【正文】 dex 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 }。void Get_Descriptor(unsigned char DesType,unsigned char nLength) //得到描述符{ if(DesType==0x01) //取設(shè)備描述符 WriteEp(0,18,Device_Descriptor)。if((DesType==0x02)amp。amp。(nLength==0x09)) //取端口描述符 WriteEp(0,9,Configuration_Descriptor_All)。 if((DesType==0x02)amp。amp。(nLength==0xff)) //取端點(diǎn)描述符 { WriteEp(0,32,Configuration_Descriptor_All)。 WriteEp(0,2,amp。Device_Descriptor[4])。 } if((DesType==0x02)amp。amp。(nLength==0x20)) WriteEp(0,32,Configuration_Descriptor_All)。 //取配置描述符}void Set_Configuration(unsigned char wValue) //設(shè)置配置{ if(wValue == 0) { UEPNUM=0x00。 UEPCONX=0x80。 UEPNUM=0x01。 UEPCONX=0x86。 UEPNUM=0x02。 UEPCONX=0x82。 USBCONamp。=(~CONFG)。 WriteEp(0,0,0)。 //狀態(tài)傳送階段之前完成指定操作 } else if(wValue == 1) { UEPNUM=0x00。 UEPCONX=0x80。 UEPNUM=0x01。 UEPCONX=0x86。 UEPNUM=0x02。 UEPCONX=0x82。 USBCON|=CONFG。 WriteEp(0,0,0)。 //狀態(tài)傳送階段之前完成指定操作 }}void Ep0() //端點(diǎn)0處理主函數(shù){ unsigned char data DT[32]={0,}。 unsigned char data i。 i = ReadEp(0,DT)。 if (((DT[0] amp。 0x60)==0) amp。amp。 i) { switch (DT[1]) { case set_address :Set_Address(DT[2])。 break。 //設(shè)置地址 case get_descriptor :Get_Descriptor(DT[3],DT[6])。 break。 //取描述符 case set_configuration :Set_Configuration(DT[2])。 break。 //設(shè)置配置 default :。 break。 } } else if(DT[0]==0xa1) //非標(biāo)準(zhǔn)USB請(qǐng)求 { WriteEp(0,0,0)。 } }/******************************************************************************//** 以下為利用Bulk_Only傳輸協(xié)議的函數(shù)部分 **//******************************************************************************/unsigned char data bulk_CSW[]={0x55,0x53,0x42,0x53, // bytes 4 dCSWSignature 0x00,0x00,0x00,0x00, //bytes 4 dCSWTag 0x00,0x00,0x00,0x00, //bytes 4 dDataResiduce 0x00}。 //bCSWStatus 00=good state.typedef struct _STRUCT_CBW{ unsigned char CBWCB[12]。 //for UFI Command all have 12bit} struct_CBW。struct_CBW data bulk_CBW。void WriteEpBulk(unsigned char EpNum,unsigned char nLength,unsigned char *Data){ unsigned char data i。 UEPNUM=EpNum。 //設(shè)置端點(diǎn)號(hào) UEPSTAX|=DIR。 //...設(shè)置為In模式 for(i=0。inLength。i++) UEPDATX=Data[i]。 //填緩沖區(qū) UEPSTAX|=TXRDY。 //發(fā)送數(shù)據(jù)}void TransmitCSW() //向Host返回CSW{ WriteEpBulk(1, sizeof(bulk_CSW), bulk_CSW)。 while(!(UEPSTAXamp。TXCMP)) 。 UEPSTAXamp。=(~(TXCMP))。 //清除TXCMP UEPINT = 0。}void main_txdone() //數(shù)據(jù)發(fā)送完畢給出回復(fù){ UEPSTAXamp。=(~(TXCMP))。 //清除TXCMP TransmitCSW()。}//////////////////////////////////有關(guān)輸出端點(diǎn)的調(diào)用//////////////////////////////////////////////define Inquiry 0x12define Mode_Sense 0x1Adefine Read10 0x28define Read_Capacity 0x25 define Read_Format_Capacities 0x23 define Test_Unit_Ready 0x00 define Verify 0x2F define Write10 0x2A define Medium_Removal 0x1Edefine SCSI_MSPGCD_TPP 0x1Cdefine SCSI_MSPGCD_RETALL 0x3F//SCSIInquiry命令的返回?cái)?shù)據(jù) code unsigned char B_InquiryData[] = { 0x00, //Direct Access Device 0x80, //RMB 0x00, //ISO/ECMA/ANSI 0x01, //Response Data Format 0x1f, //Additional Length 0x00, //Reserved 0x00, //Reserved 0x00, //Reserved 39。L39。, 39。I39。, 39。T39。,39。 39。, //Vendor Information 39。M39。, 39。P39。, 39。339。, 39。 39。, 39。P39。, 39。l39。, 39。a39。, 39。y39。, 39。e39。, 39。r39。, 39。 39。, 39。V39。, 39。139。, 39。.39。, 39。039。,//Product Identification 0, 0, 0, 0}。 //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 }。//SCSIRead_Capacity命令的返回?cái)?shù)據(jù)code unsigned char B_Read_Capacity[] = { 0x00, 0x00, 0xfe, 0xa0, //Last Logical Block Address for 32MB 0x00, 0x00, 0x02, 0x00 //block le
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1