furi_hal_rfid.h 2.4 KB

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