furi_hal_rfid.h 2.2 KB

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