IAR PowerPac RTOS User Guide
IAR PowerPac RTOS User Guide IAR PowerPac RTOS User Guide
COPYRIGHT NOTICE© Copyright 2006–2007 IAR Systems. All rights reserved.No part of this document may be reproduced without the prior written consent of IARSystems. The software described in this document is furnished under a license and may onlybe used or copied in accordance with the terms of such a license.DISCLAIMERThe information in this document is subject to change without notice and does not representa commitment on any part of IAR Systems. While the information contained herein isassumed to be accurate, IAR Systems assumes no responsibility for any errors or omissions.In no event shall IAR Systems, its employees, its contractors, or the authors of this documentbe liable for special, direct, indirect, or consequential damage, losses, costs, charges, claims,demands, claim for lost profits, fees, or expenses of any nature or kind.TRADEMARKSIAR, IAR Systems, IAR Embedded Workbench, IAR MakeApp, C-SPY, visualSTATE, FromIdea To Target, IAR KickStart Kit and IAR PowerPac are trademarks or registered trademarksowned by IAR Systems AB.Microsoft and Windows are registered trademarks of Microsoft Corporation.All other product names are trademarks or registered trademarks of their respective owners.EDITION NOTICESecond edition: June 2007Part number: PPRTOS-2Internal reference: 2.10, 3.40A, Rev.1, ISUD.PPRTOS-2
PrefaceWelcome to the IAR PowerPac RTOS for ARM Cores. The purpose of this guide is to provide you with detailedreference information that can help you to use the IAR PowerPac RTOS to best suit your applicationrequirements.Who should read this guideYou should read this guide if you plan to develop an embedded system using IAR PowerPac RTOS and need to getdetailed reference information about it. This document assumes that you already have a solid knowledge of thefollowing:● The software tools used for building your application (assembler, linker, C compiler)● The C programming language● The target processor● DOS command line.If you feel that your knowledge of C is not sufficient, we recommend The C Programming Language by Kernighan andRichie (ISBN 0-13-1103628), which describes the standard in C-programming and, in newer editions, also covers theANSI C standard.How to use this guideThe intention of this guide is to give you a CPU- and compiler-independent introduction to IAR PowerPac RTOS andto be a reference for all IAR PowerPac RTOS API functions.For a quick and easy startup with IAR PowerPac RTOS, refer to Chapter 2 in the CPU & Compiler Specifics manualof IAR PowerPac RTOS documentation, which includes a step-by-step introduction to using IAR PowerPac RTOS.Document conventionsTYPOGRAPHIC CONVENTIONS FOR SYNTAXThis guide uses the following typographic conventions:StyleKeywordParameterSampleReferenceGUIElementEmphasisUsed forTable 1: Typographic conventionsText that you enter at the command-prompt or that appears on the display (that is systemfunctions, file- or pathnames).Parameters in API functions.Sample code in program examples.Reference to chapters, tables and figures or other documents.Buttons, dialog boxes, menu names, menu commands.Very important sectionsPPRTOS-2 3
- Page 1: IAR PowerPac RTOSUser GuidePPRTOS-2
- Page 5 and 6: ContentsPreface ...................
- Page 7 and 8: ContentsOS_WaitCSema() ............
- 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
COPYRIGHT NOTICE© Copyright 2006–2007 <strong>IAR</strong> Systems. All rights reserved.No part of this document may be reproduced without the prior written consent of <strong>IAR</strong>Systems. The software described in this document is furnished under a license and may onlybe used or copied in accordance with the terms of such a license.DISCLAIMERThe information in this document is subject to change without notice and does not representa commitment on any part of <strong>IAR</strong> Systems. While the information contained herein isassumed to be accurate, <strong>IAR</strong> Systems assumes no responsibility for any errors or omissions.In no event shall <strong>IAR</strong> Systems, its employees, its contractors, or the authors of this documentbe liable for special, direct, indirect, or consequential damage, losses, costs, charges, claims,demands, claim for lost profits, fees, or expenses of any nature or kind.TRADEMARKS<strong>IAR</strong>, <strong>IAR</strong> Systems, <strong>IAR</strong> Embedded Workbench, <strong>IAR</strong> MakeApp, C-SPY, visualSTATE, FromIdea To Target, <strong>IAR</strong> KickStart Kit and <strong>IAR</strong> <strong>PowerPac</strong> are trademarks or registered trademarksowned by <strong>IAR</strong> Systems AB.Microsoft and Windows are registered trademarks of Microsoft Corporation.All other product names are trademarks or registered trademarks of their respective owners.EDITION NOTICESecond edition: June 2007Part number: PP<strong>RTOS</strong>-2Internal reference: 2.10, 3.40A, Rev.1, ISUD.PP<strong>RTOS</strong>-2