Near Field Communication Tag (NFCT) peripheral driver. More...
Modules | |
NFCT peripheral driver configuration | |
Data Structures | |
struct | nrfx_nfct_nfcid1_t |
NFCID1 descriptor. More... | |
struct | nrfx_nfct_param_t |
NFCT driver parameter descriptor. More... | |
struct | nrfx_nfct_data_desc_t |
NFCT driver RX/TX buffer descriptor. More... | |
struct | nrfx_nfct_evt_rx_frameend_t |
Structure used to describe the NRFX_NFCT_EVT_RX_FRAMEEND event type. More... | |
struct | nrfx_nfct_evt_tx_framestart_t |
Structure used to describe the NRFX_NFCT_EVT_TX_FRAMESTART event type. More... | |
struct | nrfx_nfct_evt_error_t |
Structure used to describe the NRFX_NFCT_EVT_ERROR event type. More... | |
struct | nrfx_nfct_evt_t |
NFCT driver event. More... | |
struct | nrfx_nfct_config_t |
NFCT driver configuration structure. More... | |
Macros | |
#define | NRFX_NFCT_NFCID1_SINGLE_SIZE 4u |
Length of single-size NFCID1. | |
#define | NRFX_NFCT_NFCID1_DOUBLE_SIZE 7u |
Length of double-size NFCID1. | |
#define | NRFX_NFCT_NFCID1_TRIPLE_SIZE 10u |
Length of triple-size NFCID1. | |
#define | NRFX_NFCT_NFCID1_DEFAULT_LEN NRFX_NFCT_NFCID1_DOUBLE_SIZE |
Default length of NFC ID. */. | |
Typedefs | |
typedef void(* | nrfx_nfct_handler_t )(nrfx_nfct_evt_t const *p_event) |
Callback descriptor to pass events from the NFCT driver to the upper layer. More... | |
Enumerations | |
enum | nrfx_nfct_state_t { NRFX_NFCT_STATE_DISABLED = NRF_NFCT_TASK_DISABLE, NRFX_NFCT_STATE_SENSING = NRF_NFCT_TASK_SENSE, NRFX_NFCT_STATE_ACTIVATED = NRF_NFCT_TASK_ACTIVATE } |
NFCT hardware states. More... | |
enum | nrfx_nfct_active_state_t { NRFX_NFCT_ACTIVE_STATE_IDLE = NRF_NFCT_TASK_GOIDLE, NRFX_NFCT_ACTIVE_STATE_SLEEP = NRF_NFCT_TASK_GOSLEEP, NRFX_NFCT_ACTIVE_STATE_DEFAULT } |
NFC tag states, when NFCT hardware is activated. More... | |
enum | nrfx_nfct_evt_id_t { NRFX_NFCT_EVT_FIELD_DETECTED = NRF_NFCT_INT_FIELDDETECTED_MASK, NRFX_NFCT_EVT_FIELD_LOST = NRF_NFCT_INT_FIELDLOST_MASK, NRFX_NFCT_EVT_SELECTED = NRF_NFCT_INT_SELECTED_MASK, NRFX_NFCT_EVT_RX_FRAMESTART = NRF_NFCT_INT_RXFRAMESTART_MASK, NRFX_NFCT_EVT_RX_FRAMEEND = NRF_NFCT_INT_RXFRAMEEND_MASK, NRFX_NFCT_EVT_TX_FRAMESTART = NRF_NFCT_INT_TXFRAMESTART_MASK, NRFX_NFCT_EVT_TX_FRAMEEND = NRF_NFCT_INT_TXFRAMEEND_MASK, NRFX_NFCT_EVT_ERROR = NRF_NFCT_INT_ERROR_MASK } |
NFCT driver event types, passed to the upper-layer callback function provided during the initialization. More... | |
enum | nrfx_nfct_error_t { NRFX_NFCT_ERROR_FRAMEDELAYTIMEOUT, NRFX_NFCT_ERROR_NUM } |
NFCT timing-related error types. More... | |
enum | nrfx_nfct_param_id_t { NRFX_NFCT_PARAM_ID_FDT, NRFX_NFCT_PARAM_ID_SEL_RES, NRFX_NFCT_PARAM_ID_NFCID1 } |
NFCT driver parameter types. More... | |
Functions | |
nrfx_err_t | nrfx_nfct_init (nrfx_nfct_config_t const *p_config) |
Function for initializing the NFCT driver. More... | |
void | nrfx_nfct_uninit (void) |
Function for uninitializing the NFCT driver. More... | |
void | nrfx_nfct_enable (void) |
Function for starting the NFC subsystem. More... | |
void | nrfx_nfct_disable (void) |
Function for disabling the NFCT driver. More... | |
bool | nrfx_nfct_field_check (void) |
Function for checking whether the external NFC field is present in the range of the tag. More... | |
void | nrfx_nfct_rx (nrfx_nfct_data_desc_t const *p_rx_data) |
Function for preparing the NFCT driver for receiving an NFC frame. More... | |
nrfx_err_t | nrfx_nfct_tx (nrfx_nfct_data_desc_t const *p_tx_data, nrf_nfct_frame_delay_mode_t delay_mode) |
Function for transmitting an NFC frame. More... | |
void | nrfx_nfct_state_force (nrfx_nfct_state_t state) |
Function for moving the NFCT to a new state. More... | |
void | nrfx_nfct_init_substate_force (nrfx_nfct_active_state_t sub_state) |
Function for moving the NFCT to a new initial substate within NRFX_NFCT_STATE_ACTIVATED. More... | |
nrfx_err_t | nrfx_nfct_parameter_set (nrfx_nfct_param_t const *p_param) |
Function for setting the NFC communication parameter. More... | |
nrfx_err_t | nrfx_nfct_nfcid1_default_bytes_get (uint8_t *const p_nfcid1_buff, uint32_t nfcid1_buff_len) |
Function for getting default bytes for NFCID1. More... | |
void | nrfx_nfct_autocolres_enable (void) |
Function for enabling the automatic collision resolution. More... | |
void | nrfx_nfct_autocolres_disable (void) |
Function for disabling the automatic collision resolution. More... | |
Near Field Communication Tag (NFCT) peripheral driver.
typedef void(* nrfx_nfct_handler_t)(nrfx_nfct_evt_t const *p_event) |
Callback descriptor to pass events from the NFCT driver to the upper layer.
[in] | p_event | Pointer to the event descriptor. |
NFC tag states, when NFCT hardware is activated.
These states are substates of the NRFX_NFCT_STATE_ACTIVATED state.
enum nrfx_nfct_error_t |
enum nrfx_nfct_evt_id_t |
NFCT driver event types, passed to the upper-layer callback function provided during the initialization.
enum nrfx_nfct_param_id_t |
enum nrfx_nfct_state_t |
NFCT hardware states.
Enumerator | |
---|---|
NRFX_NFCT_STATE_DISABLED |
NFC Tag is disabled (no sensing of an external NFC field). |
NRFX_NFCT_STATE_SENSING |
NFC Tag is sensing whether there is an external NFC field. |
NRFX_NFCT_STATE_ACTIVATED |
NFC Tag is powered-up (see nrfx_nfct_active_state_t for possible substates). |
void nrfx_nfct_autocolres_disable | ( | void | ) |
Function for disabling the automatic collision resolution.
See also details in nrfx_nfct_autocolres_enable.
void nrfx_nfct_autocolres_enable | ( | void | ) |
Function for enabling the automatic collision resolution.
As defined by the NFC Forum Digital Protocol Technical Specification (and ISO 14443-3), the automatic collision resolution is implemented in the NFCT hardware. This function allows enabling and disabling this feature.
void nrfx_nfct_disable | ( | void | ) |
Function for disabling the NFCT driver.
After this function returns, NFC readers are no longer able to connect to the tag.
void nrfx_nfct_enable | ( | void | ) |
Function for starting the NFC subsystem.
After this function completes, NFC readers are able to detect the tag.
bool nrfx_nfct_field_check | ( | void | ) |
Function for checking whether the external NFC field is present in the range of the tag.
true | The NFC field is present. |
false | No NFC field is present. |
nrfx_err_t nrfx_nfct_init | ( | nrfx_nfct_config_t const * | p_config | ) |
Function for initializing the NFCT driver.
[in] | p_config | Pointer to the NFCT driver configuration structure. |
NRFX_SUCCESS | The NFCT driver was initialized successfully. |
NRFX_ERROR_INVALID_STATE | The NFCT driver is already initialized. |
void nrfx_nfct_init_substate_force | ( | nrfx_nfct_active_state_t | sub_state | ) |
Function for moving the NFCT to a new initial substate within NRFX_NFCT_STATE_ACTIVATED.
[in] | sub_state | The required substate. |
nrfx_err_t nrfx_nfct_nfcid1_default_bytes_get | ( | uint8_t *const | p_nfcid1_buff, |
uint32_t | nfcid1_buff_len | ||
) |
Function for getting default bytes for NFCID1.
[in,out] | p_nfcid1_buff | In: empty buffer for data; Out: buffer with the NFCID1 default data. These values can be used to fill the Type 2 Tag Internal Bytes. |
[in] | nfcid1_buff_len | Length of the NFCID1 buffer. |
NRFX_SUCCESS | The operation was successful. |
NRFX_ERROR_INVALID_LENGTH | Length of the NFCID buffer is different than NRFX_NFCT_NFCID1_SINGLE_SIZE, NRFX_NFCT_NFCID1_DOUBLE_SIZE, or NRFX_NFCT_NFCID1_TRIPLE_SIZE. |
nrfx_err_t nrfx_nfct_parameter_set | ( | nrfx_nfct_param_t const * | p_param | ) |
Function for setting the NFC communication parameter.
[in] | p_param | Pointer to parameter descriptor. |
NRFX_SUCCESS | The operation was successful. |
NRFX_ERROR_INVALID_PARAM | The parameter data is invalid. |
void nrfx_nfct_rx | ( | nrfx_nfct_data_desc_t const * | p_rx_data | ) |
Function for preparing the NFCT driver for receiving an NFC frame.
[in] | p_rx_data | Pointer to the RX buffer. |
void nrfx_nfct_state_force | ( | nrfx_nfct_state_t | state | ) |
Function for moving the NFCT to a new state.
[in] | state | The required state. |
nrfx_err_t nrfx_nfct_tx | ( | nrfx_nfct_data_desc_t const * | p_tx_data, |
nrf_nfct_frame_delay_mode_t | delay_mode | ||
) |
Function for transmitting an NFC frame.
[in] | p_tx_data | Pointer to the TX buffer. |
[in] | delay_mode | Delay mode of the NFCT frame timer. |
NRFX_SUCCESS | The operation was successful. |
NRFX_ERROR_INVALID_LENGTH | The TX buffer size is invalid. |
NRFX_ERROR_BUSY | Driver is already transferring. |
void nrfx_nfct_uninit | ( | void | ) |
Function for uninitializing the NFCT driver.
After uninitialization, the instance is in disabled state.