NXP NFC Reader Library v4.040.05.011646

Typedefs | Enumerations | Functions
Platform HOST Porting Component

These Components implement the Platform HOST porting abstraction layer. More...

## Typedefs
typedef enum phPlatform_Port_Host_config | phPlatform_Port_Host_config_t
| Functional Abstraction of various PINs between Host and Frontend.
typedef enum phPlatform_Port_Host_Interrupt | phPlatform_Port_Host_Interrupt_t
| Configures the interrupt generation condition.

## Enumerations
enum | phPlatform_Port_Host_config { PHPLATFORM_PORT_PIN_RESET = 0x1U, PHPLATFORM_PORT_PIN_IRQ = 0x2U, PHPLATFORM_PORT_PIN_SPI = 0x3U, PHPLATFORM_PORT_PIN_I2C = 0x4U, PHPLATFORM_PORT_PIN_BUSY = 0x5U, PHPLATFORM_PORT_PIN_DWL = 0x6U, PHPLATFORM_PORT_PIN_IFSEL0 = 0x7U, PHPLATFORM_PORT_PIN_IFSEL1 = 0x8U, PHPLATFORM_PORT_PIN_AD0 = 0x9U, PHPLATFORM_PORT_PIN_AD1 = 0xAU, PHPLATFORM_PORT_PIN_AD2 = 0xBU }
| Functional Abstraction of various PINs between Host and Frontend. More...
enum | phPlatform_Port_Host_Interrupt { PHPLATFORM_PORT_INT_DISABLED = 0x0U, PHPLATFORM_PORT_INT_RISING_EDGE = 0x1U, PHPLATFORM_PORT_INT_FALLING_EDGE = 0x2U }
| Configures the interrupt generation condition. More...

## Functions
phStatus_t | phPlatform_Port_Host_SetPinConfig (phPlatform_Port_Host_config_t bConfig)
| This API is used to configure and initialize the HOST pins (ex : Reset, IRQ, AD etc) which are connected to respective front-ends. More...
void | phPlatform_Port_Host_SetPinValue (phPlatform_Port_Host_config_t bConfig, uint8_t bVal)
| This API is used to set the state of HOST pin. More...
bool | phPlatform_Port_Host_GetPinValue (phPlatform_Port_Host_config_t bConfig)
| Get a GPIO pin state via the GPIO byte register. More...
void | phPlatform_Port_Host_ClearInt (void)
| Clear interrupt status. More...
phStatus_t | phPlatform_Port_Host_HwTimer_Init (void)
| Initialize the Host Timer module. More...
phStatus_t | phPlatform_Port_Host_HwTimer_Create (uint32_t dwUnits, uint8_t bTimerId, void **ppTimerHandle)
| Allocates a free Host timer. More...
phStatus_t | phPlatform_Port_Host_HwTimer_Configure (void *pTimerHandle, uint32_t dwUnits, uint32_t dwTimePeriod)
| This API configures the acquired timer with timeout duration. More...
phStatus_t | phPlatform_Port_Host_HwTimer_Start (void *pTimerHandle, uint16_t wOption)
| Start the Host timer, upon timer expire phPlatform_Timer_IsrHandler API will be called with timer ID. More...
phStatus_t | phPlatform_Port_Host_HwTimer_GetElapsedDelay (void *pTimerHandle, uint32_t dwUnits, uint32_t *pdwGetElapsedDelay)
| Get Elapsed Delay from host timer which is created and started before calling this API. More...
phStatus_t | phPlatform_Port_Host_HwTimer_Stop (void *pTimerHandle)
| Stop the host timer. More...
phStatus_t | phPlatform_Port_Host_HwTimer_Reset (void *pTimerHandle)
| Reset the host timer. More...
phStatus_t | phPlatform_Port_Host_HwTimer_Delete (void *pTimerHandle)
| Delete the host timer. More...
void | phPlatform_Port_Host_HwTimer_DeInit (void)
| DeInitializes the Timer component. More...

## Detailed Description

These Components implement the Platform HOST porting abstraction layer.

These API provide easy to port NfcRdLib on different Host platform.

## Enumeration Type Documentation

## § phPlatform_Port_Host_config

enum phPlatform_Port_Host_config

Functional Abstraction of various PINs between Host and Frontend.

Enumerator
PHPLATFORM_PORT_PIN_RESET | Reset the Frontend.
PHPLATFORM_PORT_PIN_IRQ | Interrupt from the Frontend to Host.
PHPLATFORM_PORT_PIN_SPI | SPI Pins of the Host.
PHPLATFORM_PORT_PIN_I2C | I2C Pins of the Host.
PHPLATFORM_PORT_PIN_BUSY | Frontend's Busy Status, if Applicable.
PHPLATFORM_PORT_PIN_DWL | Assert Download mode of Frontend, if Applicable.
PHPLATFORM_PORT_PIN_IFSEL0 | IFSEL0 of the Frontend, if Applicable.
PHPLATFORM_PORT_PIN_IFSEL1 | IFSEL1 of the Frontend, if Applicable.
PHPLATFORM_PORT_PIN_AD0 | Address Select Pin of Frontend, if Applicable.
PHPLATFORM_PORT_PIN_AD1 | Address Select Pin of Frontend, if Applicable.
PHPLATFORM_PORT_PIN_AD2 | Address Select Pin of Frontend, if Applicable.

## § phPlatform_Port_Host_Interrupt

enum phPlatform_Port_Host_Interrupt

Configures the interrupt generation condition.

Enumerator
PHPLATFORM_PORT_INT_DISABLED | Interrupt request is disabled.
PHPLATFORM_PORT_INT_RISING_EDGE | Interrupt on rising edge.
PHPLATFORM_PORT_INT_FALLING_EDGE | Interrupt on falling edge.

## Function Documentation

## § phPlatform_Port_Host_SetPinConfig()

phStatus_t phPlatform_Port_Host_SetPinConfig | ( | phPlatform_Port_Host_config_t | bConfig | ) |

This API is used to configure and initialize the HOST pins (ex : Reset, IRQ, AD etc) which are connected to respective front-ends.

Port and Pin number are abstracted in specific Platform configuration header file. For any new combination of Host and Front-end, new configuration header file can be added to easy the porting.

Parameters

  [in] | bConfig | : HOST pin that needs to be configured.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.

## § phPlatform_Port_Host_SetPinValue()

void phPlatform_Port_Host_SetPinValue | ( | phPlatform_Port_Host_config_t | bConfig,
|  | uint8_t | bVal
| ) |  |

This API is used to set the state of HOST pin.

Port and Pin number are abstracted in specific Platform configuration header file. For any new combination of Host and Front-end, new configuration header file can be added to easy the porting.

Parameters

  [in] | bConfig | : HOST pin needs to be set.
  [in] | bVal | : PH_PLATFORM_SET_HIGH for high, PH_PLATFORM_SET_LOW for low.

Returns
  Nothing

## § phPlatform_Port_Host_GetPinValue()

bool phPlatform_Port_Host_GetPinValue | ( | phPlatform_Port_Host_config_t | bConfig | ) |

Get a GPIO pin state via the GPIO byte register.

Port and Pin number are abstracted in specific Platform configuration header file. For any new combination of Host and Front-end, new configuration header file can be added to easy the porting.

Parameters

  [in] | bConfig | : Get the state of HOST pin.

Returns
  Status of the API
  true if HOST pin is in high state else false.

## § phPlatform_Port_Host_ClearInt()

void phPlatform_Port_Host_ClearInt | ( | void |  | ) |

Clear interrupt status.

Port and Pin number are abstracted in specific Platform configuration header file. For any new combination of Host and Front-end, new configuration header file can be added to easy the porting.

Returns
  Nothing

## § phPlatform_Port_Host_HwTimer_Init()

phStatus_t phPlatform_Port_Host_HwTimer_Init | ( | void |  | ) |

Initialize the Host Timer module.

Note
  This API will be called by phPlatform_Timer_Init API.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INTERNAL_ERROR | For unsuccessful operation.

## § phPlatform_Port_Host_HwTimer_Create()

phStatus_t phPlatform_Port_Host_HwTimer_Create | ( | uint32_t | dwUnits,
|  | uint8_t | bTimerId,
|  | void ** | ppTimerHandle
| ) |  |

Allocates a free Host timer.

Note
  This API will be called by phPlatform_Timer_Create API.

Parameters

  [in] | dwUnits | Timer Resolution (e.g. PH_PLATFORM_TIMER_UNIT_S)
  [in] | bTimerId | Timer Number
  [out] | ppTimerHandle | Handle to the timer in case of success else NULL.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_RESOURCE_ERROR | If host timer cannot be created.

## § phPlatform_Port_Host_HwTimer_Configure()

phStatus_t phPlatform_Port_Host_HwTimer_Configure | ( | void * | pTimerHandle,
|  | uint32_t | dwUnits,
|  | uint32_t | dwTimePeriod
| ) |  |

This API configures the acquired timer with timeout duration.

Note
  This API will be called by phPlatform_Timer_Configure API.

Parameters

  [in] | pTimerHandle | Handle to timer as returned by phPlatform_Port_Host_HwTimer_Create.
  [in] | dwUnits | Timer Resolution configured during phPlatform_Port_Host_HwTimer_Create.
  [in] | dwTimePeriod |

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Invalid input parameter.
  PH_ERR_PARAMETER_OVERFLOW | If timer cannot be configured to the provide time by parameter dwTimePeriod.

## § phPlatform_Port_Host_HwTimer_Start()

phStatus_t phPlatform_Port_Host_HwTimer_Start | ( | void * | pTimerHandle,
|  | uint16_t | wOption
| ) |  |

Start the Host timer, upon timer expire phPlatform_Timer_IsrHandler API will be called with timer ID.

Note
  This API will be called by phPlatform_Timer_Start API.

Parameters

  [in] | pTimerHandle | Handle to timer as returned by phPlatform_Port_Host_HwTimer_Create.
  [in] | wOption | Parameter to mention Single shot PH_PLATFORM_TIMER_SINGLE_SHOT or Free running timer PH_PLATFORM_TIMER_FREE_RUN.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Invalid input parameter.
  PH_ERR_RESOURCE_ERROR | If host timer could not be started.

## § phPlatform_Port_Host_HwTimer_GetElapsedDelay()

phStatus_t phPlatform_Port_Host_HwTimer_GetElapsedDelay | ( | void * | pTimerHandle,
|  | uint32_t | dwUnits,
|  | uint32_t * | pdwGetElapsedDelay
| ) |  |

Get Elapsed Delay from host timer which is created and started before calling this API.

Note
  This API will be called by phPlatform_Timer_GetElapsedDelay API.

Parameters

  [in] | pTimerHandle | Handle to timer as returned by phPlatform_Port_Host_HwTimer_Create.
  [in] | dwUnits | Timer Resolution configured during phPlatform_Port_Host_HwTimer_Create.
  [out] | pdwGetElapsedDelay | Duration of delay as per the passed resolution.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Invalid input parameter.

## § phPlatform_Port_Host_HwTimer_Stop()

phStatus_t phPlatform_Port_Host_HwTimer_Stop | ( | void * | pTimerHandle | ) |

Stop the host timer.

Note
  This API will be called by phPlatform_Timer_Stop API.

Parameters

  [in] | pTimerHandle | Handle to timer as returned by phPlatform_Port_Host_HwTimer_Create.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Invalid input parameter.
  PH_ERR_RESOURCE_ERROR | Timer could not be stopped.

## § phPlatform_Port_Host_HwTimer_Reset()

phStatus_t phPlatform_Port_Host_HwTimer_Reset | ( | void * | pTimerHandle | ) |

Reset the host timer.

Note
  This API will be called by phPlatform_Timer_Reset API.

Parameters

  [in] | pTimerHandle | Handle to timer as returned by phPlatform_Port_Host_HwTimer_Create.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Invalid input parameter.
  PH_ERR_RESOURCE_ERROR | Could not reset timer.

## § phPlatform_Port_Host_HwTimer_Delete()

phStatus_t phPlatform_Port_Host_HwTimer_Delete | ( | void * | pTimerHandle | ) |

Delete the host timer.

Note
  This API will be called by phPlatform_Timer_Delete API.

Parameters

  [in] | pTimerHandle | Handle to timer as returned by phPlatform_Port_Host_HwTimer_Create

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Invalid input parameter.
  PH_ERR_RESOURCE_ERROR | Timer could not delete.

## § phPlatform_Port_Host_HwTimer_DeInit()

void phPlatform_Port_Host_HwTimer_DeInit | ( | void |  | ) |

DeInitializes the Timer component.

Note
  This API will be called by phPlatform_Timer_DeInit API.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.