mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-25 03:29:58 -07:00
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:
@@ -369,6 +369,21 @@ bool protocol_fdx_b_write_data(ProtocolFDXB* protocol, void* data) {
|
||||
request->t5577.block[4] = bit_lib_get_bits_32(protocol->encoded_data, 96, 32);
|
||||
request->t5577.blocks_to_write = 5;
|
||||
result = true;
|
||||
} else if(request->write_type == LFRFIDWriteTypeEM4305) {
|
||||
request->em4305.word[4] =
|
||||
(EM4x05_MODULATION_BIPHASE | EM4x05_SET_BITRATE(32) | (8 << EM4x05_MAXBLOCK_SHIFT));
|
||||
uint32_t encoded_data_reversed[4] = {0};
|
||||
for(uint8_t i = 0; i < 128; i++) {
|
||||
encoded_data_reversed[i / 32] =
|
||||
(encoded_data_reversed[i / 32] << 1) |
|
||||
(bit_lib_get_bit(protocol->encoded_data, (127 - i)) & 1);
|
||||
}
|
||||
request->em4305.word[5] = encoded_data_reversed[3];
|
||||
request->em4305.word[6] = encoded_data_reversed[2];
|
||||
request->em4305.word[7] = encoded_data_reversed[1];
|
||||
request->em4305.word[8] = encoded_data_reversed[0];
|
||||
request->em4305.mask = 0x1F0;
|
||||
result = true;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user