NXP Reader Library  v17.1.0.2535

SAM commands used for DESFire and ULC card communication in X-Mode. More...

Collaboration diagram for DESFire and ULC in X-Mode:

Macros

#define PHHAL_HW_SAMAV2_CMD_DESFIRE_AUTH_PICC_MIN_DATA_LENGTH   0x03
 Minimum CMD length of DESFIRE_AuythenticatePICC command.
 
#define PHHAL_HW_SAMAV2_CMD_DESFIRE_CHANGE_KEY_MIN_DATA_LENGTH   0x04
 Minimum CMD length of DESFIRE_ChangeKey command.
 
#define PHHAL_HW_SAMAV2_CMD_DESFIRE_READ_X_MIN_DATA_LENGTH   0x03
 Minimum CMD length of DESFIRE_ReadX command.
 
#define PHHAL_HW_SAMAV2_CMD_ULC_AUTH_PICC_MIN_DATA_LENGTH   0x02
 Minimum CMD length of ULC_AuthenticatePICC command.
 

Functions

phStatus_t phhalHw_SamAV2_Cmd_DESFireAuthenticatePICC (phhalHw_SamAV2_DataParams_t *pDataParams, uint8_t bAuthMode, uint8_t bISOMode, uint8_t bDFKeyNo, uint8_t bKeyNo, uint8_t bKeyV, uint8_t *pDivInput, uint8_t bDivInputLength)
 Perform an authentication procedure between SAM and DESFire. More...
 
phStatus_t phhalHw_SamAV2_Cmd_DESFireChangeKeyPICC (phhalHw_SamAV2_DataParams_t *pDataParams, uint8_t bKeyCompMeth, uint8_t bCfg, uint8_t bKeyNoCurrent, uint8_t bKeyVCurrent, uint8_t bKeyNoNew, uint8_t bKeyVNew, uint8_t *pDivInput, uint8_t bDivInputLength)
 Change a key of a DESFire PICC. More...
 
phStatus_t phhalHw_SamAV2_Cmd_DESFireWriteX (phhalHw_SamAV2_DataParams_t *pDataParams, uint16_t wOption, uint8_t bCrypto, uint8_t *pData, uint8_t bDataLength)
 Write data to a DESFire encrypted or MACed. More...
 
phStatus_t phhalHw_SamAV2_Cmd_DESFireReadX (phhalHw_SamAV2_DataParams_t *pDataParams, uint16_t wOption, uint8_t bCrypto, uint8_t *pData, uint8_t bDataLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Read data from a DESFire encrypted or MACed. More...
 
phStatus_t phhalHw_SamAV2_Cmd_ULCAuthenticatePICC (phhalHw_SamAV2_DataParams_t *pDataParams, uint8_t bKeyNo, uint8_t bKeyV, uint8_t *pDivInput, uint8_t bDivInputLength)
 Perform an authentication procedure between SAM and ULC. More...
 

Sam AV2 command code for MIFARE DESFire and ULC X mode feature.

#define PHHAL_HW_SAMAV2_CMD_DESFIRE_AUTH_PICC_INS   0xDA
 CMD Byte for DESFIRE_AuthenticatePICC command.
 
#define PHHAL_HW_SAMAV2_CMD_DESFIRE_CHANGE_KEY_INS   0xDE
 CMD Byte for DESFIRE_ChangeKey command.
 
#define PHHAL_HW_SAMAV2_CMD_DESFIRE_WRITE_X_INS   0xD3
 CMD Byte for DESFIRE_WriteX command.
 
#define PHHAL_HW_SAMAV2_CMD_DESFIRE_READ_X_INS   0xD2
 CMD Byte for DESFIRE_ReadX command.
 
#define PHHAL_HW_SAMAV2_CMD_ULC_AUTH_PICC_INS   0x2C
 CMD Byte for ULC_AuthenticatePICC command.
 

Detailed Description

SAM commands used for DESFire and ULC card communication in X-Mode.

Function Documentation

◆ phhalHw_SamAV2_Cmd_DESFireAuthenticatePICC()

phStatus_t phhalHw_SamAV2_Cmd_DESFireAuthenticatePICC ( phhalHw_SamAV2_DataParams_t pDataParams,
uint8_t  bAuthMode,
uint8_t  bISOMode,
uint8_t  bDFKeyNo,
uint8_t  bKeyNo,
uint8_t  bKeyV,
uint8_t pDivInput,
uint8_t  bDivInputLength 
)

Perform an authentication procedure between SAM and DESFire.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bAuthMode[In] Authentication mode to be used.
[in]bISOMode[In] ISO mode to be used.
[in]bDFKeyNo[In] DESFire key number.
[in]bKeyNo[In] Key reference number.
[in]bKeyV[In] Key version.
[in]pDivInput[In] Diversification data. This buffer has to be bDivInputLength bytes long.
[in]bDivInputLength[In] Diversification data length. If set to 00h no diversification is used.

◆ phhalHw_SamAV2_Cmd_DESFireChangeKeyPICC()

phStatus_t phhalHw_SamAV2_Cmd_DESFireChangeKeyPICC ( phhalHw_SamAV2_DataParams_t pDataParams,
uint8_t  bKeyCompMeth,
uint8_t  bCfg,
uint8_t  bKeyNoCurrent,
uint8_t  bKeyVCurrent,
uint8_t  bKeyNoNew,
uint8_t  bKeyVNew,
uint8_t pDivInput,
uint8_t  bDivInputLength 
)

Change a key of a DESFire PICC.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bKeyCompMeth[In] Bit mask defining the key compilation method.
[in]bCfg[In] Bit mask defining the change key configuration.
[in]bKeyNoCurrent[In] Current Key Number.
[in]bKeyVCurrent[In] Current Key Version.
[in]bKeyNoNew[In] New Key Number.
[in]bKeyVNew[In] New Key Version.
[in]pDivInput[In] Diversification data. This buffer has to be bDivInputLength bytes long.
[in]bDivInputLength[In] Diversification data length. If set to 00h no diversification is used.

◆ phhalHw_SamAV2_Cmd_DESFireWriteX()

phStatus_t phhalHw_SamAV2_Cmd_DESFireWriteX ( phhalHw_SamAV2_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t  bCrypto,
uint8_t pData,
uint8_t  bDataLength 
)

Write data to a DESFire encrypted or MACed.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter:
[in]bCrypto[In] Crypto mode.
[in]pData[In] Data to be written. This buffer has to be bDataLen bytes long.
[in]bDataLength[In] Data length.

◆ phhalHw_SamAV2_Cmd_DESFireReadX()

phStatus_t phhalHw_SamAV2_Cmd_DESFireReadX ( phhalHw_SamAV2_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t  bCrypto,
uint8_t pData,
uint8_t  bDataLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Read data from a DESFire encrypted or MACed.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter:
[in]bCrypto[In] Crypto mode.
[in]pData[In] Data to send to DESFire.
[in]bDataLength[In] Data length.
[out]ppRxBuffer[Out] Pointer to the received data.
[out]pRxLength[Out] Amount of valid bytes in the received data buffer.

◆ phhalHw_SamAV2_Cmd_ULCAuthenticatePICC()

phStatus_t phhalHw_SamAV2_Cmd_ULCAuthenticatePICC ( phhalHw_SamAV2_DataParams_t pDataParams,
uint8_t  bKeyNo,
uint8_t  bKeyV,
uint8_t pDivInput,
uint8_t  bDivInputLength 
)

Perform an authentication procedure between SAM and ULC.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bKeyNo[In] Key reference number to be used in authentication.
[in]bKeyV[In] Key version to be used in authentication.
[in]pDivInput[In] Diversification data. This buffer has to be bDivInputLength bytes long.
[in]bDivInputLength[In] Diversification data length. If set to 00h no diversification is used.