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

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

?? usb.c

?? 此為philip 1362 USB DOS下的驅動程式包, 已經共測試並內含有說明文件
?? C
字號:
#include "isp1362.h"
#include "reg.h"

unsigned int device_info(char mode, char itype, char index)
{
 static int iManufacturer=0;
 static int iProduct=0;
 static int iInterface=0;
 static int MaxPacSize=0;

 if(mode=='W')
 {
  if(itype=='M') {iManufacturer=index;}
  if(itype=='P') {iProduct     =index;}
  if(itype=='I') {iInterface   =index;}
  if(itype=='S') {MaxPacSize   =index;}
 }

 if(mode=='R')
 {
  if(itype=='M') {return(iManufacturer);}
  if(itype=='P') {return(iProduct)     ;}
  if(itype=='I') {return(iInterface)   ;}
  if(itype=='S') {return(MaxPacSize)   ;}
 }

 if(mode=='S')
 {
  printf("\niManufacturer = %4X",iManufacturer);
  printf("\niProduct      = %4X",iProduct     );
  printf("\niInterface    = %4X",iInterface   );
  printf("\nMaxPacSize    = %4X",MaxPacSize   );
 }

 return 0;
}

unsigned int set_address(int old_addr, int new_addr, int port)
{
 unsigned int cbuf[128];
 unsigned int rbuf[128];
 unsigned int uni_req[4]={0x0500,0x0000,0x0000,0x0000};
 unsigned int mycode=0;
 unsigned int tcnt;

 uni_req[1]=new_addr;

 w16(HcUpInt,0x100);

 r32(HcATLDone);
 r32(HcATLDone);

 make_ptd(cbuf,SETUP,0,8,0,old_addr,port);
 array_app(cbuf+4,uni_req,4);
 tcnt=send_control(cbuf,rbuf);
 mycode=(*rbuf&0xF000)>>12;

 if(tcnt==0)
 {
  mycode|=0xF000;
 }

 if(mycode==0)
 {
  //send out DATA IN packet
  make_ptd(cbuf,IN,0,0,1,old_addr,port);
  tcnt=send_control(cbuf,rbuf);
  mycode=(*rbuf&0xF000)>>12;
   if(tcnt==0)
	{
	 mycode|=0xF000;
	}
 }

 r32(HcATLDone);

 return(mycode);
}

void set_config(int addr, int config)
{
 unsigned int cbuf[128];
 unsigned int rbuf[128];
 unsigned int uni_req[4]={0x0900,0x0000,0x0000,0x0000};
 unsigned int tcnt;
 unsigned int mycode=0;

 uni_req[1]=config;

 w16(HcUpInt,0x100);

 r32(HcATLDone);
 r32(HcATLDone);

 make_ptd(cbuf,SETUP,0,8,0,addr,addr);
 array_app(cbuf+4,uni_req,4);
 tcnt=send_control(cbuf,rbuf);

 if(tcnt==0) { mycode|=0xF000;}
 mycode=mycode | (*rbuf&0xF000)>>12;

 if(mycode==0)
 {
 //send out DATA IN packet
  make_ptd(cbuf,IN,0,0,1,addr,addr);
  tcnt=send_control(cbuf,rbuf);

  if(tcnt==0) { mycode|=0xF000;}
  mycode=mycode | (*rbuf&0xF000)>>12;
 }

 r32(HcATLDone);
 r32(HcATLDone);

 return(mycode);
}


unsigned int get_control_old(unsigned int *rptr,unsigned int addr,char control_type,unsigned int extra,int port)
{
 unsigned int cbuf[128];
 unsigned int rbuf[128];
 unsigned int cnt=0,lcnt=0;
 unsigned int toggle_cnt=0;
 unsigned int word_size;
 unsigned int DesSize,MaxSize,RemainSize;
 unsigned int LocalLimit;

 unsigned int dev_req[4]={0x0680,0x0100      ,0x0000,0x8};
 unsigned int cfg_req[4]={0x0680,0x0200      ,0x0000,0x8};
 unsigned int str_req[4]={0x0680,0x0300      ,0x0000,0x8};
 unsigned int int_req[4]={0x0680,0x0400      ,0x0000,0x8};
 unsigned int end_req[4]={0x0680,0x0500      ,0x0000,0x8};
 unsigned int hid_req[4]={0x0681,0x2100      ,0x0000,0x8};

 unsigned int ccode=0;
 unsigned int stage=1;
 unsigned int tout; //timeout indicator

 //STAGE 1 : Send out first setup packet
 make_ptd(cbuf,SETUP,0,8,0,addr,port);
 if(control_type=='D') {array_app(cbuf+4,dev_req,4);}
 if(control_type=='C') {array_app(cbuf+4,cfg_req,4);}
 if(control_type=='S') {array_app(cbuf+4,str_req,4);}
 if(control_type=='I') {array_app(cbuf+4,int_req,4);}
 if(control_type=='E') {array_app(cbuf+4,end_req,4);}
 if(control_type=='H') {array_app(cbuf+4,hid_req,4);}

 if(control_type=='S')
 {
  cbuf[5]=cbuf[5]|extra;   //This is for string processing
 }

 tout=send_control(cbuf,rbuf);
 if(tout==0) {ccode|=0xF000;}   //Indicates Timeout in transaction

 if(ccode==0)
 {
  toggle_cnt++;
  make_ptd(cbuf,IN,0,8,toggle_cnt%2,addr,port);
  tout=send_control(cbuf,rbuf);
  ccode|=(rbuf[0]&0xF000)>>12;

  if(ccode==0x09)  //Descriptor Size is less than 8
  {
   ccode=0;
  }

  if(tout==0) {ccode|=0xF000;}   //Indicates Timeout in transaction

  if(control_type!='C')
  {
   DesSize=((rbuf[4]&0x00FF));
  }

  if(control_type=='C')
  {
   DesSize=rbuf[5];
  }

  if(control_type!='D')
  {
   MaxSize=addr_info(addr,'R','M',MaxSize);
  }

  if(control_type=='D')
  {
   MaxSize=(rbuf[7]&0xFF00)>>8;
   if(MaxSize<8) {MaxSize==8;}

   addr_info(addr,'W','M',MaxSize);
  }

  if(control_type=='H')
  {
   DesSize=(rbuf[7]&0xFF00)>>8;
   if(DesSize<8) {DesSize==8;}
  }

 }

 if(ccode==0)
 {
  //send out DATA OUT packet
  make_ptd(cbuf,OUT,0,0,toggle_cnt%2,addr,port);
  tout=send_control(cbuf,rbuf);
  if(tout==0) {ccode|=0xF000;}   //Indicates Timeout in transaction

  ccode|=(rbuf[0]&0xF000)>>12;
 }
 //STAGE 1: END

 if(ccode==0)
 {
  stage=2;

  hid_req[1]=0x2200; //Change HID req into HID report descriptor

  //STAGE 2
  make_ptd(cbuf,SETUP,0,8,0,addr,port);
  if(control_type=='D') {array_app(cbuf+4,dev_req,4);}
  if(control_type=='C') {array_app(cbuf+4,cfg_req,4);}
  if(control_type=='S') {array_app(cbuf+4,str_req,4);}
  if(control_type=='I') {array_app(cbuf+4,int_req,4);}
  if(control_type=='E') {array_app(cbuf+4,end_req,4);}
  if(control_type=='H') {array_app(cbuf+4,hid_req,4);}

  if(control_type=='S')
  {
   cbuf[5]=cbuf[5]|extra;
  }

  cbuf[7]=DesSize;
  tout=send_control(cbuf,rbuf);
  if(tout==0) {ccode|=0xF000;}   //Indicates Timeout in transaction

  word_size=(DesSize+1)>>1;

  RemainSize=DesSize;

  toggle_cnt=0;
  cnt=0;
  do
  {
   //send out DATA IN packet
   toggle_cnt++;

   //The last transaction where remaining data size < max pac size
   if(RemainSize<MaxSize)
   {
	make_ptd(cbuf,IN,0,RemainSize,toggle_cnt%2,addr,port);
   }

   //Normal
   else
   {
	make_ptd(cbuf,IN,0,MaxSize,toggle_cnt%2,addr,port);
   }

   tout=send_control(cbuf,rbuf);
   if(tout==0) {ccode|=0xF000;}   //Indicates Timeout in transaction

   ccode|=(rbuf[0]&0xF000)>>12;

   RemainSize=RemainSize-MaxSize;

   LocalLimit=MaxSize>>1;

   if(ccode==0)//Data In is sucessful
   {
	lcnt=0;
	do
	{
	 //Copy the data located right after the 8 bytes PTD
	 *(rptr+cnt)=rbuf[4+lcnt];

	 cnt++;
	 lcnt++;
	}
	while(lcnt<(LocalLimit));
   }

  }
  while((cnt<word_size)&&(ccode==0));
 //STAGE 2: END
 }

 if(ccode==0)
 {
  stage=3;

  //STAGE 3 :Send out DATA OUT packet
  make_ptd(cbuf,OUT,0,0,toggle_cnt%2,addr,port);
  send_control(cbuf,rbuf);

  ccode=(rbuf[0]&0xF000)>>12;
  //STAGE 3: END
 }

 return( (ccode)|(stage<<8) );

// byte 0 indicates the error code
// byte 2 indicates at which stage the error was encountered
// byte 3 is F if time-out, else 0
}

unsigned int get_control(unsigned int *rptr,unsigned int addr,char control_type,unsigned int extra,int port)
{
 unsigned int cbuf[128];
 unsigned int rbuf[128];
 unsigned int cnt=0,lcnt=0;
 unsigned int toggle_cnt=0;
 unsigned int word_size;
 unsigned int DesSize,MaxSize;

 unsigned int dev_req[4]={0x0680,0x0100      ,0x0000,0x8};
 unsigned int cfg_req[4]={0x0680,0x0200      ,0x0000,0x8};
 unsigned int str_req[4]={0x0680,0x0300      ,0x0000,0x8};
 unsigned int int_req[4]={0x0680,0x0400      ,0x0000,0x8};
 unsigned int end_req[4]={0x0680,0x0500      ,0x0000,0x8};
 unsigned int hid_req[4]={0x0681,0x2100      ,0x0000,0x8};

 unsigned int ccode=0;
 unsigned int stage=1;
 unsigned int tout; //timeout indicator

 //STAGE 1 : Send out first setup packet
 make_ptd(cbuf,SETUP,0,8,0,addr,port);
 if(control_type=='D') {array_app(cbuf+4,dev_req,4);}
 if(control_type=='C') {array_app(cbuf+4,cfg_req,4);}
 if(control_type=='S') {array_app(cbuf+4,str_req,4);}
 if(control_type=='I') {array_app(cbuf+4,int_req,4);}
 if(control_type=='E') {array_app(cbuf+4,end_req,4);}
 if(control_type=='H') {array_app(cbuf+4,hid_req,4);}

 if(control_type=='S')
 {
  cbuf[5]=cbuf[5]|extra;   //This is for string processing
 }

 tout=send_control(cbuf,rbuf);
 if(tout==0) {ccode|=0xF000;}   //Indicates Timeout in transaction

 if(ccode==0)
 {
  toggle_cnt++;
  make_ptd(cbuf,IN,0,8,toggle_cnt%2,addr,port);
  tout=send_control(cbuf,rbuf);
  ccode|=(rbuf[0]&0xF000)>>12;

  if(ccode==0x09)  //Descriptor Size is less than 8
  {
   ccode=0;
  }

  if(tout==0) {ccode|=0xF000;}   //Indicates Timeout in transaction

  if(control_type!='C')
  {
   DesSize=((rbuf[4]&0x00FF));
  }

  if(control_type=='C')
  {
   DesSize=rbuf[5];
  }

  if(control_type!='D')
  {
   MaxSize=addr_info(addr,'R','M',MaxSize);
  }

  if(control_type=='D')
  {
   MaxSize=(rbuf[7]&0xFF00)>>8;
   if(MaxSize<8) {MaxSize==8;}

   addr_info(addr,'W','M',MaxSize);
  }

  if(control_type=='H')
  {
   DesSize=(rbuf[7]&0xFF00)>>8;
   if(DesSize<8) {DesSize==8;}
  }
 }

 if(ccode==0)
 {
  //send out DATA OUT packet
  make_ptd(cbuf,OUT,0,0,toggle_cnt%2,addr,port);
  tout=send_control(cbuf,rbuf);
  if(tout==0) {ccode|=0xF000;}   //Indicates Timeout in transaction

  ccode|=(rbuf[0]&0xF000)>>12;
 }
 //STAGE 1: END

 if(ccode==0)
 {
  stage=2;

  hid_req[1]=0x2200; //Change HID req into HID report descriptor

  //STAGE 2
  make_ptd(cbuf,SETUP,0,8,0,addr,port);
  if(control_type=='D') {array_app(cbuf+4,dev_req,4);}
  if(control_type=='C') {array_app(cbuf+4,cfg_req,4);}
  if(control_type=='S') {array_app(cbuf+4,str_req,4);}
  if(control_type=='I') {array_app(cbuf+4,int_req,4);}
  if(control_type=='E') {array_app(cbuf+4,end_req,4);}
  if(control_type=='H') {array_app(cbuf+4,hid_req,4);}

  if(control_type=='S')
  {
   cbuf[5]=cbuf[5]|extra;
  }

  cbuf[7]=DesSize;
  tout=send_control(cbuf,rbuf);
  if(tout==0) {ccode|=0xF000;}   //Indicates Timeout in transaction

  word_size=(DesSize+1)>>1;

  cnt=0;

  //send out DATA IN packet
   new_make_ptd(cbuf,IN,0,MaxSize,1,addr,port,DesSize);

   tout=send_control(cbuf,rbuf);
   if(tout==0) {ccode|=0xF000;}   //Indicates Timeout in transaction

   ccode|=(rbuf[0]&0xF000)>>12;

   if(ccode==0)//Data In is sucessful
   {
	lcnt=0;
	do
	{
	 //Copy the data located right after the 8 bytes PTD
	 *(rptr+cnt)=rbuf[4+lcnt];

	 cnt++;
	 lcnt++;
	}
	while(lcnt<DesSize);
   }
 //STAGE 2: END
 }

 if(ccode==0)
 {
  stage=3;

  //STAGE 3 :Send out DATA OUT packet
  make_ptd(cbuf,OUT,0,0,toggle_cnt%2,addr,port);
  send_control(cbuf,rbuf);

  ccode=(rbuf[0]&0xF000)>>12;
  //STAGE 3: END
 }

 return( (ccode)|(stage<<8) );
// byte 0 indicates the error code
// byte 2 indicates at which stage the error was encountered
// byte 3 is F if time-out, else 0
}

unsigned int set_sound(int addr,int port,int r0,int r1,int r2,int r3,int d0)
{
 unsigned int cbuf[128];
 unsigned int rbuf[128];
 unsigned int uni_req[4]={0x0212,0x0201,0x0200,0x0002};
 unsigned int audio_req[4]={0xF416,0x0,0x0,0x0};
 unsigned int mycode=0;
 unsigned int tcnt;

 uni_req[0]=r0;
 uni_req[1]=r1;
 uni_req[2]=r2;
 uni_req[3]=r3;

 audio_req[0]=d0;

 w16(HcUpInt,0x100);

 r32(HcATLDone);
 r32(HcATLDone);

 make_ptd(cbuf,SETUP,0,8,0,addr,port);
 array_app(cbuf+4,uni_req,4);
 tcnt=send_control(cbuf,rbuf);
 mycode=(*rbuf&0xF000)>>12;

 if(tcnt==0)
 {
  mycode|=0xF000;
 }

 if(mycode==0)
 {
  //send out DATA IN packet
  make_ptd(cbuf,OUT,0,2,1,addr,port);
  array_app(cbuf+4,audio_req,4);
  tcnt=send_control(cbuf,rbuf);
  mycode=(*rbuf&0xF000)>>12;
   if(tcnt==0)
	{
	 mycode|=0xF000;
	}
 }
 r32(HcATLDone);

 if(mycode==0)
 {
  //send out DATA IN packet
  make_ptd(cbuf,IN,0,0,1,addr,port);
  tcnt=send_control(cbuf,rbuf);
  mycode=(*rbuf&0xF000)>>12;
   if(tcnt==0)
	{
	 mycode|=0xF000;
	}
 }

 r32(HcATLDone);

 return(mycode);
}

unsigned int set_interface(int addr, int interface, int port)
{
 unsigned int cbuf[128];
 unsigned int rbuf[128];
 unsigned int uni_req[4]={0x0B01,0x0000,0x0001,0x0000};
 unsigned int mycode=0;
 unsigned int tcnt;

 uni_req[1]=interface;

 w16(HcUpInt,0x100);

 r32(HcATLDone);
 r32(HcATLDone);

 make_ptd(cbuf,SETUP,0,8,0,addr,port);
 array_app(cbuf+4,uni_req,4);
 tcnt=send_control(cbuf,rbuf);
 mycode=(*rbuf&0xF000)>>12;

 if(tcnt==0)
 {
  mycode|=0xF000;
 }

 if(mycode==0)
 {
  //send out DATA IN packet
  make_ptd(cbuf,IN,0,0,1,addr,port);
  tcnt=send_control(cbuf,rbuf);
  mycode=(*rbuf&0xF000)>>12;
   if(tcnt==0)
	{
	 mycode|=0xF000;
	}
 }

 r32(HcATLDone);

 return(mycode);
}





?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美年轻男男videosbes| 亚洲三级小视频| 7777女厕盗摄久久久| 99r国产精品| 欧美一区二区二区| 久久99久久精品| 日韩精品欧美精品| 天天综合日日夜夜精品| 亚洲午夜三级在线| 亚洲成人三级小说| 三级在线观看一区二区| 香蕉影视欧美成人| 日本成人在线一区| 蜜臀av一区二区在线观看| 美女一区二区三区| 国产真实乱子伦精品视频| 国产精品99久久久久久似苏梦涵 | 中文字幕av一区二区三区免费看| 久久中文娱乐网| 国产日本欧洲亚洲| 国产精品久久福利| 一区二区三区在线影院| 亚洲国产一区二区三区| 男男gaygay亚洲| 国产在线一区观看| 99久久综合精品| 精品视频免费在线| 日韩欧美www| 国产精品美女久久久久久久网站| 最新高清无码专区| 亚洲va国产天堂va久久en| 秋霞电影网一区二区| 国内欧美视频一区二区 | 精品欧美乱码久久久久久1区2区 | 国产精品福利在线播放| 亚洲视频你懂的| 性做久久久久久久免费看| 经典三级一区二区| 99免费精品视频| 欧美日韩国产综合一区二区三区| 日韩视频一区二区三区| 国产日韩影视精品| 亚洲一区二区三区影院| 激情综合网激情| 91年精品国产| 日韩女优电影在线观看| 国产精品每日更新| 日韩高清一区二区| 成人污污视频在线观看| 欧美熟乱第一页| 国产欧美日韩另类视频免费观看| 亚洲情趣在线观看| 国内外成人在线| 欧美丝袜丝nylons| 国产女主播在线一区二区| 亚洲一区二区三区四区在线免费观看 | 国产福利视频一区二区三区| 91亚洲国产成人精品一区二区三| 9191国产精品| 中文字幕一区av| 蜜臀av性久久久久蜜臀aⅴ流畅| 白白色亚洲国产精品| 日韩一区二区三区视频在线| 国产精品每日更新| 精品一区二区久久久| 一本色道a无线码一区v| 26uuu精品一区二区| 亚洲一区二区三区精品在线| 国产成人免费高清| 日韩亚洲欧美一区二区三区| 亚洲精品乱码久久久久久久久| 九色porny丨国产精品| 在线观看日韩av先锋影音电影院| 久久精品人人做人人综合| 午夜国产不卡在线观看视频| 成人福利视频在线看| 欧美xxxxx裸体时装秀| 亚洲国产成人91porn| 99久久久精品免费观看国产蜜| 精品久久99ma| 免费在线观看成人| 欧美日韩在线播放| 亚洲柠檬福利资源导航| 成人黄色在线网站| 国产日韩欧美不卡在线| 久久爱另类一区二区小说| 精品1区2区3区| 亚洲另类中文字| 成人高清免费观看| 日本一区二区免费在线观看视频| 久久er99精品| 日韩免费视频一区二区| 日韩专区一卡二卡| 精品婷婷伊人一区三区三| 亚洲免费视频成人| 91丝袜美女网| 亚洲欧美区自拍先锋| jlzzjlzz欧美大全| 国产精品进线69影院| 成人精品电影在线观看| 久久精品欧美一区二区三区麻豆| 九九久久精品视频| 日韩欧美一级精品久久| 另类中文字幕网| 欧美一级xxx| 麻豆精品新av中文字幕| 日韩午夜在线观看| 久久99国内精品| 日韩精品一区二| 黄色日韩三级电影| 国产午夜精品理论片a级大结局| 国产美女视频91| 中文一区在线播放| jiyouzz国产精品久久| 亚洲欧洲99久久| 色综合天天天天做夜夜夜夜做| 亚洲日本青草视频在线怡红院 | 欧美性三三影院| 亚洲国产综合视频在线观看| 欧美日韩亚洲综合一区二区三区| 亚洲成av人影院在线观看网| 欧美日韩精品一区二区三区蜜桃 | 久久99国产精品麻豆| 精品福利一区二区三区| 国产福利视频一区二区三区| 国产精品伦一区| 欧美亚洲另类激情小说| 图片区小说区国产精品视频| 欧美成人在线直播| 国产99久久久久| 一区二区视频免费在线观看| 91精品国产综合久久久蜜臀图片| 国内外成人在线| 亚洲色图在线播放| 欧美日韩一区在线| 激情综合网天天干| 亚洲欧美日韩国产手机在线| 欧美精品vⅰdeose4hd| 国内精品免费在线观看| 欧美激情综合在线| 欧美视频在线一区| 精品在线免费观看| 亚洲视频免费观看| 日韩三级电影网址| av一区二区久久| 奇米一区二区三区| 国产精品传媒视频| 欧美一区二区视频网站| 成人免费看黄yyy456| 亚洲成人激情综合网| 久久久精品影视| 欧美性猛片xxxx免费看久爱| 激情综合五月天| 亚洲大片精品永久免费| 久久精品一区二区三区av| 欧美天堂一区二区三区| 国产乱子伦一区二区三区国色天香| 亚洲视频一二三区| 精品成人在线观看| 欧亚洲嫩模精品一区三区| 国产毛片精品视频| 亚洲成人资源在线| 中文字幕 久热精品 视频在线| 91精品国产免费久久综合| eeuss国产一区二区三区| 免费一级欧美片在线观看| 亚洲欧美日韩久久精品| 久久网这里都是精品| 欧美日韩成人综合在线一区二区 | 日韩亚洲欧美成人一区| 91麻豆国产自产在线观看| 国产在线视视频有精品| 婷婷久久综合九色综合绿巨人 | 亚洲人成精品久久久久久| 亚洲精品在线免费播放| 欧美性高清videossexo| 成人激情视频网站| 狠狠色丁香婷婷综合久久片| 亚洲第一福利一区| 亚洲欧洲综合另类在线| 欧美极品aⅴ影院| 精品国产免费人成在线观看| 欧美日韩免费视频| 一本到一区二区三区| 成人免费观看av| 狠狠色丁香九九婷婷综合五月| 一区二区国产盗摄色噜噜| 国产精品不卡一区| 久久精品一区二区三区不卡牛牛| 91精品国产91综合久久蜜臀| 欧美午夜一区二区三区| 一本到一区二区三区| 不卡一区二区三区四区| 国产成+人+日韩+欧美+亚洲| 美女网站在线免费欧美精品| 日韩成人午夜精品| 天天影视涩香欲综合网| 亚洲成国产人片在线观看| 亚洲精品日产精品乱码不卡| 亚洲日本青草视频在线怡红院 |