NXP NFC Reader Library  v4.040.05.011646
Component : Software
Collaboration diagram for Component : Software:

Data Structures

struct  phacDiscLoop_Sw_TypeA_Info
 Type A parameter structure. More...
 
struct  phacDiscLoop_Sw_TypeB_Info
 Type B parameter structure. More...
 
struct  phacDiscLoop_Sw_TypeF_Info
 Type F parameter structure. More...
 
struct  phacDiscLoop_Sw_TypeV_Info
 Type V parameter structure. More...
 
struct  phacDiscLoop_I18000p3m3_Info
 18000p3m3 parameter structure More...
 
struct  phacDiscLoop_TargetParams
 Target parameter structure. More...
 
struct  phacDiscLoop_Sw_DataParams
 Discovery loop parameter structure. More...
 

Macros

#define PHAC_DISCLOOP_SW_ID   0x01U
 ID for this layer (software implementation of Discover loop component). More...
 
#define PHAC_DISCLOOP_CFG_MAX_CARDS_SUPPORTED   0x01U
 Maximum cards supported per technologies in passive poll mode. More...
 
#define PHAC_DISCLOOP_CFG_MAX_VICINITY_CARDS_SUPPORTED   0x01U
 Maximum cards supported per vicinity technologies in passive poll mode. More...
 
#define PHAC_DISCLOOP_PASS_POLL_MAX_TECHS_SUPPORTED   0x06U
 Maximum (NFC + proprietary) technologies support in passive poll mode. More...
 

Typedefs

typedef enum phacDiscLoop_Profile phacDiscLoop_Profile_t
 Reader Library Profiles. More...
 
typedef enum phacDiscLoop_Sw_PollState phacDiscLoop_Sw_PollState_t
 Discovery loop poll states to start with while in passive poll mode. More...
 
typedef enum phacDiscLoop_Sw_EntryPoints phacDiscLoop_Sw_EntryPoints_t
 Discovery entry points. More...
 
typedef enum phacDiscLoop_Sw_NfcTech phacDiscLoop_Sw_NfcTech_t
 Technology bit position / sequence. More...
 
typedef struct phacDiscLoop_Sw_TypeA_Info phacDiscLoop_Sw_TypeA_Info_t
 Type A parameter structure.
 
typedef struct phacDiscLoop_Sw_TypeB_Info phacDiscLoop_Sw_TypeB_Info_t
 Type B parameter structure.
 
typedef struct phacDiscLoop_Sw_TypeF_Info phacDiscLoop_Sw_TypeF_Info_t
 Type F parameter structure.
 
typedef struct phacDiscLoop_Sw_TypeV_Info phacDiscLoop_Sw_TypeV_Info_t
 Type V parameter structure.
 
typedef struct phacDiscLoop_I18000p3m3_Info phacDiscLoop_I18000p3m3_Info_t
 18000p3m3 parameter structure
 
typedef struct phacDiscLoop_TargetParams phacDiscLoop_Sw_TargetParams_t
 Target parameter structure.
 
typedef struct phacDiscLoop_Sw_DataParams phacDiscLoop_Sw_DataParams_t
 Discovery loop parameter structure.
 

Enumerations

enum  phacDiscLoop_Profile {
  PHAC_DISCLOOP_PROFILE_UNKNOWN = 0, PHAC_DISCLOOP_PROFILE_NFC, PHAC_DISCLOOP_PROFILE_EMVCO, PHAC_DISCLOOP_PROFILE_ISO,
  PHAC_DISCLOOP_PROFILE_NFC_AND_ACTIVE
}
 Reader Library Profiles. More...
 
enum  phacDiscLoop_Sw_PollState { PHAC_DISCLOOP_POLL_STATE_UNKNOWN = 0, PHAC_DISCLOOP_POLL_STATE_DETECTION, PHAC_DISCLOOP_POLL_STATE_COLLISION_RESOLUTION, PHAC_DISCLOOP_POLL_STATE_REMOVAL }
 Discovery loop poll states to start with while in passive poll mode. More...
 
enum  phacDiscLoop_Sw_EntryPoints { PHAC_DISCLOOP_ENTRY_POINT_POLL = 0, PHAC_DISCLOOP_ENTRY_POINT_LISTEN }
 Discovery entry points. More...
 
enum  phacDiscLoop_Sw_NfcTech {
  PHAC_DISCLOOP_TECH_TYPE_A = 0, PHAC_DISCLOOP_TECH_TYPE_B, PHAC_DISCLOOP_TECH_TYPE_F212, PHAC_DISCLOOP_TECH_TYPE_F424,
  PHAC_DISCLOOP_TECH_TYPE_V, PHAC_DISCLOOP_TECH_TYPE_18000P3M3, PHAC_DISCLOOP_TECH_TYPE_UNKNOWN
}
 Technology bit position / sequence. More...
 

Functions

phStatus_t phacDiscLoop_Sw_Init (phacDiscLoop_Sw_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, void *pHalDataParams)
 Initialize discovery loop. More...
 

Supported NFC Activity versions.

Discovery loop support both NFC Activity version 1.0 and 1.1.

By default discovery loop is configured for NFC Activity version 1.1. Use phacDiscLoop_SetConfig with PHAC_DISCLOOP_CONFIG_ACTIVITY_VERSION option to configure below values.

#define PHAC_DISCLOOP_NFC_ACTIVITY_VERSION_1_0   0x01
 Supports NFC Activity version 1.0. More...
 
#define PHAC_DISCLOOP_NFC_ACTIVITY_VERSION_1_1   0x02
 Supports NFC Activity version 1.1. More...
 

Discovery loop return status codes.

#define PHAC_DISCLOOP_FAILURE   0x0080U
 Discovery loop failure. More...
 
#define PHAC_DISCLOOP_COLLISION_PENDING   0x0081U
 Indicates that collision is pending. More...
 
#define PHAC_DISCLOOP_EXTERNAL_RFON   0x0082U
 External RF field on. More...
 
#define PHAC_DISCLOOP_EXTERNAL_RFOFF   0x0083U
 External RF field off. More...
 
#define PHAC_DISCLOOP_NO_TECH_DETECTED   0x0084U
 No technologies detected. More...
 
#define PHAC_DISCLOOP_NO_DEVICE_RESOLVED   0x0085U
 No card/device resolved. More...
 
#define PHAC_DISCLOOP_LPCD_NO_TECH_DETECTED   0x0086U
 Low Power Card Detection (LPCD) succeeded but no technologies detected. More...
 
#define PHAC_DISCLOOP_MULTI_TECH_DETECTED   0x0088U
 Multiple Technologies detected. More...
 
#define PHAC_DISCLOOP_MULTI_DEVICES_RESOLVED   0x008AU
 Multiple cards/devices resolved. More...
 
#define PHAC_DISCLOOP_DEVICE_ACTIVATED   0x008BU
 Single card/device activated. More...
 
#define PHAC_DISCLOOP_ACTIVE_TARGET_ACTIVATED   0x008CU
 Active target activated. More...
 
#define PHAC_DISCLOOP_PASSIVE_TARGET_ACTIVATED   0x008DU
 Passive target activated. More...
 
#define PHAC_DISCLOOP_MERGED_SEL_RES_FOUND   0x008EU
 Merged SEL_RES (Type A) with NFC-DEP and T4T support found. More...
 
#define PHAC_DISCLOOP_ACTIVATED_BY_PEER   0x008FU
 Activated in listen mode. More...
 

Bit positions for different technologies.

Application can use these mask values to find the detected technology, collision pending status, bail out configuration etc.


Example (Check for Type A detection in passive poll mode):

#define PHAC_DISCLOOP_POS_BIT_MASK_A   0x01U
 Position bit mask for Type A. More...
 
#define PHAC_DISCLOOP_POS_BIT_MASK_B   0x02U
 Position bit mask for Type B. More...
 
#define PHAC_DISCLOOP_POS_BIT_MASK_F212   0x04U
 Position bit mask for Type F212. More...
 
#define PHAC_DISCLOOP_POS_BIT_MASK_F424   0x08U
 Position bit mask for Type F424. More...
 
#define PHAC_DISCLOOP_POS_BIT_MASK_V   0x10U
 Position bit mask for Type V. More...
 
#define PHAC_DISCLOOP_POS_BIT_MASK_18000P3M3   0x20U
 Position bit mask for ISO 18000P3M3. More...
 

Bit positions for active poll mode technologies.

Application can use these mask values to find the detected technology in active poll mode and to configure technologies to be detected in active poll mode.


Example (Check for Active @ 106 kbps detection):

#define PHAC_DISCLOOP_ACT_POS_BIT_MASK_106   0x01U
 106 Kbps Bit rate for Active Communication. More...
 
#define PHAC_DISCLOOP_ACT_POS_BIT_MASK_212   0x02U
 212 Kbps Bit rate for Active Communication. More...
 
#define PHAC_DISCLOOP_ACT_POS_BIT_MASK_424   0x04U
 424 Kbps Bit rate for Active Communication. More...
 

FELICA data rates.

#define PHAC_DISCLOOP_CON_BITR_212   PHAC_DISCLOOP_POS_BIT_MASK_F212
 Configures 212 Kbps bit rate for Type F tag. More...
 
#define PHAC_DISCLOOP_CON_BITR_424   PHAC_DISCLOOP_POS_BIT_MASK_F424
 Configures 424 Kbps bit rate for Type F tag. More...
 

Type A default parameters.

#define PHAC_DISCLOOP_I3P3A_MAX_ATQA_LENGTH   0x02U
 Answer to RequestA (ATQA) length for ISO 14443-3A card type. More...
 
#define PHAC_DISCLOOP_I3P3A_MAX_UID_LENGTH   0x0AU
 Maximum UID length for 14443 Type A compliant tags. More...
 
#define PHAC_DISCLOOP_I3P3A_SINGLE_SIZE_UID_LENGTH   0x04U
 UID length for single size NFCID1 Type A compliant tags. More...
 
#define PHAC_DISCLOOP_I3P3A_DOUBLE_SIZE_UID_LENGTH   0x07U
 UID length for double size NFCID1 Type A compliant tags. More...
 
#define PHAC_DISCLOOP_I3P3A_TRIPLE_SIZE_UID_LENGTH   0x0AU
 UID length for triple size NFCID1 Type A compliant tags. More...
 
#define PHAC_DISCLOOP_JEWEL_HR_LENGTH   0x02U
 Type 1 Tag Header ROM byte length. More...
 

Type B default parameters.

#define PHAC_DISCLOOP_I3P3B_PUPI_LENGTH   0x04U
 Device Identifier length for Type B tag. More...
 
#define PHAC_DISCLOOP_I3P3B_MAX_ATQB_LENGTH   13U
 Maximum Answer to RequestB (ATQB) Response length. More...
 

Type F default parameters.

#define PHAC_DISCLOOP_FELICA_IDM_LENGTH   0x08U
 Manufacture ID (IDM) Length for FELICA. More...
 
#define PHAC_DISCLOOP_FELICA_PMM_LENGTH   0x08U
 Manufacturer Parameter (PMm) length for FELICA. More...
 
#define PHAC_DISCLOOP_FELICA_RD_LENGTH   0x02U
 Request Data (RD) length for Felica SENSF_RES. More...
 

Select Acknowledge (SAK) mask values for different Type A tags.

Application can use these mask values to detect the Type of tag from the SAK value.

Usage:

  bTagType = (phacDiscLoop_Sw_DataParams->sTypeATargetInfo.aTypeA_I3P3[0].aSak & 0x60);
  bTagType = bTagType >> 5;

  switch(bTagType)
  {
  case PHAC_DISCLOOP_TYPEA_TYPE2_TAG_CONFIG_MASK:
      printf("\n\t\tType: Type 2 Tag\n");
      break;
  case PHAC_DISCLOOP_TYPEA_TYPE4A_TAG_CONFIG_MASK:
      printf ("\n\t\tType: Type 4A Tag\n");
      break;
  case PHAC_DISCLOOP_TYPEA_TYPE_NFC_DEP_TAG_CONFIG_MASK:
      printf ("\n\t\tType: P2P\n");
      break;
  case PHAC_DISCLOOP_TYPEA_TYPE_NFC_DEP_TYPE4A_TAG_CONFIG_MASK:
      printf ("\n\t\tType: Type NFC_DEP and  4A Tag\n");
      break;
  default:
      break;
  }
#define PHAC_DISCLOOP_TYPEA_T1T_ATQA1_MASK   0x1FU
 Mask for Type 1 tag ATQA Byte 1. More...
 
#define PHAC_DISCLOOP_TYPEA_T1T_ATQA2_MASK   0x0FU
 Mask for determining whether a Type A tag is Type 1. More...
 
#define PHAC_DISCLOOP_TYPEA_TYPE2_TAG_CONFIG_MASK   0x00U
 Mask for determining for Type 2 tag. More...
 
#define PHAC_DISCLOOP_TYPEA_TYPE4A_TAG_CONFIG_MASK   0x01U
 Mask for determining for Type 4A tag. More...
 
#define PHAC_DISCLOOP_TYPEA_TYPE_NFC_DEP_TAG_CONFIG_MASK   0x02U
 Mask for determining for NFC DEP Protocol. More...
 
#define PHAC_DISCLOOP_TYPEA_TYPE_NFC_DEP_TYPE4A_TAG_CONFIG_MASK   0x03U
 Mask for determining support for Type 4A and NFC DEP Protocol. More...
 

Macros for checking set bit and set bit position.

#define PHAC_DISCLOOP_CHECK_ANDMASK(value, mask)   (((value) & (mask)) != 0)
 Logically AND value and mask, if the corresponding bit is set, then non zero value is returned else zero is returned. More...
 
#define PHAC_DISCLOOP_GET_BIT_POS(x, pos)
 Get the first set bit position starting from least significant bit. More...
 

Detailed Description

Macro Definition Documentation

§ PHAC_DISCLOOP_SW_ID

#define PHAC_DISCLOOP_SW_ID   0x01U

ID for this layer (software implementation of Discover loop component).

phacDiscLoop_Sw_DataParams::wId is initialized with this ID in the initialization function phacDiscLoop_Sw_Init.

§ PHAC_DISCLOOP_CFG_MAX_CARDS_SUPPORTED

#define PHAC_DISCLOOP_CFG_MAX_CARDS_SUPPORTED   0x01U

Maximum cards supported per technologies in passive poll mode.

By default maximum cards supported per technology is set to 1. Users can change this value to support more cards.

NOTE: Size of discovery loop data structure phacDiscLoop_Sw_DataParams will increase if this value is increased.

§ PHAC_DISCLOOP_CFG_MAX_VICINITY_CARDS_SUPPORTED

#define PHAC_DISCLOOP_CFG_MAX_VICINITY_CARDS_SUPPORTED   0x01U

Maximum cards supported per vicinity technologies in passive poll mode.

By default maximum cards supported per vicinity technology is set to 1. Users can change this value to support more cards.

NOTE: Size of discovery loop data structure phacDiscLoop_Sw_DataParams will increase if this value is increased.

§ PHAC_DISCLOOP_PASS_POLL_MAX_TECHS_SUPPORTED

#define PHAC_DISCLOOP_PASS_POLL_MAX_TECHS_SUPPORTED   0x06U

Maximum (NFC + proprietary) technologies support in passive poll mode.

Supported technologies are:

  • Type A (As per NFC Activity 1.1 and EMVCo Specification 2.3.1a)
  • Type B (As per NFC Activity 1.1 and EMVCo Specification 2.3.1a)
  • Type F @ 212 kbps (As per NFC Activity 1.1)
  • Type F @ 424 kbps (As per NFC Activity 1.1)
  • Type V (ISO 15693) (As per NFC Activity draft specification)
  • ISO 18000P3M3 (Proprietary)

§ PHAC_DISCLOOP_NFC_ACTIVITY_VERSION_1_0

#define PHAC_DISCLOOP_NFC_ACTIVITY_VERSION_1_0   0x01

Supports NFC Activity version 1.0.

§ PHAC_DISCLOOP_NFC_ACTIVITY_VERSION_1_1

#define PHAC_DISCLOOP_NFC_ACTIVITY_VERSION_1_1   0x02

Supports NFC Activity version 1.1.

This is default.

§ PHAC_DISCLOOP_FAILURE

#define PHAC_DISCLOOP_FAILURE   0x0080U

Discovery loop failure.

This status can be returned by phacDiscLoop_Run in poll and listen modes. This is returned when discovery loop failed to proceed further due to an error in lower layer. Use phacDiscLoop_GetConfig with PHAC_DISCLOOP_CONFIG_ADDITIONAL_INFO to get the actual error code from lower layer.

§ PHAC_DISCLOOP_COLLISION_PENDING

#define PHAC_DISCLOOP_COLLISION_PENDING   0x0081U

Indicates that collision is pending.

This status is returned by phacDiscLoop_Run in passive poll mode when collision resolution is disabled or when device limit is set to zero for a detected technology. Use phacDiscLoop_GetConfig with PHAC_DISCLOOP_CONFIG_COLLISION_PENDING option to get collision pending status for all technologies.

§ PHAC_DISCLOOP_EXTERNAL_RFON

#define PHAC_DISCLOOP_EXTERNAL_RFON   0x0082U

External RF field on.

This status is returned by phacDiscLoop_Run in passive poll mode when external RF is detected during RF collision avoidance (RFCA) procedure. On getting this error application may restart phacDiscLoop_Run in listen mode if supported.

§ PHAC_DISCLOOP_EXTERNAL_RFOFF

#define PHAC_DISCLOOP_EXTERNAL_RFOFF   0x0083U

External RF field off.

This status is returned by phacDiscLoop_Run in listen mode if external RF is switched off during listen. On getting this error application may restart discovery loop in poll mode or wait for a specific time for external RF to turn ON.

§ PHAC_DISCLOOP_NO_TECH_DETECTED

#define PHAC_DISCLOOP_NO_TECH_DETECTED   0x0084U

No technologies detected.

This status is returned by phacDiscLoop_Run in passive poll mode if no technologies are detected during detection stage of passive polling.

§ PHAC_DISCLOOP_NO_DEVICE_RESOLVED

#define PHAC_DISCLOOP_NO_DEVICE_RESOLVED   0x0085U

No card/device resolved.

This status is returned by phacDiscLoop_Run in passive poll mode if no card/device is resolved during collision resolution stage but that technology was detected during technology detection stage of passive polling.

§ PHAC_DISCLOOP_LPCD_NO_TECH_DETECTED

#define PHAC_DISCLOOP_LPCD_NO_TECH_DETECTED   0x0086U

Low Power Card Detection (LPCD) succeeded but no technologies detected.

This status is returned by phacDiscLoop_Run in passive poll mode when LPCD is enabled and LPCD returned success but no technologies were detected during technology detection stage of passive poll mode. This can be due to false triggering of LPCD interrupt or LPCD triggered by a card/device not supported by discovery loop.

§ PHAC_DISCLOOP_MULTI_TECH_DETECTED

#define PHAC_DISCLOOP_MULTI_TECH_DETECTED   0x0088U

Multiple Technologies detected.

This status is returned by phacDiscLoop_Run in passive poll mode when multiple technologies are detected during technology detection stage of passive poll mode.
To continue with collision resolution stage of one of the detected technology, application can follow below steps:

§ PHAC_DISCLOOP_MULTI_DEVICES_RESOLVED

#define PHAC_DISCLOOP_MULTI_DEVICES_RESOLVED   0x008AU

Multiple cards/devices resolved.

This status is returned by phacDiscLoop_Run in passive poll mode when multiple cards/devices are resolved during collision resolution stage of passive poll mode when CON_DEVICES_LIMIT > 1.

§ PHAC_DISCLOOP_DEVICE_ACTIVATED

#define PHAC_DISCLOOP_DEVICE_ACTIVATED   0x008BU

Single card/device activated.

This status is returned by phacDiscLoop_Run in passive poll mode when a single card/device is successfully activated during activation stage.
Use phacDiscLoop_GetConfig with PHAC_DISCLOOP_CONFIG_TECH_DETECTED to get the technology detected.

§ PHAC_DISCLOOP_ACTIVE_TARGET_ACTIVATED

#define PHAC_DISCLOOP_ACTIVE_TARGET_ACTIVATED   0x008CU

Active target activated.

This status is returned by phacDiscLoop_Run in active poll mode when a single active target is successfully activated during active polling.
Use phacDiscLoop_GetConfig with PHAC_DISCLOOP_CONFIG_TECH_DETECTED to get the activated technology.

§ PHAC_DISCLOOP_PASSIVE_TARGET_ACTIVATED

#define PHAC_DISCLOOP_PASSIVE_TARGET_ACTIVATED   0x008DU

Passive target activated.

This status is returned by phacDiscLoop_Run in passive poll mode when a single passive target is successfully activated during passive polling.
Use phacDiscLoop_GetConfig with PHAC_DISCLOOP_CONFIG_TECH_DETECTED to get the activated technology.

§ PHAC_DISCLOOP_MERGED_SEL_RES_FOUND

#define PHAC_DISCLOOP_MERGED_SEL_RES_FOUND   0x008EU

Merged SEL_RES (Type A) with NFC-DEP and T4T support found.

This status is returned by phacDiscLoop_Run in passive poll mode when device/card is successfully activated till ISO 14443-3 and both T4T and NFC DEP support is detected in SEL_RES/SAK. Then ATR_REQ or RATS is not sent by discovery loop. On getting this status application can decide whether to send ATR_REQ or RATS. This status is applicable only to Type A.

§ PHAC_DISCLOOP_ACTIVATED_BY_PEER

#define PHAC_DISCLOOP_ACTIVATED_BY_PEER   0x008FU

Activated in listen mode.

This status is returned by phacDiscLoop_Run in listen mode when it got successfully activated in listen mode by another reader/initiator.
Application shall check phacDiscLoop_TargetParams to validate the received request (ATR_REQ/RATS), data rate and framing (active/passive) and send the response.

§ PHAC_DISCLOOP_POS_BIT_MASK_A

#define PHAC_DISCLOOP_POS_BIT_MASK_A   0x01U

Position bit mask for Type A.

§ PHAC_DISCLOOP_POS_BIT_MASK_B

#define PHAC_DISCLOOP_POS_BIT_MASK_B   0x02U

Position bit mask for Type B.

§ PHAC_DISCLOOP_POS_BIT_MASK_F212

#define PHAC_DISCLOOP_POS_BIT_MASK_F212   0x04U

Position bit mask for Type F212.

§ PHAC_DISCLOOP_POS_BIT_MASK_F424

#define PHAC_DISCLOOP_POS_BIT_MASK_F424   0x08U

Position bit mask for Type F424.

§ PHAC_DISCLOOP_POS_BIT_MASK_V

#define PHAC_DISCLOOP_POS_BIT_MASK_V   0x10U

Position bit mask for Type V.

§ PHAC_DISCLOOP_POS_BIT_MASK_18000P3M3

#define PHAC_DISCLOOP_POS_BIT_MASK_18000P3M3   0x20U

Position bit mask for ISO 18000P3M3.

§ PHAC_DISCLOOP_ACT_POS_BIT_MASK_106

#define PHAC_DISCLOOP_ACT_POS_BIT_MASK_106   0x01U

106 Kbps Bit rate for Active Communication.

§ PHAC_DISCLOOP_ACT_POS_BIT_MASK_212

#define PHAC_DISCLOOP_ACT_POS_BIT_MASK_212   0x02U

212 Kbps Bit rate for Active Communication.

§ PHAC_DISCLOOP_ACT_POS_BIT_MASK_424

#define PHAC_DISCLOOP_ACT_POS_BIT_MASK_424   0x04U

424 Kbps Bit rate for Active Communication.

§ PHAC_DISCLOOP_CON_BITR_212

#define PHAC_DISCLOOP_CON_BITR_212   PHAC_DISCLOOP_POS_BIT_MASK_F212

Configures 212 Kbps bit rate for Type F tag.

§ PHAC_DISCLOOP_CON_BITR_424

#define PHAC_DISCLOOP_CON_BITR_424   PHAC_DISCLOOP_POS_BIT_MASK_F424

Configures 424 Kbps bit rate for Type F tag.

§ PHAC_DISCLOOP_I3P3A_MAX_ATQA_LENGTH

#define PHAC_DISCLOOP_I3P3A_MAX_ATQA_LENGTH   0x02U

Answer to RequestA (ATQA) length for ISO 14443-3A card type.

§ PHAC_DISCLOOP_I3P3A_MAX_UID_LENGTH

#define PHAC_DISCLOOP_I3P3A_MAX_UID_LENGTH   0x0AU

Maximum UID length for 14443 Type A compliant tags.

§ PHAC_DISCLOOP_I3P3A_SINGLE_SIZE_UID_LENGTH

#define PHAC_DISCLOOP_I3P3A_SINGLE_SIZE_UID_LENGTH   0x04U

UID length for single size NFCID1 Type A compliant tags.

§ PHAC_DISCLOOP_I3P3A_DOUBLE_SIZE_UID_LENGTH

#define PHAC_DISCLOOP_I3P3A_DOUBLE_SIZE_UID_LENGTH   0x07U

UID length for double size NFCID1 Type A compliant tags.

§ PHAC_DISCLOOP_I3P3A_TRIPLE_SIZE_UID_LENGTH

#define PHAC_DISCLOOP_I3P3A_TRIPLE_SIZE_UID_LENGTH   0x0AU

UID length for triple size NFCID1 Type A compliant tags.

§ PHAC_DISCLOOP_JEWEL_HR_LENGTH

#define PHAC_DISCLOOP_JEWEL_HR_LENGTH   0x02U

Type 1 Tag Header ROM byte length.

§ PHAC_DISCLOOP_I3P3B_PUPI_LENGTH

#define PHAC_DISCLOOP_I3P3B_PUPI_LENGTH   0x04U

Device Identifier length for Type B tag.

§ PHAC_DISCLOOP_I3P3B_MAX_ATQB_LENGTH

#define PHAC_DISCLOOP_I3P3B_MAX_ATQB_LENGTH   13U

Maximum Answer to RequestB (ATQB) Response length.

§ PHAC_DISCLOOP_FELICA_IDM_LENGTH

#define PHAC_DISCLOOP_FELICA_IDM_LENGTH   0x08U

Manufacture ID (IDM) Length for FELICA.

§ PHAC_DISCLOOP_FELICA_PMM_LENGTH

#define PHAC_DISCLOOP_FELICA_PMM_LENGTH   0x08U

Manufacturer Parameter (PMm) length for FELICA.

§ PHAC_DISCLOOP_FELICA_RD_LENGTH

#define PHAC_DISCLOOP_FELICA_RD_LENGTH   0x02U

Request Data (RD) length for Felica SENSF_RES.

§ PHAC_DISCLOOP_TYPEA_T1T_ATQA1_MASK

#define PHAC_DISCLOOP_TYPEA_T1T_ATQA1_MASK   0x1FU

Mask for Type 1 tag ATQA Byte 1.

§ PHAC_DISCLOOP_TYPEA_T1T_ATQA2_MASK

#define PHAC_DISCLOOP_TYPEA_T1T_ATQA2_MASK   0x0FU

Mask for determining whether a Type A tag is Type 1.

Used along with byte 2 of ATQA.

§ PHAC_DISCLOOP_TYPEA_TYPE2_TAG_CONFIG_MASK

#define PHAC_DISCLOOP_TYPEA_TYPE2_TAG_CONFIG_MASK   0x00U

Mask for determining for Type 2 tag.

§ PHAC_DISCLOOP_TYPEA_TYPE4A_TAG_CONFIG_MASK

#define PHAC_DISCLOOP_TYPEA_TYPE4A_TAG_CONFIG_MASK   0x01U

Mask for determining for Type 4A tag.

§ PHAC_DISCLOOP_TYPEA_TYPE_NFC_DEP_TAG_CONFIG_MASK

#define PHAC_DISCLOOP_TYPEA_TYPE_NFC_DEP_TAG_CONFIG_MASK   0x02U

Mask for determining for NFC DEP Protocol.

§ PHAC_DISCLOOP_TYPEA_TYPE_NFC_DEP_TYPE4A_TAG_CONFIG_MASK

#define PHAC_DISCLOOP_TYPEA_TYPE_NFC_DEP_TYPE4A_TAG_CONFIG_MASK   0x03U

Mask for determining support for Type 4A and NFC DEP Protocol.

§ PHAC_DISCLOOP_CHECK_ANDMASK

#define PHAC_DISCLOOP_CHECK_ANDMASK (   value,
  mask 
)    (((value) & (mask)) != 0)

Logically AND value and mask, if the corresponding bit is set, then non zero value is returned else zero is returned.

Application can use this to check the detection technologies.

Example (Check for Type B):

§ PHAC_DISCLOOP_GET_BIT_POS

#define PHAC_DISCLOOP_GET_BIT_POS (   x,
  pos 
)
Value:
{ \
(pos) = 0; \
while((x)){ (x) >>= 1; ++(pos); } \
if ((pos) == 0) {return (PH_ERR_INTERNAL_ERROR);} \
}
#define PH_ERR_INTERNAL_ERROR
An internal error occurred.
Definition: ph_Status.h:86

Get the first set bit position starting from least significant bit.

Application can use this to check the bit position of detected technology.

Example (Activation of device/tag at index 0, when phacDiscLoop_Run returns PHAC_DISCLOOP_MULTI_DEVICES_RESOLVED):

Typedef Documentation

§ phacDiscLoop_Profile_t

Reader Library Profiles.

This will be set and handled by the application.

§ phacDiscLoop_Sw_PollState_t

Discovery loop poll states to start with while in passive poll mode.


Use phacDiscLoop_SetConfig with PHAC_DISCLOOP_CONFIG_NEXT_POLL_STATE option to configure these states. Default discovery loop starts with PHAC_DISCLOOP_POLL_STATE_DETECTION in passive poll mode.

§ phacDiscLoop_Sw_EntryPoints_t

Discovery entry points.


This is an input parameter to phacDiscLoop_Run.

§ phacDiscLoop_Sw_NfcTech_t

Technology bit position / sequence.


Enumeration Type Documentation

§ phacDiscLoop_Profile

Reader Library Profiles.

This will be set and handled by the application.

Enumerator
PHAC_DISCLOOP_PROFILE_UNKNOWN 

Unknown.

PHAC_DISCLOOP_PROFILE_NFC 

NFC Forum Profile.

PHAC_DISCLOOP_PROFILE_EMVCO 

EMVCo Profile.

PHAC_DISCLOOP_PROFILE_ISO 

ISO Profile.

PHAC_DISCLOOP_PROFILE_NFC_AND_ACTIVE 

NFC Forum and Active Profile.

§ phacDiscLoop_Sw_PollState

Discovery loop poll states to start with while in passive poll mode.


Use phacDiscLoop_SetConfig with PHAC_DISCLOOP_CONFIG_NEXT_POLL_STATE option to configure these states. Default discovery loop starts with PHAC_DISCLOOP_POLL_STATE_DETECTION in passive poll mode.

Enumerator
PHAC_DISCLOOP_POLL_STATE_UNKNOWN 

Unknown.

PHAC_DISCLOOP_POLL_STATE_DETECTION 

Starts passive poll mode in Technology Detection stage.

PHAC_DISCLOOP_POLL_STATE_COLLISION_RESOLUTION 

Starts passive poll mode in Collision Resolution stage.

PHAC_DISCLOOP_POLL_STATE_REMOVAL 

Starts passive poll mode in Card Removal stage (Only for EMVCo mode).

§ phacDiscLoop_Sw_EntryPoints

Discovery entry points.


This is an input parameter to phacDiscLoop_Run.

Enumerator
PHAC_DISCLOOP_ENTRY_POINT_POLL 

Starts discovery loop in poll mode.

PHAC_DISCLOOP_ENTRY_POINT_LISTEN 

Starts discovery loop in listen mode.

§ phacDiscLoop_Sw_NfcTech

Technology bit position / sequence.


Enumerator
PHAC_DISCLOOP_TECH_TYPE_A 

Type A bit position.

PHAC_DISCLOOP_TECH_TYPE_B 

Type B bit position.

PHAC_DISCLOOP_TECH_TYPE_F212 

Type F @ 212 kbps bit position.

PHAC_DISCLOOP_TECH_TYPE_F424 

Type F @ 424 kbps bit position.

PHAC_DISCLOOP_TECH_TYPE_V 

Type V bit position.

PHAC_DISCLOOP_TECH_TYPE_18000P3M3 

18000P3M3 bit position.

PHAC_DISCLOOP_TECH_TYPE_UNKNOWN 

Unknown.

Function Documentation

§ phacDiscLoop_Sw_Init()

phStatus_t phacDiscLoop_Sw_Init ( phacDiscLoop_Sw_DataParams_t pDataParams,
uint16_t  wSizeOfDataParams,
void *  pHalDataParams 
)

Initialize discovery loop.

This should be called before using any of the discovery loop functions to do the initialization of discovery loop component. This configures discovery loop with default configurations. Refer configuration options for supported configurations and their default values.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERInvalid option/response received.
otherOther Depending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to discovery loop parameter structure.
[in]wSizeOfDataParamsSpecifies the size of the discovery data parameter structure.
[in]pHalDataParamsPointer to HAL parameter structure.