NXP NFC Reader Library  v4.040.05.011646

Pn5180 Int functions. More...

Collaboration diagram for Internal:

Macros

#define TIMER_FREQ   13.56
 Pn5180 clk frequency. More...
 
#define TMR_RELOAD_VALUE_MASK   (0x000FFFFFUL)
 The reload mask for the timer, also the maximum value that can be loaded into the timer reload register. More...
 
#define PHHAL_HW_PN5180_MAX_FREQ   13560000
 Pn5180 clk Maximum frequency = 13.56 MHz. More...
 
#define PHHAL_HW_PN5180_MIN_FREQ   53000
 Pn5180 clk Minimum frequency = 53 KHz. More...
 
#define PHHAL_HW_PN5180_MAX_TIME_DELAY_MS   19784
 Pn5180 Maximum Time Delay in milli second = 19.78443396226. More...
 
#define PHHAL_HW_PN5180_MIN_TIME_DELAY_US   1
 Pn5180 Minimum Time Delay in micro second = 0.00001886792. More...
 
#define PHHAL_HW_PN5180_CONVERSION_MS_SEC   1000
 MilliSec to Sec (In denominator for calculation purpose) –> 1000. More...
 
#define PHHAL_HW_PN5180_CONVERSION_US_SEC   1000000
 MicroSec to Sec (In denominator for calculation purpose) –> 1000000. More...
 
#define PHHAL_HW_PN5180_I14443_ADD_DELAY_US   15
 Additional digital timeout delay for ISO14443. More...
 
#define PHHAL_HW_PN5180_I15693_ADD_DELAY_US   120
 Additional digital timeout delay for ISO15693. More...
 
#define PHHAL_HW_CHECK_IRQ_PIN_MASK   0x01U
 Mask to Check for the IRQ PIN instead of polling for Status.
 
#define PHHAL_HW_DISABLE_IRQ_CLEAR_MASK   0x80U
 Mask to Disable the Clear of IRQ During the Wait for IRQ.
 

Functions

phStatus_t phhalHw_Pn5180_GetRxBuffer (phhalHw_Pn5180_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_Pn5180_GetTxBuffer (phhalHw_Pn5180_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_Pn5180_SetConfig_Int (phhalHw_Pn5180_DataParams_t *pDataParams, uint16_t wConfig, uint16_t wValue)
 Internal set config function. More...
 
phStatus_t phhalHw_Pn5180_ReadData (phhalHw_Pn5180_DataParams_t *pDataParams, uint8_t **pData, uint16_t *pBytesRead)
 Reads the data from the h/w buffer. More...
 
phStatus_t phhalHw_Pn5180_TimerStart (phhalHw_Pn5180_DataParams_t *pDataParams, uint8_t bTimer, uint32_t dwStartCond, uint32_t dwStopCond, uint32_t wPrescaler, uint32_t dwLoadValue)
 Generic timer routine. More...
 
phStatus_t phhalHw_Pn5180_SetCardMode (phhalHw_Pn5180_DataParams_t *pDataParams, uint16_t wTxDataRate, uint16_t wRxDataRate, uint16_t wSubcarrier)
 Apply card mode register settings (Tx and Rx Data Rate) according to given parameters. More...
 
phStatus_t phhalHw_Pn5180_SetTmo (phhalHw_Pn5180_DataParams_t *pDataParams, uint16_t wTimeout, uint8_t bUnit)
 Starts the timer as part of the time out behaviour. More...
 
phStatus_t phhalHw_Pn5180_Int_Wait (phhalHw_Pn5180_DataParams_t *pDataParams, uint32_t dwLoadValue, uint32_t wPrescaler)
 Internal wait function. More...
 
phStatus_t phhalHw_Pn5180_Int_GetDigiDelay (phhalHw_Pn5180_DataParams_t *pDataParams, uint8_t bIsTimeout, uint16_t *pDelayUs)
 Internal Get Digital Delay time function. More...
 
phStatus_t phhalHw_Pn5180_Int_GetFdt (phhalHw_Pn5180_DataParams_t *pDataParams, phStatus_t wExchangeStatus, uint32_t *pTime)
 Internal Get Frame Delay time function. More...
 
phStatus_t phhalHw_Pn5180_Receive_Int (phhalHw_Pn5180_DataParams_t *pDataParams, uint32_t dwIrqWaitFor, uint8_t **ppRxBuffer, uint16_t *pRxLength, uint8_t bIrqEnable)
 PN5180 implementation of common receive functionality. More...
 
phStatus_t phhalHw_Pn5180_Int_IdleCommand (phhalHw_Pn5180_DataParams_t *pDataParams)
 PN5180 implementation of loading of idle command. More...
 
phStatus_t phhalHw_Pn5180_Int_LoadCommand (phhalHw_Pn5180_DataParams_t *pDataParams, uint8_t bCmd)
 PN5180 implementation of loading a command. More...
 
phStatus_t phhalHw_Pn5180_AutoSyncByte (phhalHw_Pn5180_DataParams_t *pDataParams)
 PN5180 implementation of handling the F0 Sync byte automatically for P2P data exchange. More...
 

Rf Datarate Values

#define PHHAL_HW_RF_DATARATE_NO_CHANGE   0x00FFU
 Data rate no change. More...
 

RF_STATUS_RF_ACTIVE_ERROR_CAUSE Values

#define RF_ACTIVE_ERROR_NO_EXT_FIELD_DETECTED   3
 

FSD Values

#define PHHAL_HW_PN5180_MAX_FSD   256
 

Detailed Description

Pn5180 Int functions.

Macro Definition Documentation

§ TIMER_FREQ

#define TIMER_FREQ   13.56

Pn5180 clk frequency.

§ TMR_RELOAD_VALUE_MASK

#define TMR_RELOAD_VALUE_MASK   (0x000FFFFFUL)

The reload mask for the timer, also the maximum value that can be loaded into the timer reload register.

§ PHHAL_HW_PN5180_MAX_FREQ

#define PHHAL_HW_PN5180_MAX_FREQ   13560000

Pn5180 clk Maximum frequency = 13.56 MHz.

§ PHHAL_HW_PN5180_MIN_FREQ

#define PHHAL_HW_PN5180_MIN_FREQ   53000

Pn5180 clk Minimum frequency = 53 KHz.

§ PHHAL_HW_PN5180_MAX_TIME_DELAY_MS

#define PHHAL_HW_PN5180_MAX_TIME_DELAY_MS   19784

Pn5180 Maximum Time Delay in milli second = 19.78443396226.

§ PHHAL_HW_PN5180_MIN_TIME_DELAY_US

#define PHHAL_HW_PN5180_MIN_TIME_DELAY_US   1

Pn5180 Minimum Time Delay in micro second = 0.00001886792.

§ PHHAL_HW_PN5180_CONVERSION_MS_SEC

#define PHHAL_HW_PN5180_CONVERSION_MS_SEC   1000

MilliSec to Sec (In denominator for calculation purpose) –> 1000.

§ PHHAL_HW_PN5180_CONVERSION_US_SEC

#define PHHAL_HW_PN5180_CONVERSION_US_SEC   1000000

MicroSec to Sec (In denominator for calculation purpose) –> 1000000.

§ PHHAL_HW_PN5180_I14443_ADD_DELAY_US

#define PHHAL_HW_PN5180_I14443_ADD_DELAY_US   15

Additional digital timeout delay for ISO14443.

§ PHHAL_HW_PN5180_I15693_ADD_DELAY_US

#define PHHAL_HW_PN5180_I15693_ADD_DELAY_US   120

Additional digital timeout delay for ISO15693.

§ PHHAL_HW_RF_DATARATE_NO_CHANGE

#define PHHAL_HW_RF_DATARATE_NO_CHANGE   0x00FFU

Data rate no change.

Function Documentation

§ phhalHw_Pn5180_GetRxBuffer()

phStatus_t phhalHw_Pn5180_GetRxBuffer ( phhalHw_Pn5180_DataParams_t pDataParams,
uint8_t  bIsExchange,
uint8_t **  pRxBuffer,
uint16_t pRxBufferLen,
uint16_t pRxBufferSize 
)

Returns the RxBuffer pointer, length and size.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParamsDatParams to this layer.
[in]bIsExchangeExchange option specifier.
[out]pRxBufferPointer to HAL RX buffer.
[out]pRxBufferLenLength of the buffer.
[out]pRxBufferSizeSize of the buffer.

§ phhalHw_Pn5180_GetTxBuffer()

phStatus_t phhalHw_Pn5180_GetTxBuffer ( phhalHw_Pn5180_DataParams_t pDataParams,
uint8_t  bIsExchange,
uint8_t **  pTxBuffer,
uint16_t pTxBufferLen,
uint16_t pTxBufferSize 
)

Returns the TxBuffer pointer, length and size.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParamsDatParams to this layer.
[in]bIsExchangeExchange option specifier.
[out]pTxBufferPointer to HAL TX buffer.
[out]pTxBufferLenLength of the buffer.
[out]pTxBufferSizeSize of the buffer.

§ phhalHw_Pn5180_SetConfig_Int()

phStatus_t phhalHw_Pn5180_SetConfig_Int ( phhalHw_Pn5180_DataParams_t pDataParams,
uint16_t  wConfig,
uint16_t  wValue 
)

Internal set config function.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_UNSUPPORTED_PARAMETERConfiguration is not supported or invalid.
PH_ERR_INVALID_PARAMETERParameter value is invalid.
PH_ERR_PARAMETER_OVERFLOWSetting the parameter value would lead to an overflow.
Parameters
[in]pDataParamsDatParams to this layer.
[in]wConfigSetConfig option.
[in]wValueSetConfig value.

§ phhalHw_Pn5180_ReadData()

phStatus_t phhalHw_Pn5180_ReadData ( phhalHw_Pn5180_DataParams_t pDataParams,
uint8_t **  pData,
uint16_t pBytesRead 
)

Reads the data from the h/w buffer.

Parameters
[in]pDataParamsDatParams to this layer.
[out]pDataData read from the h/w FIFO.
[out]pBytesReadNumber of bytes read.

§ phhalHw_Pn5180_TimerStart()

phStatus_t phhalHw_Pn5180_TimerStart ( phhalHw_Pn5180_DataParams_t pDataParams,
uint8_t  bTimer,
uint32_t  dwStartCond,
uint32_t  dwStopCond,
uint32_t  wPrescaler,
uint32_t  dwLoadValue 
)

Generic timer routine.

Parameters
[in]pDataParamsDatParams to this layer.
[in]bTimerTimer1/2/3 to be used.
[in]dwStartCondStop condition(s) for timer.
[in]dwStopCondStart condition(s) for timer.
[in]wPrescalerPrescalar to be used.
[in]dwLoadValueValue to be loaded to the timer count.

§ phhalHw_Pn5180_SetCardMode()

phStatus_t phhalHw_Pn5180_SetCardMode ( phhalHw_Pn5180_DataParams_t pDataParams,
uint16_t  wTxDataRate,
uint16_t  wRxDataRate,
uint16_t  wSubcarrier 
)

Apply card mode register settings (Tx and Rx Data Rate) according to given parameters.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsDatParams to this layer.
[in]wTxDataRateTX data rate to be used.
[in]wRxDataRateRX data rate to be used.
[in]wSubcarrierSub carrier to be used.

§ phhalHw_Pn5180_SetTmo()

phStatus_t phhalHw_Pn5180_SetTmo ( phhalHw_Pn5180_DataParams_t pDataParams,
uint16_t  wTimeout,
uint8_t  bUnit 
)

Starts the timer as part of the time out behaviour.

Note
uses timer 1
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsDatParams to this layer.
[in]wTimeoutTime out period.
[in]bUnitThe unit unit used for specifying the delay.

§ phhalHw_Pn5180_Int_Wait()

phStatus_t phhalHw_Pn5180_Int_Wait ( phhalHw_Pn5180_DataParams_t pDataParams,
uint32_t  dwLoadValue,
uint32_t  wPrescaler 
)

Internal wait function.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsDatParams to this layer.
[in]dwLoadValuethe load count.
[in]wPrescalerPrescalar for the timer.

§ phhalHw_Pn5180_Int_GetDigiDelay()

phStatus_t phhalHw_Pn5180_Int_GetDigiDelay ( phhalHw_Pn5180_DataParams_t pDataParams,
uint8_t  bIsTimeout,
uint16_t pDelayUs 
)

Internal Get Digital Delay time function.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsDatParams to this layer.
[in]bIsTimeoutTimeout status.
[out]pDelayUsDelay time.

§ phhalHw_Pn5180_Int_GetFdt()

phStatus_t phhalHw_Pn5180_Int_GetFdt ( phhalHw_Pn5180_DataParams_t pDataParams,
phStatus_t  wExchangeStatus,
uint32_t pTime 
)

Internal Get Frame Delay time function.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsDatParams to this layer.
[in]wExchangeStatusExchange status.
[out]pTimeTimeout value.

§ phhalHw_Pn5180_Receive_Int()

phStatus_t phhalHw_Pn5180_Receive_Int ( phhalHw_Pn5180_DataParams_t pDataParams,
uint32_t  dwIrqWaitFor,
uint8_t **  ppRxBuffer,
uint16_t pRxLength,
uint8_t  bIrqEnable 
)

PN5180 implementation of common receive functionality.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsDatParams to this layer.
[in]dwIrqWaitForIrqs to wait for.
[out]ppRxBufferRx buffer.
[out]pRxLengthreceived length.
[in]bIrqEnableenable IRQs.

§ phhalHw_Pn5180_Int_IdleCommand()

phStatus_t phhalHw_Pn5180_Int_IdleCommand ( phhalHw_Pn5180_DataParams_t pDataParams)

PN5180 implementation of loading of idle command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsDatParams to this layer.

§ phhalHw_Pn5180_Int_LoadCommand()

phStatus_t phhalHw_Pn5180_Int_LoadCommand ( phhalHw_Pn5180_DataParams_t pDataParams,
uint8_t  bCmd 
)

PN5180 implementation of loading a command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParamsDatParams to this layer.
[in]bCmdCMD to load

§ phhalHw_Pn5180_AutoSyncByte()

phStatus_t phhalHw_Pn5180_AutoSyncByte ( phhalHw_Pn5180_DataParams_t pDataParams)

PN5180 implementation of handling the F0 Sync byte automatically for P2P data exchange.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.