IAR PowerPac RTOS User Guide

IAR PowerPac RTOS User Guide IAR PowerPac RTOS User Guide

ie.ksu.edu.tw
from ie.ksu.edu.tw More from this publisher
11.07.2015 Views

Prototypevoid OS_StartTimer (OS_TIMER* pTimer);ParameterDescriptionpTimerPointer to the OS_TIMER data structure which contains the data of the timer.Table 22: OS_StartTimer() parameter listAdditional InformationOS_StartTimer() is used for the following reasons:●●Start a timer which was created by OS_CreateTimer(). The timer will start with its initial timer value.Restart a timer which was stopped by calling OS_StopTimer(). In this case, the timer will continue with theremaining time value which was preserved by stopping the timer.ImportantThis function has no effect on running timers. It also has no effect on timers that are not running, but has expired. UseOS_RetriggerTimer() to restart those timers.OS_StopTimer()DescriptionStops a specified timer.Prototypevoid OS_StopTimer (OS_TIMER* pTimer);ParameterDescriptionpTimerTable 23: OS_StopTimer() parameter listAdditional InformationThe actual value of the timer (the time until expiration) is kept until OS_StartTimer() lets the timer continue.OS_RetriggerTimer()DescriptionRestarts a specified timer with its initial time value.Prototypevoid OS_RetriggerTimer (OS_TIMER* pTimer);ParameterDescriptionpTimerTable 24: OS_RetriggerTimer() parameter listAdditional InformationOS_RetriggerTimer() restarts the timer using the initial time value programmed at creation of the timer or with thefunction OS_SetTimerPeriod().ExampleOS_TIMER TIMERCursor;BOOL CursorOn;Pointer to the OS_TIMER data structure which contains the data of the timer.Pointer to the OS_TIMER data structure which contains the data of the timer.void TimerCursor(void) {if (CursorOn) ToggleCursor(); /* Invert character at cursor-position */OS_RetriggerTimer(&TIMERCursor); /* Make timer periodical */}void InitTask(void) {/* Create and start TimerCursor */OS_CREATETIMER(&TIMERCursor, TimerCursor, 500);}40IAR PowerPac RTOSfor ARM CoresPPRTOS-2

Software timersOS_SetTimerPeriod()DescriptionSets a new timer reload value for a specified timer.Prototypevoid OS_SetTimerPeriod (OS_TIMER* pTimer,OS_TIME Period);ParameterDescriptionpTimerPeriodTable 25: OS_SetTimerPeriod() parameter listAdditional InformationOS_SetTimerPeriod() sets the initial time value of the specified timer. Period is the reload value of the timer to beused as initial value when the timer is retriggered by OS_RetriggerTimer().ExampleOS_TIMER TIMERPulse;BOOL CursorOn;void TimerPulse(void) {if TogglePulseOutput(); /* Toggle output */OS_RetriggerTimer(&TIMERCursor); /* Make timer periodical */}void InitTask(void) {/* Create and start Pulse Timer with first pulse = 500ms */OS_CREATETIMER(&TIMERPulse, TimerPulse, 500);/* Set timer period to 200 ms for further pulses */OS_SetTimerPeriod(&TIMERPulse, 200);}OS_DeleteTimer()DescriptionStops and deletes a specified timer.Prototypevoid OS_DeleteTimer (OS_TIMER* pTimer);ParameterDescriptionpTimerTable 26: OS_DeleteTimer() parameter listAdditional InformationThe timer is stopped and therefore removed out of the linked list of running timers. In debug builds of IAR PowerPacRTOS, the timer is also marked as invalid.OS_GetTimerPeriod()DescriptionReturns the current reload value of a specified timer.PrototypePointer to the OS_TIMER data structure which contains the data of the timer.Timer period in basic IAR PowerPac RTOS time units (nominal ms):The data type OS_TIME defaults to an integer, therefore valid values are1

Prototypevoid OS_StartTimer (OS_TIMER* pTimer);ParameterDescriptionpTimerPointer to the OS_TIMER data structure which contains the data of the timer.Table 22: OS_StartTimer() parameter listAdditional InformationOS_StartTimer() is used for the following reasons:●●Start a timer which was created by OS_CreateTimer(). The timer will start with its initial timer value.Restart a timer which was stopped by calling OS_StopTimer(). In this case, the timer will continue with theremaining time value which was preserved by stopping the timer.ImportantThis function has no effect on running timers. It also has no effect on timers that are not running, but has expired. UseOS_RetriggerTimer() to restart those timers.OS_StopTimer()DescriptionStops a specified timer.Prototypevoid OS_StopTimer (OS_TIMER* pTimer);ParameterDescriptionpTimerTable 23: OS_StopTimer() parameter listAdditional InformationThe actual value of the timer (the time until expiration) is kept until OS_StartTimer() lets the timer continue.OS_RetriggerTimer()DescriptionRestarts a specified timer with its initial time value.Prototypevoid OS_RetriggerTimer (OS_TIMER* pTimer);ParameterDescriptionpTimerTable 24: OS_RetriggerTimer() parameter listAdditional InformationOS_RetriggerTimer() restarts the timer using the initial time value programmed at creation of the timer or with thefunction OS_SetTimerPeriod().ExampleOS_TIMER TIMERCursor;BOOL CursorOn;Pointer to the OS_TIMER data structure which contains the data of the timer.Pointer to the OS_TIMER data structure which contains the data of the timer.void TimerCursor(void) {if (CursorOn) ToggleCursor(); /* Invert character at cursor-position */OS_RetriggerTimer(&TIMERCursor); /* Make timer periodical */}void InitTask(void) {/* Create and start TimerCursor */OS_CREATETIMER(&TIMERCursor, TimerCursor, 500);}40<strong>IAR</strong> <strong>PowerPac</strong> <strong>RTOS</strong>for ARM CoresPP<strong>RTOS</strong>-2

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

Saved successfully!

Ooh no, something went wrong!