NXP NFC Reader Library v4.040.05.011646

Macros | Functions
Internal
Hardware Abstraction Layer » component : Pn5180

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_SUCCESS | Operation successful.

Parameters

  [in] | pDataParams | DatParams to this layer.
  [in] | bIsExchange | Exchange option specifier.
  [out] | pRxBuffer | Pointer to HAL RX buffer.
  [out] | pRxBufferLen | Length of the buffer.
  [out] | pRxBufferSize | Size 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_SUCCESS | Operation successful.

Parameters

  [in] | pDataParams | DatParams to this layer.
  [in] | bIsExchange | Exchange option specifier.
  [out] | pTxBuffer | Pointer to HAL TX buffer.
  [out] | pTxBufferLen | Length of the buffer.
  [out] | pTxBufferSize | Size 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_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_PARAMETER | Configuration is not supported or invalid.
  PH_ERR_INVALID_PARAMETER | Parameter value is invalid.
  PH_ERR_PARAMETER_OVERFLOW | Setting the parameter value would lead to an overflow.

Parameters

  [in] | pDataParams | DatParams to this layer.
  [in] | wConfig | SetConfig option.
  [in] | wValue | SetConfig 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] | pDataParams | DatParams to this layer.
  [out] | pData | Data read from the h/w FIFO.
  [out] | pBytesRead | Number 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] | pDataParams | DatParams to this layer.
  [in] | bTimer | Timer1/2/3 to be used.
  [in] | dwStartCond | Stop condition(s) for timer.
  [in] | dwStopCond | Start condition(s) for timer.
  [in] | wPrescaler | Prescalar to be used.
  [in] | dwLoadValue | Value 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_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | DatParams to this layer.
  [in] | wTxDataRate | TX data rate to be used.
  [in] | wRxDataRate | RX data rate to be used.
  [in] | wSubcarrier | Sub 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_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | DatParams to this layer.
  [in] | wTimeout | Time out period.
  [in] | bUnit | The 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_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | DatParams to this layer.
  [in] | dwLoadValue | the load count.
  [in] | wPrescaler | Prescalar 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_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | DatParams to this layer.
  [in] | bIsTimeout | Timeout status.
  [out] | pDelayUs | Delay 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_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | DatParams to this layer.
  [in] | wExchangeStatus | Exchange status.
  [out] | pTime | Timeout 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_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | DatParams to this layer.
  [in] | dwIrqWaitFor | Irqs to wait for.
  [out] | ppRxBuffer | Rx buffer.
  [out] | pRxLength | received length.
  [in] | bIrqEnable | enable 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_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | DatParams 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_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | DatParams to this layer.
  [in] | bCmd | CMD 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_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.