This is only a wrapper layer to abstract the different MIFARE Ultralight / NTAG implementations. With this wrapper it is possible to support more than one MIFARE Ultralight / NTAG implementation in parallel, by adapting this wrapper. More...

Modules | |
| Component : Software | |
| Software implementation of the MIFARE Ultralight / NTAG commands. Here the MIFARE Ultralight / NTAG commands are framed and exchanged to PICC. | |
| Component : Sam_NonX | |
| SAM NonX implementation of the MIFARE Ultralight / NTAG commands. Here the MIFARE Ultralight / NTAG commands are framed and exchanged to PICC. | |
| Component : Sam_X | |
| SAM X implementation of the MIFARE Ultralight / NTAG commands. Here the MIFARE Ultralight / NTAG commands are framed and exchanged to PICC. | |
| Defines | |
Functions | |
| phStatus_t | phalMful_UlcAuthenticate (void *pDataParams, uint8_t bOption, uint16_t wKeyNo, uint16_t wKeyVer, uint8_t *pDivInput, uint8_t bDivInputLen) |
| Perform MIFARE(R) Ultralight-C Authenticate command with PICC. More... | |
| phStatus_t | phalMful_AuthenticateAES (void *pDataParams, uint8_t bOption, uint16_t wKeyNo, uint16_t wKeyVer, uint8_t bRamKeyNo, uint8_t bRamKeyVer, uint8_t bKeyNoCard, uint8_t *pDivInput, uint8_t bDivLen) |
| Perform MIFARE(R) Ultralight / NTAG AES Authentication with PICC. More... | |
| phStatus_t | phalMful_Read (void *pDataParams, uint8_t bAddress, uint8_t *pData) |
| Perform MIFARE(R) Ultralight / NTAG Read command with PICC. More... | |
| phStatus_t | phalMful_Write (void *pDataParams, uint8_t bAddress, uint8_t *pData) |
| Perform MIFARE(R) Ultralight / NATG Write command with PICC. More... | |
| phStatus_t | phalMful_FastWrite (void *pDataParams, uint8_t *pData) |
| Perform NATG Fast Write command which writes 64 bytes from 0xF0 to 0xFF address blocks. More... | |
| phStatus_t | phalMful_CompatibilityWrite (void *pDataParams, uint8_t bAddress, uint8_t *pData) |
| Perform MIFARE(R) Ultralight / NATG Compatibility-Write command with PICC. More... | |
| phStatus_t | phalMful_IncrCnt (void *pDataParams, uint8_t bCntNum, uint8_t *pCnt) |
| Perform MIFARE(R) Ultralight Increment count command with PICC. More... | |
| phStatus_t | phalMful_ReadCnt (void *pDataParams, uint8_t bCntNum, uint8_t *pCntValue) |
| Perform MIFARE(R) Ultralight / NATG Read count command with PICC. More... | |
| phStatus_t | phalMful_PwdAuth (void *pDataParams, uint8_t bOption, uint8_t bKeyNo, uint8_t bKeyVer, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pPwd, uint8_t *pPack) |
| Perform MIFARE(R) Ultralight / NATG Password auth command with PICC. More... | |
| phStatus_t | phalMful_GetVersion (void *pDataParams, uint8_t *pVersion) |
| Perform MIFARE(R) Ultralight / NATG 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 / NATG Fast read command with PICC. More... | |
| phStatus_t | phalMful_SectorSelect (void *pDataParams, uint8_t bSecNo) |
| Perform NTAG Sector Select within PICC. More... | |
| phStatus_t | phalMful_ReadSign (void *pDataParams, uint8_t bAddr, uint8_t **pSignature) |
| Perform MIFARE(R) Ultralight / NATG 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... | |
| phStatus_t | phalMful_WriteSign (void *pDataParams, uint8_t bAddress, uint8_t *pSignature) |
| Perform MIFARE(R) Ultralight / NATG Write Signature command with PICC. More... | |
| phStatus_t | phalMful_LockSign (void *pDataParams, uint8_t bLockMode) |
| Perform MIFARE(R) Ultralight / NATG Lock Signature command with PICC. More... | |
| phStatus_t | phalMful_VirtualCardSelect (void *pDataParams, uint8_t *pVCIID, uint8_t bVCIIDLen, uint8_t *pVCTID) |
| Perform MIFARE(R) Ultralight Virtual Card Select command with PICC. More... | |
| phStatus_t | phalMful_ReadTTStatus (void *pDataParams, uint8_t bAddr, uint8_t *pData) |
| Perform NTAG Tag Temper Status Read. More... | |
| phStatus_t | phalMful_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue) |
| Perform a GetConfig command. More... | |
| phStatus_t | phalMful_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue) |
| Perform a SetConfig command. More... | |
| phStatus_t | phalMful_CalculateSunCMAC (void *pDataParams, uint16_t wKeyNo, uint16_t wKeyVer, uint8_t *pInData, uint16_t wInDataLen, uint8_t *pRespMac) |
| Calculate SUNCMAC. More... | |
This is only a wrapper layer to abstract the different MIFARE Ultralight / NTAG implementations. With this wrapper it is possible to support more than one MIFARE Ultralight / NTAG implementation in parallel, by adapting this wrapper.
| phStatus_t phalMful_UlcAuthenticate | ( | void * | pDataParams, |
| uint8_t | bOption, | ||
| uint16_t | wKeyNo, | ||
| uint16_t | wKeyVer, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInputLen | ||
| ) |
Perform MIFARE(R) Ultralight-C Authenticate command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_AUTH_ERROR | Authentication failure. |
| PH_ERR_PROTOCOL_ERROR | Unexpected PICC response length or unexpected first byte received from PICC. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bOption | [In] Option for specifying the diversification input. Only valid for Sam AV3 |
| [in] | wKeyNo | [In] Key number to be used in authentication. |
| [in] | wKeyVer | [In] Key version to be used in authentication. |
| [in] | pDivInput | [In] Diversification input for key diversification. (1 to 31 byte(s) input). |
| [in] | bDivInputLen | [In] Length of diversification input. |
| phStatus_t phalMful_AuthenticateAES | ( | void * | pDataParams, |
| uint8_t | bOption, | ||
| uint16_t | wKeyNo, | ||
| uint16_t | wKeyVer, | ||
| uint8_t | bRamKeyNo, | ||
| uint8_t | bRamKeyVer, | ||
| uint8_t | bKeyNoCard, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivLen | ||
| ) |
Perform MIFARE(R) Ultralight / NTAG AES Authentication with PICC.
This will be using the AES128 keys and will generate and verify the contents based on generic AES algorithm.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_AUTH_ERROR | Authentication failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bOption | [In] Option for specifying the diversification input. |
| [in] | wKeyNo | [In] Key number to be used in authentication. |
| [in] | wKeyVer | [In] Key version to be used in authentication. |
| [in] | bRamKeyNo | [In] Key number of Destination Key where the computed session key will be stored. To be used for SAM AV3 only. |
| [in] | bRamKeyVer | [In] Key version of Destination Key where the computed session key will be stored. To be used for SAM AV3 only. |
| [in] | bKeyNoCard | [In] Key number on card. |
| [in] | pDivInput | [In] Diversification input. Can be NULL. |
| [in] | bDivLen | [In] Length of diversification input max 31B. |
| phStatus_t phalMful_Read | ( | void * | pDataParams, |
| uint8_t | bAddress, | ||
| uint8_t * | pData | ||
| ) |
Perform MIFARE(R) Ultralight / NTAG Read command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bAddress | [In] Address on PICC to read from. |
| [out] | pData | [Out] pData[PHAL_MFUL_READ_BLOCK_LENGTH] containing data returned from the PICC. |
| phStatus_t phalMful_Write | ( | void * | pDataParams, |
| uint8_t | bAddress, | ||
| uint8_t * | pData | ||
| ) |
Perform MIFARE(R) Ultralight / NATG Write command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bAddress | [In] Address on PICC to write to. |
| [in] | pData | [In] pData[PHAL_MFUL_WRITE_BLOCK_LENGTH] containing block to be written to the PICC. |
| phStatus_t phalMful_FastWrite | ( | void * | pDataParams, |
| uint8_t * | pData | ||
| ) |
Perform NATG Fast Write command which writes 64 bytes from 0xF0 to 0xFF address blocks.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | pData | [In] Buffer containing the block data to be written to the PICC. |
| phStatus_t phalMful_CompatibilityWrite | ( | void * | pDataParams, |
| uint8_t | bAddress, | ||
| uint8_t * | pData | ||
| ) |
Perform MIFARE(R) Ultralight / NATG Compatibility-Write command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bAddress | [In] Address on PICC to write to. |
| [in] | pData | [In] pData[PHAL_MFUL_COMPWRITE_BLOCK_LENGTH] containing block to be written to the PICC. |
| phStatus_t phalMful_IncrCnt | ( | void * | pDataParams, |
| uint8_t | bCntNum, | ||
| uint8_t * | pCnt | ||
| ) |
Perform MIFARE(R) Ultralight Increment count command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bCntNum | [In] One byte counter number 00 to 02 |
| [in] | pCnt | [In] pCnt[4] counter value LSB first. Only first three data bytes are used by the PICC. The 4th byte is ignored |
| phStatus_t phalMful_ReadCnt | ( | void * | pDataParams, |
| uint8_t | bCntNum, | ||
| uint8_t * | pCntValue | ||
| ) |
Perform MIFARE(R) Ultralight / NATG Read count command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bCntNum | [In] One byte counter number 00 to 02 |
| [out] | pCntValue | [Out] pCntValue[3] counter value. LSB first. Three bytes counter value returned from PICC. |
| phStatus_t phalMful_PwdAuth | ( | void * | pDataParams, |
| uint8_t | bOption, | ||
| uint8_t | bKeyNo, | ||
| uint8_t | bKeyVer, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInputLen, | ||
| uint8_t * | pPwd, | ||
| uint8_t * | pPack | ||
| ) |
Perform MIFARE(R) Ultralight / NATG Password auth command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_AUTH_ERROR | Authentication failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bOption | [In] One of the below options should be used. This option byte is supported for Sam component only. |
| [in] | bKeyNo | [In] Key number to be used in Sam hardware. Only valid for Sam AV3 NonX and X mode. |
| [in] | bKeyVer | [In] Key version to be used in Sam hardware. Only valid for Sam AV3 NonX and X mode. |
| [in] | pDivInput | [In] Diversification input. Only valid for Sam AV3 NonX and X mode. |
| [in] | bDivInputLen | [In] Diversification input length. Only valid for Sam AV3 NonX and X mode. |
| [in] | pPwd | [In] Four byte array of type uint8_t containing four password bytes.
|
| [out] | pPack | [Out] Two byte array of type uint8_t containing two password acknowledge bytes For software and Sam AV3 NonX layer, the user will be provided with the Pack information returned by the card. |
| phStatus_t phalMful_GetVersion | ( | void * | pDataParams, |
| uint8_t * | pVersion | ||
| ) |
Perform MIFARE(R) Ultralight / NATG get version command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [out] | pVersion | [Out] An eight byte array containing version information bytes |
| phStatus_t phalMful_FastRead | ( | void * | pDataParams, |
| uint8_t | bStartAddr, | ||
| uint8_t | bEndAddr, | ||
| uint8_t ** | pData, | ||
| uint16_t * | wNumBytes | ||
| ) |
Perform MIFARE(R) Ultralight / NATG Fast read command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bStartAddr | [In] One byte start address |
| [in] | bEndAddr | [In] One byte end address |
| [out] | pData | [Out] Pointer to the data read from the card. The bytes are stored on the HAL's Rx buffer. |
| [out] | wNumBytes | [Out] Contains number of bytes read from the card |
| phStatus_t phalMful_SectorSelect | ( | void * | pDataParams, |
| uint8_t | bSecNo | ||
| ) |
Perform NTAG Sector Select within PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bSecNo | [In] The number of the sector to be selected. |
| phStatus_t phalMful_ReadSign | ( | void * | pDataParams, |
| uint8_t | bAddr, | ||
| uint8_t ** | pSignature | ||
| ) |
Perform MIFARE(R) Ultralight / NATG read signature command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bAddr | [In] Value is always 00. Present for forward compatibility reasons |
| [out] | pSignature | [Out] Pointer to a 32/48 byte signature read from the card |
| phStatus_t phalMful_ChkTearingEvent | ( | void * | pDataParams, |
| uint8_t | bCntNum, | ||
| uint8_t * | pValidFlag | ||
| ) |
Perform MIFARE(R) Ultralight EV1 check tearing event command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bCntNum | [In] Value specifying the counter number 00 to 02 |
| [out] | pValidFlag | [Out] Address of one byte containing the valid flag byte |
| phStatus_t phalMful_WriteSign | ( | void * | pDataParams, |
| uint8_t | bAddress, | ||
| uint8_t * | pSignature | ||
| ) |
Perform MIFARE(R) Ultralight / NATG Write Signature command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bAddress | [In] Relative page location of the signature part to be written. |
| [out] | pSignature | [Out] 4 bytes of signature value to be written to the specified relative page address. |
| phStatus_t phalMful_LockSign | ( | void * | pDataParams, |
| uint8_t | bLockMode | ||
| ) |
Perform MIFARE(R) Ultralight / NATG Lock Signature command with PICC.
This command locks the signature temporarily or permanently based on the information provided in the API. The locking and unlocking of the signature can be performed using this command if the signature is not locked or temporary locked. If the signature is permanently locked, then the unlocking cannot be done.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bLockMode | [In] Configuration to Lock, Unlock and Permanently Lock the signature data. |
| phStatus_t phalMful_VirtualCardSelect | ( | void * | pDataParams, |
| uint8_t * | pVCIID, | ||
| uint8_t | bVCIIDLen, | ||
| uint8_t * | pVCTID | ||
| ) |
Perform MIFARE(R) Ultralight Virtual Card Select command with PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | pVCIID | [In] The Virtual Card Installation Identifier data for selecting the VC. |
| [in] | bVCIIDLen | [In] Length of the VCIID data. |
| [out] | pVCTID | [Out] 1 byte of Virtual card type identifier data. |
| phStatus_t phalMful_ReadTTStatus | ( | void * | pDataParams, |
| uint8_t | bAddr, | ||
| uint8_t * | pData | ||
| ) |
Perform NTAG Tag Temper Status Read.
| PH_ERR_SUCCESS | Operation successful. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bAddr | [In] Value is always 00. Present for forward compatibility reason |
| [out] | pData | [Out] 5 bytes of Tag Temper Status. |
| phStatus_t phalMful_GetConfig | ( | void * | pDataParams, |
| uint16_t | wConfig, | ||
| uint16_t * | pValue | ||
| ) |
Perform a GetConfig command.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_UNSUPPORTED_PARAMETER | If the configuration identifier is not supported. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wConfig | [In] Configuration to get the status of CMAC inclusion in command / response. |
| [out] | pValue | [Out] The value for the mentioned configuration. |
| phStatus_t phalMful_SetConfig | ( | void * | pDataParams, |
| uint16_t | wConfig, | ||
| uint16_t | wValue | ||
| ) |
Perform a SetConfig command.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_UNSUPPORTED_PARAMETER | If the configuration identifier is not supported. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wConfig | [In] Configuration to set the status of CMAC inclusion in command / response. |
| [in] | wValue | [In] The value for the mentioned configuration. |
| phStatus_t phalMful_CalculateSunCMAC | ( | void * | pDataParams, |
| uint16_t | wKeyNo, | ||
| uint16_t | wKeyVer, | ||
| uint8_t * | pInData, | ||
| uint16_t | wInDataLen, | ||
| uint8_t * | pRespMac | ||
| ) |
Calculate SUNCMAC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | If DataParams is null. |
| PH_ERR_INVALID_PARAMETER | If the buffer is null. |
| PH_ERR_INTEGRITY_ERROR | CMAC verification failure. |
| XXXX |
|
| [in] | pDataParams | [In] Pointer to this layers parameter structure. |
| [in] | wKeyNo | [In] Key number to be used from software or hardware KeyStore. |
| [in] | wKeyVer | [In] Key version to be used from software or hardware KeyStore. |
| [in] | pInData | [In] Input Data for which the MAC to be calculated. |
| [in] | wInDataLen | [In] Length of bytes available in InData buffer. |
| [out] | pRespMac | [Out] Computed SUN CMAC. |