nRF5 SDK v17.1.0
Macros | Enumerations | Functions
NFCT HAL

Hardware access layer (HAL) for the Near Field Communication Tag (NFCT) peripheral. More...

Macros

#define NRF_NFCT_CRC_SIZE   2
 
#define NRF_NFCT_DISABLE_ALL_INT   0xFFFFFFFF
 

Enumerations

enum  nrf_nfct_task_t {
  NRF_NFCT_TASK_ACTIVATE = offsetof(NRF_NFCT_Type, TASKS_ACTIVATE),
  NRF_NFCT_TASK_DISABLE = offsetof(NRF_NFCT_Type, TASKS_DISABLE),
  NRF_NFCT_TASK_SENSE = offsetof(NRF_NFCT_Type, TASKS_SENSE),
  NRF_NFCT_TASK_STARTTX = offsetof(NRF_NFCT_Type, TASKS_STARTTX),
  NRF_NFCT_TASK_ENABLERXDATA = offsetof(NRF_NFCT_Type, TASKS_ENABLERXDATA),
  NRF_NFCT_TASK_GOIDLE = offsetof(NRF_NFCT_Type, TASKS_GOIDLE),
  NRF_NFCT_TASK_GOSLEEP = offsetof(NRF_NFCT_Type, TASKS_GOSLEEP)
}
 NFCT tasks. More...
 
enum  nrf_nfct_event_t {
  NRF_NFCT_EVENT_READY = offsetof(NRF_NFCT_Type, EVENTS_READY),
  NRF_NFCT_EVENT_FIELDDETECTED = offsetof(NRF_NFCT_Type, EVENTS_FIELDDETECTED),
  NRF_NFCT_EVENT_FIELDLOST = offsetof(NRF_NFCT_Type, EVENTS_FIELDLOST),
  NRF_NFCT_EVENT_TXFRAMESTART = offsetof(NRF_NFCT_Type, EVENTS_TXFRAMESTART),
  NRF_NFCT_EVENT_TXFRAMEEND = offsetof(NRF_NFCT_Type, EVENTS_TXFRAMEEND),
  NRF_NFCT_EVENT_RXFRAMESTART = offsetof(NRF_NFCT_Type, EVENTS_RXFRAMESTART),
  NRF_NFCT_EVENT_RXFRAMEEND = offsetof(NRF_NFCT_Type, EVENTS_RXFRAMEEND),
  NRF_NFCT_EVENT_ERROR = offsetof(NRF_NFCT_Type, EVENTS_ERROR),
  NRF_NFCT_EVENT_RXERROR = offsetof(NRF_NFCT_Type, EVENTS_RXERROR),
  NRF_NFCT_EVENT_ENDRX = offsetof(NRF_NFCT_Type, EVENTS_ENDRX),
  NRF_NFCT_EVENT_ENDTX = offsetof(NRF_NFCT_Type, EVENTS_ENDTX),
  NRF_NFCT_EVENT_AUTOCOLRESSTARTED = offsetof(NRF_NFCT_Type, EVENTS_AUTOCOLRESSTARTED),
  NRF_NFCT_EVENT_COLLISION = offsetof(NRF_NFCT_Type, EVENTS_COLLISION),
  NRF_NFCT_EVENT_SELECTED = offsetof(NRF_NFCT_Type, EVENTS_SELECTED),
  NRF_NFCT_EVENT_STARTED = offsetof(NRF_NFCT_Type, EVENTS_STARTED)
}
 NFCT events. More...
 
enum  nrf_nfct_short_mask_t {
  NRF_NFCT_SHORT_FIELDDETECTED_ACTIVATE_MASK = NFCT_SHORTS_FIELDDETECTED_ACTIVATE_Msk,
  NRF_NFCT_SHORT_FIELDLOST_SENSE_MASK = NFCT_SHORTS_FIELDLOST_SENSE_Msk,
  NRF_NFCT_SHORT_TXFRAMEEND_ENABLERXDATA_MASK = NFCT_SHORTS_TXFRAMEEND_ENABLERXDATA_Msk
}
 NFCT shortcuts. More...
 
enum  nrf_nfct_int_mask_t {
  NRF_NFCT_INT_READY_MASK = NFCT_INTEN_READY_Msk,
  NRF_NFCT_INT_FIELDDETECTED_MASK = NFCT_INTEN_FIELDDETECTED_Msk,
  NRF_NFCT_INT_FIELDLOST_MASK = NFCT_INTEN_FIELDLOST_Msk,
  NRF_NFCT_INT_TXFRAMESTART_MASK = NFCT_INTEN_TXFRAMESTART_Msk,
  NRF_NFCT_INT_TXFRAMEEND_MASK = NFCT_INTEN_TXFRAMEEND_Msk,
  NRF_NFCT_INT_RXFRAMESTART_MASK = NFCT_INTEN_RXFRAMESTART_Msk,
  NRF_NFCT_INT_RXFRAMEEND_MASK = NFCT_INTEN_RXFRAMEEND_Msk,
  NRF_NFCT_INT_ERROR_MASK = NFCT_INTEN_ERROR_Msk,
  NRF_NFCT_INT_RXERROR_MASK = NFCT_INTEN_RXERROR_Msk,
  NRF_NFCT_INT_ENDRX_MASK = NFCT_INTEN_ENDRX_Msk,
  NRF_NFCT_INT_ENDTX_MASK = NFCT_INTEN_ENDTX_Msk,
  NRF_NFCT_INT_AUTOCOLRESSTARTED_MASK = NFCT_INTEN_AUTOCOLRESSTARTED_Msk,
  NRF_NFCT_INT_COLLISION_MASK = NFCT_INTEN_COLLISION_Msk,
  NRF_NFCT_INT_SELECTED_MASK = NFCT_INTEN_SELECTED_Msk,
  NRF_NFCT_INT_STARTED_MASK = NFCT_INTEN_STARTED_Msk
}
 NFCT interrupts. More...
 
enum  nrf_nfct_error_status_t {
  NRF_NFCT_ERROR_FRAMEDELAYTIMEOUT_MASK = NFCT_ERRORSTATUS_FRAMEDELAYTIMEOUT_Msk,
  NRF_NFCT_ERROR_NFCFIELDTOOSTRONG_MASK = NFCT_ERRORSTATUS_NFCFIELDTOOSTRONG_Msk,
  NRF_NFCT_ERROR_NFCFIELDTOOWEAK_MASK = NFCT_ERRORSTATUS_NFCFIELDTOOWEAK_Msk
}
 NFC error status bit masks. More...
 
enum  nrf_nfct_rx_frame_status_t {
  NRF_NFCT_RX_FRAME_STATUS_CRC_MASK = NFCT_FRAMESTATUS_RX_CRCERROR_Msk,
  NRF_NFCT_RX_FRAME_STATUS_PARITY_MASK = NFCT_FRAMESTATUS_RX_PARITYSTATUS_Msk,
  NRF_NFCT_RX_FRAME_STATUS_OVERRUN_MASK = NFCT_FRAMESTATUS_RX_OVERRUN_Msk
}
 NFC received frame status bit masks. More...
 
enum  nrf_nfct_tag_state_t {
  NRF_NFCT_TAG_STATE_DISABLED = NFCT_NFCTAGSTATE_NFCTAGSTATE_Disabled,
  NRF_NFCT_TAG_STATE_RAMP_UP = NFCT_NFCTAGSTATE_NFCTAGSTATE_RampUp,
  NRF_NFCT_TAG_STATE_IDLE = NFCT_NFCTAGSTATE_NFCTAGSTATE_Idle,
  NRF_NFCT_TAG_STATE_RECEIVE = NFCT_NFCTAGSTATE_NFCTAGSTATE_Receive,
  NRF_NFCT_TAG_STATE_FRAME_DELAY = NFCT_NFCTAGSTATE_NFCTAGSTATE_FrameDelay,
  NRF_NFCT_TAG_STATE_TRANSMIT = NFCT_NFCTAGSTATE_NFCTAGSTATE_Transmit
}
 NFC tag state. More...
 
enum  nrf_nfct_sleep_state_t {
  NRF_NFCT_SLEEP_STATE_IDLE = NFCT_SLEEPSTATE_SLEEPSTATE_Idle,
  NRF_NFCT_SLEEP_STATE_SLEEP_A = NFCT_SLEEPSTATE_SLEEPSTATE_SleepA
}
 NFC tag sleep state. More...
 
enum  nrf_nfct_field_state_t {
  NRF_NFCT_FIELD_STATE_PRESENT_MASK = NFCT_FIELDPRESENT_FIELDPRESENT_Msk,
  NRF_NFCT_FIELD_STATE_LOCK_MASK = NFCT_FIELDPRESENT_LOCKDETECT_Msk
}
 NFC field state bit masks. More...
 
enum  nrf_nfct_frame_delay_mode_t {
  NRF_NFCT_FRAME_DELAY_MODE_FREERUN = NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_FreeRun,
  NRF_NFCT_FRAME_DELAY_MODE_WINDOW = NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_Window,
  NRF_NFCT_FRAME_DELAY_MODE_EXACTVAL = NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_ExactVal,
  NRF_NFCT_FRAME_DELAY_MODE_WINDOWGRID = NFCT_FRAMEDELAYMODE_FRAMEDELAYMODE_WindowGrid
}
 NFC frame delay mode for data transmission. More...
 
enum  nrf_nfct_tx_frame_config_t {
  NRF_NFCT_TX_FRAME_CONFIG_PARITY = NFCT_TXD_FRAMECONFIG_PARITY_Msk,
  NRF_NFCT_TX_FRAME_CONFIG_DISCARD_START = NFCT_TXD_FRAMECONFIG_DISCARDMODE_Msk,
  NRF_NFCT_TX_FRAME_CONFIG_SOF = NFCT_TXD_FRAMECONFIG_SOF_Msk,
  NRF_NFCT_TX_FRAME_CONFIG_CRC16 = NFCT_TXD_FRAMECONFIG_CRCMODETX_Msk
}
 Bit masks for NFC transmission frame configuration. More...
 
enum  nrf_nfct_rx_frame_config_t {
  NRF_NFCT_RX_FRAME_CONFIG_PARITY = NFCT_RXD_FRAMECONFIG_PARITY_Msk,
  NRF_NFCT_RX_FRAME_CONFIG_SOF = NFCT_RXD_FRAMECONFIG_SOF_Msk,
  NRF_NFCT_RX_FRAME_CONFIG_CRC16 = NFCT_RXD_FRAMECONFIG_CRCMODERX_Msk
}
 Bit masks for NFC reception frame configuration. More...
 
enum  nrf_nfct_sensres_nfcid1_size_t {
  NRF_NFCT_SENSRES_NFCID1_SIZE_SINGLE,
  NRF_NFCT_SENSRES_NFCID1_SIZE_DOUBLE,
  NRF_NFCT_SENSRES_NFCID1_SIZE_TRIPLE,
  NRF_NFCT_SENSRES_NFCID1_SIZE_DEFAULT
}
 'NFCI1 size' NFC field configuration for the SENS_RES frame according to the NFC Forum Digital Protocol Technical Specification. More...
 
enum  nrf_nfct_sensres_bit_frame_sdd_t {
  NRF_NFCT_SENSRES_BIT_FRAME_SDD_00000,
  NRF_NFCT_SENSRES_BIT_FRAME_SDD_00001,
  NRF_NFCT_SENSRES_BIT_FRAME_SDD_00010,
  NRF_NFCT_SENSRES_BIT_FRAME_SDD_00100,
  NRF_NFCT_SENSRES_BIT_FRAME_SDD_01000,
  NRF_NFCT_SENSRES_BIT_FRAME_SDD_10000
}
 'Bit frame SDD' NFC field configuration for the SENS_RES frame according to the NFC Forum Digital Protocol Technical Specification. More...
 
enum  nrf_nfct_sensres_platform_config_t {
  NRF_NFCT_SENSRES_PLATFORM_CONFIG_T1T = 6 << NFCT_SENSRES_PLATFCONFIG_Pos,
  NRF_NFCT_SENSRES_PLATFORM_CONFIG_OTHER = 0 << NFCT_SENSRES_PLATFCONFIG_Pos
}
 'Platofrm Config' NFC field configuration for the SENS_RES frame according to the NFC Forum Digital Protocol Technical Specification. More...
 
enum  nrf_nfct_selres_t {
  NRF_NFCT_SELRES_CASCADE_MASK = NFCT_SELRES_CASCADE_Msk,
  NRF_NFCT_SELRES_PROTOCOL_MASK = NFCT_SELRES_PROTOCOL_Msk
}
 Bit masks for SEL_RES NFC frame configuration. More...
 
enum  nrf_nfct_selres_protocol_t {
  NRF_NFCT_SELRES_PROTOCOL_T2T = 0,
  NRF_NFCT_SELRES_PROTOCOL_T4AT = 1,
  NRF_NFCT_SELRES_PROTOCOL_NFCDEP = 2,
  NRF_NFCT_SELRES_PROTOCOL_NFCDEP_T4AT = 3
}
 Protocol NFC field (bits b7 and b6) configuration for the SEL_RES frame according to the NFC Forum Digital Protocol Technical Specification. More...
 

Functions

__STATIC_INLINE void nrf_nfct_task_trigger (nrf_nfct_task_t task)
 Function for activating a specific NFCT task. More...
 
__STATIC_INLINE uint32_t nrf_nfct_task_address_get (nrf_nfct_task_t task)
 Function for returning the address of a specific NFCT task register. More...
 
__STATIC_INLINE void nrf_nfct_event_clear (nrf_nfct_event_t event)
 Function for clearing a specific event. More...
 
__STATIC_INLINE bool nrf_nfct_event_check (nrf_nfct_event_t event)
 Function for retrieving the state of the NFCT event. More...
 
__STATIC_INLINE uint32_t nrf_nfct_event_address_get (nrf_nfct_event_t event)
 Function for returning the address of a specific NFCT event register. More...
 
__STATIC_INLINE void nrf_nfct_shorts_enable (uint32_t short_mask)
 Function for enabling selected shortcuts. More...
 
__STATIC_INLINE void nrf_nfct_shorts_disable (uint32_t short_mask)
 Function for disabling selected shortcuts. More...
 
__STATIC_INLINE uint32_t nrf_nfct_shorts_get (void)
 Function for retrieving the enabled shortcuts. More...
 
__STATIC_INLINE void nrf_nfct_shorts_set (uint32_t short_mask)
 Function for setting shortcuts. More...
 
__STATIC_INLINE void nrf_nfct_int_enable (uint32_t int_mask)
 Function for enabling the selected interrupts. More...
 
__STATIC_INLINE bool nrf_nfct_int_enable_check (uint32_t int_mask)
 Function for retrieving the state of the selected interrupts. More...
 
__STATIC_INLINE uint32_t nrf_nfct_int_enable_get (void)
 Function for retrieving the information about enabled interrupts. More...
 
__STATIC_INLINE void nrf_nfct_int_disable (uint32_t int_mask)
 Function for disabling the selected interrupts. More...
 
__STATIC_INLINE uint32_t nrf_nfct_error_status_get (void)
 Function for getting the NFCT error status. More...
 
__STATIC_INLINE void nrf_nfct_error_status_clear (uint32_t error_flag)
 Function for clearing the NFCT error status. More...
 
__STATIC_INLINE uint32_t nrf_nfct_rx_frame_status_get (void)
 Function for getting the NFC frame reception status. More...
 
__STATIC_INLINE void nrf_nfct_rx_frame_status_clear (uint32_t framestatus_flags)
 Function for clearing the NFC frame reception status. More...
 
__STATIC_INLINE
nrf_nfct_tag_state_t 
nrf_nfct_tag_state_get (void)
 Function for getting the NFC tag state. More...
 
__STATIC_INLINE
nrf_nfct_sleep_state_t 
nrf_nfct_sleep_state_get (void)
 Function for getting the NFC tag sleep state during the automatic collision resolution. More...
 
__STATIC_INLINE uint8_t nrf_nfct_field_status_get (void)
 Function for getting the status of the external NFC field detection. More...
 
__STATIC_INLINE uint16_t nrf_nfct_frame_delay_min_get (void)
 Function for getting the minimum Frame Delay Time value. More...
 
__STATIC_INLINE void nrf_nfct_frame_delay_min_set (uint16_t frame_delay_min)
 Function for setting the minimum Frame Delay Time value. More...
 
__STATIC_INLINE uint32_t nrf_nfct_frame_delay_max_get (void)
 Function for getting the maximum Frame Delay Time value. More...
 
__STATIC_INLINE void nrf_nfct_frame_delay_max_set (uint32_t frame_delay_max)
 Function for setting the maximum Frame Delay Time value. More...
 
__STATIC_INLINE
nrf_nfct_frame_delay_mode_t 
nrf_nfct_frame_delay_mode_get (void)
 Function for getting the Frame Delay Mode configuration. More...
 
__STATIC_INLINE void nrf_nfct_frame_delay_mode_set (nrf_nfct_frame_delay_mode_t frame_delay_mode)
 Function for setting the NFC Frame Delay Mode configuration. More...
 
__STATIC_INLINE uint8_t * nrf_nfct_rxtx_buffer_get (void)
 Function for getting the pointer to the NFCT RX/TX buffer. More...
 
__STATIC_INLINE void nrf_nfct_rxtx_buffer_set (uint8_t *p_rxtx_buf, uint16_t max_txrx_len)
 Function for setting the the NFCT RX/TX buffer (address and maximum length). More...
 
__STATIC_INLINE uint16_t nrf_nfct_max_rxtx_length_get (void)
 Function for getting the NFCT RX/TX maximum buffer length. More...
 
__STATIC_INLINE uint8_t nrf_nfct_tx_frame_config_get (void)
 Function for getting the flags for NFC frame transmission configuration. More...
 
__STATIC_INLINE void nrf_nfct_tx_frame_config_set (uint8_t flags)
 Function for setting up the flags of the NFC frame transmission configuration. More...
 
__STATIC_INLINE uint16_t nrf_nfct_tx_bits_get (void)
 Function for getting the length of the configured transmission frame. More...
 
__STATIC_INLINE void nrf_nfct_tx_bits_set (uint16_t tx_bits)
 Function for setting up the NFC frame transmission. More...
 
__STATIC_INLINE uint8_t nrf_nfct_rx_frame_config_get (void)
 Function for getting the flags of the NFC frame reception configuration. More...
 
__STATIC_INLINE void nrf_nfct_rx_frame_config_set (uint8_t flags)
 Function for setting up the NFC frame reception. More...
 
__STATIC_INLINE uint16_t nrf_nfct_rx_bits_get (bool crc_excluded)
 Function for getting the number of bits received from the NFC poller. More...
 
__STATIC_INLINE
nrf_nfct_sensres_nfcid1_size_t 
nrf_nfct_nfcid1_get (uint8_t *p_nfcid1_buf)
 Function for getting the NFCID1 (NFC tag identifier). More...
 
__STATIC_INLINE void nrf_nfct_nfcid1_set (uint8_t const *p_nfcid1_buf, nrf_nfct_sensres_nfcid1_size_t nfcid1_size)
 Function for setting the NFCID1 (NFC tag identifier). More...
 
__STATIC_INLINE bool nrf_nfct_autocolres_is_enabled (void)
 Function for getting the setting for the automatic collision resolution. More...
 
__STATIC_INLINE void nrf_nfct_autocolres_enable (void)
 Function for enabling the automatic collision resolution. More...
 
__STATIC_INLINE void nrf_nfct_autocolres_disable (void)
 Function for disabling the automatic collision resolution. More...
 
__STATIC_INLINE
nrf_nfct_sensres_nfcid1_size_t 
nrf_nfct_sensres_nfcid1_size_get (void)
 Function for getting the NFCID1 size from the SENS_RES frame configuration. More...
 
__STATIC_INLINE void nrf_nfct_sensres_nfcid1_size_set (nrf_nfct_sensres_nfcid1_size_t nfcid1_size)
 Function for setting the NFCID1 (tag identifier) size.field in the SENS_RES frame configuration. More...
 
__STATIC_INLINE
nrf_nfct_sensres_bit_frame_sdd_t 
nrf_nfct_sensres_bit_frame_sdd_get (void)
 Function for getting the Bit Frame SDD field from the SENS_RES frame configuration. More...
 
__STATIC_INLINE void nrf_nfct_sensres_bit_frame_sdd_set (nrf_nfct_sensres_bit_frame_sdd_t bit_frame_sdd)
 Function for setting the Bit Frame SDD field in the SENS_RES frame configuration. More...
 
__STATIC_INLINE
nrf_nfct_sensres_platform_config_t 
nrf_nfct_sensres_platform_config_get (void)
 Function for getting the Platform Config field from the SENS_RES frame configuration. More...
 
__STATIC_INLINE void nrf_nfct_sensres_platform_config_set (nrf_nfct_sensres_platform_config_t platform_config)
 Function for setting the Platform Config field in the SENS_RES frame configuration. More...
 
__STATIC_INLINE bool nrf_nfct_selsres_cascade_check (void)
 Function for checking the CASCADE bit of the SEL_RES frame. More...
 
__STATIC_INLINE
nrf_nfct_selres_protocol_t 
nrf_nfct_selsres_protocol_get (void)
 Function for getting the Protocol field in the SEL_RES frame. More...
 
__STATIC_INLINE void nrf_nfct_selres_protocol_set (nrf_nfct_selres_protocol_t sel_res_protocol)
 Function for setting the Protocol field in the SEL_RES frame configuration. More...
 

Detailed Description

Hardware access layer (HAL) for the Near Field Communication Tag (NFCT) peripheral.

Macro Definition Documentation

#define NRF_NFCT_CRC_SIZE   2

CRC size in bytes.

#define NRF_NFCT_DISABLE_ALL_INT   0xFFFFFFFF

Value to disable all interrupts.

Enumeration Type Documentation

NFC error status bit masks.

Enumerator
NRF_NFCT_ERROR_FRAMEDELAYTIMEOUT_MASK 

Timeout of the Frame Delay Timer (no frame transmission started in the FDT window).

NRF_NFCT_ERROR_NFCFIELDTOOSTRONG_MASK 

Field level is too high at maximum load resistance.

NRF_NFCT_ERROR_NFCFIELDTOOWEAK_MASK 

Field level is too low at minimum load resistance.

NFCT events.

Enumerator
NRF_NFCT_EVENT_READY 

The NFCT peripheral is ready to receive and send frames.

NRF_NFCT_EVENT_FIELDDETECTED 

Remote NFC field is detected.

NRF_NFCT_EVENT_FIELDLOST 

Remote NFC field is lost.

NRF_NFCT_EVENT_TXFRAMESTART 

The start of the first symbol of a transmitted frame.

NRF_NFCT_EVENT_TXFRAMEEND 

The end of the last transmitted on-air symbol of a frame.

NRF_NFCT_EVENT_RXFRAMESTART 

The end of the first symbol of a received frame.

NRF_NFCT_EVENT_RXFRAMEEND 

Received data was checked (CRC, parity) and transferred to RAM, and EasyDMA ended accessing the RX buffer.

NRF_NFCT_EVENT_ERROR 

NFC error reported. The ERRORSTATUS register contains details on the source of the error.

NRF_NFCT_EVENT_RXERROR 

NFC RX frame error reported. The FRAMESTATUS.RX register contains details on the source of the error.

NRF_NFCT_EVENT_ENDRX 

RX buffer (as defined by PACKETPTR and MAXLEN) in Data RAM full.

NRF_NFCT_EVENT_ENDTX 

Transmission of data in RAM ended, and EasyDMA ended accessing the TX buffer.

NRF_NFCT_EVENT_AUTOCOLRESSTARTED 

Auto collision resolution process started.

NRF_NFCT_EVENT_COLLISION 

NFC auto collision resolution error reported.

NRF_NFCT_EVENT_SELECTED 

NFC auto collision resolution successfully completed.

NRF_NFCT_EVENT_STARTED 

EasyDMA is ready to receive or send frames.

NFC field state bit masks.

Enumerator
NRF_NFCT_FIELD_STATE_PRESENT_MASK 

Field presence mask.

NRF_NFCT_FIELD_STATE_LOCK_MASK 

Field lock mask.

NFC frame delay mode for data transmission.

Enumerator
NRF_NFCT_FRAME_DELAY_MODE_FREERUN 

Frame transmission starts when NRF_NFCT_TASK_STARTTX is set (delay timer is not used).

NRF_NFCT_FRAME_DELAY_MODE_WINDOW 

Frame transmission starts in a window between FRAMEDELAYMIN and FRAMEDELAYMAX.

NRF_NFCT_FRAME_DELAY_MODE_EXACTVAL 

Frame transmission starts when the delay timer reaches FRAMEDELAYMAX.

NRF_NFCT_FRAME_DELAY_MODE_WINDOWGRID 

Frame transmission starts in a bit grid between FRAMEDELAYMIN and FRAMEDELAYMAX.

NFCT interrupts.

Enumerator
NRF_NFCT_INT_READY_MASK 

Interrupt on READY event.

NRF_NFCT_INT_FIELDDETECTED_MASK 

Interrupt on FIELDDETECTED event.

NRF_NFCT_INT_FIELDLOST_MASK 

Interrupt on FIELDLOST event.

NRF_NFCT_INT_TXFRAMESTART_MASK 

Interrupt on TXFRAMESTART event.

NRF_NFCT_INT_TXFRAMEEND_MASK 

Interrupt on TXFRAMEEND event.

NRF_NFCT_INT_RXFRAMESTART_MASK 

Interrupt on RXFRAMESTART event.

NRF_NFCT_INT_RXFRAMEEND_MASK 

Interrupt on RXFRAMEEND event.

NRF_NFCT_INT_ERROR_MASK 

Interrupt on ERROR event.

NRF_NFCT_INT_RXERROR_MASK 

Interrupt on RXERROR event.

NRF_NFCT_INT_ENDRX_MASK 

Interrupt on ENDRX event.

NRF_NFCT_INT_ENDTX_MASK 

Interrupt on ENDTX event.

NRF_NFCT_INT_AUTOCOLRESSTARTED_MASK 

Interrupt on AUTOCOLRESSTARTED event.

NRF_NFCT_INT_COLLISION_MASK 

Interrupt on COLLISION event.

NRF_NFCT_INT_SELECTED_MASK 

Interrupt on SELECTED event.

NRF_NFCT_INT_STARTED_MASK 

Interrupt on STARTED event.

Bit masks for NFC reception frame configuration.

Enumerator
NRF_NFCT_RX_FRAME_CONFIG_PARITY 

Indicates whether parity is expected in the received frames.

NRF_NFCT_RX_FRAME_CONFIG_SOF 

Indicates whether SoF symbol is expected in the received frames.

NRF_NFCT_RX_FRAME_CONFIG_CRC16 

Indicates whether CRC is expected and checked in the received frames.

NFC received frame status bit masks.

Enumerator
NRF_NFCT_RX_FRAME_STATUS_CRC_MASK 

CRC status mask.

NRF_NFCT_RX_FRAME_STATUS_PARITY_MASK 

Parity status mask.

NRF_NFCT_RX_FRAME_STATUS_OVERRUN_MASK 

Overrun status mask.

Protocol NFC field (bits b7 and b6) configuration for the SEL_RES frame according to the NFC Forum Digital Protocol Technical Specification.

Enumerator
NRF_NFCT_SELRES_PROTOCOL_T2T 

Type 2 Tag platform.

NRF_NFCT_SELRES_PROTOCOL_T4AT 

Type 4A Tag platform.

NRF_NFCT_SELRES_PROTOCOL_NFCDEP 

NFC-DEP Protocol.

NRF_NFCT_SELRES_PROTOCOL_NFCDEP_T4AT 

NFC-DEP Protocol and Type 4A Tag platform).

Bit masks for SEL_RES NFC frame configuration.

Enumerator
NRF_NFCT_SELRES_CASCADE_MASK 

SEL_RES Cascade field bit mask.

NRF_NFCT_SELRES_PROTOCOL_MASK 

SEL_RES Protocol field bit mask.

'Bit frame SDD' NFC field configuration for the SENS_RES frame according to the NFC Forum Digital Protocol Technical Specification.

Enumerator
NRF_NFCT_SENSRES_BIT_FRAME_SDD_00000 

SDD pattern 00000.

NRF_NFCT_SENSRES_BIT_FRAME_SDD_00001 

SDD pattern 00001.

NRF_NFCT_SENSRES_BIT_FRAME_SDD_00010 

SDD pattern 00010.

NRF_NFCT_SENSRES_BIT_FRAME_SDD_00100 

SDD pattern 00100.

NRF_NFCT_SENSRES_BIT_FRAME_SDD_01000 

SDD pattern 01000.

NRF_NFCT_SENSRES_BIT_FRAME_SDD_10000 

SDD pattern 10000.

'NFCI1 size' NFC field configuration for the SENS_RES frame according to the NFC Forum Digital Protocol Technical Specification.

Enumerator
NRF_NFCT_SENSRES_NFCID1_SIZE_SINGLE 

Single size NFCID1 (4 bytes).

NRF_NFCT_SENSRES_NFCID1_SIZE_DOUBLE 

Double size NFCID1 (7 bytes).

NRF_NFCT_SENSRES_NFCID1_SIZE_TRIPLE 

Triple size NFCID1 (10 bytes).

NRF_NFCT_SENSRES_NFCID1_SIZE_DEFAULT 

Default size. Use this option to leave NFCID1 size unchanged.

'Platofrm Config' NFC field configuration for the SENS_RES frame according to the NFC Forum Digital Protocol Technical Specification.

Enumerator
NRF_NFCT_SENSRES_PLATFORM_CONFIG_T1T 

SENS_RES 'Platform Config' field (b4-b1) value for Type 1 Tag platform. SENS_RES 'Platform Config' field (b7-b6) value for any platform except Type 1 Tag platform.

NFCT shortcuts.

Enumerator
NRF_NFCT_SHORT_FIELDDETECTED_ACTIVATE_MASK 

Shortcut between the FIELDDETECTED event and the ACTIVATE task.

NRF_NFCT_SHORT_FIELDLOST_SENSE_MASK 

Shortcut between the FIELDLOST event and the SENSE task.

NRF_NFCT_SHORT_TXFRAMEEND_ENABLERXDATA_MASK 

Shortcut between the TXFRAMEEND event and the ENABLERXDATA task.

NFC tag sleep state.

Shows the sleep state during automatic collision resolution according to the NFC Forum Activity Technical Specification v2.0.

Enumerator
NRF_NFCT_SLEEP_STATE_IDLE 

'IDLE' state.

NRF_NFCT_SLEEP_STATE_SLEEP_A 

'SLEEP_A' state.

NFC tag state.

Enumerator
NRF_NFCT_TAG_STATE_DISABLED 

Disabled or sensing NFC field.

NRF_NFCT_TAG_STATE_RAMP_UP 

Ramping up.

NRF_NFCT_TAG_STATE_IDLE 

Idle.

NRF_NFCT_TAG_STATE_RECEIVE 

Receiving data.

NRF_NFCT_TAG_STATE_FRAME_DELAY 

Counting Frame Delay Time since the last symbol of the last received frame.

NRF_NFCT_TAG_STATE_TRANSMIT 

Transmitting data.

NFCT tasks.

Enumerator
NRF_NFCT_TASK_ACTIVATE 

Activate the NFCT peripheral for the incoming and outgoing frames, change state to activated.

NRF_NFCT_TASK_DISABLE 

Disable the NFCT peripheral.

NRF_NFCT_TASK_SENSE 

Enable the NFC sense field mode, change state to sense mode.

NRF_NFCT_TASK_STARTTX 

Start the transmission of an outgoing frame, change state to transmit.

NRF_NFCT_TASK_ENABLERXDATA 

Initialize EasyDMA for receive.

NRF_NFCT_TASK_GOIDLE 

Force state machine to the IDLE state.

NRF_NFCT_TASK_GOSLEEP 

Force state machine to the SLEEP_A state.

Bit masks for NFC transmission frame configuration.

Enumerator
NRF_NFCT_TX_FRAME_CONFIG_PARITY 

Indicates whether parity is added in the transmitted frames.

NRF_NFCT_TX_FRAME_CONFIG_DISCARD_START 

Indicates whether unused bits are discarded at the start or at the end of the transmitted frames.

NRF_NFCT_TX_FRAME_CONFIG_SOF 

Indicates whether SoF symbol is added in the transmitted frames.

NRF_NFCT_TX_FRAME_CONFIG_CRC16 

Indicates whether CRC is added in the transmitted frames.

Function Documentation

__STATIC_INLINE void nrf_nfct_autocolres_disable ( void  )

Function for disabling the automatic collision resolution.

The automatic collision resolution mechanism as defined in ISO 14443-3 and NFC Forum Digital Protocol Technical Specification 2.0, section 6.

__STATIC_INLINE void nrf_nfct_autocolres_enable ( void  )

Function for enabling the automatic collision resolution.

The automatic collision resolution mechanism as defined in ISO 14443-3 and NFC Forum Digital Protocol Technical Specification 2.0, section 6.

__STATIC_INLINE bool nrf_nfct_autocolres_is_enabled ( void  )

Function for getting the setting for the automatic collision resolution.

The automatic collision resolution mechanism as defined in ISO 14443-3 and NFC Forum Digital Protocol Technical Specification 2.0, section 6.

Return values
trueIf automatic collision resolution is enabled.
falseIf automatic collision resolution is disabled.
__STATIC_INLINE void nrf_nfct_error_status_clear ( uint32_t  error_flag)

Function for clearing the NFCT error status.

Parameters
[in]error_flagError flags to be cleared, defined in nrf_nfct_error_status_t.
__STATIC_INLINE uint32_t nrf_nfct_error_status_get ( void  )

Function for getting the NFCT error status.

Returns
The NFCT error status flags, defined in nrf_nfct_error_status_t.
__STATIC_INLINE uint32_t nrf_nfct_event_address_get ( nrf_nfct_event_t  event)

Function for returning the address of a specific NFCT event register.

Parameters
[in]eventEvent.
Returns
Address.
__STATIC_INLINE bool nrf_nfct_event_check ( nrf_nfct_event_t  event)

Function for retrieving the state of the NFCT event.

Parameters
[in]eventEvent to be checked.
Return values
trueThe event has been generated.
falseThe event has not been generated.
__STATIC_INLINE void nrf_nfct_event_clear ( nrf_nfct_event_t  event)

Function for clearing a specific event.

Parameters
[in]eventEvent.
__STATIC_INLINE uint8_t nrf_nfct_field_status_get ( void  )

Function for getting the status of the external NFC field detection.

Returns
The NFC field detection status. Status bits can be checked by using nrf_nfct_field_state_t.
__STATIC_INLINE uint32_t nrf_nfct_frame_delay_max_get ( void  )

Function for getting the maximum Frame Delay Time value.

This is the maximum value for Frame Delay Timer. It controls the longest time between the last symbol of the last received frame and the start of the transmission of a new TX frame. If no transmission starts before the Frame Delay Timer timeout, NRF_NFCT_ERROR_FRAMEDELAYTIMEOUT_MASK is set.

Returns
The maximum Frame Delay Time value in 13.56-MHz clock ticks.
__STATIC_INLINE void nrf_nfct_frame_delay_max_set ( uint32_t  frame_delay_max)

Function for setting the maximum Frame Delay Time value.

This is the maximum value for Frame Delay Timer. It controls the longest time between the last symbol of the last received frame and the start of the transmission of a new TX frame. If no transmission starts before the Frame Delay Timer timeout, NRF_NFCT_ERROR_FRAMEDELAYTIMEOUT_MASK is set.

Parameters
[in]frame_delay_maxMaximum Frame Delay Time value in 13.56-MHz clock ticks.
__STATIC_INLINE uint16_t nrf_nfct_frame_delay_min_get ( void  )

Function for getting the minimum Frame Delay Time value.

This is the minimum value for Frame Delay Timer. It controls the shortest time between the last symbol of the last received frame and the start of the transmission of a new TX frame.

Returns
The minimum Frame Delay Time value in 13.56-MHz clock ticks.
__STATIC_INLINE void nrf_nfct_frame_delay_min_set ( uint16_t  frame_delay_min)

Function for setting the minimum Frame Delay Time value.

This is the minimum value for Frame Delay Timer. It controls the shortest time between the last symbol of the last received frame and the start of the transmission of a new TX frame.

Parameters
[in]frame_delay_minMinimum Frame Delay Time value in 13.56-MHz clock ticks.
__STATIC_INLINE nrf_nfct_frame_delay_mode_t nrf_nfct_frame_delay_mode_get ( void  )

Function for getting the Frame Delay Mode configuration.

Returns
The configured Frame Delay Mode.
__STATIC_INLINE void nrf_nfct_frame_delay_mode_set ( nrf_nfct_frame_delay_mode_t  frame_delay_mode)

Function for setting the NFC Frame Delay Mode configuration.

Parameters
[in]frame_delay_modeFrame Delay Mode configuration.
__STATIC_INLINE void nrf_nfct_int_disable ( uint32_t  int_mask)

Function for disabling the selected interrupts.

Parameters
[in]int_maskInterrupt mask.
__STATIC_INLINE void nrf_nfct_int_enable ( uint32_t  int_mask)

Function for enabling the selected interrupts.

Parameters
[in]int_maskInterrupt mask.
__STATIC_INLINE bool nrf_nfct_int_enable_check ( uint32_t  int_mask)

Function for retrieving the state of the selected interrupts.

Parameters
[in]int_maskInterrupt mask.
Return values
trueAny of the selected interrupts is enabled.
falseNone of the selected interrupts is enabled.
__STATIC_INLINE uint32_t nrf_nfct_int_enable_get ( void  )

Function for retrieving the information about enabled interrupts.

Returns
The flags of the enabled interrupts.
__STATIC_INLINE uint16_t nrf_nfct_max_rxtx_length_get ( void  )

Function for getting the NFCT RX/TX maximum buffer length.

Returns
The configured maximum receive or transmit length in bytes (size of the RX/TX buffer for EasyDMA).
__STATIC_INLINE nrf_nfct_sensres_nfcid1_size_t nrf_nfct_nfcid1_get ( uint8_t *  p_nfcid1_buf)

Function for getting the NFCID1 (NFC tag identifier).

Note
This function always returns the full configuration of the NFCID1 setting (10 bytes), regardless of the NFCID1 size. The NFCID1 size can be configured using nrf_nfct_sensres_nfcid1_size_set or nrf_nfct_nfcid1_set.
Parameters
[out]p_nfcid1_bufPointer to a buffer for the NDFCID1 parameter. The NFCID1 values are in little endian order, that is: |NFCID1_3RD_LAST|NFCID1_2ND_LAST|NFCID1_LAST|.
Returns
Configured NFCID1 length
__STATIC_INLINE void nrf_nfct_nfcid1_set ( uint8_t const *  p_nfcid1_buf,
nrf_nfct_sensres_nfcid1_size_t  nfcid1_size 
)

Function for setting the NFCID1 (NFC tag identifier).

Note
This function also configures the NFCIDSIZE field in the SENSRES register of the NRF_NFCT peripheral.
Parameters
[in]p_nfcid1_bufPointer to the buffer with NDFCID1 bytes.
[in]nfcid1_sizeSize of the NFCID1 in bytes.
__STATIC_INLINE uint16_t nrf_nfct_rx_bits_get ( bool  crc_excluded)

Function for getting the number of bits received from the NFC poller.

Parameters
[in]crc_excludedFlag for excluding CRC size from calculation.
Returns
Number of received bits including or excluding CRC, and excluding parity and SoF/EoF framing.
__STATIC_INLINE uint8_t nrf_nfct_rx_frame_config_get ( void  )

Function for getting the flags of the NFC frame reception configuration.

Returns
The flags for NFCT frame reception configuration, defined in nrf_nfct_rx_frame_config_t.
__STATIC_INLINE void nrf_nfct_rx_frame_config_set ( uint8_t  flags)

Function for setting up the NFC frame reception.

Note
Destination for the received data is set using nrf_nfct_rxtx_buffer_set.
Parameters
[in]flagsNFCT RX configuration flags. Use nrf_nfct_rx_frame_config_t for setting the desired configuration.
__STATIC_INLINE void nrf_nfct_rx_frame_status_clear ( uint32_t  framestatus_flags)

Function for clearing the NFC frame reception status.

Parameters
[in]framestatus_flagsStatus flags to be cleared, defined in nrf_nfct_rx_frame_status_t.
__STATIC_INLINE uint32_t nrf_nfct_rx_frame_status_get ( void  )

Function for getting the NFC frame reception status.

Returns
The flags of the NFC frame reception status, defined in nrf_nfct_rx_frame_status_t.
__STATIC_INLINE uint8_t* nrf_nfct_rxtx_buffer_get ( void  )

Function for getting the pointer to the NFCT RX/TX buffer.

Returns
The configured pointer to the receive or transmit buffer.
__STATIC_INLINE void nrf_nfct_rxtx_buffer_set ( uint8_t *  p_rxtx_buf,
uint16_t  max_txrx_len 
)

Function for setting the the NFCT RX/TX buffer (address and maximum length).

Note
Buffer for the NFC RX/TX data is used by EasyDMA and must be located in RAM.
Parameters
[in]p_rxtx_bufPointer to the receive or transmit buffer.
[in]max_txrx_lenMaximum receive or transmit length in bytes (size of the RAM buffer for EasyDMA).
__STATIC_INLINE void nrf_nfct_selres_protocol_set ( nrf_nfct_selres_protocol_t  sel_res_protocol)

Function for setting the Protocol field in the SEL_RES frame configuration.

The SEL_RES frame is handled automatically by the NFCT hardware.

Parameters
[in]sel_res_protocolValue of the Protocol field in the SEL_RES frame.
__STATIC_INLINE bool nrf_nfct_selsres_cascade_check ( void  )

Function for checking the CASCADE bit of the SEL_RES frame.

The CASCADE bit in the SEL_RES register is handled automatically by the NFCT hardware and indicates the status of the NFCID1 read operation to the NFC poller according to the NFC Forum Digital Protocol Speficiation 2.0, section 6.8.2.

Return values
trueIf NFCID1 read procedure is not complete.
falseIf NFCID1 read procedure is complete.
__STATIC_INLINE nrf_nfct_selres_protocol_t nrf_nfct_selsres_protocol_get ( void  )

Function for getting the Protocol field in the SEL_RES frame.

The SEL_RES frame is handled automatically by the NFCT hardware.

Returns
Value of the Protocol field in the SEL_RES frame.
__STATIC_INLINE nrf_nfct_sensres_bit_frame_sdd_t nrf_nfct_sensres_bit_frame_sdd_get ( void  )

Function for getting the Bit Frame SDD field from the SENS_RES frame configuration.

The SENS_RES frame is handled automatically by the NFCT hardware.

Returns
The Bit Frame SDD field configuration.
__STATIC_INLINE void nrf_nfct_sensres_bit_frame_sdd_set ( nrf_nfct_sensres_bit_frame_sdd_t  bit_frame_sdd)

Function for setting the Bit Frame SDD field in the SENS_RES frame configuration.

Note
The SENS_RES frame is handled automatically by the NFCT hardware.
Parameters
[in]bit_frame_sddThe Bit Frame SDD field configuration.
__STATIC_INLINE nrf_nfct_sensres_nfcid1_size_t nrf_nfct_sensres_nfcid1_size_get ( void  )

Function for getting the NFCID1 size from the SENS_RES frame configuration.

The SENS_RES frame is handled automatically by the NFCT hardware.

Returns
NFCID1 (tag identifier) size.
__STATIC_INLINE void nrf_nfct_sensres_nfcid1_size_set ( nrf_nfct_sensres_nfcid1_size_t  nfcid1_size)

Function for setting the NFCID1 (tag identifier) size.field in the SENS_RES frame configuration.

Note
The SENS_RES frame is handled automatically by the NFCT hardware.
Parameters
[in]nfcid1_sizeNFCID1 (tag identifier) size.
See Also
nrf_nfct_nfcid1_set()
__STATIC_INLINE nrf_nfct_sensres_platform_config_t nrf_nfct_sensres_platform_config_get ( void  )

Function for getting the Platform Config field from the SENS_RES frame configuration.

The SENS_RES frame is handled automatically by the NFCT hardware.

Returns
The Platform Config field configuration.
__STATIC_INLINE void nrf_nfct_sensres_platform_config_set ( nrf_nfct_sensres_platform_config_t  platform_config)

Function for setting the Platform Config field in the SENS_RES frame configuration.

Note
The SENS_RES frame is handled automatically by the NFCT hardware.
Parameters
[in]platform_configThe Platform Config field configuration.
__STATIC_INLINE void nrf_nfct_shorts_disable ( uint32_t  short_mask)

Function for disabling selected shortcuts.

Parameters
[in]short_maskMask of shortcuts.
__STATIC_INLINE void nrf_nfct_shorts_enable ( uint32_t  short_mask)

Function for enabling selected shortcuts.

Parameters
[in]short_maskMask of shortcuts.
__STATIC_INLINE uint32_t nrf_nfct_shorts_get ( void  )

Function for retrieving the enabled shortcuts.

Returns
Flags of the currently enabled shortcuts.
__STATIC_INLINE void nrf_nfct_shorts_set ( uint32_t  short_mask)

Function for setting shortcuts.

Parameters
[in]short_maskShortcut mask.
__STATIC_INLINE nrf_nfct_sleep_state_t nrf_nfct_sleep_state_get ( void  )

Function for getting the NFC tag sleep state during the automatic collision resolution.

The returned value is the last state before the autimatic collision resolution started.

Return values
NRF_NFCT_SLEEP_STATE_IDLENFC tag was in IDLE state before the automatic collision resolution started.
NRF_NFCT_SLEEP_STATE_SLEEP_ANFC tag was in SLEEP_A state before the automatic collision resolution started.
__STATIC_INLINE nrf_nfct_tag_state_t nrf_nfct_tag_state_get ( void  )

Function for getting the NFC tag state.

Return values
NRF_NFCT_TAG_STATE_DISABLEDNFC tag is disabled.
NRF_NFCT_TAG_STATE_RAMP_UPNFC tag is ramping up.
NRF_NFCT_TAG_STATE_IDLENFC tag is activated and idle.
NRF_NFCT_TAG_STATE_RECEIVENFC tag is receiving data.
NRF_NFCT_TAG_STATE_FRAME_DELAYFrame Delay Timer of the NFC tag is counting ticks since the last symbol of the last received frame.
NRF_NFCT_TAG_STATE_TRANSMITNFC tag is transmitting data.
__STATIC_INLINE uint32_t nrf_nfct_task_address_get ( nrf_nfct_task_t  task)

Function for returning the address of a specific NFCT task register.

Parameters
[in]taskTask.
Returns
Task address.
__STATIC_INLINE void nrf_nfct_task_trigger ( nrf_nfct_task_t  task)

Function for activating a specific NFCT task.

Parameters
[in]taskTask to be activated.
__STATIC_INLINE uint16_t nrf_nfct_tx_bits_get ( void  )

Function for getting the length of the configured transmission frame.

Note
NFC frames do not have to consist of full bytes only, therefore data amount for transmission is configured in number of bits.
Returns
Number of bits to be sent excluding CRC, parity, SoF, and EoF.
__STATIC_INLINE void nrf_nfct_tx_bits_set ( uint16_t  tx_bits)

Function for setting up the NFC frame transmission.

Set the number of TX bits excluding CRC, parity, SoF, and EoF.

Note
Source of data for transmission is set by using nrf_nfct_rxtx_buffer_set.
NFC frames do not have to consist of full bytes only, therefore data amount for transmission is configured in number of bits.
Parameters
[in]tx_bitsOverall number of bits to be sent.
__STATIC_INLINE uint8_t nrf_nfct_tx_frame_config_get ( void  )

Function for getting the flags for NFC frame transmission configuration.

Returns
The flags of the NFCT frame transmission configuration, defined in nrf_nfct_tx_frame_config_t.
__STATIC_INLINE void nrf_nfct_tx_frame_config_set ( uint8_t  flags)

Function for setting up the flags of the NFC frame transmission configuration.

Parameters
[in]flagsFlags for NFCT TX configuration. Use nrf_nfct_tx_frame_config_t for setting.

Documentation feedback | Developer Zone | Subscribe | Updated