NXP NFC Reader Library  v4.040.05.011646

These Components implement the MIFARE(R) Classic, MIFARE(R) Ultralight, MIFARE(R) DESFire and MIFARE(R) Plus products. More...

Collaboration diagram for MIFARE(R):

Modules

 Component : Software
 
 PhpalMifare_Stub
 

Functions

phStatus_t phpalMifare_ExchangeL3 (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Perform ISO14443-3 Data Exchange with MIFARE Picc. More...
 
phStatus_t phpalMifare_ExchangeL4 (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Perform ISO14443-4 Data Exchange with MIFARE Picc. More...
 
phStatus_t phpalMifare_ExchangePc (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Perform Proximity-Check Data Exchange with MIFARE Picc. More...
 
phStatus_t phpalMifare_ExchangeRaw (void *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint16_t wTxLength, uint8_t bTxLastBits, uint8_t **ppRxBuffer, uint16_t *pRxLength, uint8_t *pRxLastBits)
 Perform Raw (No CRC, No Parity) Data Exchange with MIFARE Picc. More...
 
phStatus_t phpalMifare_MfcAuthenticateKeyNo (void *pDataParams, uint8_t bBlockNo, uint8_t bKeyType, uint16_t wKeyNo, uint16_t wKeyVersion, uint8_t *pUid)
 Perform MIFARE(R) Authenticate command with Picc using a key number. More...
 
phStatus_t phpalMifare_MfcAuthenticate (void *pDataParams, uint8_t bBlockNo, uint8_t bKeyType, uint8_t *pKey, uint8_t *pUid)
 Perform MIFARE(R) Authenticate command with Picc using a key. More...
 
phStatus_t phpalMifare_SetMinFdtPc (void *pDataParams, uint16_t wValue)
 Perform Setting min FDT for Proximity check. More...
 

Authenticate Options

#define PHPAL_MIFARE_KEYA   0x0AU
 MIFARE Classic Key Type A. More...
 
#define PHPAL_MIFARE_KEYB   0x0BU
 MIFARE Classic Key Type B. More...
 
#define PHPAL_MIFARE_KEY_LENGTH   0x06U
 Length of a MIFARE Classic key (for completeness). More...
 

Detailed Description

These Components implement the MIFARE(R) Classic, MIFARE(R) Ultralight, MIFARE(R) DESFire and MIFARE(R) Plus products.

Macro Definition Documentation

§ PHPAL_MIFARE_KEYA

#define PHPAL_MIFARE_KEYA   0x0AU

MIFARE Classic Key Type A.

§ PHPAL_MIFARE_KEYB

#define PHPAL_MIFARE_KEYB   0x0BU

MIFARE Classic Key Type B.

§ PHPAL_MIFARE_KEY_LENGTH

#define PHPAL_MIFARE_KEY_LENGTH   0x06U

Length of a MIFARE Classic key (for completeness).

Function Documentation

§ phpalMifare_ExchangeL3()

phStatus_t phpalMifare_ExchangeL3 ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Perform ISO14443-3 Data Exchange with MIFARE Picc.

wOption can be one of:

Alternatively, the following bits can be combined:

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wOptionOption parameter.
[in]pTxBufferData to transmit.
[in]wTxLengthLength of data to transmit.
[out]ppRxBufferPointer to received data.
[out]pRxLengthnumber of received data bytes.

§ phpalMifare_ExchangeL4()

phStatus_t phpalMifare_ExchangeL4 ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Perform ISO14443-4 Data Exchange with MIFARE Picc.

wOption can be one of:

Additionally, the following options are also available:

Alternatively to the FIRST/CONT/LAST options, the following bits can be combined:

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wOptionOption parameter.
[in]pTxBufferData to transmit.
[in]wTxLengthLength of data to transmit.
[out]ppRxBufferPointer to received data.
[out]pRxLengthnumber of received data bytes.

§ phpalMifare_ExchangePc()

phStatus_t phpalMifare_ExchangePc ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Perform Proximity-Check Data Exchange with MIFARE Picc.

Note: The wOption parameter is currently RFU.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wOptionOption parameter.
[in]pTxBufferData to transmit.
[in]wTxLengthLength of data to transmit.
[out]ppRxBufferPointer to received data.
[out]pRxLengthnumber of received data bytes.

§ phpalMifare_ExchangeRaw()

phStatus_t phpalMifare_ExchangeRaw ( void *  pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint16_t  wTxLength,
uint8_t  bTxLastBits,
uint8_t **  ppRxBuffer,
uint16_t pRxLength,
uint8_t pRxLastBits 
)

Perform Raw (No CRC, No Parity) Data Exchange with MIFARE Picc.

wOption can be one of:

Alternatively, the following bits can be combined:

In Sam non X configuration, wOption can be combined with the following options to instruct Sam to not do enciphering and/or deciphering.

  • #PHHAL_HW_SAMAV2_EXCHANGE_NO_ENCIPHERING_BIT
  • #PHHAL_HW_SAMAV2_EXCHANGE_NO_DECIPHERING_BIT
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wOptionOption parameter.
[in]pTxBufferData to transmit.
[in]wTxLengthLength of input data.
[in]bTxLastBitsNumber of valid bits of last byte (Tx).
[out]ppRxBufferPointer to received data.
[out]pRxLengthNumber of received data bytes including incomplete byte.
[out]pRxLastBitsNumber of valid bits of last byte (Rx).

§ phpalMifare_MfcAuthenticateKeyNo()

phStatus_t phpalMifare_MfcAuthenticateKeyNo ( void *  pDataParams,
uint8_t  bBlockNo,
uint8_t  bKeyType,
uint16_t  wKeyNo,
uint16_t  wKeyVersion,
uint8_t pUid 
)

Perform MIFARE(R) Authenticate command with Picc using a key number.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_IO_TIMEOUTError in authentication.
PH_ERR_AUTH_ERRORError in authentication.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bBlockNoBlock-Number on card to authenticate to.
[in]bKeyTypeEither PHPAL_MIFARE_KEYA or PHPAL_MIFARE_KEYB
[in]wKeyNoKey number to be used in authentication.
[in]wKeyVersionKey version to be used in authentication.
[in]pUidSerial number of current cascade level; uint8_t[4].

§ phpalMifare_MfcAuthenticate()

phStatus_t phpalMifare_MfcAuthenticate ( void *  pDataParams,
uint8_t  bBlockNo,
uint8_t  bKeyType,
uint8_t pKey,
uint8_t pUid 
)

Perform MIFARE(R) Authenticate command with Picc using a key.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_IO_TIMEOUTError in authentication.
PH_ERR_AUTH_ERRORError in authentication.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bBlockNoBlock-Number on card to authenticate to.
[in]bKeyTypeEither PHPAL_MIFARE_KEYA or PHPAL_MIFARE_KEYB
[in]pKeyKey to be used in authentication.
[in]pUidSerial number of current cascade level; uint8_t[4].

§ phpalMifare_SetMinFdtPc()

phStatus_t phpalMifare_SetMinFdtPc ( void *  pDataParams,
uint16_t  wValue 
)

Perform Setting min FDT for Proximity check.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_IO_TIMEOUTError in authentication.
PH_ERR_AUTH_ERRORError in authentication.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wValueOption parameter. '1' for setting '0' for resetting