furi-hal-rfid.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. /** Config rfid timer to read state
  25. *
  26. * @param freq timer frequency
  27. * @param duty_cycle timer duty cycle, 0.0-1.0
  28. */
  29. void furi_hal_rfid_tim_read(float freq, float duty_cycle);
  30. /** Start read timer
  31. */
  32. void furi_hal_rfid_tim_read_start();
  33. /** Stop read timer
  34. */
  35. void furi_hal_rfid_tim_read_stop();
  36. /** Config rfid timer to emulate state
  37. *
  38. * @param freq timer frequency
  39. */
  40. void furi_hal_rfid_tim_emulate(float freq);
  41. /** Start emulation timer
  42. */
  43. void furi_hal_rfid_tim_emulate_start();
  44. /** Stop emulation timer
  45. */
  46. void furi_hal_rfid_tim_emulate_stop();
  47. /** Config rfid timers to reset state
  48. */
  49. void furi_hal_rfid_tim_reset();
  50. /** Check that timer instance is emulation timer
  51. *
  52. * @param hw timer instance
  53. *
  54. * @return true if instance is emulation timer
  55. */
  56. bool furi_hal_rfid_is_tim_emulate(TIM_HandleTypeDef* hw);
  57. /** Set emulation timer period
  58. *
  59. * @param period overall duration
  60. */
  61. void furi_hal_rfid_set_emulate_period(uint32_t period);
  62. /** Set emulation timer pulse
  63. *
  64. * @param pulse duration of high level
  65. */
  66. void furi_hal_rfid_set_emulate_pulse(uint32_t pulse);
  67. /** Set read timer period
  68. *
  69. * @param period overall duration
  70. */
  71. void furi_hal_rfid_set_read_period(uint32_t period);
  72. /** Set read timer pulse
  73. *
  74. * @param pulse duration of high level
  75. */
  76. void furi_hal_rfid_set_read_pulse(uint32_t pulse);
  77. /** Сhanges the configuration of the RFID timer "on a fly"
  78. *
  79. * @param freq new frequency
  80. * @param duty_cycle new duty cycle
  81. */
  82. void furi_hal_rfid_change_read_config(float freq, float duty_cycle);
  83. #ifdef __cplusplus
  84. }
  85. #endif