標(biāo)題:
RC522飛利浦原廠代碼下載
[打印本頁]
作者:
zhalun108
時(shí)間:
2017-7-14 10:36
標(biāo)題:
RC522飛利浦原廠代碼下載
RC522飛利浦原廠代碼 提供給有需要的朋友下載
0.png
(53.39 KB, 下載次數(shù): 63)
下載附件
2017-7-14 16:59 上傳
單片機(jī)源程序如下:
#include <string.h>
#include <stdio.h>
#include <absacc.h>
#include <intrins.h>
#include "RegCtrl.h"
#include "reg52.h"
#include "main.h"
#include "Mifare.h"
#include "Rc522Reg.h"
#include "OpCtrl.h"
/*Initialize the processor and RC522*/
void SysInit(void)
{
T2CON = 0x04;
PCON = 0x80;
SCON = 0x70;
TMOD = 0x22;
TH1 = BAUD_9600; //set serial port baudrate to 9600bps
TL1 = TH1;
TR1 = 1;
EA=0; //disable all interrupt
Rc522Init();
}
//Just for test
void main(void)
{
short status;
unsigned char idata tmp[16],i,key[6];
SysInit();
memset(key,0xff,6);
/* Request */
status = Request(ISO14443_3_REQALL, tmp);
if(status)
goto end;
/*anticollision and select the card*/
status = AnticollSelect(0, tmp);
if(status)
goto end;
/*authenticaiton the key A of sector 1 (block 4~block 7)*/
status = Authentication(MIFARE_AUTHENT_A,key, tmp, 6);
if(status)
goto end;
/*if passed authenticaiton you can read the data in this sector*/
status = Read(6, tmp);
if(status)
goto end;
memset(tmp,0x33,16);
/*write function test*/
status = Write(6, tmp);
if(status)
goto end;
memset(tmp,0,16);
/*to check if the data has been writen successfully*/
status = Read(6, tmp);
if(status)
goto end;
/*Initialize a block value, then you can do increment and decrement operation*/
memset(tmp,0xff,4);
status = InitBlock(6,tmp);
if(status)
goto end;
/*to check if the data has been initialized successfully*/
status = Read(6, tmp);
if(status)
goto end;
/*decrement operation test*/
tmp[0]=2;
tmp[1]=0;
tmp[2]=0;
tmp[3]=0;
status = ValueOper(MIFARE_DECREMENT, 6, tmp, 6);
if(status)
goto end;
/*check if the decrement operation is ok*/
status = Read(6, tmp);
if(status)
goto end;
/*Increment operation test*/
tmp[0]=2;
……………………
…………限于本文篇幅 余下代碼請從51黑下載附件…………
復(fù)制代碼
所有資料51hei提供下載:
RC522飛利浦原廠代碼.zip
(23.25 KB, 下載次數(shù): 29)
2017-7-14 10:35 上傳
點(diǎn)擊文件名下載附件
RC522飛利浦原廠代碼
下載積分: 黑幣 -5
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1