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

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

?? rc531.c

?? RC531
?? C
?? 第 1 頁 / 共 2 頁
字號:
       prescale = 0x15;
       reload   = 0xFF;				    // T = (reload - counter) / fcnt
    }
    Write_RF531(RegTimerClock,prescale); 	// TAutoRestart=0,TPrescale=prescale
    Write_RF531(RegTimerReload,reload);		// TReloadVal = reload
    
    return 1;
}
char  PcdSingleResponseCmd(U8 cmd,volatile U8* send,volatile U8* rcv, volatile MfCmdInfo *info)
{     
   	long status  = MI_OK;
   	U8 lastBits;
   	U8 validErrorFlags = 0x1F; 
   	U8 rxMultiple = 0x00;

   	U8 irqEn     = 0x00;
   	U8 waitFor   = 0x00;
   	U8 timerCtl  = 0x02;
   	U8 waterLevelBackup;
   	Write_RF531(RegInterruptEn,0x7F); // disable all interrupts
   	Write_RF531(RegInterruptRq,0x7F); // reset interrupt requests
   	// please pay attention to the sequence of following commands
   	// at first empty the FIFO
   	// second wait for probably e2 programming in progress
   	// third cancel command
   	//
  	 // ATTENTION: the guard timer must not expire earlier than 10 ms
   	FlushFIFO();            // flush FIFO buffer
   	// wait until e2 programming is finished
   	while (((Read_RF531(RegSecondaryStatus) & 0x40) == 0));
   	Write_RF531(RegCommand,PCD_IDLE); // terminate probably running command
   	// Set water level to the default value (see. 'PcdBasicRegisterConfiguration()')   
   	waterLevelBackup = Read_RF531(RegFIFOLevel);
   	Write_RF531(RegFIFOLevel,0x20);
   	// save info structures to module pointers
   	MpIsrInfo = info;  
   	MpIsrOut  = send;
   	MpIsrIn   = rcv;
   	info->irqSource = 0x0; // reset interrupt flags
   	//READER_INT_ENABLE;
   	// depending on the command code, appropriate interrupts are enabled (irqEn)
   	// and the commit interrupt is choosen (waitFor).
   	switch(cmd)
   	{
      	case PCD_IDLE:                   // nothing else required
         	irqEn = 0x00;
         	waitFor = 0x00;
         	break;
      	case PCD_WRITEE2:                // LoAlert and TxIRq
         	timerCtl = 0x00;              // start and stop timer manually            
         	irqEn = 0x11;
         	waitFor = 0x10;
		 	validErrorFlags &= ~0x08;     // hb 20.06.2001 don't check CRC errors         
         	break;
      	case PCD_READE2:                 // HiAlert, LoAlert and IdleIRq
         	timerCtl = 0x00;              // start and stop timer manually            
         	irqEn = 0x07;
         	waitFor = 0x04;
		 	validErrorFlags &= ~0x08;     // wu 15.05.2001 don't check CRC errors
         	break;
      	case PCD_LOADKEYE2:              // IdleIRq and LoAlert
         	timerCtl = 0x00;              // start and stop timer manually            
		 	validErrorFlags &= ~0x08;     // hb 20.06.2001 don't check CRC errors               
         	irqEn = 0x05;
         	waitFor = 0x04;
         	break;
      	case PCD_LOADCONFIG:             // IdleIRq and LoAlert
         	timerCtl = 0x00;              // start and stop timer manually            
         	irqEn = 0x05;
         	waitFor = 0x04;
         	break;
      	case PCD_AUTHENT1:               // IdleIRq and LoAlert
         	irqEn = 0x05;
         	waitFor = 0x04;
         	break;
      	case PCD_CALCCRC:                // LoAlert and TxIRq
         	timerCtl = 0x00;              // start and stop timer manually            
         	irqEn = 0x11;
         	waitFor = 0x10;
         	break;
      	case PCD_AUTHENT2:               // IdleIRq
         	irqEn = 0x04;
         	waitFor = 0x04;
         	break;
     	case PCD_RECEIVE:                // HiAlert and IdleIRq
         	info->nBitsReceived = -(Read_RF531(RegBitFraming) >> 4);      
         	timerCtl = 0x04;              // start timer manually and stop
                                       // with first bit received
         	irqEn = 0x06;
         	waitFor = 0x04;
         	break;
      	case PCD_LOADKEY:                // IdleIRq
         	timerCtl = 0x00;              // start and stop timer manually            
         	irqEn = 0x05;
         	waitFor = 0x04;
        	break;
      	case PCD_TRANSMIT:               // LoAlert and IdleIRq
         	timerCtl = 0x00;              // start and stop timer manually            
         	irqEn = 0x05;
         	waitFor = 0x04;
         	break;
      	case PCD_TRANSCEIVE:             // TxIrq, RxIrq, IdleIRq and LoAlert
         	info->nBitsReceived = -(Read_RF531(RegBitFraming) >> 4);
         	irqEn = 0x3D;
         	waitFor = 0x04;
         	break;
      	default:
         	status = MI_UNKNOWN_COMMAND;
   	}        
   	if (status == MI_OK)
   	{
      	rxMultiple = Read_RF531(RegDecoderControl) & 0x40;
      	if (!rxMultiple)
         	SetBitMask(RegDecoderControl,0x40);    
      	// Initialize uC Timer for global Timeout management
      	irqEn |= 0x20;                        // always enable timout irq
      	waitFor |= 0x20;                      // always wait for timeout 
      	Write_RF531(RegInterruptEn,irqEn | 0x80);  //necessary interrupts are enabled // count up from 1     
      	Write_RF531(RegTimerControl,timerCtl);
      	if (~timerCtl & 0x02){ // if no start condition could be detected, then
                              // start timer manually
         	SetBitMask(RegControl,0x02);
      	}
      	Write_RF531(RegCommand,cmd);               //start command   
      	// wait for commmand completion
      	// a command is completed, if the corresponding interrupt occurs
      	// or a timeout is signaled  
      	while (!(MpIsrInfo->irqSource & waitFor)); // wait for cmd completion or timeout
      	SetBitMask(RegControl,0x04);         // stop timer now
      	Write_RF531(RegInterruptEn,0x7F);          // disable all interrupts
      	Write_RF531(RegInterruptRq,0x7F);          // clear all interrupt requests
      	Write_RF531(RegCommand,PCD_IDLE);          // reset command register
      	status = MpIsrInfo->status;          // set status
      	if (MpIsrInfo->irqSource & 0x20) // if timeout expired - look at old error state
        	MpIsrInfo->errFlags |= MpIsrInfo->saveErrorState;
      	MpIsrInfo->errFlags &=  validErrorFlags;
      	if (MpIsrInfo->errFlags){ // error occured
         	if (MpIsrInfo->errFlags & 0x01){   // collision detected
            	info->collPos = Read_RF531(RegCollPos); // read collision position
            	status = MI_COLLERR;
         	}else{
            	if (MpIsrInfo->errFlags & 0x02){   // parity error
               		status = MI_PARITYERR;
            	}
         	}
         	if (MpIsrInfo->errFlags & 0x04){   // framing error
            	status = MI_FRAMINGERR;
         	}else if (MpIsrInfo->errFlags & 0x10){   // FIFO overflow
            	FlushFIFO();
            	status = MI_OVFLERR;
         	}else if (MpIsrInfo->errFlags & 0x08){ // CRC error
            	status = MI_CRCERR;
         	}else if (status == MI_OK)
            	status = MI_NY_IMPLEMENTED;
         		// key error occures always, because of 
         		// missing crypto 1 keys loaded
      	}
      		// if the last command was TRANSCEIVE, the number of 
      		// received bits must be calculated - even if an error occured
      	if (cmd == PCD_TRANSCEIVE || cmd == PCD_RECEIVE){
         	// number of bits in the last byte
         	lastBits = Read_RF531(RegSecondaryStatus) & 0x07;
         	if (lastBits)
            	info->nBitsReceived += (info->nBytesReceived-1) * 8 + lastBits;
         	else
            	info->nBitsReceived += info->nBytesReceived * 8;
      	}     
      	if (!rxMultiple)
         	ClearBitMask(RegDecoderControl,0x40);
   		}	
  	// READER_INT_DISABLE;
   	MpIsrInfo = 0;         // reset interface variables for ISR
   	MpIsrOut  = 0;
   	MpIsrIn   = 0; 
   	// restore the previous value for the FIFO water level
   	Write_RF531(RegFIFOLevel, waterLevelBackup);
   	return status;
} 
  
void memcpy(void *dest, void *src, U32 len)							//拷貝
{
	U32 i;
	U8 *p1, *p2;
	p1=(U8*)src;  p2=(U8*)dest;
	for(i=0; i<len; i++){
		*p2=*p1;  p1++;  p2++;
	}
}


U8 Mf500PiccCommonRequest(U8 req_code, 
                            U8 *atq)
{
   	long status;

    //************* initialize ******************************
   	if ((status = Mf500PcdSetDefaultAttrib()) == 1)
   	{   
      PcdSetTmo(60);      
      Write_RF531(RegChannelRedundancy,0x03); // RxCRC and TxCRC disable, parity enable
      ClearBitMask(RegControl,0x08);      // disable crypto 1 unit   
      Write_RF531(RegBitFraming,0x07);        // set TxLastBits to 7      
      ResetInfo(MInfo);   
      MSndBuffer[0] = req_code;
      MInfo.nBytesToSend   = 1;   
      MInfo.DisableDF = 1;
      status = PcdSingleResponseCmd(PCD_TRANSCEIVE,
                         MSndBuffer,
                         MRcvBuffer,
                         &MInfo);
      if ((status == MI_OK) && (MInfo.nBitsReceived != 16)) // 2 bytes expected
      {
         status = MI_BITCOUNTERR;
      } 
      if ((status == MI_COLLERR) && (MInfo.nBitsReceived == 16)) //
         status = MI_OK; // all received tag-types are combined to the 16 bit
         
      // in any case, copy received data to output - for debugging reasons
      if (MInfo.nBytesReceived >= 2)
      {
         memcpy(atq,(void *)MRcvBuffer,2);      
      }
      else
      {
         if (MInfo.nBytesReceived == 1)
            atq[0] = MRcvBuffer[0];
         else
            atq[0] = 0x00;
         atq[1] = 0x00;
      }
   }
   return status; 
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合九色综合欧美亚洲| 一本到三区不卡视频| 精品卡一卡二卡三卡四在线| 美日韩一级片在线观看| 精品国产一区二区三区忘忧草| 精品在线观看视频| 国产精品护士白丝一区av| 欧美在线啊v一区| 青草av.久久免费一区| 久久天堂av综合合色蜜桃网| 国产风韵犹存在线视精品| 中文字幕一区二区5566日韩| 色婷婷一区二区| 麻豆专区一区二区三区四区五区| 国产欧美日韩精品a在线观看| 91小视频免费观看| 男男成人高潮片免费网站| 国产亚洲va综合人人澡精品| 在线观看免费一区| 国产一区二区三区综合| 亚洲精选视频免费看| 欧美巨大另类极品videosbest| 精品亚洲成av人在线观看| 亚洲欧美韩国综合色| 日韩欧美一级二级| av不卡在线播放| 日本不卡在线视频| 亚洲欧洲日韩在线| 日韩欧美卡一卡二| 欧美在线free| 成人免费观看av| 欧美96一区二区免费视频| 欧美激情中文字幕| 91精品婷婷国产综合久久性色| 成人黄色大片在线观看| 麻豆国产欧美一区二区三区| 亚洲猫色日本管| 久久精品视频在线免费观看| 欧美色大人视频| caoporn国产一区二区| 精品在线一区二区| 午夜日韩在线观看| 亚洲男人的天堂在线aⅴ视频| 久久蜜臀中文字幕| 日韩欧美中文字幕精品| 欧美日韩在线一区二区| zzijzzij亚洲日本少妇熟睡| 久久er精品视频| 亚洲高清一区二区三区| 国产精品视频你懂的| 欧美电视剧在线观看完整版| 欧美日韩精品是欧美日韩精品| 99国产精品久久久久久久久久久| 国产精品一区二区在线观看不卡| 日本人妖一区二区| 亚洲成人7777| 亚洲成人免费影院| 一区二区三区在线免费观看 | 欧美写真视频网站| 成人免费毛片嘿嘿连载视频| 国产乱子伦一区二区三区国色天香| 日韩中文字幕av电影| 亚洲国产一区二区三区青草影视| 一区在线播放视频| 中文字幕一区二区三区在线不卡 | 亚洲精品水蜜桃| 中文乱码免费一区二区| 国产欧美视频一区二区| 久久久久国产一区二区三区四区| 日韩欧美国产1| 欧美一级爆毛片| 欧美一区二区网站| 91精品国产综合久久福利| 欧美久久一二三四区| 51精品国自产在线| 日韩亚洲欧美高清| 久久日一线二线三线suv| 欧美精品一区二区三区蜜臀| 久久久国际精品| 国产精品素人视频| 中文字幕佐山爱一区二区免费| 亚洲人午夜精品天堂一二香蕉| 亚洲日本青草视频在线怡红院 | 亚洲国产日韩a在线播放性色| 一区二区三区中文字幕在线观看| 亚洲综合在线五月| 一区二区三区中文字幕精品精品| 亚洲妇熟xx妇色黄| 日韩av午夜在线观看| 狠狠色丁香婷综合久久| 国产精品77777| 99国内精品久久| 欧美精品日韩一区| www精品美女久久久tv| 国产视频一区二区在线观看| 欧美激情中文不卡| 亚洲午夜电影在线观看| 日韩av一级片| 成人国产精品免费观看动漫| 日本国产一区二区| 欧美疯狂做受xxxx富婆| 久久综合久久综合九色| 国产精品久久久久久久蜜臀 | 午夜精品久久久久久久久| 免费成人小视频| 成人av资源站| 欧美裸体一区二区三区| 欧美国产欧美亚州国产日韩mv天天看完整| 综合欧美一区二区三区| 香蕉加勒比综合久久| 国产成人午夜精品5599| 91成人网在线| 久久久综合网站| 一区二区成人在线观看| 国模套图日韩精品一区二区| 91黄色在线观看| 久久色在线视频| 亚洲国产精品一区二区尤物区| 国产自产2019最新不卡| 欧美日韩一区二区在线观看 | 99re视频这里只有精品| 欧美一区二区三区免费视频| 国产精品久久久久永久免费观看| 五月激情六月综合| 色综合视频一区二区三区高清| 欧美精品一区二区在线播放| 一区二区高清在线| 高清视频一区二区| 欧美成人福利视频| 五月天久久比比资源色| 成人av动漫网站| 久久久另类综合| 日韩国产在线观看一区| 一本色道a无线码一区v| 久久久久久一二三区| 日韩国产欧美三级| 欧美三级电影一区| 亚洲人xxxx| jizzjizzjizz欧美| 国产午夜亚洲精品不卡| 狠狠色丁香婷婷综合| 欧美一个色资源| 亚洲国产欧美另类丝袜| 色婷婷激情综合| 中文字幕亚洲综合久久菠萝蜜| 国产麻豆午夜三级精品| 精品国产伦一区二区三区观看体验| 午夜精品福利一区二区蜜股av| 91亚洲精品一区二区乱码| 久久精品一区四区| 国产一区二区看久久| 欧美电影精品一区二区| 秋霞电影一区二区| 3d动漫精品啪啪一区二区竹菊 | 日本欧美一区二区三区| 在线免费观看一区| 一区二区成人在线观看| 91官网在线免费观看| 亚洲综合色在线| 欧美丝袜丝nylons| 亚洲第一二三四区| 欧美日本国产视频| 日韩精品一二三| 欧美一个色资源| 久久99精品久久只有精品| 亚洲精品一区二区三区香蕉| 黑人巨大精品欧美一区| 久久一日本道色综合| 国产99久久久国产精品免费看| 久久精品人人做人人综合| 豆国产96在线|亚洲| 亚洲欧洲成人自拍| 91免费看`日韩一区二区| 亚洲精品国产无天堂网2021| 在线观看国产一区二区| 性做久久久久久久免费看| 7777精品伊人久久久大香线蕉| 日本aⅴ免费视频一区二区三区 | 国产欧美日韩另类一区| 成人国产在线观看| 亚洲午夜久久久久中文字幕久| 欧美午夜精品一区二区蜜桃| 日韩av一区二区在线影视| 久久影院视频免费| av成人免费在线观看| 一区二区在线观看av| 91麻豆精品国产91久久久使用方法 | 精品乱码亚洲一区二区不卡| 国产伦精品一区二区三区免费迷 | 国产激情视频一区二区在线观看 | 久久老女人爱爱| 99久久综合精品| 水蜜桃久久夜色精品一区的特点| 日韩一区二区免费视频| 成人午夜免费视频| 婷婷综合在线观看| 国产婷婷精品av在线| 欧美三级视频在线观看| 精品一区二区三区日韩| 亚洲精品免费一二三区|