api-hal-nfc.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #define API_HAL_NFC_UID_MAX_LEN 10
  10. /**
  11. * Init nfc
  12. */
  13. ReturnCode api_hal_nfc_init();
  14. /**
  15. * Check if nfc worker is busy
  16. */
  17. bool api_hal_nfc_is_busy();
  18. /**
  19. * NFC field on
  20. */
  21. void api_hal_nfc_field_on();
  22. /**
  23. * NFC field off
  24. */
  25. void api_hal_nfc_field_off();
  26. /**
  27. * NFC start sleep
  28. */
  29. void api_hal_nfc_start_sleep();
  30. /**
  31. * NFC stop sleep
  32. */
  33. void api_hal_nfc_exit_sleep();
  34. /**
  35. * NFC poll
  36. */
  37. bool api_hal_nfc_detect(rfalNfcDevice** dev_list, uint8_t* dev_cnt, uint32_t timeout, bool deactivate);
  38. /**
  39. * NFC listen
  40. */
  41. bool api_hal_nfc_listen(uint8_t* uid, uint8_t uid_len, uint8_t* atqa, uint8_t sak, uint32_t timeout);
  42. /**
  43. * NFC data exchange
  44. */
  45. ReturnCode api_hal_nfc_data_exchange(uint8_t* tx_buff, uint16_t tx_len, uint8_t** rx_buff, uint16_t** rx_len, bool deactivate);
  46. /**
  47. * NFC deactivate and start sleep
  48. */
  49. void api_hal_nfc_deactivate();
  50. #ifdef __cplusplus
  51. }
  52. #endif