NXP NFC Reader Library v4.040.05.011646

Data Structures | Typedefs | Functions
Operating System Abstraction Layer
Common

This component implements the OSAL APIs used by the Nxp Reader Library. More...

Collaboration diagram for Operating System Abstraction Layer:

## Data Structures
struct | phOsal_ThreadObj
| Osal Thread Object. More...
struct | phOsal_EventObj
| Osal Event Object. More...
struct | phOsal_TimePeriodObj
| Timer Period Object. More...
struct | phOsal_TimerObj
| Osal Timer Object. More...
struct | phOsal_SemObj
| OS Semaphore Object. More...
struct | phOsal_MutexObj
| Mutex Object. More...

## Typedefs
typedef uint32_t | phOsal_Ticks_t
| Amount of Time : specifiedd in Ticks.

## Functions
phStatus_t | phOsal_Init (void)
| This function initializes the osal attributes with the default values. More...
phStatus_t | phOsal_ThreadCreate (phOsal_Thread_t *threadHandle, pphOsal_ThreadObj_t threadObj, pphOsal_StartFunc_t startFunc, void *arg)
| This function starts a new thread in the calling process. More...
phStatus_t | phOsal_ThreadDelete (phOsal_Thread_t *threadHandle)
| This function will delete the thread. More...
phStatus_t | phOsal_ThreadChangePrio (phOsal_Thread_t *threadHandle, uint32_t newPrio)
| This function changes the priority of the thread. More...
phStatus_t | phOsal_ThreadExit (void)
| This function exits the thread itself. More...
phStatus_t | phOsal_ThreadDelay (phOsal_Ticks_t ticksToSleep)
| This function delays the calling thread. More...
phStatus_t | phOsal_EventCreate (phOsal_Event_t *eventHandle, pphOsal_EventObj_t eventObj)
| This function will create the event group and returns the newly created event group. More...
phStatus_t | phOsal_EventPend (volatile phOsal_Event_t *eventHandle, phOsal_EventOpt_t options, phOsal_Ticks_t ticksToWait, phOsal_EventBits_t FlagsToWait, phOsal_EventBits_t *pCurrFlags)
| This function will wait for the events. More...
phStatus_t | phOsal_EventPost (phOsal_Event_t *eventHandle, phOsal_EventOpt_t options, phOsal_EventBits_t FlagsToPost, phOsal_EventBits_t *pCurrFlags)
| This function will post the events. More...
phStatus_t | phOsal_EventClear (phOsal_Event_t *eventHandle, phOsal_EventOpt_t options, phOsal_EventBits_t FlagsToClear, phOsal_EventBits_t *pCurrFlags)
| This function will clear the events. More...
phStatus_t | phOsal_EventGet (phOsal_Event_t *eventHandle, phOsal_EventBits_t *pCurrFlags)
| This function will get the events which are already there. More...
phStatus_t | phOsal_EventDelete (phOsal_Event_t *eventHandle)
| This function will delete the events. More...
phStatus_t | phOsal_SemCreate (phOsal_Semaphore_t *semHandle, pphOsal_SemObj_t semObj, phOsal_SemOpt_t opt)
| This function will create the Semaphore and return the handle. More...
phStatus_t | phOsal_SemPend (phOsal_Semaphore_t *semHandle, phOsal_TimerPeriodObj_t timePeriodToWait)
| This function will wait for the semaphore. More...
phStatus_t | phOsal_SemPost (phOsal_Semaphore_t *semHandle, phOsal_SemOpt_t opt)
| This function will release the semaphore. More...
phStatus_t | phOsal_SemDelete (phOsal_Semaphore_t *semHandle)
| This function will delete the semaphore. More...
phStatus_t | phOsal_MutexCreate (phOsal_Mutex_t *mutexHandle, pphOsal_MutexObj_t mutexObj)
| This function will create the Mutex and return the handle. More...
phStatus_t | phOsal_MutexLock (phOsal_Mutex_t *mutexHandle, phOsal_TimerPeriodObj_t timePeriodToWait)
| This function will lock the mutex. More...
phStatus_t | phOsal_MutexUnLock (phOsal_Mutex_t *mutexHandle)
| This function will unlock the semaphore. More...
phStatus_t | phOsal_MutexDelete (phOsal_Mutex_t *mutexHandle)
| This function will delete the semaphore. More...
phStatus_t | phOsal_TimerCreate (phOsal_Timer_t *timerHandle, pphOsal_TimerObj_t timerObj)
| This function will create the timer and return the handle. More...
phStatus_t | phOsal_TimerStart (phOsal_Timer_t *timerHandle)
| This function will start the timer. More...
phStatus_t | phOsal_TimerStop (phOsal_Timer_t *timerHandle)
| This function will stop the timer. More...
phStatus_t | phOsal_TimerGetCurrent (phOsal_Timer_t *timerHandle, uint32_t *pdwGetElapsedTime)
| This function will give the elapsed timing of the timer. More...
phStatus_t | phOsal_TimerModify (phOsal_Timer_t *timerHandle, pphOsal_TimerObj_t timerObj)
| This function is used to modify the parameters of the timer. More...
phStatus_t | phOsal_TimerDelete (phOsal_Timer_t *timerHandle)
| This function is delete the timer. More...
void | phOsal_StartScheduler (void)
| This function will start the scheduler. More...
typedef void * | phOsal_Thread_t
| Osal Thread Handle.
typedef struct phOsal_ThreadObj | phOsal_ThreadObj_t
| Osal Thread Object.
typedef void * | phOsal_Event_t
| Osal Event Handle.
typedef struct phOsal_EventObj | phOsal_EventObj_t
| Osal Event Object.
typedef uint32_t | phOsal_EventBits_t
| OS Event Bits.
enum | phOsal_EventOpt_t
| OS Event Options Enum.
enum | phOsal_EventOptPos_t
| OS Event Options Position Enum.
typedef void * | phOsal_Timer_t
| Osal Timer Handle.
enum | phOsal_TimerOpt_t
| OS Timer Options Enum.
typedef void(* | pphOsal_TimerCallback_t) (void *)
| OS Timer Callback.
enum | phOsal_TimerUnit_t
| OS Timer Unit Enum.
typedef struct phOsal_TimePeriodObj | phOsal_TimerPeriodObj_t
| Timer Period Object.
typedef struct phOsal_TimerObj | phOsal_TimerObj_t
| Osal Timer Object.
typedef void * | phOsal_Semaphore_t
| OS Semaphore Handle.
typedef struct phOsal_SemObj | phOsal_SemObj_t
| OS Semaphore Object.
enum | phOsal_SemOpt_t
| OS Event Options Enum.
typedef void * | phOsal_Mutex_t
| Mutex Handle.
typedef struct phOsal_MutexObj | phOsal_MutexObj_t
| Mutex Object.

## Detailed Description

This component implements the OSAL APIs used by the Nxp Reader Library.

All these functions are used by the NXP reader library internally.

If compiling only the library NxpNfcRdLib, the file NxpNfcRdLib/types/ph_NxpBuild_Lpc.h should define the Osal used by the User.

API Changes

Old API | Changed API
--- | ---
phOsal_Event_Consume() | phOsal_EventClear
phOsal_Event_Post() | phOsal_EventPost
phOsal_Event_WaitAll() | phOsal_EventPend
phOsal_Event_WaitAny() | phOsal_EventPend
phOsal_Mutex_Create() | phOsal_MutexCreate
phOsal_Mutex_Delete() | phOsal_MutexDelete
phOsal_Mutex_Give() | phOsal_MutexUnLock
phOsal_Mutex_Take() | phOsal_MutexLock
phOsal_Semaphore_Create() | phOsal_SemCreate
phOsal_Semaphore_Delete() | phOsal_SemDelete
phOsal_Semaphore_Give() | phOsal_SemPost
phOsal_Semaphore_Take() | phOsal_SemPend
phOsal_TaskDelay() | phOsal_ThreadDelay
phOsal_Timer_Create() | phOsal_TimerCreate
phOsal_Timer_Delete() | phOsal_TimerDelete
phOsal_Timer_Start() | phOsal_TimerStart
phOsal_Timer_Stop() | phOsal_TimerStop

The following internal APIs have been refactored and re-implemented for generic portability

Old Internal API | Status
--- | ---
phOsal_Event_Deinit() | Not Supported
phOsal_Event_GetDetail() | Not Supported
phOsal_Event_GetEventHandle() | Not Supported
phOsal_Event_Init() | Not Supported
phOsal_Event_PostwithDetail() | See also phOsal_EventPost
phOsal_Event_SetDetail() | Not Supported

New APIs
phOsal_StartScheduler
phOsal_ThreadCreate
phOsal_ThreadDelete
phOsal_EventDelete
phOsal_EventGet
phOsal_EventCreate

## Function Documentation

## § phOsal_Init()

phStatus_t phOsal_Init | ( | void |  | ) |

This function initializes the osal attributes with the default values.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.

## § phOsal_ThreadCreate()

phStatus_t phOsal_ThreadCreate | ( | phOsal_Thread_t * | threadHandle,
|  | pphOsal_ThreadObj_t | threadObj,
|  | pphOsal_StartFunc_t | startFunc,
|  | void * | arg
| ) |  |

This function starts a new thread in the calling process.

The new thread starts execution by invoking phOsal_StartScheduler().

Before returning, a successful call to phOsal_ThreadCreate() stores the ID of the new thread in the buffer pointed to by thread; this identifier is used to refer to the thread in subsequent calls to other functions.

Each task requires RAM that is used to hold the task state, and used by the task as its stack. If stackSizeInNum(threadObj.stackSizeInNum) is NULL, then the Task stack will be allocated dynamically otherwise it will allocated the static stack and this static stack should be allocated and provided by the user in threadObj(threadObj.pStackBuffer) structure.

Instead of using any proprietary function use phOsal_ThreadCreate() to create the task/thread.

Parameters

  [out] | threadHandle | Thread Handle, stores the ID of the new thread
  [in] | threadObj | Thread Object whose contents are used at thread creation time
  [in] | startFunc | The new thread starts execution by invoking Start function (startFunc).
  [in] | arg | The argument passed for the Start function (startFunc)

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.
  PH_ERR_RESOURCE_ERROR | Resource not available incase of Static allocation.

## § phOsal_ThreadDelete()

phStatus_t phOsal_ThreadDelete | ( | phOsal_Thread_t * | threadHandle | ) |

This function will delete the thread.

Instead of using any proprietary function use phOsal_ThreadDelete() to delete the task/thread.

Parameters

  [in] | threadHandle | Handle to the therad.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_ThreadChangePrio()

phStatus_t phOsal_ThreadChangePrio | ( | phOsal_Thread_t * | threadHandle,
|  | uint32_t | newPrio
| ) |  |

This function changes the priority of the thread.

phOsal_ThreadCreate should be called before using this Api.

Parameters

  [in] | threadHandle | Thread Handle.
  [in] | newPrio | New Priority of the thread.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_ThreadExit()

phStatus_t phOsal_ThreadExit | ( | void |  | ) |

This function exits the thread itself.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.

## § phOsal_ThreadDelay()

phStatus_t phOsal_ThreadDelay | ( | phOsal_Ticks_t | ticksToSleep | ) |

This function delays the calling thread.

Earlier phOsal_TaskDelay() functions was provided to delay the thread. Function phOsal_TaskDelay() is changed to phOsal_ThreadDelay() function to delay the thread.

Parameters

  [in] | ticksToSleep | Time to delay(in Ticks)

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.

## § phOsal_EventCreate()

phStatus_t phOsal_EventCreate | ( | phOsal_Event_t * | eventHandle,
|  | pphOsal_EventObj_t | eventObj
| ) |  |

This function will create the event group and returns the newly created event group.

Each event requires RAM that is used to hold the event group state.

Earlier phOsal_Event_Init() function was provided which was creating the event group. Functions phOsal_Event_Init() and phOsal_Event_GetEventHandle() are depreciated. Now the user has to use phOsal_EventCreate() function to create the event group.

Parameters

  [out] | eventHandle | Event handle
  [in] | eventObj | Event object used to create the event.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.
  PH_ERR_RESOURCE_ERROR | Resource not available incase of Static allocation.

## § phOsal_EventPend()

phStatus_t phOsal_EventPend | ( | volatile phOsal_Event_t * | eventHandle,
|  | phOsal_EventOpt_t | options,
|  | phOsal_Ticks_t | ticksToWait,
|  | phOsal_EventBits_t | FlagsToWait,
|  | phOsal_EventBits_t * | pCurrFlags
| ) |  |

This function will wait for the events.

Parameters

  [in] | eventHandle | Event handle
  [in] | options | Event options phOsal_EventOpt_t.
  [in] | ticksToWait | Time to wait(in Ticks)
  [in] | FlagsToWait | Events to wait.
  [out] | pCurrFlags | Events at the time either the event bits being waited for became set or the block time expired

Earlier phOsal_Event_WaitAny()/phOsal_Event_WaitAll() functions was provided to wait for the events. Functions phOsal_Event_WaitAny()/phOsal_Event_WaitAll() are depreciated. Now the user has to use phOsal_EventPend() function to wait/pend on events.

To achieve the functionality of phOsal_Event_WaitAny() : options value has to be E_OS_EVENT_OPT_PEND_SET_ANY To achieve the functionality of phOsal_Event_WaitAll() : options value has to be E_OS_EVENT_OPT_PEND_SET_ALL To clear set event which are passed as FlagsToWait on exit : options value has to be E_OS_EVENT_OPT_PEND_CLEAR_ON_EXIT

To achieive multiple functionality options can be ORed and provided. Example : To wait for any event generated and clear the generated events on exit, then the options value has be : (E_OS_EVENT_OPT_PEND_SET_ANY | E_OS_EVENT_OPT_PEND_CLEAR_ON_EXIT)

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.
  PH_ERR_IO_TIMEOUT | Desired events didn't occur during the wait time(ticksToWait).

## § phOsal_EventPost()

phStatus_t phOsal_EventPost | ( | phOsal_Event_t * | eventHandle,
|  | phOsal_EventOpt_t | options,
|  | phOsal_EventBits_t | FlagsToPost,
|  | phOsal_EventBits_t * | pCurrFlags
| ) |  |

This function will post the events.

Earlier phOsal_Event_Post() function was taking three arguments. which are (phOsal_EventType_t eEvtType, phOsal_EventSource_t eSrc, phOsal_EventDestination_t eDest) Functions phOsal_Event_PostwithDetail() and phOsal_Event_SetDetail() are depreciated. And Function phOsal_Event_Post() is changed t phOsal_EventPost which will accept four arguments. Now the user has to use phOsal_EventPost() function to post the events.

Parameters

  [in] | eventHandle | Event handle
  [in] | options | Event options phOsal_EventOpt_t.
  [in] | FlagsToPost | Events to post.
  [out] | pCurrFlags | Events at the time either the event bits being posted.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_EventClear()

phStatus_t phOsal_EventClear | ( | phOsal_Event_t * | eventHandle,
|  | phOsal_EventOpt_t | options,
|  | phOsal_EventBits_t | FlagsToClear,
|  | phOsal_EventBits_t * | pCurrFlags
| ) |  |

This function will clear the events.

Earlier phOsal_Event_Consume() functions was provided to clear the events. Function phOsal_Event_Consume() is changed t phOsal_EventClear() which will accept four arguments. Now the user has to use phOsal_EventClear() function to clear the events.

Parameters

  [in] | eventHandle | Event handle
  [in] | options | Event options phOsal_EventOpt_t.
  [in] | FlagsToClear | Events to clear.
  [out] | pCurrFlags | Events at the time either the event bits being cleared.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_EventGet()

phStatus_t phOsal_EventGet | ( | phOsal_Event_t * | eventHandle,
|  | phOsal_EventBits_t * | pCurrFlags
| ) |  |

This function will get the events which are already there.

Earlier phOsal_Event_GetDetail() functions was provided to get the event details. Function phOsal_Event_GetDetail() is depreciated. Now the user has to use phOsal_EventGet() function to get the events.

Parameters

  [in] | eventHandle | Event handle
  [out] | pCurrFlags | Events at the time either the event bits being cleared.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_EventDelete()

phStatus_t phOsal_EventDelete | ( | phOsal_Event_t * | eventHandle | ) |

This function will delete the events.

Earlier phOsal_Event_Deinit() functions was provided to delete the event group. Function phOsal_Event_Deinit() is depreciated. Now the user has to use phOsal_EventDelete() function to delete the event group.

Parameters

  [in] | eventHandle | Event handle.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_SemCreate()

phStatus_t phOsal_SemCreate | ( | phOsal_Semaphore_t * | semHandle,
|  | pphOsal_SemObj_t | semObj,
|  | phOsal_SemOpt_t | opt
| ) |  |

This function will create the Semaphore and return the handle.

Earlier phOsal_Semaphore_Create() functions was provided to create the semaphore. Function phOsal_Semaphore_Create() is depreciated. Now the user has to use phOsal_SemCreate() function to create the semaphore.

Parameters

  [out] | semHandle | Newly created Semaphore Handle.
  [in] | semObj | Semaphore Object. This will be used to create the semaphore.
  [in] | opt | Option for Semaphore creation phOsal_SemOpt_t

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.
  PH_ERR_RESOURCE_ERROR | Resource not available incase of Static allocation.

## § phOsal_SemPend()

phStatus_t phOsal_SemPend | ( | phOsal_Semaphore_t * | semHandle,
|  | phOsal_TimerPeriodObj_t | timePeriodToWait
| ) |  |

This function will wait for the semaphore.

The semaphore must be created with a call to phOsal_SemCreate().

Earlier phOsal_Semaphore_Take() functions was provided to take the semaphore. Function phOsal_Semaphore_Take() is depreciated. Now the user has to use phOsal_SemPend() function to pend/take the semaphore.

Parameters

  [in] | semHandle | Semaphore handle
  [in] | timePeriodToWait | Time to wait phOsal_TimerPeriodObj_t.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.
  PH_ERR_IO_TIMEOUT | Time expired without semaphore becoming available.

## § phOsal_SemPost()

phStatus_t phOsal_SemPost | ( | phOsal_Semaphore_t * | semHandle,
|  | phOsal_SemOpt_t | opt
| ) |  |

This function will release the semaphore.

Earlier phOsal_Semaphore_Give() functions was provided to give the semaphore. Function phOsal_Semaphore_Give() is depreciated. Now the user has to use phOsal_SemPost() function to post/give the semaphore.

Parameters

  [in] | semHandle | Semaphore handle
  [in] | opt | Semaphore options phOsal_SemOpt_t.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_SemDelete()

phStatus_t phOsal_SemDelete | ( | phOsal_Semaphore_t * | semHandle | ) |

This function will delete the semaphore.

Earlier phOsal_Semaphore_Delete() functions was provided to delete the semaphore. Function phOsal_Semaphore_Delete() is changed to phOsal_SemDelete() function to delete the semaphore.

Parameters

  [in] | semHandle | Semaphore handle.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_MutexCreate()

phStatus_t phOsal_MutexCreate | ( | phOsal_Mutex_t * | mutexHandle,
|  | pphOsal_MutexObj_t | mutexObj
| ) |  |

This function will create the Mutex and return the handle.

Earlier phOsal_Mutex_Create() functions was provided to create the mutex. Function phOsal_Mutex_Create() is changed to phOsal_MutexCreate() function to create the mutex.

Parameters

  [out] | mutexHandle | Newly created Mutex Handle.
  [in] | mutexObj | Mutex Object. This will be used to create the mutex.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.
  PH_ERR_RESOURCE_ERROR | Resource not available incase of Static allocation.

## § phOsal_MutexLock()

phStatus_t phOsal_MutexLock | ( | phOsal_Mutex_t * | mutexHandle,
|  | phOsal_TimerPeriodObj_t | timePeriodToWait
| ) |  |

This function will lock the mutex.

The semaphore must be created with a call to phOsal_SemCreate().

Earlier phOsal_Mutex_Take() functions was provided to take the semaphore. Function phOsal_Mutex_Take() is depreciated. Now the user has to use phOsal_MutexLock() function to Lock/take the semaphore.

Parameters

  [in] | mutexHandle | Semaphore handle
  [in] | timePeriodToWait | Time to wait for mutex lock phOsal_TimerPeriodObj_t.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.
  PH_ERR_IO_TIMEOUT | Time expired without mutex getting locked.

## § phOsal_MutexUnLock()

phStatus_t phOsal_MutexUnLock | ( | phOsal_Mutex_t * | mutexHandle | ) |

This function will unlock the semaphore.

Earlier phOsal_Mutex_Give() functions was provided to give the semaphore. Function phOsal_Mutex_Give() is depreciated. Now the user has to use phOsal_MutexUnLock() function to UnLock/give the semaphore.

Parameters

  [in] | mutexHandle | Mutex handle

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.

## § phOsal_MutexDelete()

phStatus_t phOsal_MutexDelete | ( | phOsal_Mutex_t * | mutexHandle | ) |

This function will delete the semaphore.

Earlier phOsal_Mutex_Delete() functions was provided to delete the mutex. Function phOsal_Mutex_Delete() is changed to phOsal_MutexDelete() function to delete the mutex.

Parameters

  [in] | mutexHandle | Mutex handle.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.
  PH_ERR_UNSUPPORTED_COMMAND | Command not supported.

## § phOsal_TimerCreate()

phStatus_t phOsal_TimerCreate | ( | phOsal_Timer_t * | timerHandle,
|  | pphOsal_TimerObj_t | timerObj
| ) |  |

This function will create the timer and return the handle.

This function will also configure the timer.

Earlier phOsal_Timer_Create() functions was provided to create the timer. Function phOsal_Timer_Create() is changed to phOsal_TimerCreate() function to create the timer.

Parameters

  [out] | timerHandle | Newly created Timer Handle.
  [in] | timerObj | Timer Object. This will be used to create the timer.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.
  PH_ERR_RESOURCE_ERROR | Resource not available incase of Static allocation.

## § phOsal_TimerStart()

phStatus_t phOsal_TimerStart | ( | phOsal_Timer_t * | timerHandle | ) |

This function will start the timer.

Earlier phOsal_Timer_Start() functions was provided to start the timer. Function phOsal_Timer_Start() is changed to phOsal_TimerStart() function to start the timer. And the function phOsal_Timer_Reset() is depreciated.

Parameters

  [in] | timerHandle | Newly created Timer Handle.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_TimerStop()

phStatus_t phOsal_TimerStop | ( | phOsal_Timer_t * | timerHandle | ) |

This function will stop the timer.

Earlier phOsal_Timer_Stop() functions was provided to stop the timer. Function phOsal_Timer_Stop() is changed to phOsal_TimerStop() function to stop the timer.

Parameters

  [in] | timerHandle | Newly created Timer Handle.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_TimerGetCurrent()

phStatus_t phOsal_TimerGetCurrent | ( | phOsal_Timer_t * | timerHandle,
|  | uint32_t * | pdwGetElapsedTime
| ) |  |

This function will give the elapsed timing of the timer.

Parameters

  [in] | timerHandle | Newly created Timer Handle.
  [out] | dwGetElapsedTime | Elapsed Time value(ms)

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_TimerModify()

phStatus_t phOsal_TimerModify | ( | phOsal_Timer_t * | timerHandle,
|  | pphOsal_TimerObj_t | timerObj
| ) |  |

This function is used to modify the parameters of the timer.

Parameters

  [in] | timerHandle | Newly created Timer Handle.
  [in] | timerObj | Timer object used to modify the timer.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_TimerDelete()

phStatus_t phOsal_TimerDelete | ( | phOsal_Timer_t * | timerHandle | ) |

This function is delete the timer.

Earlier phOsal_Timer_Delete() functions was provided to delete the timer. Function phOsal_Timer_Delete() is changed to phOsal_TimerDelete() function to delete the timer.

Parameters

  [in] | timerHandle | Newly created Timer Handle.

Returns
  Status of the API

Return values

  PH_ERR_SUCCESS | Operation successful.
  PH_ERR_INVALID_PARAMETER | Parameter passed is invalid.

## § phOsal_StartScheduler()

void phOsal_StartScheduler | ( | void |  | ) |

This function will start the scheduler.

If insufficient memory, this function will exit. In normal case this function should not exit.

Instead of using any proprietary function use phOsal_StartScheduler() to schedule the tasks/threads.