rfid-reader.h 875 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #pragma once
  2. #include "decoder-analyzer.h"
  3. #include "decoder-emmarine.h"
  4. #include "decoder-hid26.h"
  5. #include "decoder-indala.h"
  6. #include "key-info.h"
  7. class RfidReader {
  8. public:
  9. enum class Type : uint8_t {
  10. Normal,
  11. Indala,
  12. };
  13. RfidReader();
  14. void start(Type type);
  15. void stop();
  16. bool read(LfrfidKeyType* type, uint8_t* data, uint8_t data_size);
  17. private:
  18. friend struct RfidReaderAccessor;
  19. //DecoderAnalyzer decoder_analyzer;
  20. DecoderEMMarine decoder_em;
  21. DecoderHID26 decoder_hid26;
  22. DecoderIndala decoder_indala;
  23. uint32_t last_dwt_value;
  24. void start_comparator(void);
  25. void start_timer(void);
  26. void start_timer_indala(void);
  27. void start_gpio(void);
  28. void stop_comparator(void);
  29. void stop_timer(void);
  30. void stop_gpio(void);
  31. void decode(bool polarity);
  32. Type type = Type::Normal;
  33. };