NXP NFC Reader Library
v4.040.05.011646
|
These Functions implement the MIFARE(R) Classic commands. More...
![]() |
Modules | |
Component : Software | |
Functions | |
phStatus_t | phalMfc_Authenticate (void *pDataParams, uint8_t bBlockNo, uint8_t bKeyType, uint16_t wKeyNumber, uint16_t wKeyVersion, uint8_t *pUid, uint8_t bUidLength) |
Perform MIFARE(R) Authenticate command with MIFARE Picc. More... | |
phStatus_t | phalMfc_Read (void *pDataParams, uint8_t bBlockNo, uint8_t *pBlockData) |
Perform MIFARE(R) Read command with MIFARE Picc. More... | |
phStatus_t | phalMfc_ReadValue (void *pDataParams, uint8_t bBlockNo, uint8_t *pValue, uint8_t *pAddrData) |
Perform MIFARE(R) Read Value command with MIFARE Picc. More... | |
phStatus_t | phalMfc_Write (void *pDataParams, uint8_t bBlockNo, uint8_t *pBlockData) |
Perform MIFARE(R) Write command with MIFARE Picc. More... | |
phStatus_t | phalMfc_WriteValue (void *pDataParams, uint8_t bBlockNo, uint8_t *pValue, uint8_t bAddrData) |
Perform MIFARE(R) Write Value command with MIFARE Picc. More... | |
phStatus_t | phalMfc_Increment (void *pDataParams, uint8_t bBlockNo, uint8_t *pValue) |
Perform MIFARE(R) Increment command with MIFARE Picc. More... | |
phStatus_t | phalMfc_Decrement (void *pDataParams, uint8_t bBlockNo, uint8_t *pValue) |
Perform MIFARE(R) Decrement command with MIFARE Picc. More... | |
phStatus_t | phalMfc_Transfer (void *pDataParams, uint8_t bBlockNo) |
Perform MIFARE(R) Transfer command with MIFARE Picc. More... | |
phStatus_t | phalMfc_Restore (void *pDataParams, uint8_t bBlockNo) |
Perform MIFARE(R) Restore command with MIFARE Picc. More... | |
phStatus_t | phalMfc_IncrementTransfer (void *pDataParams, uint8_t bSrcBlockNo, uint8_t bDstBlockNo, uint8_t *pValue) |
Perform MIFARE(R) Increment Transfer command sequence with MIFARE Picc. More... | |
phStatus_t | phalMfc_DecrementTransfer (void *pDataParams, uint8_t bSrcBlockNo, uint8_t bDstBlockNo, uint8_t *pValue) |
Perform MIFARE(R) Decrement Transfer command sequence with MIFARE Picc. More... | |
phStatus_t | phalMfc_RestoreTransfer (void *pDataParams, uint8_t bSrcBlockNo, uint8_t bDstBlockNo) |
Perform MIFARE(R) Restore Transfer command sequence with MIFARE Picc. More... | |
phStatus_t | phalMfc_PersonalizeUid (void *pDataParams, uint8_t bUidType) |
Perform MIFARE(R) Personalize UID usage command sequence with MIFARE Picc. More... | |
phStatus_t | phalMfc_GetVersion (void *pDataParams, uint8_t *pVersion) |
Perform MIFARE(R) GET VERSION usage command sequence with MIFARE Picc. More... | |
Authentication Parameters | |
#define | PHAL_MFC_KEYA 0x0AU |
MIFARE(R) Key A. More... | |
#define | PHAL_MFC_KEYB 0x0BU |
MIFARE(R) Key B. More... | |
Block definitions | |
#define | PHAL_MFC_DATA_BLOCK_LENGTH 16U |
Length of a MIFARE(R) Classic data block. More... | |
#define | PHAL_MFC_VALUE_BLOCK_LENGTH 4U |
Length of a MIFARE(R) Classic value block. More... | |
UID Type definitions | |
#define | PHAL_MFC_UID_TYPE_UIDF0 0x00U |
MIFARE(R) Classic UID type UIDF0. More... | |
#define | PHAL_MFC_UID_TYPE_UIDF1 0x40U |
MIFARE(R) Classic UID type UIDF1. More... | |
#define | PHAL_MFC_UID_TYPE_UIDF2 0x20U |
MIFARE(R) Classic UID type UIDF2. More... | |
#define | PHAL_MFC_UID_TYPE_UIDF3 0x60U |
MIFARE(R) Classic UID type UIDF3. More... | |
These Functions implement the MIFARE(R) Classic commands.
#define PHAL_MFC_KEYA 0x0AU |
MIFARE(R) Key A.
#define PHAL_MFC_KEYB 0x0BU |
MIFARE(R) Key B.
#define PHAL_MFC_DATA_BLOCK_LENGTH 16U |
Length of a MIFARE(R) Classic data block.
#define PHAL_MFC_VALUE_BLOCK_LENGTH 4U |
Length of a MIFARE(R) Classic value block.
#define PHAL_MFC_UID_TYPE_UIDF0 0x00U |
MIFARE(R) Classic UID type UIDF0.
#define PHAL_MFC_UID_TYPE_UIDF1 0x40U |
MIFARE(R) Classic UID type UIDF1.
#define PHAL_MFC_UID_TYPE_UIDF2 0x20U |
MIFARE(R) Classic UID type UIDF2.
#define PHAL_MFC_UID_TYPE_UIDF3 0x60U |
MIFARE(R) Classic UID type UIDF3.
phStatus_t phalMfc_Authenticate | ( | void * | pDataParams, |
uint8_t | bBlockNo, | ||
uint8_t | bKeyType, | ||
uint16_t | wKeyNumber, | ||
uint16_t | wKeyVersion, | ||
uint8_t * | pUid, | ||
uint8_t | bUidLength | ||
) |
Perform MIFARE(R) Authenticate command with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bBlockNo | Blocknumber on card to authenticate to. |
[in] | bKeyType | Either PHAL_MFC_KEYA or PHAL_MFC_KEYB. |
[in] | wKeyNumber | Key number to be used in authentication. |
[in] | wKeyVersion | Key version to be used in authentication. |
[in] | pUid | Complete serial number; uint8_t[4/7/10]. |
[in] | bUidLength | Length of provided serial number (4/7/10). |
Perform MIFARE(R) Read command with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bBlockNo | block number to be read. |
[out] | pBlockData | pBlockData[16] containing block read from the MIFARE(R) card |
phStatus_t phalMfc_ReadValue | ( | void * | pDataParams, |
uint8_t | bBlockNo, | ||
uint8_t * | pValue, | ||
uint8_t * | pAddrData | ||
) |
Perform MIFARE(R) Read Value command with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bBlockNo | block number to be read. |
[out] | pValue | pValue[4] containing value (LSB first) read from the MIFARE(R) card |
[out] | pAddrData | pAddrData containing address read from the MIFARE(R) card value block |
Perform MIFARE(R) Write command with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bBlockNo | block number to be written. |
[in] | pBlockData | pBlockData[16] containing block to be written to the MIFARE(R) card |
phStatus_t phalMfc_WriteValue | ( | void * | pDataParams, |
uint8_t | bBlockNo, | ||
uint8_t * | pValue, | ||
uint8_t | bAddrData | ||
) |
Perform MIFARE(R) Write Value command with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bBlockNo | block number to be written. |
[in] | pValue | pValue[4] containing value (LSB first) to be written to the MIFARE(R) card |
[in] | bAddrData | bAddrData containing address written to the MIFARE(R) card value block |
Perform MIFARE(R) Increment command with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bBlockNo | block number to be incremented. |
[in] | pValue | pValue[4] containing value (LSB first) to be incremented on the MIFARE(R) card |
Perform MIFARE(R) Decrement command with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bBlockNo | block number to be decremented. |
[in] | pValue | pValue[4] containing value (LSB first) to be decremented on the MIFARE(R) card |
phStatus_t phalMfc_Transfer | ( | void * | pDataParams, |
uint8_t | bBlockNo | ||
) |
Perform MIFARE(R) Transfer command with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bBlockNo | block number the transfer buffer shall be transferred to. |
phStatus_t phalMfc_Restore | ( | void * | pDataParams, |
uint8_t | bBlockNo | ||
) |
Perform MIFARE(R) Restore command with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bBlockNo | block number the transfer buffer shall be restored from. |
phStatus_t phalMfc_IncrementTransfer | ( | void * | pDataParams, |
uint8_t | bSrcBlockNo, | ||
uint8_t | bDstBlockNo, | ||
uint8_t * | pValue | ||
) |
Perform MIFARE(R) Increment Transfer command sequence with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bSrcBlockNo | block number to be incremented. |
[in] | bDstBlockNo | block number to be transferred to. |
[in] | pValue | pValue[4] containing value (LSB first) to be incremented on the MIFARE(R) card |
phStatus_t phalMfc_DecrementTransfer | ( | void * | pDataParams, |
uint8_t | bSrcBlockNo, | ||
uint8_t | bDstBlockNo, | ||
uint8_t * | pValue | ||
) |
Perform MIFARE(R) Decrement Transfer command sequence with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bSrcBlockNo | block number to be decremented. |
[in] | bDstBlockNo | block number to be transferred to. |
[in] | pValue | pValue[4] containing value (LSB first) to be decremented on the MIFARE(R) card |
Perform MIFARE(R) Restore Transfer command sequence with MIFARE Picc.
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bSrcBlockNo | block number to be decremented. |
[in] | bDstBlockNo | block number to be transferred to. |
phStatus_t phalMfc_PersonalizeUid | ( | void * | pDataParams, |
uint8_t | bUidType | ||
) |
Perform MIFARE(R) Personalize UID usage command sequence with MIFARE Picc.
UID type can be one of
PH_ERR_SUCCESS | Operation successful. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bUidType | UID type. |
phStatus_t phalMfc_GetVersion | ( | void * | pDataParams, |
uint8_t * | pVersion | ||
) |
Perform MIFARE(R) GET VERSION usage command sequence with MIFARE Picc.
GET_VERSION command is used to retrieve information about the NTAG family, the product version, storage size and other product data required to identify the specific NTAG-I2C
PH_ERR_SUCCESS | Operation successful. |
PH_ERR_PROTOCOL_ERROR | wrong Lenght byte received. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[out] | pVersion | Version no It should be PHAL_MFC_VERSION_LENGTH |