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. | |
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_FDT_MIN , 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. | |
void | nrfx_nfct_uninit (void) |
Function for uninitializing the NFCT driver. | |
bool | nrfx_nfct_init_check (void) |
Function for checking if the NFCT driver is initialized. | |
void | nrfx_nfct_enable (void) |
Function for starting the NFC subsystem. | |
void | nrfx_nfct_disable (void) |
Function for disabling the NFCT driver. | |
bool | nrfx_nfct_field_check (void) |
Function for checking whether the external NFC field is present in the range of the tag. | |
nrfx_err_t | nrfx_nfct_rx (nrfx_nfct_data_desc_t const *p_rx_data) |
Function for preparing the NFCT driver for receiving an NFC frame. | |
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. | |
nrfx_err_t | nrfx_nfct_bits_tx (nrfx_nfct_data_desc_t const *p_tx_data, nrf_nfct_frame_delay_mode_t delay_mode) |
Function for transmitting an NFC frame with a specified number of bits. | |
void | nrfx_nfct_state_force (nrfx_nfct_state_t state) |
Function for moving the NFCT to a new state. | |
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. | |
nrfx_err_t | nrfx_nfct_parameter_set (nrfx_nfct_param_t const *p_param) |
Function for setting the NFC communication parameter. | |
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. | |
void | nrfx_nfct_autocolres_enable (void) |
Function for enabling the automatic collision resolution. | |
void | nrfx_nfct_autocolres_disable (void) |
Function for disabling the automatic collision resolution. | |
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 |
NFCT driver parameter types.
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.
nrfx_err_t nrfx_nfct_bits_tx | ( | nrfx_nfct_data_desc_t const * | p_tx_data, |
nrf_nfct_frame_delay_mode_t | delay_mode | ||
) |
Function for transmitting an NFC frame with a specified number of bits.
[in] | p_tx_data | Pointer to the TX buffer. Unlike in nrfx_nfct_tx, data_size is used as the number of bits to transmit, rather than bytes. |
[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. |
NRFX_ERROR_INVALID_ADDR | Data buffer does not point to memory region reachable by EasyDMA. |
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_ALREADY | The driver is already initialized. |
NRFX_ERROR_INVALID_STATE | The driver is already initialized. Deprecated - use NRFX_ERROR_ALREADY instead. |
NRFX_ERROR_FORBIDDEN | The NFCT antenna pads are not configured as antenna pins. |
bool nrfx_nfct_init_check | ( | void | ) |
Function for checking if the NFCT driver is initialized.
true | Driver is already initialized. |
false | Driver is not 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. |
nrfx_err_t 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. |
NRFX_SUCCESS | The operation was successful. |
NRFX_ERROR_INVALID_ADDR | Data buffer does not point to memory region reachable by EasyDMA. |
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. |
NRFX_ERROR_INVALID_ADDR | Data buffer does not point to memory region reachable by EasyDMA. |
void nrfx_nfct_uninit | ( | void | ) |
Function for uninitializing the NFCT driver.
After uninitialization, the instance is in disabled state.