api-hal-rfid.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #include <main.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. /**
  9. * @brief config rfid pins to reset state
  10. *
  11. */
  12. void api_hal_rfid_pins_reset();
  13. /**
  14. * @brief config rfid pins to emulate state
  15. *
  16. */
  17. void api_hal_rfid_pins_emulate();
  18. /**
  19. * @brief config rfid pins to read state
  20. *
  21. */
  22. void api_hal_rfid_pins_read();
  23. /**
  24. * @brief 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 api_hal_rfid_tim_read(float freq, float duty_cycle);
  30. /**
  31. * @brief start read timer
  32. *
  33. */
  34. void api_hal_rfid_tim_read_start();
  35. /**
  36. * @brief stop read timer
  37. *
  38. */
  39. void api_hal_rfid_tim_read_stop();
  40. /**
  41. * @brief config rfid timer to emulate state
  42. *
  43. * @param freq timer frequency
  44. */
  45. void api_hal_rfid_tim_emulate(float freq);
  46. /**
  47. * @brief start emulation timer
  48. *
  49. */
  50. void api_hal_rfid_tim_emulate_start();
  51. /**
  52. * @brief stop emulation timer
  53. *
  54. */
  55. void api_hal_rfid_tim_emulate_stop();
  56. /**
  57. * @brief config rfid timers to reset state
  58. *
  59. */
  60. void api_hal_rfid_tim_reset();
  61. /**
  62. * @brief check that timer instance is emulation timer
  63. *
  64. * @param hw timer instance
  65. */
  66. bool api_hal_rfid_is_tim_emulate(TIM_HandleTypeDef* hw);
  67. /**
  68. * @brief set emulation timer period
  69. *
  70. * @param period overall duration
  71. */
  72. void api_hal_rfid_set_emulate_period(uint32_t period);
  73. /**
  74. * @brief set emulation timer pulse
  75. *
  76. * @param pulse duration of high level
  77. */
  78. void api_hal_rfid_set_emulate_pulse(uint32_t pulse);
  79. /**
  80. * @brief set read timer period
  81. *
  82. * @param period overall duration
  83. */
  84. void api_hal_rfid_set_read_period(uint32_t period);
  85. /**
  86. * @brief set read timer pulse
  87. *
  88. * @param pulse duration of high level
  89. */
  90. void api_hal_rfid_set_read_pulse(uint32_t pulse);
  91. #ifdef __cplusplus
  92. }
  93. #endif