IAR PowerPac RTOS User Guide
IAR PowerPac RTOS User Guide IAR PowerPac RTOS User Guide
OS_Terminate()......................................................................................................................................33OS_WakeTask().....................................................................................................................................34OS_IsTask() ...........................................................................................................................................34OS_GetTaskID() ....................................................................................................................................34OS_GetpCurrentTask() ..........................................................................................................................35Software timers.............................................................................................................................................. 37Software timer ...................................................................................................................................37Extended software timer ........................................................................................................................37Software timers API function overview ..........................................................................................38OS_CREATETIMER() ..........................................................................................................................38OS_CreateTimer()..................................................................................................................................39OS_StartTimer().....................................................................................................................................39OS_StopTimer().....................................................................................................................................40OS_RetriggerTimer() .............................................................................................................................40OS_SetTimerPeriod().............................................................................................................................41OS_DeleteTimer()..................................................................................................................................41OS_GetTimerPeriod()............................................................................................................................41OS_GetTimerValue().............................................................................................................................42OS_GetTimerStatus().............................................................................................................................42OS_GetpCurrentTimer() ........................................................................................................................42OS_CREATETIMER_EX()...................................................................................................................43OS_CreateTimerEx() .............................................................................................................................44OS_StartTimerEx() ................................................................................................................................45OS_StopTimerEx() ................................................................................................................................45OS_RetriggerTimerEx().........................................................................................................................46OS_SetTimerPeriodEx() ........................................................................................................................46OS_DeleteTimerEx() .............................................................................................................................47OS_GetTimerPeriodEx()........................................................................................................................47OS_GetTimerValueEx() ........................................................................................................................47OS_GetTimerStatusEx() ........................................................................................................................48OS_GetpCurrentTimerEx()....................................................................................................................48Resource semaphores................................................................................................................................... 49Introduction........................................................................................................................................49Resource semaphores API function overview ................................................................................51OS_CREATERSEMA().........................................................................................................................51OS_Use()................................................................................................................................................51OS_Unuse()............................................................................................................................................52OS_Request() .........................................................................................................................................53OS_GetSemaValue()..............................................................................................................................54OS_GetResourceOwner() ......................................................................................................................54OS_DeleteRSema() ................................................................................................................................54Counting Semaphores................................................................................................................................... 55Introduction........................................................................................................................................55Counting semaphores API function overview ...............................................................................55OS_CREATECSEMA().........................................................................................................................55OS_CreateCSema() ................................................................................................................................56OS_SignalCSema() ................................................................................................................................56OS_SignalCSemaMax().........................................................................................................................566IAR PowerPac RTOSfor ARM CoresPPRTOS-2
ContentsOS_WaitCSema() ..................................................................................................................................57OS_WaitCSemaTimed() ........................................................................................................................57OS_CSemaRequest() .............................................................................................................................58OS_GetCSemaValue()...........................................................................................................................58OS_SetCSemaValue()............................................................................................................................58OS_DeleteCSema()................................................................................................................................59Mailboxes......................................................................................................................................................... 61Why mailboxes?................................................................................................................................. 61Basics................................................................................................................................................... 61Typical applications ........................................................................................................................... 61Single-byte mailbox functions .......................................................................................................... 62Mailboxes API function overview..................................................................................................... 63OS_CREATEMB() ................................................................................................................................63OS_PutMail() / OS_PutMail1() .............................................................................................................64OS_PutMailCond() / OS_PutMailCond1()............................................................................................65OS_PutMailFront() / OS_PutMailFront1()............................................................................................65OS_PutMailFrontCond() / OS_PutMailFrontCond1() ..........................................................................66OS_GetMail() / OS_GetMail1() ............................................................................................................66OS_GetMailCond() / OS_GetMailCond1()...........................................................................................67OS_GetMailTimed() ..............................................................................................................................68OS_WaitMail() ......................................................................................................................................69OS_ClearMB().......................................................................................................................................69OS_GetMessageCnt() ............................................................................................................................69OS_DeleteMB() .....................................................................................................................................70Queues............................................................................................................................................................. 71Why queues? ...................................................................................................................................... 71Basics................................................................................................................................................... 71Queues API function overview......................................................................................................... 71OS_Q_Create() ......................................................................................................................................71OS_Q_Put()............................................................................................................................................72OS_Q_GetPtr() ......................................................................................................................................72OS_Q_GetPtrCond()..............................................................................................................................73OS_Q_GetPtrTimed() ............................................................................................................................74OS_Q_Purge()........................................................................................................................................74OS_Q_Clear() ........................................................................................................................................75OS_Q_GetMessageCnt() .......................................................................................................................75Task events...................................................................................................................................................... 77Introduction ....................................................................................................................................... 77Events API function overview .......................................................................................................... 77OS_WaitEvent().....................................................................................................................................77OS_WaitSingleEvent() ..........................................................................................................................78OS_WaitEventTimed() ..........................................................................................................................78OS_WaitSingleEventTimed() ................................................................................................................79OS_SignalEvent() ..................................................................................................................................79OS_GetEventsOccurred() ......................................................................................................................80OS_ClearEvents() ..................................................................................................................................80PPRTOS-27
- Page 1 and 2: IAR PowerPac RTOSUser GuidePPRTOS-2
- Page 3 and 4: PrefaceWelcome to the IAR PowerPac
- Page 5: ContentsPreface ...................
- Page 9 and 10: ContentsOS_LeaveInterrupt() .......
- Page 11 and 12: Introduction to IAR PowerPacRTOSWha
- Page 13 and 14: Basic conceptsTasksIn this context,
- Page 15 and 16: Basic conceptsPREEMPTIVES MULTITASK
- Page 17 and 18: Basic conceptsMAILBOXES AND QUEUESA
- Page 19 and 20: Basic conceptsThe active task may b
- Page 21 and 22: Basic conceptsThe flowchart below i
- Page 23 and 24: Basic conceptsLIST OF LIBRARIESIn y
- Page 25 and 26: Task routinesIntroductionA task tha
- Page 27 and 28: Task routinesOS_CREATETASK() can be
- Page 29 and 30: Task routinesExampleThe following e
- Page 31 and 32: Task routinesExampleint sec,min;voi
- Page 33 and 34: Task routinesAdditional Information
- Page 35 and 36: Task routinesReturn valueOS_TASKID:
- Page 37 and 38: Software timersSoftware timerA soft
- Page 39 and 40: Software timers#define OS_CREATETIM
- Page 41 and 42: Software timersOS_SetTimerPeriod()D
- Page 43 and 44: Software timersAdditional Informati
- Page 45 and 46: Software timersAdditional Informati
- Page 47 and 48: Software timersExampleOS_TIMER TIME
- Page 49 and 50: Resource semaphoresIntroductionReso
- Page 51 and 52: Resource semaphoresResource semapho
- Page 53 and 54: Resource semaphoresOS_Request()Desc
- Page 55 and 56: Counting SemaphoresIntroductionCoun
ContentsOS_WaitCSema() ..................................................................................................................................57OS_WaitCSemaTimed() ........................................................................................................................57OS_CSemaRequest() .............................................................................................................................58OS_GetCSemaValue()...........................................................................................................................58OS_SetCSemaValue()............................................................................................................................58OS_DeleteCSema()................................................................................................................................59Mailboxes......................................................................................................................................................... 61Why mailboxes?................................................................................................................................. 61Basics................................................................................................................................................... 61Typical applications ........................................................................................................................... 61Single-byte mailbox functions .......................................................................................................... 62Mailboxes API function overview..................................................................................................... 63OS_CREATEMB() ................................................................................................................................63OS_PutMail() / OS_PutMail1() .............................................................................................................64OS_PutMailCond() / OS_PutMailCond1()............................................................................................65OS_PutMailFront() / OS_PutMailFront1()............................................................................................65OS_PutMailFrontCond() / OS_PutMailFrontCond1() ..........................................................................66OS_GetMail() / OS_GetMail1() ............................................................................................................66OS_GetMailCond() / OS_GetMailCond1()...........................................................................................67OS_GetMailTimed() ..............................................................................................................................68OS_WaitMail() ......................................................................................................................................69OS_ClearMB().......................................................................................................................................69OS_GetMessageCnt() ............................................................................................................................69OS_DeleteMB() .....................................................................................................................................70Queues............................................................................................................................................................. 71Why queues? ...................................................................................................................................... 71Basics................................................................................................................................................... 71Queues API function overview......................................................................................................... 71OS_Q_Create() ......................................................................................................................................71OS_Q_Put()............................................................................................................................................72OS_Q_GetPtr() ......................................................................................................................................72OS_Q_GetPtrCond()..............................................................................................................................73OS_Q_GetPtrTimed() ............................................................................................................................74OS_Q_Purge()........................................................................................................................................74OS_Q_Clear() ........................................................................................................................................75OS_Q_GetMessageCnt() .......................................................................................................................75Task events...................................................................................................................................................... 77Introduction ....................................................................................................................................... 77Events API function overview .......................................................................................................... 77OS_WaitEvent().....................................................................................................................................77OS_WaitSingleEvent() ..........................................................................................................................78OS_WaitEventTimed() ..........................................................................................................................78OS_WaitSingleEventTimed() ................................................................................................................79OS_SignalEvent() ..................................................................................................................................79OS_GetEventsOccurred() ......................................................................................................................80OS_ClearEvents() ..................................................................................................................................80PP<strong>RTOS</strong>-27