NXP NFC Reader Library
v4.040.05.011646
|
This component implements tools that are necessary for many different software modules. More...
![]() |
Data Structures | |
struct | phTools_Q |
Queue structure of Message Queue. More... | |
Typedefs | |
typedef struct phTools_Q | phTools_Q_t |
Queue structure of Message Queue. | |
Enumerations | |
enum | phTools_Q_Type_t { PH_TOOLS_Q_DATA_TO_BE_SENT = 0x01, PH_TOOLS_Q_RX_DATA } |
Type of Queue Message. More... | |
Functions | |
phStatus_t | phTools_EncodeParity (uint8_t bOption, uint8_t *pInBuffer, uint16_t wInBufferLength, uint8_t bInBufferBits, uint16_t wOutBufferSize, uint8_t *pOutBuffer, uint16_t *pOutBufferLength, uint8_t *pOutBufferBits) |
Calculate even or odd parity. More... | |
phStatus_t | phTools_DecodeParity (uint8_t bOption, uint8_t *pInBuffer, uint16_t wInBufferLength, uint8_t bInBufferBits, uint16_t wOutBufferSize, uint8_t *pOutBuffer, uint16_t *pOutBufferLength, uint8_t *pOutBufferBits) |
Verify and Remove even or odd parity. More... | |
phStatus_t | phTools_CalculateCrc5 (uint8_t bOption, uint8_t bPreset, uint8_t bPolynom, uint8_t *pData, uint16_t wDataLength, uint8_t *pCrc) |
Calculate a CRC 5. More... | |
phStatus_t | phTools_CalculateCrc8 (uint8_t bOption, uint8_t bPreset, uint8_t bPolynom, uint8_t *pData, uint16_t wDataLength, uint8_t *pCrc) |
Calculate a CRC 8. More... | |
phStatus_t | phTools_CalculateCrc16 (uint8_t bOption, uint16_t wPreset, uint16_t wPolynom, uint8_t *pData, uint16_t wDataLength, uint16_t *pCrc) |
Calculate a CRC 16. More... | |
phStatus_t | phTools_CalculateCrc32 (uint8_t bOption, uint32_t dwPreset, uint32_t dwPolynom, uint8_t *pData, uint16_t wDataLength, uint32_t *pCrc) |
Calculate a CRC 32. More... | |
phStatus_t | phTools_ComputeCrc_B (uint8_t *pData, uint32_t dwLength, uint8_t *pCrc) |
Calculate a CRC_B. More... | |
phStatus_t | phTools_GetVersion (uint8_t *pProductVer, uint16_t *pMajor, uint8_t *pMinor, uint16_t *pPatch_Dev, uint8_t *pVersionString, uint16_t *pVersionStringLen) |
The function gets the Version of the Firmware of DUT. More... | |
phStatus_t | phTools_Q_Init (void) |
To initialize the Queue manager. More... | |
phTools_Q_t * | phTools_Q_Get (uint32_t dwBlockTime, uint8_t bPriority) |
To get a empty Queue from a Free Pool. More... | |
phStatus_t | phTools_Q_Send (phTools_Q_t *psMsgQueue, uint32_t dwBlockTime, uint16_t wFrameOpt) |
Queue a message to last of the Message send queue list. More... | |
phStatus_t | phTools_Q_SendFront (phTools_Q_t *psMsgQueue, uint32_t dwBlockTime, uint16_t wFrameOpt) |
Queue a message to front of the Message send queue list. More... | |
phTools_Q_t * | phTools_Q_Receive (uint32_t dwBlockTime) |
To get a filled message queue from the send queue list. More... | |
phStatus_t | phTools_Q_Release (phTools_Q_t *psMsgQueue, uint32_t dwBlockTime) |
Returns a freed message queue back to the free message pool. More... | |
void | phTools_Q_DeInit (void) |
To release the memory resources used by the Message queue manager. | |
ToolsConfigs | |
#define | PH_TOOLS_CRC16_PRESET_ISO14443A 0x6363U |
CRC16 Preset for ISO14443-A. More... | |
#define | PH_TOOLS_CRC16_PRESET_ISO14443B 0xFFFFU |
CRC16 Preset for ISO14443-B. More... | |
#define | PH_TOOLS_CRC16_PRESET_FELICA 0x0000U |
CRC16 Preset for Felica. More... | |
#define | PH_TOOLS_CRC16_POLY_ISO14443 0x8408U |
CRC16 Polynom for ISO14443. More... | |
#define | PH_TOOLS_CRC32_PRESET_DF8 0xFFFFFFFFU |
CRC32 Preset for DesFire. More... | |
#define | PH_TOOLS_CRC32_POLY_DF8 0xEDB88320U |
CRC32 Polynom for DesFire. More... | |
#define | PH_TOOLS_CRC8_PRESET_EPC 0xFFU |
Preset value for EPC CRC-8 generation. More... | |
#define | PH_TOOLS_CRC8_PRESET_UID 0xFDU |
Preset value for UID CRC-8 generation. More... | |
#define | PH_TOOLS_CRC8_POLY_EPCUID 0x1DU |
Polynomial for EPC/UID CRC-8 generation: x^8 + x^4 + x^3 + x^2 + 1 (MSB first). More... | |
#define | PH_TOOLS_CRC16_PRESET_EPCUID 0xFFFFU |
Preset value for EPC/UID CRC-16 generation. More... | |
#define | PH_TOOLS_CRC16_POLY_EPCUID 0x1021U |
Polynomial for EPC/UID CRC-16 generation: x^16 + x^12 + x^5 + 1 (MSB first). More... | |
#define | PH_TOOLS_CRC5_PRESET_I18000P3 0x09U |
Preset value for ISO18000-3 CRC-5 generation. More... | |
#define | PH_TOOLS_CRC5_POLY_I18000P3 0x09U |
Polynomial for ISO18000-3 CRC-5 generation: x^5 + x^3 + 1 (LSB first). More... | |
#define | PH_TOOLS_CRC16_PRESET_I18000P3 0xFFFFU |
Preset value for ISO18000-3 CRC-16 generation. More... | |
#define | PH_TOOLS_CRC16_POLY_I18000P3 0x8408U |
Polynomial for ISO18000-3 CRC-16 generation: x^16 + x^12 + x^5 + 1 (LSB first). More... | |
#define | PH_TOOLS_CRC16_POLY_FELICA 0x1021U |
Polynomial for Felica CRC-16 generation: x^16 + x^12 + x^5 + 1 (MSB first). More... | |
#define | PH_TOOLS_PARITY_OPTION_EVEN 0x00U |
Encode/Decode even parity bits. More... | |
#define | PH_TOOLS_PARITY_OPTION_ODD 0x01U |
Encode/Decode odd parity bits. More... | |
#define | PH_TOOLS_CRC16_POLY_PN7462AU_TESTOS 0x1021U |
Polynomial for TestOS CRC-16 generation: x^16 + x^12 + x^5 + 1 (MSB first). More... | |
#define | PH_TOOLS_CRC_OPTION_DEFAULT 0x00U |
Default CRC operation. More... | |
#define | PH_TOOLS_CRC_OPTION_OUPUT_INVERTED 0x01U |
Inverts the bits after calculation. More... | |
#define | PH_TOOLS_CRC_OPTION_MSB_FIRST 0x02U |
Calculates CRC with MSB(it) first. More... | |
#define | PH_TOOLS_CRC_OPTION_BITWISE 0x04U |
Bitwise CRC, wDataLength represents the Bitlength. More... | |
#define | PH_TOOLS_CRC_OPTION_MASK 0x07U |
Mask of valid option bits. More... | |
This component implements tools that are necessary for many different software modules.
#define PH_TOOLS_CRC16_PRESET_ISO14443A 0x6363U |
CRC16 Preset for ISO14443-A.
#define PH_TOOLS_CRC16_PRESET_ISO14443B 0xFFFFU |
CRC16 Preset for ISO14443-B.
#define PH_TOOLS_CRC16_PRESET_FELICA 0x0000U |
CRC16 Preset for Felica.
#define PH_TOOLS_CRC16_POLY_ISO14443 0x8408U |
CRC16 Polynom for ISO14443.
#define PH_TOOLS_CRC32_PRESET_DF8 0xFFFFFFFFU |
CRC32 Preset for DesFire.
#define PH_TOOLS_CRC32_POLY_DF8 0xEDB88320U |
CRC32 Polynom for DesFire.
#define PH_TOOLS_CRC8_PRESET_EPC 0xFFU |
Preset value for EPC CRC-8 generation.
#define PH_TOOLS_CRC8_PRESET_UID 0xFDU |
Preset value for UID CRC-8 generation.
#define PH_TOOLS_CRC8_POLY_EPCUID 0x1DU |
Polynomial for EPC/UID CRC-8 generation: x^8 + x^4 + x^3 + x^2 + 1 (MSB first).
#define PH_TOOLS_CRC16_PRESET_EPCUID 0xFFFFU |
Preset value for EPC/UID CRC-16 generation.
#define PH_TOOLS_CRC16_POLY_EPCUID 0x1021U |
Polynomial for EPC/UID CRC-16 generation: x^16 + x^12 + x^5 + 1 (MSB first).
#define PH_TOOLS_CRC5_PRESET_I18000P3 0x09U |
Preset value for ISO18000-3 CRC-5 generation.
#define PH_TOOLS_CRC5_POLY_I18000P3 0x09U |
Polynomial for ISO18000-3 CRC-5 generation: x^5 + x^3 + 1 (LSB first).
#define PH_TOOLS_CRC16_PRESET_I18000P3 0xFFFFU |
Preset value for ISO18000-3 CRC-16 generation.
#define PH_TOOLS_CRC16_POLY_I18000P3 0x8408U |
Polynomial for ISO18000-3 CRC-16 generation: x^16 + x^12 + x^5 + 1 (LSB first).
#define PH_TOOLS_CRC16_POLY_FELICA 0x1021U |
Polynomial for Felica CRC-16 generation: x^16 + x^12 + x^5 + 1 (MSB first).
#define PH_TOOLS_PARITY_OPTION_EVEN 0x00U |
Encode/Decode even parity bits.
#define PH_TOOLS_PARITY_OPTION_ODD 0x01U |
Encode/Decode odd parity bits.
#define PH_TOOLS_CRC16_POLY_PN7462AU_TESTOS 0x1021U |
Polynomial for TestOS CRC-16 generation: x^16 + x^12 + x^5 + 1 (MSB first).
#define PH_TOOLS_CRC_OPTION_DEFAULT 0x00U |
Default CRC operation.
#define PH_TOOLS_CRC_OPTION_OUPUT_INVERTED 0x01U |
Inverts the bits after calculation.
#define PH_TOOLS_CRC_OPTION_MSB_FIRST 0x02U |
Calculates CRC with MSB(it) first.
#define PH_TOOLS_CRC_OPTION_BITWISE 0x04U |
Bitwise CRC, wDataLength
represents the Bitlength.
#define PH_TOOLS_CRC_OPTION_MASK 0x07U |
Mask of valid option bits.
enum phTools_Q_Type_t |
phStatus_t phTools_EncodeParity | ( | uint8_t | bOption, |
uint8_t * | pInBuffer, | ||
uint16_t | wInBufferLength, | ||
uint8_t | bInBufferBits, | ||
uint16_t | wOutBufferSize, | ||
uint8_t * | pOutBuffer, | ||
uint16_t * | pOutBufferLength, | ||
uint8_t * | pOutBufferBits | ||
) |
Calculate even or odd parity.
PH_ERR_SUCCESS | Operation successful. |
[in] | bOption | Parity option; e.g. PH_TOOLS_PARITY_OPTION_EVEN. |
[in] | pInBuffer | Array to input data. |
[in] | wInBufferLength | Length of input data in bytes. |
[in] | bInBufferBits | Number of valid bits in last byte of pInBuffer. |
[in] | wOutBufferSize | Size of the output buffer. |
[out] | pOutBuffer | Output buffer. |
[out] | pOutBufferLength | Number of valid bytes in pOutBuffer. |
[out] | pOutBufferBits | Number of valid bits in last byte of pOutBuffer. |
phStatus_t phTools_DecodeParity | ( | uint8_t | bOption, |
uint8_t * | pInBuffer, | ||
uint16_t | wInBufferLength, | ||
uint8_t | bInBufferBits, | ||
uint16_t | wOutBufferSize, | ||
uint8_t * | pOutBuffer, | ||
uint16_t * | pOutBufferLength, | ||
uint8_t * | pOutBufferBits | ||
) |
Verify and Remove even or odd parity.
PH_ERR_SUCCESS | Operation successful. |
[in] | bOption | Parity option; e.g. PH_TOOLS_PARITY_OPTION_EVEN. |
[in] | pInBuffer | Array to input data. |
[in] | wInBufferLength | Length of input data in bytes. |
[in] | bInBufferBits | Number of valid bits in last byte of pInBuffer. |
[in] | wOutBufferSize | Size of the output buffer. |
[out] | pOutBuffer | Output buffer. |
[out] | pOutBufferLength | Number of valid bytes in pOutBuffer. |
[out] | pOutBufferBits | Number of valid bits in last byte of pOutBuffer. |
phStatus_t phTools_CalculateCrc5 | ( | uint8_t | bOption, |
uint8_t | bPreset, | ||
uint8_t | bPolynom, | ||
uint8_t * | pData, | ||
uint16_t | wDataLength, | ||
uint8_t * | pCrc | ||
) |
Calculate a CRC 5.
PH_ERR_SUCCESS | Operation successful. |
[in] | bOption | Specifies whether the output should be inverted or not. |
[in] | bPreset | Preset used for CRC calculation, e.g. PH_TOOLS_CRC5_PRESET_I18000P3. |
[in] | bPolynom | Polynom used for reduction, e.g. PH_TOOLS_CRC5_POLY_I18000P3. |
[in] | pData | Array to input data. |
[in] | wDataLength | Length of input data. |
[out] | pCrc | Resulting CRC. |
phStatus_t phTools_CalculateCrc8 | ( | uint8_t | bOption, |
uint8_t | bPreset, | ||
uint8_t | bPolynom, | ||
uint8_t * | pData, | ||
uint16_t | wDataLength, | ||
uint8_t * | pCrc | ||
) |
Calculate a CRC 8.
PH_ERR_SUCCESS | Operation successful. |
[in] | bOption | Specifies whether the output should be inverted or not. |
[in] | bPreset | Preset used for CRC calculation, e.g. PH_TOOLS_CRC8_PRESET_UID. |
[in] | bPolynom | Polynom used for reduction, e.g. PH_TOOLS_CRC8_POLY_EPCUID. |
[in] | pData | Array to input data. |
[in] | wDataLength | Length of input data. |
[out] | pCrc | Resulting CRC. |
phStatus_t phTools_CalculateCrc16 | ( | uint8_t | bOption, |
uint16_t | wPreset, | ||
uint16_t | wPolynom, | ||
uint8_t * | pData, | ||
uint16_t | wDataLength, | ||
uint16_t * | pCrc | ||
) |
Calculate a CRC 16.
PH_ERR_SUCCESS | Operation successful. |
[in] | bOption | Specifies whether the output should be inverted or not. |
[in] | wPreset | Preset used for CRC calculation, e.g. PH_TOOLS_CRC16_PRESET_ISO14443A. |
[in] | wPolynom | Polynom used for reduction, e.g. PH_TOOLS_CRC16_POLY_ISO14443. |
[in] | pData | Array to input data. |
[in] | wDataLength | Length of input data. |
[out] | pCrc | Resulting CRC. |
phStatus_t phTools_CalculateCrc32 | ( | uint8_t | bOption, |
uint32_t | dwPreset, | ||
uint32_t | dwPolynom, | ||
uint8_t * | pData, | ||
uint16_t | wDataLength, | ||
uint32_t * | pCrc | ||
) |
Calculate a CRC 32.
PH_ERR_SUCCESS | Operation successful. |
[in] | bOption | Specifies whether the output should be inverted or not. |
[in] | dwPreset | Preset used for CRC calculation, e.g. PH_TOOLS_CRC32_PRESET_DF8. |
[in] | dwPolynom | Polynom used for reduction, e.g. PH_TOOLS_CRC32_POLY_DF8. |
[in] | pData | Array to input data. |
[in] | wDataLength | Length of input data. |
[out] | pCrc | Resulting CRC. |
Calculate a CRC_B.
PH_ERR_SUCCESS | Operation successful. |
[in] | pData | Array to input data. |
[in] | dwLength | Length of input data. |
[out] | pCrc | Resulting Two byte CRC. |
phStatus_t phTools_GetVersion | ( | uint8_t * | pProductVer, |
uint16_t * | pMajor, | ||
uint8_t * | pMinor, | ||
uint16_t * | pPatch_Dev, | ||
uint8_t * | pVersionString, | ||
uint16_t * | pVersionStringLen | ||
) |
The function gets the Version of the Firmware of DUT.
PH_ERR_SUCCESS | Command successfully executed. |
PH_ERR_PROTOCOL_ERROR | Invalid frame or unexpected receive data length or command code mismatch. |
[out] | pProductVer | Product Version. |
[out] | pMajor | Major Version. |
[out] | pMinor | Minor Version. |
[out] | pPatch_Dev | Development/Patch Version. |
[out] | pVersionString | Version String. |
[out] | pVersionStringLen | Version String Length. |
phStatus_t phTools_Q_Init | ( | void | ) |
To initialize the Queue manager.
PH_ERR_SUCCESS | Operation successful. |
PH_ERR_RESOURCE_ERROR | Message Queue is unavailable or OSAL returned error. |
phTools_Q_t* phTools_Q_Get | ( | uint32_t | dwBlockTime, |
uint8_t | bPriority | ||
) |
To get a empty Queue from a Free Pool.
Returns a pointer to an empty Queue if available or returns NULL.
bPriority can be one of:
PH_ERR_SUCCESS | Operation successful. |
PH_ERR_RESOURCE_ERROR | OSAL returned error. |
[in] | dwBlockTime | The time in ticks to wait for a empty Queue to become available. |
[in] | bPriority | Used to indicate if Queue is required by high priority thread or not. |
phStatus_t phTools_Q_Send | ( | phTools_Q_t * | psMsgQueue, |
uint32_t | dwBlockTime, | ||
uint16_t | wFrameOpt | ||
) |
Queue a message to last of the Message send queue list.
wFrameOpt can be one of:
wFrameOpt can be combined with:
PH_ERR_SUCCESS | Operation successful. |
PH_ERR_RESOURCE_ERROR | OSAL returned error. |
[in] | psMsgQueue | Pointer to the Message Queue to be Queued. |
[in] | dwBlockTime | The time in ticks to wait for a empty Queue to become available. |
[in] | wFrameOpt | MAC/HAL Buffering option. |
phStatus_t phTools_Q_SendFront | ( | phTools_Q_t * | psMsgQueue, |
uint32_t | dwBlockTime, | ||
uint16_t | wFrameOpt | ||
) |
Queue a message to front of the Message send queue list.
wFrameOpt can be one of:
wFrameOpt can be combined with:
PH_ERR_SUCCESS | Operation successful. |
PH_ERR_RESOURCE_ERROR | OSAL returned error. |
[in] | psMsgQueue | Pointer to the Message Queue to be Queued. |
[in] | dwBlockTime | The time in ticks to wait for a empty Queue to become available. |
[in] | wFrameOpt | MAC/HAL Buffering option. |
phTools_Q_t* phTools_Q_Receive | ( | uint32_t | dwBlockTime | ) |
To get a filled message queue from the send queue list.
Usually used by the Message Queue Manager to retrieve the queued messages waiting to be processed.
[in] | dwBlockTime | The time in ticks to wait for a empty Queue to become available. |
phStatus_t phTools_Q_Release | ( | phTools_Q_t * | psMsgQueue, |
uint32_t | dwBlockTime | ||
) |
Returns a freed message queue back to the free message pool.
Usually used by the Message Queue Manager to return the queue to the Free pool.
PH_ERR_SUCCESS | Operation successful. |
PH_ERR_RESOURCE_ERROR | OSAL returned error. |
[in] | psMsgQueue | Pointer to the Message Queue to be Queued. |
[in] | dwBlockTime | The time in ticks to wait for a empty Queue to become available. |