NXP NFC Reader Library  v4.040.05.011646
MIFARE(R) Ultralight

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_SUCCESSOperation successful.
PH_ERR_AUTH_ERROROperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]wKeyNumberKey number to be used in authentication.
[in]wKeyVersionKey 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_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bAddressAddress on Picc to read from.
[out]pDatapData[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_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bSecNoSector 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_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bAddressAddress on Picc to write to.
[in]pDatapData[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_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bAddressAddress on Picc to write to.
[in]pDatapData[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_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bCntNumOne byte counter number 00 to 02
[in]pCntpCnt[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_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bCntNumOne byte counter number 00 to 02
[out]pCntValuepCntValue[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_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]pPwdFour byte array of type uint8_t containing four password bytes
[out]pPackTwo 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_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[out]pVersionAn 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_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bStartAddrOne byte start address
[in]bEndAddrOne byte end address
[out]pDataPointer to the data read from the card. The bytes are stored on the HAL's Rx buffer.
[out]wNumBytesContains 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_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bAddrValue is always 00. Present for forward compatibility reasons
[out]pSignaturePointer 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_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsPointer to this layer's parameter structure.
[in]bCntNumValue specifying the counter number 00 to 02
[out]pValidFlagAddress of one byte containing the valid flag byte