-
Notifications
You must be signed in to change notification settings - Fork 1.4k
nfc: tnep tag separate signalling layer for Bare Metal #26440
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
nfc: tnep tag separate signalling layer for Bare Metal #26440
Conversation
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]>
The `nfc_tnep_tag_init` function prototype has been changed. It requires now that `nfc_tnep_tag_signalling_init` is called before. This commit adjusts the samples accordingly. Signed-off-by: Andrzej Kuros <[email protected]>
276de58 to
d32394c
Compare
CI InformationTo view the history of this post, click the 'edited' button above Inputs:Sources:sdk-nrf: PR head: d32394ccb47eb1bf49533b656f2b2e3905841442 more detailssdk-nrf:
Github labels
List of changed files detected by CI (9)Outputs:ToolchainVersion: f911d4f4e7 Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped;
|
|
You can find the documentation preview for this PR here. |
| k_poll_signal_reset(tnep_ctrl.events[i].signal); | ||
| tnep_ctrl.events[i].state = K_POLL_STATE_NOT_READY; | ||
| if (nfc_tnep_tag_signalling_rx_event_check_and_clear(&event)) { | ||
| /* Run TNEP State Machine - prepare response */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Response or receive?
The Bare Metal requires TNEP tag handling which is implemented in
subsys/nfc/tnep/tag.cfile. Current code insubsys/nfc/tnep/tag.cusedk_poll_eventfeatures directly, which are not available in Bare Metal.This PR separates TNEP signalling from
subsys/nfc/tnep/tag.cso that thesubsys/nfc/tnep/tag.cfile can be re-used by Bare Metal.The TNEP signalling using zephyr primitives is provided in the sdk-nrf.
The TNEP signalling using other primitives will be provided in the sdk-nrf-bm (see PR nrfconnect/sdk-nrf-bm#606 )
Full justification in commit messages.