11.07.2015 Views

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Software timers API function overviewRoutineOS_CREATETIMER()OS_CreateTimer()OS_StartTimer()OS_StopTimer()OS_RetriggerTimer()OS_SetTimerPeriod()OS_DeleteTimer()OS_GetTimerPeriod()OS_GetTimerValue()OS_GetTimerStatus()OS_GetpCurrentTimer()OS_CREATETIMER_EX()OS_CreateTimer_Ex()OS_StartTimer_Ex()OS_StopTimer_Ex()OS_RetriggerTimer_Ex()OS_SetTimerPeriod_Ex()OS_DeleteTimer_Ex()OS_GetTimerPeriod_Ex()OS_GetTimerValue_Ex()OS_GetTimerStatus_Ex()OS_GetpCurrentTimer_Ex()Table 19: Software timers APIOS_CREATETIMER()DescriptionMacro that creates and starts a software-timer.Prototypevoid OS_CREATETIMER (OS_TIMER* pTimer,OS_TIMERROUTINE* Callback,OS_TIME Timeout);ParameterDescriptionpTimerCallbackTimeoutTable 20: OS_CREATETIMER() parameter listAdditional Information<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> keeps track of the timers by using a linked list. Once the timeout is expired, the callback routinewill be called immediately (unless the task is in a critical region or has interrupts disabled).This macro uses the functions OS_CreateTimer() and OS_StartTimer(). It is supplied for backwardcompatibility; in newer applications these routines should be called directly instead.OS_TIMERROUTINE is defined in <strong>RTOS</strong>.h as follows:typedef void OS_TIMERROUTINE(void);Source of the macro (in <strong>RTOS</strong>.h):DescriptionCreates and starts a software-timer.Creates a software timer (but does not start it).Starts a specified timer.Stops a specified timer.Restarts a specified timer with its initial time value.Sets a new timer reload value for a specified timer.Stops and deletes a specified timer.Returns the current reload value of a specified timer.Returns the remaining timer value of a specified timer.Returns the current timer status of a specified timer.Returns a pointer to the data structure of the timer that just expired.Creates and starts an extended software-timer.Creates an extended software timer without starting it.Starts a specified extended timer.Stops a specified extended timer.Restarts a specified extended timer with its initial time value.Sets a new timer reload value for a specified extended timer.Stops and deletes a specified extended timer.Returns the current reload value of a specified extended timer.Returns the remaining timer value of a specified extended timer.Returns the current timer status of a specified extended timer.Returns a pointer to the data structure of the extended timer that just expired.Pointer to the OS_TIMER data structure which contains the data of the timer.Pointer to the callback routine to be called from the <strong>RTOS</strong> after expiration of the delay.Initial timeout in basic <strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong> time units (nominal ms):The data type OS_TIME defaults to an integer, therefore valid values are1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!