Skip to content

Commit b6bec07

Browse files
committed
acr122u: Fix crc errors on acr122u clones.
1 parent 075a95a commit b6bec07

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

rnfc-acr122u/src/lib.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,35 @@ impl Device {
8282
// SetParameters: Enable auto-RATS, auto-ATR_RES
8383
self.pn53x_cmd(0x12, &[0x14]).await?;
8484

85+
self.pn53x_cmd(0x32, &hex!("02 000b0a")).await?;
86+
self.pn53x_cmd(0x32, &hex!("04 00")).await?;
87+
self.pn53x_cmd(0x32, &hex!("05 010001")).await?;
88+
89+
// analog settings for Type A 106 kbps
90+
// Original settings are 59 F4 3F 11 4D 85 61 6F 26 62 87
91+
// but RxThreshold=0xF5 makes it work better on clone ACR122u's.
92+
self.pn53x_cmd(0x32, &hex!("0a 59 F4 3F 11 4D f5 61 6F 26 62 87")).await?;
93+
// | | | | | | | | | | TxBitPhase
94+
// | | | | | | | | | MifNFC
95+
// | | | | | | | | ModWidth
96+
// | | | | | | | GsNOff
97+
// | | | | | | Demod when own RF is Off
98+
// | | | | | RxThreshold
99+
// | | | | Demod when own RF is On
100+
// | | | ModGsP
101+
// | | CWGsP
102+
// | GsNOn
103+
// RFCfg
104+
105+
// analog settings for Type F 212/424 kbps
106+
self.pn53x_cmd(0x32, &hex!("0b 69 FF 3F 11 41 85 61 6F")).await?;
107+
108+
// analog settings for Type B 106 kbps
109+
self.pn53x_cmd(0x32, &hex!("0c FF 04 85")).await?;
110+
111+
// analog settings for 14443-4 212/424/848 kbps
112+
self.pn53x_cmd(0x32, &hex!("0d 85 15 8A 85 08 B2 85 01 DA")).await?;
113+
85114
Ok(())
86115
}
87116

0 commit comments

Comments
 (0)