Add support for Pyramid tags (#1676)

* Add support for Pyramid tags
* Also add additional checks for AWID decoder to avoid missdetection

* lfrfid worker: reset GPIO_LOAD pin
* lfrfid: protocol viking, format
* lfrfid: protocol pyramid, format
* lfrfid: protocol paradox, format
* lfrfid: protocol jablotron, format
* lfrfid: protocol em4100, format
* lfrfid: increase reading time by 0.5s since protocol viking takes longer to read

Co-authored-by: SG <who.just.the.doctor@gmail.com>
This commit is contained in:
Sebastian Mauer
2022-08-29 17:31:28 +01:00
committed by GitHub
parent 611b7e15ed
commit d76ba20652
12 changed files with 438 additions and 29 deletions

View File

@@ -7,6 +7,8 @@
extern "C" {
#endif
#define TOPBIT(X) (1 << (X - 1))
typedef enum {
BitLibParityEven,
BitLibParityOdd,
@@ -114,6 +116,27 @@ bool bit_lib_test_parity(
BitLibParity parity,
uint8_t parity_length);
/**
* @brief Add parity to bit array
*
* @param data Source bit array
* @param position Start position
* @param dest Destination bit array
* @param dest_position Destination position
* @param source_length Source bit count
* @param parity_length Parity block length
* @param parity Parity to test against
* @return size_t
*/
size_t bit_lib_add_parity(
const uint8_t* data,
size_t position,
uint8_t* dest,
size_t dest_position,
uint8_t source_length,
uint8_t parity_length,
BitLibParity parity);
/**
* @brief Remove bit every n in array and shift array left. Useful to remove parity.
*
@@ -202,6 +225,27 @@ uint16_t bit_lib_reverse_16_fast(uint16_t data);
*/
uint8_t bit_lib_reverse_8_fast(uint8_t byte);
/**
* @brief Slow, but generic CRC8 implementation
*
* @param data
* @param data_size
* @param polynom CRC polynom
* @param init init value
* @param ref_in true if the right bit is older
* @param ref_out true to reverse output
* @param xor_out xor output with this value
* @return uint8_t
*/
uint16_t bit_lib_crc8(
uint8_t const* data,
size_t data_size,
uint8_t polynom,
uint8_t init,
bool ref_in,
bool ref_out,
uint8_t xor_out);
/**
* @brief Slow, but generic CRC16 implementation
*