PcdReadeE2.c
资源名称:RC500.rar [点击查看]
上传用户:hbtfgg
上传日期:2021-12-10
资源大小:16k
文件大小:1k
源码类别:
RFID编程
开发平台:
C/C++
- #include<reg52.h>
- #include<rc500.h>
- extern char PcdReadE2(uint startaddr,uchar length,uchar *readdata)
- {
- char status;
- uchar i;
- idata struct TranSciveBuffer{uchar MfCommand;
- uchar MfLength;
- uchar MfData[16];
- }MfComData;
- struct TranSciveBuffer *pi;
- pi=&MfComData;
- MfComData.MfCommand=PCD_READE2;
- MfComData.MfLength=3;
- MfComData.MfData[0]=startaddr&0xff;
- MfComData.MfData[1]=(startaddr>>8)&0xff;
- MfComData.MfData[2]=length;
- status=PcdComTransceive(pi);
- if(status==MI_OK)
- {
- for(i=0;i<length;i++)
- {
- *(readdata+i)=MfComData.MfData[i];
- }
- }
- return status;
- }