nfc_fixes.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* Copyright (c) 2015 Nordic Semiconductor. All Rights Reserved.
  2. *
  3. * The information contained herein is property of Nordic Semiconductor ASA.
  4. * Terms and conditions of usage are described in detail in NORDIC
  5. * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
  6. *
  7. * Licensees are granted free, non-transferable use of the information. NO
  8. * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
  9. * the file.
  10. *
  11. */
  12. #ifndef NFC_FIXES_H__
  13. #define NFC_FIXES_H__
  14. #include <stdint.h>
  15. /** @file
  16. * @defgroup nfc_fixes NFC fixes
  17. * @{
  18. * @ingroup nfc_library
  19. * @brief @tagAPI52 Fixes for HW anomaly.
  20. *
  21. * If you are using PCA10036 (part of nRF52 Preview Development Kit),
  22. * you must define the macro HAL_NFC_ENGINEERING_A_FTPAN_WORKAROUND to apply
  23. * workarounds for the following anomalies:
  24. * - 17. NFCT: The EVENTS_FIELDLOST is not generated
  25. * - 24. NFCT: The FIELDPRESENT register read is not reliable
  26. * - 27. NFCT: Triggering NFCT ACTIVATE task also activates the Rx easyDMA
  27. * - 45. NFCT: EasyDMA does not function properly while System ON CPU IDLE state
  28. * - 57. NFCT: NFC Modulation amplitude
  29. *
  30. * If you are using PCA10040 (part of nRF52 Development Kit),
  31. * you must define the macro HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND to apply
  32. * workarounds for the following anomalies:
  33. * - 79. NFCT: A false EVENTS_FIELDDETECTED event occurs after the field is lost
  34. * - NFCT does not release HFCLK when switching from ACTVATED to SENSE mode.
  35. *
  36. * The current code contains a patch for anomaly 25 (NFCT: Reset value of
  37. * SENSRES register is incorrect), so that it now works on Windows Phone.
  38. */
  39. #ifdef BOARD_PCA10036 // assume nRF52832 chip in IC rev. Engineering A
  40. #define HAL_NFC_ENGINEERING_A_FTPAN_WORKAROUND
  41. #elif defined(BOARD_PCA10040) // assume nRF52832 chip in IC rev. Engineering B or Engineering C
  42. #define HAL_NFC_ENGINEERING_BC_FTPAN_WORKAROUND
  43. #endif
  44. /* Begin: Bugfix for FTPAN-45 */
  45. #ifdef HAL_NFC_ENGINEERING_A_FTPAN_WORKAROUND
  46. extern volatile uint8_t m_nfc_active;
  47. #define NFC_NEED_MCU_RUN_STATE() (m_nfc_active != 0)
  48. #else
  49. #define NFC_NEED_MCU_RUN_STATE() (0)
  50. #endif
  51. /* End: Bugfix for FTPAN-45 */
  52. /** @} */
  53. #endif /* NFC_FIXES_H__ */