IAR PowerPac RTOS User Guide
IAR PowerPac RTOS User Guide IAR PowerPac RTOS User Guide
Prototypevoid OS_CREATECSEMA (OS_CSEMA* pCSema);ParameterDescriptionpCSemaTable 49: OS_CREATECSEMA() parameter listAdditional InformationTo create a counting semaphore, a data structure of the type OS_CSEMA needs to be defined in memory and initializedusing OS_CREATECSEMA(). The value of a semaphore created using this macro is zero. If, for any reason, you have tocreate a semaphore with an initial counting value above zero, use the function OS_CreateCSema().OS_CreateCSema()DescriptionCreates a counting semaphore with a specified initial count value.Prototypevoid OS_CreateCSema (OS_CSEMA*OS_UINTParameterDescriptionpCSemaInitValueTable 50: OS_CreateCSema() parameter listAdditional InformationpCSema,InitValue);To create a counting semaphore, a data structure of the type OS_CSEMA needs to be defined in memory and initializedusing OS_CreateCSema(). If the value of the created semaphore should be zero, the macro OS_CREATECSEMA()should be used.OS_SignalCSema()DescriptionIncrements the counter of a semaphore.Prototypevoid OS_SignalCSema (OS_CSEMA * pCSema);ParameterDescriptionpCSemaTable 51: OS_SignalCSema() parameter listAdditional InformationOS_SignalCSema() signals an event to a semaphore by incrementing its counter. If one or more tasks are waiting foran event to be signaled to this semaphore, the task that has the highest priority will become the active task. The countercan have a maximum value of 0xFFFF for 8/16-bit CPUs / 0xFFFFFFFF for 32-bit CPUs. It is the responsibility of theapplication to make sure that this limit will not be exceeded.OS_SignalCSemaMax()DescriptionPointer to a data structure of type OS_CSEMA.Pointer to a data structure of type OS_CSEMA.Initial count value of the semaphore:0
Counting SemaphoresPrototypevoid OS_SignalCSemaMax (OS_CSEMA* pCSema,OS_UINT MaxValue );ParameterDescriptionpCSemaPointer to a data structure of type OS_CSEMA.MaxValueLimit of semaphore count value.1
- 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
- Page 53 and 54: Resource semaphoresOS_Request()Desc
- Page 55: Counting SemaphoresIntroductionCoun
- Page 59 and 60: Counting SemaphoresReturn value0: I
- Page 61 and 62: MailboxesWhy mailboxes?In the prece
- Page 63 and 64: MailboxesMailboxes API function ove
- Page 65 and 66: MailboxesExampleSingle-byte mailbox
- Page 67 and 68: MailboxesPrototypevoid OS_GetMail (
- Page 69 and 70: MailboxesOS_WaitMail()DescriptionWa
- Page 71 and 72: QueuesWhy queues?In the preceding c
- Page 73 and 74: QueuesReturn valueThe size of the r
- Page 75 and 76: QueuesExamplestatic void MemoryTask
- Page 77 and 78: Task eventsIntroductionTask events
- Page 79 and 80: Task eventsExampleOS_WaitEventTimed
- Page 81 and 82: Task eventsPrototypechar OS_ClearEv
- Page 83 and 84: Event objectsIntroductionEvent obje
- Page 85 and 86: Event objectsExampleif (OS_EVENT_Wa
- Page 87 and 88: Event objectsExampleOS_EVENT_Reset(
- Page 89 and 90: Heap type memory managementANSI C o
- Page 91 and 92: Fixed block size memory poolsIntrod
- Page 93 and 94: Fixed block size memory poolsProtot
- Page 95 and 96: Fixed block size memory poolsProtot
- Page 97 and 98: StacksIntroductionThe stack is the
- Page 99 and 100: InterruptsIntroductionIn this chapt
- Page 101 and 102: InterruptsRules for interrupt handl
- Page 103 and 104: InterruptsOS_LeaveInterruptNoSwitch
- Page 105 and 106: InterruptsNesting interrupt routine
Prototypevoid OS_CREATECSEMA (OS_CSEMA* pCSema);ParameterDescriptionpCSemaTable 49: OS_CREATECSEMA() parameter listAdditional InformationTo create a counting semaphore, a data structure of the type OS_CSEMA needs to be defined in memory and initializedusing OS_CREATECSEMA(). The value of a semaphore created using this macro is zero. If, for any reason, you have tocreate a semaphore with an initial counting value above zero, use the function OS_CreateCSema().OS_CreateCSema()DescriptionCreates a counting semaphore with a specified initial count value.Prototypevoid OS_CreateCSema (OS_CSEMA*OS_UINTParameterDescriptionpCSemaInitValueTable 50: OS_CreateCSema() parameter listAdditional InformationpCSema,InitValue);To create a counting semaphore, a data structure of the type OS_CSEMA needs to be defined in memory and initializedusing OS_CreateCSema(). If the value of the created semaphore should be zero, the macro OS_CREATECSEMA()should be used.OS_SignalCSema()DescriptionIncrements the counter of a semaphore.Prototypevoid OS_SignalCSema (OS_CSEMA * pCSema);ParameterDescriptionpCSemaTable 51: OS_SignalCSema() parameter listAdditional InformationOS_SignalCSema() signals an event to a semaphore by incrementing its counter. If one or more tasks are waiting foran event to be signaled to this semaphore, the task that has the highest priority will become the active task. The countercan have a maximum value of 0xFFFF for 8/16-bit CPUs / 0xFFFFFFFF for 32-bit CPUs. It is the responsibility of theapplication to make sure that this limit will not be exceeded.OS_SignalCSemaMax()DescriptionPointer to a data structure of type OS_CSEMA.Pointer to a data structure of type OS_CSEMA.Initial count value of the semaphore:0