NXP NFC Reader Library
v4.040.05.011646
|
Internal definitions. More...
![]() |
Macros | |
#define | PHHAL_HW_RC523_TIMER_FREQ 13.56f |
RC internal timer frequency. More... | |
#define | PHHAL_HW_RC523_TIMER_MAX_VALUE_US 39586813 |
RC maximum timer value in microseconds. More... | |
#define | PHHAL_HW_RC523_TIMER_SHIFT 4.8f |
Shift of the internal RC timer in ETUs. More... | |
#define | PHHAL_HW_RC523_ETU_106 9.44f |
Duration of one ETU at 106 kBit/s in [us]. More... | |
#define | PHHAL_HW_RC523_ETU_212 4.7f |
Duration of one ETU at 212 kBit/s in [us]. More... | |
#define | PHHAL_HW_RC523_ETU_424 2.4f |
Duration of one ETU at 424 kBit/s in [us]. More... | |
#define | PHHAL_HW_RC523_ETU_848 1.2f |
Duration of one ETU at 848 kBit/s in [us]. More... | |
#define | PHHAL_HW_RC523_REQC_MIN_LEN 19U |
Minimum length of valid ReqC response when multiple reception is enable. More... | |
#define | PHHAL_HW_RC523_MFC_AUTHA_CMD 0x60U |
MIFARE(R) Classic AUTHA command code. More... | |
#define | PHHAL_HW_RC523_MFC_AUTHB_CMD 0x61U |
MIFARE(R) Classic AUTHB command code. More... | |
Functions | |
phStatus_t | phhalHw_Rc523_WriteFifo (phhalHw_Rc523_DataParams_t *pDataParams, uint8_t *pData, uint16_t wLength, uint16_t *pBytesWritten) |
Write Data to Fifo buffer. More... | |
phStatus_t | phhalHw_Rc523_ReadFifo (phhalHw_Rc523_DataParams_t *pDataParams, uint16_t wBufSize, uint8_t *pData, uint16_t *pLength) |
Read Data from Fifo buffer. More... | |
phStatus_t | phhalHw_Rc523_FlushFifo (phhalHw_Rc523_DataParams_t *pDataParams) |
Clear Fifo buffer. More... | |
phStatus_t | phhalHw_Rc523_WriteData (phhalHw_Rc523_DataParams_t *pDataParams, uint8_t bAddress, uint8_t *pData, uint16_t wLength) |
Write multiple values to a single register address. More... | |
phStatus_t | phhalHw_Rc523_ReadData (phhalHw_Rc523_DataParams_t *pDataParams, uint8_t bAddress, uint16_t wLength, uint8_t *pData) |
Read multiple values from single register address. More... | |
phStatus_t | phhalHw_Rc523_ExchangeTransmit (phhalHw_Rc523_DataParams_t *pDataParams, uint8_t bCmdCode, uint8_t *pTxBuffer, uint16_t wTxLength) |
Transmit part of Exchange command. More... | |
phStatus_t | phhalHw_Rc523_ExchangeReceive (phhalHw_Rc523_DataParams_t *pDataParams, uint8_t **ppRxBuffer, uint16_t *pRxLength) |
Receive part of Exchange command. More... | |
phStatus_t | phhalHw_Rc523_SetFdt (phhalHw_Rc523_DataParams_t *pDataParams, uint16_t wConfig, uint16_t wTimeout) |
This function will calculate and store Timer Pre-scaler and Timer ReLoad values (Lower and Higher bytes). More... | |
phStatus_t | phhalHw_Rc523_GetFdt (phhalHw_Rc523_DataParams_t *pDataParams, phStatus_t wExchangeStatus, uint32_t *pTime) |
Retrieves the Frame Delay Time of the last command. More... | |
phStatus_t | phhalHw_Rc523_GetTxBuffer (phhalHw_Rc523_DataParams_t *pDataParams, uint8_t bIsExchange, uint8_t **pTxBuffer, uint16_t *pTxBufferLen, uint16_t *pTxBufferSize) |
Returns the TxBuffer pointer, length and size. More... | |
phStatus_t | phhalHw_Rc523_GetRxBuffer (phhalHw_Rc523_DataParams_t *pDataParams, uint8_t bIsExchange, uint8_t **pRxBuffer, uint16_t *pRxBufferLen, uint16_t *pRxBufferSize) |
Returns the RxBuffer pointer, length and size. More... | |
phStatus_t | phhalHw_Rc523_WaitIrq (phhalHw_Rc523_DataParams_t *pDataParams, uint8_t bIrq0WaitFor, uint8_t bIrq1WaitFor, uint8_t *pIrq0Reg, uint8_t *pIrq1Reg) |
Wait until one of the given interrupts occurs. More... | |
phStatus_t | phhalHw_Rc523_LoadTimeout (phhalHw_Rc523_DataParams_t *pDataParams) |
Configure registers for Frame Delay Time (Timeout) values. More... | |
phStatus_t | phhalHw_Rc523_StartTxWaitTimer (phhalHw_Rc523_DataParams_t *pDataParams) |
Configure registers for TxWait and start timer. More... | |
void | phhalHw_Rc523_CreateRespFrame (uint8_t *bInBuff, uint8_t bDataPos, uint8_t *bOutBuff) |
This function will return the answer to ReqC in 32 byte multi slot frame format. More... | |
phStatus_t | phhalHw_Rc523_FrameRxMultiplePkt (phhalHw_Rc523_DataParams_t *pDataParams) |
Frame packet which contains a series of ReqC responses(if multiple response received) in multi-slot response format and update Hal Rx buffer. More... | |
phStatus_t | phhalHw_Rc523_CheckForEmdError (phhalHw_Rc523_DataParams_t *pDataParams, uint8_t bIrq0WaitFor, uint8_t bIrq1WaitFor, uint8_t *pIrq0Reg, uint8_t *pIrq1Reg) |
EMD error handling function on PN512. More... | |
phStatus_t | phhalHw_Rc523_ReStartRx (phhalHw_Rc523_DataParams_t *pDataParams) |
Restart Receiver function on PN512. More... | |
phStatus_t | phhalHw_Rc523_GetMultiReg (phhalHw_Rc523_DataParams_t *pDataParams, uint8_t *pData) |
Get MultiReg function on PN512. More... | |
phStatus_t | phhalHw_Rc523_GetError (phhalHw_Rc523_DataParams_t *pDataParams) |
Get error from ErrorReg of PN512. More... | |
Timing related constants | |
#define | PHHAL_HW_RC523_FELICA_ADD_DELAY_US 240U |
Additional digital timeout delay for Felica. More... | |
RS232 speed settings | |
#define | PHHAL_HW_RC523_SERIALSPEED_7200 0xFAU |
7.200 kBit/s. More... | |
#define | PHHAL_HW_RC523_SERIALSPEED_9600 0xEBU |
9.600 kBit/s. More... | |
#define | PHHAL_HW_RC523_SERIALSPEED_14400 0xDAU |
14.400 kBit/s. More... | |
#define | PHHAL_HW_RC523_SERIALSPEED_19200 0xCBU |
19.200 kBit/s. More... | |
#define | PHHAL_HW_RC523_SERIALSPEED_38400 0xABU |
38.400 kBit/s. More... | |
#define | PHHAL_HW_RC523_SERIALSPEED_57600 0x9AU |
57.500 kBit/s. More... | |
#define | PHHAL_HW_RC523_SERIALSPEED_115200 0x7AU |
115.200 kBit/s. More... | |
#define | PHHAL_HW_RC523_SERIALSPEED_128000 0x74U |
128.000 kBit/s. More... | |
#define | PHHAL_HW_RC523_SERIALSPEED_230400 0x5AU |
230.400 kBit/s. More... | |
#define | PHHAL_HW_RC523_SERIALSPEED_460800 0x3AU |
460.800 kBit/s. More... | |
#define | PHHAL_HW_RC523_SERIALSPEED_921600 0x1CU |
921.600 kBit/s. More... | |
#define | PHHAL_HW_RC523_SERIALSPEED_1228800 0x15U |
1.228.800 kBit/s. More... | |
EMD noise detection settings | |
#define | PHHAL_HWRC523_EMD_NOISE_ERROR (PHHAL_HW_RC523_BIT_COLLERR | PHHAL_HW_RC523_BIT_CRCERR | PHHAL_HW_RC523_BIT_PARITYERR | PHHAL_HW_RC523_BIT_PROTERR) |
#define | PHHAL_HWRC523_EMD_NOISE_CHECK(dwReg) |
#define | PHHAL_HW_RC523_EMV_NOISE_MAXLEN 2U |
#define | PHHAL_HW_RC523_ISO_NOISE_MAXLEN 1U |
Internal definitions.
#define PHHAL_HW_RC523_TIMER_FREQ 13.56f |
RC internal timer frequency.
#define PHHAL_HW_RC523_TIMER_MAX_VALUE_US 39586813 |
RC maximum timer value in microseconds.
#define PHHAL_HW_RC523_TIMER_SHIFT 4.8f |
Shift of the internal RC timer in ETUs.
#define PHHAL_HW_RC523_ETU_106 9.44f |
Duration of one ETU at 106 kBit/s in [us].
#define PHHAL_HW_RC523_ETU_212 4.7f |
Duration of one ETU at 212 kBit/s in [us].
#define PHHAL_HW_RC523_ETU_424 2.4f |
Duration of one ETU at 424 kBit/s in [us].
#define PHHAL_HW_RC523_ETU_848 1.2f |
Duration of one ETU at 848 kBit/s in [us].
#define PHHAL_HW_RC523_REQC_MIN_LEN 19U |
Minimum length of valid ReqC response when multiple reception is enable.
#define PHHAL_HW_RC523_FELICA_ADD_DELAY_US 240U |
Additional digital timeout delay for Felica.
#define PHHAL_HW_RC523_SERIALSPEED_7200 0xFAU |
7.200 kBit/s.
#define PHHAL_HW_RC523_SERIALSPEED_9600 0xEBU |
9.600 kBit/s.
#define PHHAL_HW_RC523_SERIALSPEED_14400 0xDAU |
14.400 kBit/s.
#define PHHAL_HW_RC523_SERIALSPEED_19200 0xCBU |
19.200 kBit/s.
#define PHHAL_HW_RC523_SERIALSPEED_38400 0xABU |
38.400 kBit/s.
#define PHHAL_HW_RC523_SERIALSPEED_57600 0x9AU |
57.500 kBit/s.
#define PHHAL_HW_RC523_SERIALSPEED_115200 0x7AU |
115.200 kBit/s.
#define PHHAL_HW_RC523_SERIALSPEED_128000 0x74U |
128.000 kBit/s.
#define PHHAL_HW_RC523_SERIALSPEED_230400 0x5AU |
230.400 kBit/s.
#define PHHAL_HW_RC523_SERIALSPEED_460800 0x3AU |
460.800 kBit/s.
#define PHHAL_HW_RC523_SERIALSPEED_921600 0x1CU |
921.600 kBit/s.
#define PHHAL_HW_RC523_SERIALSPEED_1228800 0x15U |
1.228.800 kBit/s.
#define PHHAL_HW_RC523_MFC_AUTHA_CMD 0x60U |
MIFARE(R) Classic AUTHA command code.
#define PHHAL_HW_RC523_MFC_AUTHB_CMD 0x61U |
MIFARE(R) Classic AUTHB command code.
phStatus_t phhalHw_Rc523_WriteFifo | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint8_t * | pData, | ||
uint16_t | wLength, | ||
uint16_t * | pBytesWritten | ||
) |
Write Data to Fifo buffer.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | pData | input data |
[in] | wLength | length of input data |
[out] | pBytesWritten | Number of written bytes |
phStatus_t phhalHw_Rc523_ReadFifo | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint16_t | wBufSize, | ||
uint8_t * | pData, | ||
uint16_t * | pLength | ||
) |
Read Data from Fifo buffer.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wBufSize | size of output buffer |
[out] | pData | output data |
[out] | pLength | number of output data bytes |
phStatus_t phhalHw_Rc523_FlushFifo | ( | phhalHw_Rc523_DataParams_t * | pDataParams | ) |
Clear Fifo buffer.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
phStatus_t phhalHw_Rc523_WriteData | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint8_t | bAddress, | ||
uint8_t * | pData, | ||
uint16_t | wLength | ||
) |
Write multiple values to a single register address.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bAddress | Start-Register Address |
[in] | pData | Register Values; uint8_t[wLength] |
[in] | wLength | Number of Values |
phStatus_t phhalHw_Rc523_ReadData | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint8_t | bAddress, | ||
uint16_t | wLength, | ||
uint8_t * | pData | ||
) |
Read multiple values from single register address.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bAddress | Register Address |
[in] | wLength | Number of Values |
[out] | pData | Register Values; uint8_t[wLength] |
phStatus_t phhalHw_Rc523_ExchangeTransmit | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint8_t | bCmdCode, | ||
uint8_t * | pTxBuffer, | ||
uint16_t | wTxLength | ||
) |
Transmit part of Exchange command.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bCmdCode | Command-Code of command. |
[in] | pTxBuffer | Data to transmit. |
[in] | wTxLength | Length of data to transmit. |
phStatus_t phhalHw_Rc523_ExchangeReceive | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint8_t ** | ppRxBuffer, | ||
uint16_t * | pRxLength | ||
) |
Receive part of Exchange command.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[out] | ppRxBuffer | Pointer to received data. |
[out] | pRxLength | Number of received data bytes. |
phStatus_t phhalHw_Rc523_SetFdt | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint16_t | wConfig, | ||
uint16_t | wTimeout | ||
) |
This function will calculate and store Timer Pre-scaler and Timer ReLoad values (Lower and Higher bytes).
For function phhalHw_Wait, this function will directly set register with calculated values. This function will calculate and store value for PHHAL_HW_CONFIG_TXWAIT_US or PHHAL_HW_CONFIG_TXWAIT_MS or PHHAL_HW_CONFIG_TIMEOUT_VALUE_US or PHHAL_HW_CONFIG_TIMEOUT_VALUE_MS.
wConfig can be one of:
Note: Frame Delay Time (FDT) is defined between the last transmitted bit and the first received bit.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wConfig | Configuration Identifier. |
[in] | wTimeout | Time-out value. |
phStatus_t phhalHw_Rc523_GetFdt | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
phStatus_t | wExchangeStatus, | ||
uint32_t * | pTime | ||
) |
Retrieves the Frame Delay Time of the last command.
Note: Frame Delay Time is defined between the last transmitted bit and the first received bit.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | wExchangeStatus | Status code returned by exchange function. |
[out] | pTime | Calculated time in microseconds from timer contents. |
phStatus_t phhalHw_Rc523_GetTxBuffer | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint8_t | bIsExchange, | ||
uint8_t ** | pTxBuffer, | ||
uint16_t * | pTxBufferLen, | ||
uint16_t * | pTxBufferSize | ||
) |
Returns the TxBuffer pointer, length and size.
PH_ERR_SUCCESS | Operation successful. |
phStatus_t phhalHw_Rc523_GetRxBuffer | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint8_t | bIsExchange, | ||
uint8_t ** | pRxBuffer, | ||
uint16_t * | pRxBufferLen, | ||
uint16_t * | pRxBufferSize | ||
) |
Returns the RxBuffer pointer, length and size.
PH_ERR_SUCCESS | Operation successful. |
phStatus_t phhalHw_Rc523_WaitIrq | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint8_t | bIrq0WaitFor, | ||
uint8_t | bIrq1WaitFor, | ||
uint8_t * | pIrq0Reg, | ||
uint8_t * | pIrq1Reg | ||
) |
Wait until one of the given interrupts occurs.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bIrq0WaitFor | Bitmask of interrupts in CommIrq register to wait for. |
[in] | bIrq1WaitFor | Bitmask of interrupts in DivIrq register to wait for. |
[out] | pIrq0Reg | Contents of CommIrq register. |
[out] | pIrq1Reg | Contents of DivIrq register. |
phStatus_t phhalHw_Rc523_LoadTimeout | ( | phhalHw_Rc523_DataParams_t * | pDataParams | ) |
Configure registers for Frame Delay Time (Timeout) values.
Registers value are calculated and stored by function phhalHw_Rc523_SetFdt.
Note: Frame Delay Time is defined between the last transmitted bit and the first received bit.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
phStatus_t phhalHw_Rc523_StartTxWaitTimer | ( | phhalHw_Rc523_DataParams_t * | pDataParams | ) |
Configure registers for TxWait and start timer.
Registers value are calculated and stored by function phhalHw_Rc523_SetFdt.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
This function will return the answer to ReqC in 32 byte multi slot frame format.
Size of output frame is PHHAL_HW_RESP_FRAME_SIZE byte.
Note: This function is only valid when multiple reception PHHAL_HW_CONFIG_RXMULTIPLE is enabled.
[in] | bInBuff | Pointer to Rx buffer. |
[in] | bDataPos | position of card response in Rxbuffer. |
[out] | bOutBuff | Pointer to buffer which store frame of PHHAL_HW_RESP_FRAME_SIZE size. |
phStatus_t phhalHw_Rc523_FrameRxMultiplePkt | ( | phhalHw_Rc523_DataParams_t * | pDataParams | ) |
Frame packet which contains a series of ReqC responses(if multiple response received) in multi-slot response format and update Hal Rx buffer.
This function will use function phhalHw_Rc523_CreateRespFrame to frame each card responses multi-slot frame format.
Note: This function is only valid when multiple reception PHHAL_HW_CONFIG_RXMULTIPLE is enabled.
PH_ERR_SUCCESS | Operation successful. |
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
phStatus_t phhalHw_Rc523_CheckForEmdError | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint8_t | bIrq0WaitFor, | ||
uint8_t | bIrq1WaitFor, | ||
uint8_t * | pIrq0Reg, | ||
uint8_t * | pIrq1Reg | ||
) |
EMD error handling function on PN512.
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[in] | bIrq0WaitFor | Bitmask of interrupts in Irq0 register to wait for. |
[in] | bIrq1WaitFor | Bitmask of interrupts in Irq1 register to wait for. |
[out] | pIrq0Reg | Contains Register Read Value. |
[out] | pIrq1Reg | Contains Register Read Value. |
phStatus_t phhalHw_Rc523_ReStartRx | ( | phhalHw_Rc523_DataParams_t * | pDataParams | ) |
Restart Receiver function on PN512.
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
phStatus_t phhalHw_Rc523_GetMultiReg | ( | phhalHw_Rc523_DataParams_t * | pDataParams, |
uint8_t * | pData | ||
) |
Get MultiReg function on PN512.
Other | Depending on implementation and under-laying component. |
[in] | pDataParams | Pointer to this layer's parameter structure. |
[out] | pData | Pointer to buffer which store register values. |
phStatus_t phhalHw_Rc523_GetError | ( | phhalHw_Rc523_DataParams_t * | pDataParams | ) |
Get error from ErrorReg of PN512.
. |
[in] | pDataParams | Pointer to this layer's parameter structure. |