mag_helpers.h 767 B

12345678910111213141516171819202122232425
  1. #include "../mag_i.h"
  2. #include <stdio.h>
  3. #include <string.h>
  4. void play_halfbit(bool value, MagState* state);
  5. void play_track(uint8_t* bits_manchester, uint16_t n_bits, MagState* state, bool reverse);
  6. void tx_init_rf(int hz);
  7. void tx_init_rfid();
  8. void tx_init_piezo();
  9. bool tx_init(MagState* state);
  10. void tx_deinit_piezo();
  11. void tx_deinit_rfid();
  12. bool tx_deinit(MagState* state);
  13. uint16_t add_bit(bool value, uint8_t* out, uint16_t count);
  14. uint16_t add_bit_manchester(bool value, uint8_t* out, uint16_t count);
  15. uint16_t mag_encode(
  16. char* data,
  17. uint8_t* out_manchester,
  18. uint8_t* out_raw,
  19. uint8_t track_bits,
  20. uint8_t track_ascii_offset);
  21. void debug_mag_string(char* data, uint8_t track_bits, uint8_t track_ascii_offset);
  22. void mag_spoof(Mag* mag);