mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
add helper fct manchesterEncodeUint32
This commit is contained in:
parent
359399b2e6
commit
960d8c4db3
3 changed files with 20 additions and 57 deletions
|
@ -419,6 +419,18 @@ uint32_t manchesterEncode2Bytes(uint16_t datain) {
|
|||
return output;
|
||||
}
|
||||
|
||||
void manchesterEncodeUint32(uint32_t data_in, uint8_t bitlen_in, uint8_t *bits_out, uint16_t *index) {
|
||||
for (int i = bitlen_in - 1; i >= 0; i--) {
|
||||
if ((data_in >> i) & 1) {
|
||||
bits_out[(*index)++] = 1;
|
||||
bits_out[(*index)++] = 0;
|
||||
} else {
|
||||
bits_out[(*index)++] = 0;
|
||||
bits_out[(*index)++] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//by marshmellow
|
||||
//encode binary data into binary manchester
|
||||
//NOTE: bitstream must have triple the size of "size" available in memory to do the swap
|
||||
|
|
|
@ -61,6 +61,7 @@ size_t fskdemod(uint8_t *dest, size_t size, uint8_t rfLen, uint8_t invert, uin
|
|||
//void getHiLo(uint8_t *bits, size_t size, int *high, int *low, uint8_t fuzzHi, uint8_t fuzzLo);
|
||||
void getHiLo(int *high, int *low, uint8_t fuzzHi, uint8_t fuzzLo);
|
||||
uint32_t manchesterEncode2Bytes(uint16_t datain);
|
||||
void manchesterEncodeUint32(uint32_t data_in, uint8_t bitlen_in, uint8_t *bits_out, uint16_t *index);
|
||||
int ManchesterEncode(uint8_t *bits, size_t size);
|
||||
uint16_t manrawdecode(uint8_t *bits, size_t *size, uint8_t invert, uint8_t *alignPos);
|
||||
int nrzRawDemod(uint8_t *dest, size_t *size, int *clk, int *invert, int *startIdx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue