furi-hal-rfid.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #include <main.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. /** Initialize RFID subsystem */
  9. void furi_hal_rfid_init();
  10. /**
  11. * @brief config rfid pins to reset state
  12. *
  13. */
  14. void furi_hal_rfid_pins_reset();
  15. /**
  16. * @brief config rfid pins to emulate state
  17. *
  18. */
  19. void furi_hal_rfid_pins_emulate();
  20. /**
  21. * @brief config rfid pins to read state
  22. *
  23. */
  24. void furi_hal_rfid_pins_read();
  25. /**
  26. * @brief config rfid timer to read state
  27. *
  28. * @param freq timer frequency
  29. * @param duty_cycle timer duty cycle, 0.0-1.0
  30. */
  31. void furi_hal_rfid_tim_read(float freq, float duty_cycle);
  32. /**
  33. * @brief start read timer
  34. *
  35. */
  36. void furi_hal_rfid_tim_read_start();
  37. /**
  38. * @brief stop read timer
  39. *
  40. */
  41. void furi_hal_rfid_tim_read_stop();
  42. /**
  43. * @brief config rfid timer to emulate state
  44. *
  45. * @param freq timer frequency
  46. */
  47. void furi_hal_rfid_tim_emulate(float freq);
  48. /**
  49. * @brief start emulation timer
  50. *
  51. */
  52. void furi_hal_rfid_tim_emulate_start();
  53. /**
  54. * @brief stop emulation timer
  55. *
  56. */
  57. void furi_hal_rfid_tim_emulate_stop();
  58. /**
  59. * @brief config rfid timers to reset state
  60. *
  61. */
  62. void furi_hal_rfid_tim_reset();
  63. /**
  64. * @brief check that timer instance is emulation timer
  65. *
  66. * @param hw timer instance
  67. */
  68. bool furi_hal_rfid_is_tim_emulate(TIM_HandleTypeDef* hw);
  69. /**
  70. * @brief set emulation timer period
  71. *
  72. * @param period overall duration
  73. */
  74. void furi_hal_rfid_set_emulate_period(uint32_t period);
  75. /**
  76. * @brief set emulation timer pulse
  77. *
  78. * @param pulse duration of high level
  79. */
  80. void furi_hal_rfid_set_emulate_pulse(uint32_t pulse);
  81. /**
  82. * @brief set read timer period
  83. *
  84. * @param period overall duration
  85. */
  86. void furi_hal_rfid_set_read_period(uint32_t period);
  87. /**
  88. * @brief set read timer pulse
  89. *
  90. * @param pulse duration of high level
  91. */
  92. void furi_hal_rfid_set_read_pulse(uint32_t pulse);
  93. /**
  94. * Сhanges the configuration of the RFID timer "on a fly"
  95. * @param freq new frequency
  96. * @param duty_cycle new duty cycle
  97. */
  98. void furi_hal_rfid_change_read_config(float freq, float duty_cycle);
  99. #ifdef __cplusplus
  100. }
  101. #endif