NXP NFC Reader Library v4.040.05.011646

Modules | Functions
MIFARE(R) Ultralight
Application Layer

These Components implement the MIFARE(R) Ultralight, C, Ultralight EV1 commands. More...

Collaboration diagram for MIFARE(R) Ultralight:

## Modules
| Component : Software

## Functions
phStatus_t | phalMful_UlcAuthenticate (void *pDataParams, uint16_t wKeyNumber, uint16_t wKeyVersion)
| Perform MIFARE(R) Ultralight-C Authenticate command with Picc. More...
phStatus_t | phalMful_Read (void *pDataParams, uint8_t bAddress, uint8_t *pData)
| Perform MIFARE(R) Ultralight Read command with Picc. More...
phStatus_t | phalMful_SectorSelect (void *pDataParams, uint8_t bSecNo)
| Perform Type 2 tag Sector Select command with Picc. More...
phStatus_t | phalMful_Write (void *pDataParams, uint8_t bAddress, uint8_t *pData)
| Perform MIFARE(R) Ultralight Write command with Picc. More...
phStatus_t | phalMful_CompatibilityWrite (void *pDataParams, uint8_t bAddress, uint8_t *pData)
| Perform MIFARE(R) Ultralight Compatibility-Write command with Picc. More...
phStatus_t | phalMful_IncrCnt (void *pDataParams, uint8_t bCntNum, uint8_t *pCnt)
| Perform MIFARE(R) Ultralight EV1 Increment count command with Picc. More...
phStatus_t | phalMful_ReadCnt (void *pDataParams, uint8_t bCntNum, uint8_t *pCntValue)
| Perform MIFARE(R) Ultralight EV1 Read count command with Picc. More...
phStatus_t | phalMful_PwdAuth (void *pDataParams, uint8_t *pPwd, uint8_t *pPack)
| Perform MIFARE(R) Ultralight EV1 Password auth command with Picc. More...
phStatus_t | phalMful_GetVersion (void *pDataParams, uint8_t *pVersion)
| Perform MIFARE(R) Ultralight EV1 get version command with Picc. More...
phStatus_t | phalMful_FastRead (void *pDataParams, uint8_t bStartAddr, uint8_t bEndAddr, uint8_t **pData, uint16_t *wNumBytes)
| Perform MIFARE(R) Ultralight EV1 Fast read command with Picc. More...
phStatus_t | phalMful_ReadSign (void *pDataParams, uint8_t bAddr, uint8_t **pSignature)
| Perform MIFARE(R) Ultralight EV1 read signature command with Picc. More...
phStatus_t | phalMful_ChkTearingEvent (void *pDataParams, uint8_t bCntNum, uint8_t *pValidFlag)
| Perform MIFARE(R) Ultralight EV1 check tearing event command with Picc. More...

## Block definitions
#define | PHAL_MFUL_READ_BLOCK_LENGTH 16U
| Length of a read MIFARE(R) Ultralight data block. More...
#define | PHAL_MFUL_WRITE_BLOCK_LENGTH 4U
| Length of a write MIFARE(R) Ultralight data block. More...
#define | PHAL_MFUL_COMPWRITE_BLOCK_LENGTH 16U
| Length of a compatibility write MIFARE(R) Ultralight data block. More...
#define | PHAL_MFUL_COUNTER_RD_VALUE_LENGTH 3U
| Length of a counter MIFARE(R) Ultralight Read data block. More...
#define | PHAL_MFUL_COUNTER_WR_VALUE_LENGTH 4U
| Length of a counter MIFARE(R) Ultralight Write data block. More...
#define | PHAL_MFUL_PACK_LENGTH 2U
| Length of a password ack MIFARE(R) Ultralight data block. More...
#define | PHAL_MFUL_VERSION_LENGTH 8U
| Length of a Version MIFARE(R) Ultralight data block. More...
#define | PHAL_MFUL_SIG_LENGTH 32U
| Length of a Version MIFARE(R) Ultralight data block. More...

## Crypto definitions
#define | PHAL_MFUL_DES_BLOCK_SIZE 8U
| Length of an MIFARE(R) Ultralight DES block. More...
#define | PHAL_MFUL_DES_KEY_LENGTH 16U
| Length of an MIFARE(R) Ultralight DES key. More...

## Detailed Description

These Components implement the MIFARE(R) Ultralight, C, Ultralight EV1 commands.

## Macro Definition Documentation

## § PHAL_MFUL_READ_BLOCK_LENGTH

#define PHAL_MFUL_READ_BLOCK_LENGTH 16U

Length of a read MIFARE(R) Ultralight data block.

## § PHAL_MFUL_WRITE_BLOCK_LENGTH

#define PHAL_MFUL_WRITE_BLOCK_LENGTH 4U

Length of a write MIFARE(R) Ultralight data block.

## § PHAL_MFUL_COMPWRITE_BLOCK_LENGTH

#define PHAL_MFUL_COMPWRITE_BLOCK_LENGTH 16U

Length of a compatibility write MIFARE(R) Ultralight data block.

## § PHAL_MFUL_COUNTER_RD_VALUE_LENGTH

#define PHAL_MFUL_COUNTER_RD_VALUE_LENGTH 3U

Length of a counter MIFARE(R) Ultralight Read data block.

## § PHAL_MFUL_COUNTER_WR_VALUE_LENGTH

#define PHAL_MFUL_COUNTER_WR_VALUE_LENGTH 4U

Length of a counter MIFARE(R) Ultralight Write data block.

## § PHAL_MFUL_PACK_LENGTH

#define PHAL_MFUL_PACK_LENGTH 2U

Length of a password ack MIFARE(R) Ultralight data block.

## § PHAL_MFUL_VERSION_LENGTH

#define PHAL_MFUL_VERSION_LENGTH 8U

Length of a Version MIFARE(R) Ultralight data block.

## § PHAL_MFUL_SIG_LENGTH

#define PHAL_MFUL_SIG_LENGTH 32U

Length of a Version MIFARE(R) Ultralight data block.

## § PHAL_MFUL_DES_BLOCK_SIZE

#define PHAL_MFUL_DES_BLOCK_SIZE 8U

Length of an MIFARE(R) Ultralight DES block.

## § PHAL_MFUL_DES_KEY_LENGTH

#define PHAL_MFUL_DES_KEY_LENGTH 16U

Length of an MIFARE(R) Ultralight DES key.

## Function Documentation

## § phalMful_UlcAuthenticate()

phStatus_t phalMful_UlcAuthenticate | ( | void * | pDataParams,
|  | uint16_t | wKeyNumber,
|  | uint16_t | wKeyVersion
| ) |  |

Perform MIFARE(R) Ultralight-C Authenticate command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_AUTH_ERROR | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | wKeyNumber | Key number to be used in authentication.
  [in] | wKeyVersion | Key version to be used in authentication.

## § phalMful_Read()

phStatus_t phalMful_Read | ( | void * | pDataParams,
|  | uint8_t | bAddress,
|  | uint8_t * | pData
| ) |  |

Perform MIFARE(R) Ultralight Read command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bAddress | Address on Picc to read from.
  [out] | pData | pData[PHAL_MFUL_READ_BLOCK_LENGTH] containing data returned from the Picc.

## § phalMful_SectorSelect()

phStatus_t phalMful_SectorSelect | ( | void * | pDataParams,
|  | uint8_t | bSecNo
| ) |  |

Perform Type 2 tag Sector Select command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bSecNo | Sector number to be selected.

## § phalMful_Write()

phStatus_t phalMful_Write | ( | void * | pDataParams,
|  | uint8_t | bAddress,
|  | uint8_t * | pData
| ) |  |

Perform MIFARE(R) Ultralight Write command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bAddress | Address on Picc to write to.
  [in] | pData | pData[PHAL_MFUL_WRITE_BLOCK_LENGTH] containing block to be written to the Picc.

## § phalMful_CompatibilityWrite()

phStatus_t phalMful_CompatibilityWrite | ( | void * | pDataParams,
|  | uint8_t | bAddress,
|  | uint8_t * | pData
| ) |  |

Perform MIFARE(R) Ultralight Compatibility-Write command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bAddress | Address on Picc to write to.
  [in] | pData | pData[PHAL_MFUL_COMPWRITE_BLOCK_LENGTH] containing block to be written to the Picc.

## § phalMful_IncrCnt()

phStatus_t phalMful_IncrCnt | ( | void * | pDataParams,
|  | uint8_t | bCntNum,
|  | uint8_t * | pCnt
| ) |  |

Perform MIFARE(R) Ultralight EV1 Increment count command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bCntNum | One byte counter number 00 to 02
  [in] | pCnt | pCnt[4] counter value LSB first. Only first three data bytes are used by the PICC. The 4th byte is ignored

## § phalMful_ReadCnt()

phStatus_t phalMful_ReadCnt | ( | void * | pDataParams,
|  | uint8_t | bCntNum,
|  | uint8_t * | pCntValue
| ) |  |

Perform MIFARE(R) Ultralight EV1 Read count command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bCntNum | One byte counter number 00 to 02
  [out] | pCntValue | pCntValue[3] counter value. LSB first. Three bytes counter value returned from PICC.

## § phalMful_PwdAuth()

phStatus_t phalMful_PwdAuth | ( | void * | pDataParams,
|  | uint8_t * | pPwd,
|  | uint8_t * | pPack
| ) |  |

Perform MIFARE(R) Ultralight EV1 Password auth command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | pPwd | Four byte array of type uint8_t containing four password bytes
  [out] | pPack | Two byte array of type uint8_t containing two password acknowledge bytes

## § phalMful_GetVersion()

phStatus_t phalMful_GetVersion | ( | void * | pDataParams,
|  | uint8_t * | pVersion
| ) |  |

Perform MIFARE(R) Ultralight EV1 get version command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [out] | pVersion | An eight byte array containing version information bytes

## § phalMful_FastRead()

phStatus_t phalMful_FastRead | ( | void * | pDataParams,
|  | uint8_t | bStartAddr,
|  | uint8_t | bEndAddr,
|  | uint8_t ** | pData,
|  | uint16_t * | wNumBytes
| ) |  |

Perform MIFARE(R) Ultralight EV1 Fast read command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bStartAddr | One byte start address
  [in] | bEndAddr | One byte end address
  [out] | pData | Pointer to the data read from the card. The bytes are stored on the HAL's Rx buffer.
  [out] | wNumBytes | Contains number of bytes read from the card

## § phalMful_ReadSign()

phStatus_t phalMful_ReadSign | ( | void * | pDataParams,
|  | uint8_t | bAddr,
|  | uint8_t ** | pSignature
| ) |  |

Perform MIFARE(R) Ultralight EV1 read signature command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bAddr | Value is always 00. Present for forward compatibility reasons
  [out] | pSignature | Pointer to a 32 byte signature read from the card

## § phalMful_ChkTearingEvent()

phStatus_t phalMful_ChkTearingEvent | ( | void * | pDataParams,
|  | uint8_t | bCntNum,
|  | uint8_t * | pValidFlag
| ) |  |

Perform MIFARE(R) Ultralight EV1 check tearing event command with Picc.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bCntNum | Value specifying the counter number 00 to 02
  [out] | pValidFlag | Address of one byte containing the valid flag byte