资源简介
这个一个arduino 的rfid库函数,是一个能达到通用80%的硬件的一个库函数

代码片段和文件信息
/*
* MFRC522.cpp - Library to use ARDUINO RFID MODULE KIT 13.56 MHZ WITH TAGS SPI W AND R BY COOQROBOT.
* NOTE: Please also check the comments in MFRC522.h - they provide useful hints and background information.
* Released into the public domain.
*/
#include
#include
/////////////////////////////////////////////////////////////////////////////////////
// Functions for setting up the Arduino
/////////////////////////////////////////////////////////////////////////////////////
/**
* Constructor.
*/
MFRC522::MFRC522() {
} // End constructor
/**
* Constructor.
* Prepares the output pins.
*/
MFRC522::MFRC522( byte resetPowerDownPin ///< Arduino pin connected to MFRC522‘s reset and power down input (Pin 6 NRSTPD active low)
): MFRC522(SS resetPowerDownPin) { // SS is defined in pins_arduino.h
} // End constructor
/**
* Constructor.
* Prepares the output pins.
*/
MFRC522::MFRC522( byte chipSelectPin ///< Arduino pin connected to MFRC522‘s SPI slave select input (Pin 24 NSS active low)
byte resetPowerDownPin ///< Arduino pin connected to MFRC522‘s reset and power down input (Pin 6 NRSTPD active low)
) {
_chipSelectPin = chipSelectPin;
_resetPowerDownPin = resetPowerDownPin;
} // End constructor
/////////////////////////////////////////////////////////////////////////////////////
// Basic interface functions for communicating with the MFRC522
/////////////////////////////////////////////////////////////////////////////////////
/**
* Writes a byte to the specified register in the MFRC522 chip.
* The interface is described in the datasheet section 8.1.2.
*/
void MFRC522::PCD_WriteRegister( byte reg ///< The register to write to. One of the PCD_Register enums.
byte value ///< The value to write.
) {
SPI.beginTransaction(SPISettings(SPI_CLOCK_DIV4 MSBFIRST SPI_MODE0)); // Set the settings to work with SPI bus
digitalWrite(_chipSelectPin LOW); // Select slave
SPI.transfer(reg & 0x7E); // MSB == 0 is for writing. LSB is not used in address. Datasheet section 8.1.2.3.
SPI.transfer(value);
digitalWrite(_chipSelectPin HIGH); // Release slave again
SPI.endTransaction(); // Stop using the SPI bus
} // End PCD_WriteRegister()
/**
* Writes a number of bytes to the specified register in the MFRC522 chip.
* The interface is described in the datasheet section 8.1.2.
*/
void MFRC522::PCD_WriteRegister( byte reg ///< The register to write to. One of the PCD_Register enums.
byte count ///< The number of bytes to write to the register
byte *values ///< The values to write. Byte array.
) {
SPI.beginTransaction(SPISettings(SPI_CLOCK_DIV4 MSBFIRST SPI_MODE0)); // Set the settings to work with SPI bus
digitalWrite(_chipSelectPin LOW); // Select slave
SPI.transfer(reg & 0x7E); // MSB == 0 is for writing. LSB is not used in address. Datasheet section 8.1.2.3.
for (byte index = 0; index < count; index++) {
SPI.transfer(values[index]);
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 58 2017-05-30 22:34 rfid-master\.gitignore
文件 2865 2017-05-30 22:34 rfid-master\.travis.yml
文件 2868 2017-05-30 22:35 rfid-master\changes.txt
文件 4518 2017-05-30 22:35 rfid-master\examples\ReadNUID\ReadNUID.ino
文件 3734 2017-05-30 22:35 rfid-master\examples\ReadUidMultiReader\ReadUidMultiReader.ino
文件 10356 2017-05-30 22:35 rfid-master\examples\RFID-Cloner\RFID-Cloner.ino
文件 5867 2017-05-30 22:35 rfid-master\examples\rfid_default_keys\rfid_default_keys.ino
文件 6527 2017-05-30 22:35 rfid-master\examples\rfid_write_personal_data\rfid_write_personal_data.ino
文件 19740 2017-05-30 22:35 rfid-master\examples\servo_motor\servo_motor.ino
文件 4940 2017-05-30 22:35 rfid-master\keywords.txt
文件 358 2017-05-30 22:35 rfid-master\library.json
文件 302 2017-05-30 22:35 rfid-master\library.properties
文件 366 2017-05-30 22:35 rfid-master\Makefile
文件 72334 2017-05-30 22:35 rfid-master\MFRC522.cpp
文件 23887 2017-05-30 22:35 rfid-master\MFRC522.h
文件 11498 2017-05-30 22:35 rfid-master\README.rst
文件 1210 2017-05-30 22:35 rfid-master\UNLICENSE
目录 0 2017-05-30 22:34 rfid-master\doc\fritzing
目录 0 2017-05-30 22:34 rfid-master\examples\ChangeUID
目录 0 2017-05-30 22:34 rfid-master\examples\DumpInfo
目录 0 2017-05-30 22:34 rfid-master\examples\firmware_check
目录 0 2017-05-30 22:34 rfid-master\examples\FixBrickedUID
目录 0 2017-05-30 22:34 rfid-master\examples\MifareClassicValueBlock
目录 0 2017-05-30 22:34 rfid-master\examples\MinimalInterrupt
目录 0 2017-05-30 22:34 rfid-master\examples\Ntag216_AUTH
目录 0 2017-05-30 22:34 rfid-master\examples\ReadAndWrite
目录 0 2017-05-31 13:22 rfid-master\examples\ReadNUID
目录 0 2017-05-31 13:22 rfid-master\examples\ReadUidMultiReader
目录 0 2017-05-31 13:22 rfid-master\examples\RFID-Cloner
目录 0 2017-05-31 13:22 rfid-master\examples\rfid_default_keys
............此处省略8个文件信息
相关资源
- 用Beckhoff(倍福)PLC读写巴鲁夫RFID
- 物联网中无线传感器节点和RFID数据融
- M1卡破解程序 Mifare 1k
- delphi rfid 读写卡读卡器/写卡器源程序
- RFID读写demo
- 校园一卡通系统中RFID读写器的设计
- 基于Zigbee技术的家用无线网络平台设
- 丹麦“超级”医院 AUH 部署Zeb
- 丹麦“超级”医院AUH部署斑马技
- 用于牛奶质量检测的RFID天线设计
- RFID防碰撞算法(Aloha算法、二进制树
- 基于RFID公交车刷卡系统设计.doc
- 基于RFID的公交卡管理系统
- RFID停车场管理系统需求分析说明书
- RFID防碰撞算法论文
- 基于RFID的门禁系统设计.pdf
- 基于M0的LPC11C14射频模块例程
- RFID实验代码
- 基于51单片机射频密码锁设计门禁刷卡
- PN532上位机读写程序
- PN532上位机读写winfrom源码
- ISO/IEC18000-3
- 基于RFID技术的读者定位系统
- 基于RFID技术的整车物流监控方案
- 基于RFID技术实现智能集装箱
- stm32智能门禁系统
- 3M SIP2 标准协议文档(中文版)
- 图尔克RFID与西门子PLC通讯与说明
- PN532 NFC RFID V3模块 开发板 支持和手机
- 无线射频识别技术(RFID)理论与应用
评论
共有 条评论