api-hal-nfc.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #pragma once
  2. #include <rfal_nfc.h>
  3. #include <st_errno.h>
  4. #include <stdbool.h>
  5. #include <stdint.h>
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. /** Nfc emulation parameters */
  10. typedef enum {
  11. ApiHalNfcEmulateParamsMifare,
  12. ApiHalNfcEmulateParamsEMV,
  13. } ApiHalNfcEmulateParams;
  14. /**
  15. * Init nfc
  16. */
  17. ReturnCode api_hal_nfc_init();
  18. /**
  19. * Check if nfc worker is busy
  20. */
  21. bool api_hal_nfc_is_busy();
  22. /**
  23. * NFC field on
  24. */
  25. void api_hal_nfc_field_on();
  26. /**
  27. * NFC field off
  28. */
  29. void api_hal_nfc_field_off();
  30. /**
  31. * NFC start sleep
  32. */
  33. void api_hal_nfc_start_sleep();
  34. /**
  35. * NFC stop sleep
  36. */
  37. void api_hal_nfc_exit_sleep();
  38. /**
  39. * NFC poll
  40. */
  41. bool api_hal_nfc_detect(rfalNfcDevice** dev_list, uint8_t* dev_cnt, uint32_t timeout, bool deactivate);
  42. /**
  43. * NFC listen
  44. */
  45. bool api_hal_nfc_listen(ApiHalNfcEmulateParams params, uint32_t timeout);
  46. /**
  47. * NFC data exchange
  48. */
  49. ReturnCode api_hal_nfc_data_exchange(uint8_t* tx_buff, uint16_t tx_len, uint8_t** rx_buff, uint16_t** rx_len, bool deactivate);
  50. /**
  51. * NFC deactivate and start sleep
  52. */
  53. void api_hal_nfc_deactivate();
  54. #ifdef __cplusplus
  55. }
  56. #endif