RFID: Add additional procotols supported by EM4305 chipset (#434)

* Add additional procotols supported by EM4305 chipset

* Add support for GProxII (inverted EM4305 BIPHASE)

* Update changelog

---------

Co-authored-by: WillyJL <me@willyjl.dev>
This commit is contained in:
Derek Jamison
2025-07-19 19:44:14 -06:00
committed by GitHub
parent ef17b42a5e
commit ec922aa5af
6 changed files with 73 additions and 2 deletions

View File

@@ -287,6 +287,20 @@ bool protocol_gproxii_write_data(ProtocolGProxII* protocol, void* data) {
request->t5577.block[3] = bit_lib_get_bits_32(protocol->data, 64, 32);
request->t5577.blocks_to_write = 4;
result = true;
} else if(request->write_type == LFRFIDWriteTypeEM4305) {
request->em4305.word[4] =
(EM4x05_MODULATION_BIPHASE | EM4x05_SET_BITRATE(64) | (7 << EM4x05_MAXBLOCK_SHIFT));
uint32_t encoded_data_reversed[3] = {0};
for(uint8_t i = 0; i < 96; i++) {
encoded_data_reversed[i / 32] = (encoded_data_reversed[i / 32] << 1) |
(bit_lib_get_bit(protocol->data, (95 - i)) & 1);
encoded_data_reversed[i / 32] ^= 1; // Invert to make DIPHASE/BIPHASE.
}
request->em4305.word[5] = encoded_data_reversed[2];
request->em4305.word[6] = encoded_data_reversed[1];
request->em4305.word[7] = encoded_data_reversed[0];
request->em4305.mask = 0xF0;
result = true;
}
return result;
}