16#define __STDC_LIMIT_MACROS
21#ifndef MFRC522_SPICLOCK
22#define MFRC522_SPICLOCK (4000000u)
31const byte MFRC522_firmware_referenceV0_0[]
PROGMEM = {
32 0x00, 0x87, 0x98, 0x0f, 0x49, 0xFF, 0x07, 0x19,
33 0xBF, 0x22, 0x30, 0x49, 0x59, 0x63, 0xAD, 0xCA,
34 0x7F, 0xE3, 0x4E, 0x03, 0x5C, 0x4E, 0x49, 0x50,
35 0x47, 0x9A, 0x37, 0x61, 0xE7, 0xE2, 0xC6, 0x2E,
36 0x75, 0x5A, 0xED, 0x04, 0x3D, 0x02, 0x4B, 0x78,
37 0x32, 0xFF, 0x58, 0x3B, 0x7C, 0xE9, 0x00, 0x94,
38 0xB4, 0x4A, 0x59, 0x5B, 0xFD, 0xC9, 0x29, 0xDF,
39 0x35, 0x96, 0x98, 0x9E, 0x4F, 0x30, 0x32, 0x8D
43const byte MFRC522_firmware_referenceV1_0[]
PROGMEM = {
44 0x00, 0xC6, 0x37, 0xD5, 0x32, 0xB7, 0x57, 0x5C,
45 0xC2, 0xD8, 0x7C, 0x4D, 0xD9, 0x70, 0xC7, 0x73,
46 0x10, 0xE6, 0xD2, 0xAA, 0x5E, 0xA1, 0x3E, 0x5A,
47 0x14, 0xAF, 0x30, 0x61, 0xC9, 0x70, 0xDB, 0x2E,
48 0x64, 0x22, 0x72, 0xB5, 0xBD, 0x65, 0xF4, 0xEC,
49 0x22, 0xBC, 0xD3, 0x72, 0x35, 0xCD, 0xAA, 0x41,
50 0x1F, 0xA7, 0xF3, 0x53, 0x14, 0xDE, 0x7E, 0x02,
51 0xD9, 0x0F, 0xB5, 0x5E, 0x25, 0x1D, 0x29, 0x79
55const byte MFRC522_firmware_referenceV2_0[]
PROGMEM = {
56 0x00, 0xEB, 0x66, 0xBA, 0x57, 0xBF, 0x23, 0x95,
57 0xD0, 0xE3, 0x0D, 0x3D, 0x27, 0x89, 0x5C, 0xDE,
58 0x9D, 0x3B, 0xA7, 0x00, 0x21, 0x5B, 0x89, 0x82,
59 0x51, 0x3A, 0xEB, 0x02, 0x0C, 0xA5, 0x00, 0x49,
60 0x7C, 0x84, 0x4D, 0xB3, 0xCC, 0xD2, 0x1B, 0x81,
61 0x5D, 0x48, 0x76, 0xD5, 0x71, 0x61, 0x21, 0xA9,
62 0x86, 0x96, 0x83, 0x38, 0xCF, 0x9D, 0x5B, 0x6D,
63 0xDC, 0x15, 0xBA, 0x3E, 0x7D, 0x95, 0x3B, 0x2F
67const byte FM17522_firmware_reference[]
PROGMEM = {
68 0x00, 0xD6, 0x78, 0x8C, 0xE2, 0xAA, 0x0C, 0x18,
69 0x2A, 0xB8, 0x7A, 0x7F, 0xD3, 0x6A, 0xCF, 0x0B,
70 0xB1, 0x37, 0x63, 0x4B, 0x69, 0xAE, 0x91, 0xC7,
71 0xC3, 0x97, 0xAE, 0x77, 0xF4, 0x37, 0xD7, 0x9B,
72 0x7C, 0xF5, 0x3C, 0x11, 0x8F, 0x15, 0xC3, 0xD7,
73 0xC1, 0x5B, 0x00, 0x2A, 0xD0, 0x75, 0xDE, 0x9E,
74 0x51, 0x64, 0xAB, 0x3E, 0xE9, 0x15, 0xB5, 0xAB,
75 0x56, 0x9A, 0x98, 0x82, 0x26, 0xEA, 0x2A, 0x62
273 MFRC522(
byte resetPowerDownPin);
274 MFRC522(
byte chipSelectPin,
byte resetPowerDownPin);
291 void PCD_Init(
byte resetPowerDownPin);
292 void PCD_Init(
byte chipSelectPin,
byte resetPowerDownPin);
309 StatusCode PCD_TransceiveData(
byte *sendData,
byte sendLen,
byte *backData,
byte *backLen,
byte *validBits =
nullptr,
byte rxAlign = 0,
bool checkCRC =
false);
310 StatusCode PCD_CommunicateWithPICC(
byte command,
byte waitIRq,
byte *sendData,
byte sendLen,
byte *backData =
nullptr,
byte *backLen =
nullptr,
byte *validBits =
nullptr,
byte rxAlign = 0,
bool checkCRC =
false);
356 bool MIFARE_SetUid(
byte *newUid,
byte uidSize,
bool logErrors);
const byte MFRC522_firmware_referenceV0_0[] PROGMEM
Definition: MFRC522.h:31
void PCD_AntennaOn()
Definition: MFRC522.cpp:278
StatusCode MIFARE_Write(byte blockAddr, byte *buffer, byte bufferSize)
Definition: MFRC522.cpp:966
StatusCode MIFARE_Transfer(byte blockAddr)
Definition: MFRC522.cpp:1105
void PCD_AntennaOff()
Definition: MFRC522.cpp:288
void PICC_DumpMifareClassicSectorToSerial(Uid *uid, MIFARE_Key *key, byte sector)
Definition: MFRC522.cpp:1488
void PCD_StopCrypto1()
Definition: MFRC522.cpp:910
bool PCD_PerformSelfTest()
Definition: MFRC522.cpp:321
bool MIFARE_SetUid(byte *newUid, byte uidSize, bool logErrors)
Definition: MFRC522.cpp:1775
static const __FlashStringHelper * GetStatusCodeName(StatusCode code)
Definition: MFRC522.cpp:1279
static constexpr byte FIFO_SIZE
Definition: MFRC522.h:81
byte _resetPowerDownPin
Definition: MFRC522.h:367
virtual bool PICC_IsNewCardPresent()
Definition: MFRC522.cpp:1904
void PICC_DumpDetailsToSerial(Uid *uid)
Definition: MFRC522.cpp:1418
PCD_Register
Definition: MFRC522.h:87
@ CWGsPReg
Definition: MFRC522.h:133
@ MfTxReg
Definition: MFRC522.h:119
@ RFCfgReg
Definition: MFRC522.h:131
@ CommandReg
Definition: MFRC522.h:90
@ TestADCReg
Definition: MFRC522.h:154
@ TModeReg
Definition: MFRC522.h:135
@ SerialSpeedReg
Definition: MFRC522.h:122
@ ErrorReg
Definition: MFRC522.h:95
@ TestDAC1Reg
Definition: MFRC522.h:152
@ ModeReg
Definition: MFRC522.h:108
@ GsNReg
Definition: MFRC522.h:132
@ FIFOLevelReg
Definition: MFRC522.h:99
@ DemodReg
Definition: MFRC522.h:116
@ TestBusReg
Definition: MFRC522.h:148
@ TestSel1Reg
Definition: MFRC522.h:144
@ VersionReg
Definition: MFRC522.h:150
@ CRCResultRegH
Definition: MFRC522.h:126
@ CRCResultRegL
Definition: MFRC522.h:127
@ TestDAC2Reg
Definition: MFRC522.h:153
@ RxThresholdReg
Definition: MFRC522.h:115
@ TestPinEnReg
Definition: MFRC522.h:146
@ RxSelReg
Definition: MFRC522.h:114
@ TxSelReg
Definition: MFRC522.h:113
@ TxControlReg
Definition: MFRC522.h:111
@ ComIrqReg
Definition: MFRC522.h:93
@ RxModeReg
Definition: MFRC522.h:110
@ TPrescalerReg
Definition: MFRC522.h:136
@ Status2Reg
Definition: MFRC522.h:97
@ MfRxReg
Definition: MFRC522.h:120
@ AutoTestReg
Definition: MFRC522.h:149
@ DivIrqReg
Definition: MFRC522.h:94
@ ControlReg
Definition: MFRC522.h:101
@ Status1Reg
Definition: MFRC522.h:96
@ TestPinValueReg
Definition: MFRC522.h:147
@ BitFramingReg
Definition: MFRC522.h:102
@ TCounterValueRegH
Definition: MFRC522.h:139
@ TestSel2Reg
Definition: MFRC522.h:145
@ TReloadRegH
Definition: MFRC522.h:137
@ TxASKReg
Definition: MFRC522.h:112
@ ModGsPReg
Definition: MFRC522.h:134
@ TxModeReg
Definition: MFRC522.h:109
@ ModWidthReg
Definition: MFRC522.h:129
@ TCounterValueRegL
Definition: MFRC522.h:140
@ ComIEnReg
Definition: MFRC522.h:91
@ WaterLevelReg
Definition: MFRC522.h:100
@ AnalogTestReg
Definition: MFRC522.h:151
@ TReloadRegL
Definition: MFRC522.h:138
@ CollReg
Definition: MFRC522.h:103
@ DivIEnReg
Definition: MFRC522.h:92
@ FIFODataReg
Definition: MFRC522.h:98
static constexpr uint8_t UNUSED_PIN
Definition: MFRC522.h:83
void PCD_DumpVersionToSerial()
Definition: MFRC522.cpp:1349
byte PCD_ReadRegister(PCD_Register reg)
Definition: MFRC522.cpp:79
StatusCode PICC_RequestA(byte *bufferATQA, byte *bufferSize)
Definition: MFRC522.cpp:556
PCD_RxGain
Definition: MFRC522.h:177
@ RxGain_48dB
Definition: MFRC522.h:185
@ RxGain_avg
Definition: MFRC522.h:187
@ RxGain_max
Definition: MFRC522.h:188
@ RxGain_18dB
Definition: MFRC522.h:178
@ RxGain_33dB
Definition: MFRC522.h:182
@ RxGain_min
Definition: MFRC522.h:186
@ RxGain_23dB
Definition: MFRC522.h:179
@ RxGain_43dB
Definition: MFRC522.h:184
@ RxGain_23dB_2
Definition: MFRC522.h:181
@ RxGain_18dB_2
Definition: MFRC522.h:180
@ RxGain_38dB
Definition: MFRC522.h:183
void PCD_SetAntennaGain(byte mask)
Definition: MFRC522.cpp:308
StatusCode PICC_REQA_or_WUPA(byte command, byte *bufferATQA, byte *bufferSize)
Definition: MFRC522.cpp:580
StatusCode PCD_Authenticate(byte command, byte blockAddr, MIFARE_Key *key, Uid *uid)
Definition: MFRC522.cpp:880
StatusCode MIFARE_Read(byte blockAddr, byte *buffer, byte *bufferSize)
Definition: MFRC522.cpp:931
void PICC_DumpToSerial(Uid *uid)
Definition: MFRC522.cpp:1373
StatusCode MIFARE_Ultralight_Write(byte page, byte *buffer, byte bufferSize)
Definition: MFRC522.cpp:1001
void PCD_ClearRegisterBitMask(PCD_Register reg, byte mask)
Definition: MFRC522.cpp:142
virtual StatusCode PICC_Select(Uid *uid, byte validBits=0)
Definition: MFRC522.cpp:619
StatusCode PCD_CalculateCRC(byte *data, byte length, byte *result)
Definition: MFRC522.cpp:156
StatusCode
Definition: MFRC522.h:242
@ STATUS_TIMEOUT
Definition: MFRC522.h:246
@ STATUS_COLLISION
Definition: MFRC522.h:245
@ STATUS_OK
Definition: MFRC522.h:243
@ STATUS_NO_ROOM
Definition: MFRC522.h:247
@ STATUS_INTERNAL_ERROR
Definition: MFRC522.h:248
@ STATUS_INVALID
Definition: MFRC522.h:249
@ STATUS_ERROR
Definition: MFRC522.h:244
@ STATUS_CRC_WRONG
Definition: MFRC522.h:250
@ STATUS_MIFARE_NACK
Definition: MFRC522.h:251
StatusCode MIFARE_TwoStepHelper(byte command, byte blockAddr, int32_t data)
Definition: MFRC522.cpp:1074
StatusCode PICC_HaltA()
Definition: MFRC522.cpp:836
bool MIFARE_OpenUidBackdoor(bool logErrors)
Definition: MFRC522.cpp:1705
MIFARE_Misc
Definition: MFRC522.h:219
@ MF_ACK
Definition: MFRC522.h:220
@ MF_KEY_SIZE
Definition: MFRC522.h:221
StatusCode MIFARE_Restore(byte blockAddr)
Definition: MFRC522.cpp:1062
void PCD_Reset()
Definition: MFRC522.cpp:262
void PCD_SoftPowerDown()
Definition: MFRC522.cpp:407
MFRC522()
Definition: MFRC522.cpp:16
PCD_Command
Definition: MFRC522.h:162
@ PCD_NoCmdChange
Definition: MFRC522.h:168
@ PCD_Receive
Definition: MFRC522.h:169
@ PCD_Mem
Definition: MFRC522.h:164
@ PCD_GenerateRandomID
Definition: MFRC522.h:165
@ PCD_CalcCRC
Definition: MFRC522.h:166
@ PCD_SoftReset
Definition: MFRC522.h:172
@ PCD_MFAuthent
Definition: MFRC522.h:171
@ PCD_Transceive
Definition: MFRC522.h:170
@ PCD_Transmit
Definition: MFRC522.h:167
@ PCD_Idle
Definition: MFRC522.h:163
byte PCD_GetAntennaGain()
Definition: MFRC522.cpp:299
void PCD_WriteRegister(PCD_Register reg, byte value)
Definition: MFRC522.cpp:46
StatusCode PCD_MIFARE_Transceive(byte *sendData, byte sendLen, bool acceptTimeout=false)
Definition: MFRC522.cpp:1233
StatusCode PCD_TransceiveData(byte *sendData, byte sendLen, byte *backData, byte *backLen, byte *validBits=nullptr, byte rxAlign=0, bool checkCRC=false)
Definition: MFRC522.cpp:438
virtual bool PICC_ReadCardSerial()
Definition: MFRC522.cpp:1926
static const __FlashStringHelper * PICC_GetTypeName(PICC_Type type)
Definition: MFRC522.cpp:1327
void PICC_DumpMifareClassicToSerial(Uid *uid, PICC_Type piccType, MIFARE_Key *key)
Definition: MFRC522.cpp:1447
PICC_Type
Definition: MFRC522.h:226
@ PICC_TYPE_NOT_COMPLETE
Definition: MFRC522.h:237
@ PICC_TYPE_MIFARE_PLUS
Definition: MFRC522.h:234
@ PICC_TYPE_TNP3XXX
Definition: MFRC522.h:236
@ PICC_TYPE_MIFARE_MINI
Definition: MFRC522.h:230
@ PICC_TYPE_ISO_14443_4
Definition: MFRC522.h:228
@ PICC_TYPE_ISO_18092
Definition: MFRC522.h:229
@ PICC_TYPE_MIFARE_4K
Definition: MFRC522.h:232
@ PICC_TYPE_MIFARE_UL
Definition: MFRC522.h:233
@ PICC_TYPE_MIFARE_1K
Definition: MFRC522.h:231
@ PICC_TYPE_MIFARE_DESFIRE
Definition: MFRC522.h:235
@ PICC_TYPE_UNKNOWN
Definition: MFRC522.h:227
StatusCode MIFARE_GetValue(byte blockAddr, int32_t *value)
Definition: MFRC522.cpp:1131
PICC_Command
Definition: MFRC522.h:192
@ PICC_CMD_MF_WRITE
Definition: MFRC522.h:208
@ PICC_CMD_SEL_CL3
Definition: MFRC522.h:199
@ PICC_CMD_MF_READ
Definition: MFRC522.h:207
@ PICC_CMD_RATS
Definition: MFRC522.h:201
@ PICC_CMD_MF_INCREMENT
Definition: MFRC522.h:210
@ PICC_CMD_MF_TRANSFER
Definition: MFRC522.h:212
@ PICC_CMD_MF_DECREMENT
Definition: MFRC522.h:209
@ PICC_CMD_MF_AUTH_KEY_A
Definition: MFRC522.h:205
@ PICC_CMD_MF_AUTH_KEY_B
Definition: MFRC522.h:206
@ PICC_CMD_WUPA
Definition: MFRC522.h:195
@ PICC_CMD_SEL_CL1
Definition: MFRC522.h:197
@ PICC_CMD_SEL_CL2
Definition: MFRC522.h:198
@ PICC_CMD_MF_RESTORE
Definition: MFRC522.h:211
@ PICC_CMD_CT
Definition: MFRC522.h:196
@ PICC_CMD_HLTA
Definition: MFRC522.h:200
@ PICC_CMD_UL_WRITE
Definition: MFRC522.h:215
@ PICC_CMD_REQA
Definition: MFRC522.h:194
void MIFARE_SetAccessBits(byte *accessBitBuffer, byte g0, byte g1, byte g2, byte g3)
Definition: MFRC522.cpp:1678
void PICC_DumpMifareUltralightToSerial()
Definition: MFRC522.cpp:1636
static PICC_Type PICC_GetType(byte sak)
Definition: MFRC522.cpp:1300
StatusCode PCD_CommunicateWithPICC(byte command, byte waitIRq, byte *sendData, byte sendLen, byte *backData=nullptr, byte *backLen=nullptr, byte *validBits=nullptr, byte rxAlign=0, bool checkCRC=false)
Definition: MFRC522.cpp:456
StatusCode PCD_NTAG216_AUTH(byte *passWord, byte pACK[])
Definition: MFRC522.cpp:1186
void PCD_SetRegisterBitMask(PCD_Register reg, byte mask)
Definition: MFRC522.cpp:131
StatusCode PICC_WakeupA(byte *bufferATQA, byte *bufferSize)
Definition: MFRC522.cpp:568
Uid uid
Definition: MFRC522.h:267
void PCD_SoftPowerUp()
Definition: MFRC522.cpp:413
void PCD_Init()
Definition: MFRC522.cpp:193
StatusCode MIFARE_Decrement(byte blockAddr, int32_t delta)
Definition: MFRC522.cpp:1034
StatusCode MIFARE_SetValue(byte blockAddr, int32_t value)
Definition: MFRC522.cpp:1156
StatusCode MIFARE_Increment(byte blockAddr, int32_t delta)
Definition: MFRC522.cpp:1048
bool MIFARE_UnbrickUidSector(bool logErrors)
Definition: MFRC522.cpp:1877
byte _chipSelectPin
Definition: MFRC522.h:366
Definition: MFRC522.h:262
Definition: MFRC522.h:255
byte size
Definition: MFRC522.h:256
byte sak
Definition: MFRC522.h:258