You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nfc: separate TNEP signalling functionality for NFC tag
The NFC TNEP signalling functionality in the nRF Connect SDK
is based on Zephyr kernel primitives. In the Bare Metal the Zephyr
primitives are not available. The Bare Metal will need a separate
implementation based on Bare Metal primitives. To allow that the
TNEP signalling is extracted from the subsys/nfc/tnep/tag.c into
separate files.
The include/nfc/tnep/tag_signalling.h is the header that defines
the signalling API that is used by subsys/nfc/tnep/tag.c
implementation.
The subsys/nfc/tnep/tag.c is now signalling-agnostic and uses the
signalling API defined in include/nfc/tnep/tag_signalling.h.
The subsys/nfc/tnep/tag_signalling_zephyr.c contains the Zephyr-based
implementation of the signalling API and the Zephyr-specific
initialization function. For other non Zephyr-based platforms
separate signalling implementation files may be created.
Because the way of handling signalling is platform-specific,
the `nfc_tnep_tag_init()` API is changed to not require
`struct k_poll_event *events, uint8_t event_cnt` parameters.
Instead, the platform-specific signalling initialization must be called
before calling `nfc_tnep_tag_init()`. The Zephyr-based signalling
initialization function is named `nfc_tnep_tag_signalling_init()`,
its prototype is declared in include/nfc/tnep/tag_signalling_zephyr.h,
and it is implemented in subsys/nfc/tnep/tag_signalling_zephyr.c.
To allow selection of applicable signalling implementation the
Kconfig choice `NFC_TNEP_TAG_SIGNALLING` is added. In the
nRF Connect SDK it has only one choice:
`NFC_TNEP_TAG_SIGNALLING_ZEPHYR`. The Bare Metal will extend the
choice and provide separate signalling implementation.
The applications based on nRF Connect SDK using the NFC TNEP tag
functionality must be updated in the following way:
- include the signalling header
`#include <nfc/tnep/tag_signalling_zephyr.h>`
- call the signalling initialization function
`nfc_tnep_tag_signalling_init()` before calling `nfc_tnep_tag_init()`
The `events` and `event_cnt` parameters that were previously passed
to `nfc_tnep_tag_init()` now are to be passed to
`nfc_tnep_tag_signalling_init` function.
Signed-off-by: Andrzej Kuros <[email protected]>
0 commit comments