Available Languages?:

This is an old revision of the document!


ALL OSA SERVICES

Third column of table consist service's proprties:

Service uses system timer
Do not call from ISR
Call from task only
Allowed calls only from task and functions called by task (any deep)
Switchs context
Call from ISR only
Have alternate service for work in ISR (suffix "_I")

System services

Service Arguments Description Properties
System
OS_Sched List all tasks, select ready task with highest priority and run it.
OS_Run Run operating system's kernel. Calls OS_Sched() in infinite loop.
OS_Init Init system vars Not allowed in interrupt
OS_Timer Insrease all active timers.
Waiting
OS_Yield Return to scheduler Allowed only in taskSwitches contexts
OS_Delay (delaytime) Delay current task for delaytime system ticks Allowed only in taskSwitches contextsService uses system timer
OS_Wait (condition) Wait for condition is true Allowed only in taskSwitches contexts
OS_Wait_TO (condition, timeout) Wait for condition is true. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer
Checking
bool
OS_IsTimeout
Return true if timeout occured in previos wait service. Service uses system timer
bool
OS_IsError
Check for error after task creating
bool
OS_IsEventError
Check for error after work with events
bool
OS_IsInCriticalSection
Return true if one of task is in critical section
Interrupts
OS_EnterInt For PICC16 and PICC18: save FSR in the begin of ISR function Only insize interrupt
OS_LeaveInt For PICC16 and PICC18: restore saved FSR in the end of ISR function Only insize interrupt
char
OS_DI
Disable all interrupts and save previos state of GIEx flags Not allowed in interrupt
OS_EI Enable all interrupts Not allowed in interrupt
OS_RI (char) Restore previosly saved by OS_DI service GIEx flags Not allowed in interrupt
OS_EnterCriticalSection Enter critical section Allowed only in task
OS_LeaveCriticalSection Leave critical section Allowed only in task

Task control

Service Arguments Description Properties
Creating/Deleting
OS_Task_Define (TaskName) For CCS: Tell to compiler that function Taskname is a task and it will be called indirrectly. This service called from main() only main
OS_Task_Create (priority, TaskName) Create task and add it to list of active tasks Not allowed in interrupt
OS_Task_Replace (priority, TaskName) Stop and delete current task and create new task Allowed only in task
OS_Task_Delete (tp) Delete task Switches contexts
Menagement
OST_TASK_POINTER
OS_Task_GetCur
Get pointer to currect task's descriptor Allowed only in task
OST_TASK_POINTER
OS_Task_GetCreated
Get pointer to just created task's descriptor
OS_Task_Pause (tp) Pause task Switches contexts
OS_Task_Continue (tp) Continue paused task
char
OS_Task_GetPriority
(tp) Get priority of task
OS_Task_SetPriority (tp, priority) Change task's priority
Checking
OS_Task_IsPaused (tp) Check for task s paused

Binary semaphores

Service Arguments Description Properties
Menagement
OS_Bsem_Set (bsem) Signal binary semaphore Have alternate service for work in ISR (suffix "_I")
OS_Bsem_Reset (bsem) Reset binary semaphore Have alternate service for work in ISR (suffix "_I")
OS_Bsem_Switch (bsem) Change binary semaphore's state Have alternate service for work in ISR (suffix "_I")
Checking
bool
OS_Bsem_Check
(bsem) Check for binary semaphore is set Have alternate service for work in ISR (suffix "_I")
Waiting
OS_Bsem_Wait (bsem) Wait for binary semaphore is set Allowed only in taskSwitches contexts
OS_Bsem_Wait_TO (bsem, timeout) Wait for binary semaphore is set. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer

Counting semaphores

Service Arguments Description Properties
Creating
OS_Csem_Create (csem) Create and zero counting semaphore Not allowed in interrupt
Menagement
OS_Csem_Signal (csem) Increase counting semaphore's value by 1 (wait when overflow) Allowed only in taskSwitches contexts
OS_Csem_Signal_Now (csem) Increase counting semaphore's value by 1 (don't wait when overflow) Have alternate service for work in ISR (suffix "_I")
OS_Csem_Set (csem) Set counting semaphore's value to 1. Have alternate service for work in ISR (suffix "_I")
OS_Csem_SetValue (csem, value) Set counting semaphore's value to given value. Have alternate service for work in ISR (suffix "_I")
OS_Csem_Reset (csem) Zero counting semaphore Have alternate service for work in ISR (suffix "_I")
Checking
bool
OS_Csem_Check
(csem) Check for counting semaphore is set (not eq. to 0) Have alternate service for work in ISR (suffix "_I")
OS_Csem_Accept (csem) Accept counting semaphore. Decrease it's value by 1. Have alternate service for work in ISR (suffix "_I")
Waiting
OS_Csem_Wait (csem) Wait for counting semaphore. Then decrease it's value by 1 Allowed only in taskSwitches contexts
OS_Csem_Wait_TO (csem, timeout) Wait for counting semaphore. Then decrease it's value by 1. Exit if timeout expired Allowed only in taskSwitches contextsService uses system timer

Pointers to messages

Service Arguments Description Properties
Creating
OS_Msg_Create (msg_cb) Create message and zero it. Not allowed in interrupt
Sending
OS_Msg_Send (msg_cb, message) Send message. If message is already exists then wait when it became free. Allowed only in taskSwitches contexts
OS_Msg_Send_TO (msg_cb, message, timeout) Send message. If message is already exists then wait when it became free. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer
OS_Msg_Send_Now (msg_cb, message) Send message. If message is already exists then it will be overwritten. Have alternate service for work in ISR (suffix "_I")
Checking
bool
OS_Msg_Check
(msg_cb) Check for message exists Have alternate service for work in ISR (suffix "_I")
OS_Msg_Accept (msg_cb, os_msg_type_var) Accept existing message. After accepting message is set free. Have alternate service for work in ISR (suffix "_I")
Waiting
OS_Msg_Wait (msg_cb, os_msg_type_var) Wait for message. After waiting message is set free Allowed only in taskSwitches contexts
OS_Msg_Wait_TO (msg_cb, os_msg_type_var, timeout) Wait for message. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer

Simple messages

Service Arguments Description Properties
Creating
OS_Smsg_Create (smsg) Create and zero simple message
Sending
OS_Smsg_Send (smsg, smessage) Send simple message. If message already exists then wait when it became free. Allowed only in taskSwitches contexts
OS_Smsg_Send_TO (smsg, smessage, timeout) Send simple message. If message already exists then wait when it became free. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer
OS_Smsg_Send_Now (smsg, smessage) Send simple message. If message already exists then it will be overwritten. Have alternate service for work in ISR (suffix "_I")
Checking
bool
OS_Smsg_Check
(smsg) Check for simple message exists Have alternate service for work in ISR (suffix "_I")
OS_Smsg_Accept (smsg, os_smsg_type_var) Accept existing simple message. After accepting message is cleared. Have alternate service for work in ISR (suffix "_I")
Waiting
OS_Smsg_Wait (smsg, os_smsg_type_var) Wait for simple message. After accepting simple message is cleared. Allowed only in taskSwitches contexts
OS_Smsg_Wait_TO (smsg, os_smsg_type_var, timeout) Wait for simple message. After accepting simple message is cleared. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer

Queue of pointers to message

Service Arguments Description Properties
Creating
OS_Queue_Create (queue, buffer, size) Create and clear queue. Not allowed in interrupt
Sending
OS_Queue_Send (queue, message) Send message via queue. If queue full then wait for free place Allowed only in taskSwitches contexts
OS_Queue_Send_TO (queue, message, timeout) Send message via queue. If queue full then wait for free place. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer
OS_Queue_Send_Now (queue, message) Send message via queue. If queue is full then most rearly message will be pushed out. Have alternate service for work in ISR (suffix "_I")
Checking
bool
OS_Queue_Check
(queue) Check for there is any message in queue. Have alternate service for work in ISR (suffix "_I")
bool
OS_Queue_IsFull
(queue) Check for queue of messages is full. Have alternate service for work in ISR (suffix "_I")
bool
OS_Queue_IsEmpty
(queue) Check for queue of messages is empty. Have alternate service for work in ISR (suffix "_I")
Waiting
OS_Queue_Wait (queue, os_msg_type_var) Wait message from queue. After accepting message will be deleted from queue. Allowed only in taskSwitches contexts
OS_Queue_Wait_TO (queue, os_msg_type_var, timeout) Wait message from queue. After accepting message will be deleted from queue. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer

Queue of simple messages

Service Arguments Description Properties
Creating
OS_Squeue_Create (squeue, buffer, size) Create and clear queue. Not allowed in interrupt
Sending
OS_Squeue_Send (squeue, smessage) Send simple message via queue. If queue full then wait for free place Allowed only in taskSwitches contexts
OS_Squeue_Send_TO (squeue, smessage, timeout) Send message via queue. If queue full then wait for free place. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer
OS_Squeue_Send_Now (squeue, smessage) Send message via queue. If queue is full then most rearly message will be pushed out. Have alternate service for work in ISR (suffix "_I")
Checking
bool
OS_Squeue_Check
(squeue) Check for there is any simple message in queue. Have alternate service for work in ISR (suffix "_I")
bool
OS_Squeue_IsFull
(squeue) Check for queue of simple messages is full. Have alternate service for work in ISR (suffix "_I")
bool
OS_Squeue_IsEmpty
(squeue) Check for queue of simple messages is empty. Have alternate service for work in ISR (suffix "_I")
Waiting
OS_Squeue_Wait (squeue, os_smsg_type_var) Wait message from queue. After accepting message will be deleted from queue. Allowed only in taskSwitches contexts
OS_Squeue_Wait_TO (squeue, os_smsg_type_var, timeout) Wait message from queue. After accepting message will be deleted from queue. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer

Flags

Service Arguments Description Properties
Creating
OS_Flag_Create (flags) (flag = 0) Create flag and clear all it's bits (flag = 0)
Menagement
OS_Flag_Init (flags, value) (flag = value) Set flag to givel value Have alternate service for work in ISR (suffix "_I")
OS_Flag_Set_1 (flags, mask) (flag = flags | mask) Set bits in flag by given mask Have alternate service for work in ISR (suffix "_I")
OS_Flag_Set_0 (flags, mask) (flag &= ~mask) Clear bits in flag by given mask Have alternate service for work in ISR (suffix "_I")
Checking
bool
OS_Flag_Check_11
(flags, mask) ( if ((flag & mask)==mask) ) Check for all bits in flags are set by given mask Have alternate service for work in ISR (suffix "_I")
bool
OS_Flag_Check_1x
(flags, mask) ( if ((flag & mask)!=0) ) Check for any bit in flags is set by given mask Have alternate service for work in ISR (suffix "_I")
bool
OS_Flag_Check_00
(flags, mask) ( if ((flag & mask)==0) ) Check for all bits in flag are cleared by given mask Have alternate service for work in ISR (suffix "_I")
bool
OS_Flag_Check_0x
(flags, mask) ( if ((flag & mask)!=mask) ) Check for any bit in flag is cleared by given mask Have alternate service for work in ISR (suffix "_I")
Waiting
OS_Flag_Wait_11 (flags, mask) ( if ((flag & mask)==mask) ) Wait for all bits in flags are set by given mask Allowed only in taskSwitches contexts
OS_Flag_Wait_1x (flags, mask) ( wait ((flag & mask)!=0) ) Wait for any bit in flags is set by given mask Allowed only in taskSwitches contexts
OS_Flag_Wait_00 (flags, mask) ( wait ((flag & mask)==0) ) Wait for all bits in flag are cleared by given mask Allowed only in taskSwitches contexts
OS_Flag_Wait_0x (flags, mask) ( wait ((flag & mask)!=mask) ) Wait for any bit in flag is cleared by given mask Allowed only in taskSwitches contexts
OS_Flag_Wait_11_TO (flags, mask, timeout) ( wait ((flag & mask)==mask) ) Wait for all bits in flags are set by given mask. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer
OS_Flag_Wait_1x_TO (flags, mask, timeout) ( wait ((flag & mask)!=0) ) Wait for any bit in flags is set by given mask. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer
OS_Flag_Wait_00_TO (flags, mask, timeout) ( wait ((flag & mask)==0) ) Wait for all bits in flag are cleared by given mask. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer
OS_Flag_Wait_0x_TO (flags, mask, timeout) ( wait ((flag & mask)!=mask) ) Wait for any bit in flag is cleared by given mask. Exit if timeout expired. Allowed only in taskSwitches contextsService uses system timer

Timers

Task timers

Service Arguments Description Properties
Control
OS_Ttimer_Run (time) Start counting current task's timer Service uses system timerAllowed only in task and functions called by task
OS_Ttimer_Break () Stop and reset current task's timer. Timeout flag is set. Service uses system timerAllowed only in task and functions called by task
OS_Ttimer_Wait () Wait for current task's timer overflowed Service uses system timerAllowed only in taskSwitches contexts
OS_Ttimer_Delay (delay) Delay using current task's timer (same as OS_Delay) Service uses system timerAllowed only in taskSwitches contexts
Checking
_OST_TTIMER
OS_Ttimer_Get
() Get current task's timer's remaining time Service uses system timerAllowed only in task and functions called by task
bool
OS_Ttimer_Check
() Check for current task's timer overflowed Service uses system timerAllowed only in task and functions called by task
bool
OS_Ttimer_IsRun
() Check for current task's timer is counting Service uses system timerAllowed only in task and functions called by task
Additional
OS_Ttimer_Pause () Pause current task's timer. Overflow bit will be set. Service uses system timerAllowed only in task and functions called by task
OS_Ttimer_Continue () Continue counting after pause Service uses system timerAllowed only in task and functions called by task

Static timers

Service Arguments Description Properties
Create/Delete
OS_Stimer_Alloc (var_stimer_id) Allocate static timer Service uses system timerNot allowed in interrupt
OS_Stimer_Free (stimer_id) Free static timer Service uses system timerNot allowed in interrupt
bool
OS_Stimer_Found
() Check for free timers enable to allocate Service uses system timerNot allowed in interrupt
Control
OS_Stimer_Run (stimer_id, time) Start counting static timer Service uses system timer
OS_Stimer_Break (stimer_id) Stop and reset static timer. Timeout flag is set. Service uses system timer
OS_Stimer_Wait (stimer_id) Wait for static timer overflowed Service uses system timerAllowed only in taskSwitches contexts
OS_Stimer_Delay (stimer_id, delay) Delay current task using static timer Service uses system timerAllowed only in taskSwitches contexts
Checking
_OST_STIMER
OS_Stimer_Get
(stimer_id) Get static timer's remaining time Service uses system timer
bool
OS_Stimer_Check
(stimer_id) Check for static timer overflowed Service uses system timer
bool
OS_Stimer_IsRun
(stimer_id) Check for static timer is counting Service uses system timer
Additional
OS_Stimer_Pause (stimer_id) Pause timer. Overflow bit will be set. Service uses system timer
OS_Stimer_Continue (stimer_id) Continue counting after pause Service uses system timer

Queue of timers

Service Arguments Description Properties
Creating/Deleting
OS_Qtimer_Create (qtimer) Add timer in quque of active timers Service uses system timerNot allowed in interrupt
OS_Qtimer_Delete (qtimer) Delete timer from queue of active timers Service uses system timerNot allowed in interrupt
Control
OS_Qtimer_Run (qtimer, newtime) Start counting with given newtime. Timeout flag is cleared. Service uses system timer
OS_Qtimer_Break (qtimer) Stop timer and delete it from queue. Timeout flag became set. Service uses system timer
OS_Qtimer_Wait (qtimer) Wait for timer will be overflowed Service uses system timerAllowed only in taskSwitches contexts
OS_Qtimer_Delay (qtimer, delay) Delay current task using timer Service uses system timerAllowed only in taskSwitches contexts
Checking
_OST_QTIMER
OS_Qtimer_Get
(qtimer) Get dinamic timer's remaining time. Service uses system timer
bool
OS_Qtimer_Check
(qtimer) Check for timer is overflowed Service uses system timer
bool
OS_Qtimer_IsRun
(qtimer) Check for timer is counting Service uses system timer

Old style timers

Dynamic timers

Service Arguments Description Properties
Creating/Deleting
OS_Dtimer_Create (dtimer) Add dynamic timer in list of active timers Service uses system timerNot allowed in interrupt
OS_Dtimer_Delete (dtimer) Delete dynamic timer from list of active timers Service uses system timerNot allowed in interrupt
Control
OS_Dtimer_Run (dtimer, newtime) Start counting with given newtime. Timeout flag is cleared. Service uses system timer
OS_Dtimer_Break (dtimer) Stop dynamic timer. Timeout flag became set. Service uses system timer
OS_Dtimer_Wait (dtimer) Wait for dynamic timer overflowed Service uses system timerAllowed only in taskSwitches contexts
OS_Dtimer_Delay (dtimer, delay) Delay current task using dynamic timer Service uses system timerAllowed only in taskSwitches contexts
Checking
_OST_DTIMER
OS_Dtimer_Get
(dtimer) Get dinamic timer's remaining time. Service uses system timer
bool
OS_Dtimer_Check
(dtimer) Check for dynamic timer overflowed Service uses system timer
bool
OS_Dtimer_IsRun
(dtimer) Check for dynamic timer is counting Service uses system timer
Additional
OS_Dtimer_Pause (dtimer) Stop/pause dynamic timer. Timeout flag remain unchanged. Service uses system timer
OS_Dtimer_Continue (dtimer) Continue dinamic timer's counting after pause. Timeout flag remain unchanged. Service uses system timer
OS_Dtimer_Update (dtimer, time) Re-run static timer for time time since last overflow. Timeout flag is cleared. Service uses system timer
OS_Dtimer_Add (dtimer, addtime) Increase time of dinamic timer counter. Timeout flag remain unchanged. Service uses system timer
bool
OS_Dtimer_IsActive
(dtimer) Check for dynamic timer present in list of active timers Service uses system timer
bool
OS_Dtimer_IsStopped
(dtimer) Check for dynamic timer is stopped Service uses system timer

Old style static timers (not recommended to use)

Service Arguments Description Properties
Control
OS_Oldtimer_Run8 (timer8_id, time) Start counting 8-bit timer Service uses system timer
OS_Oldtimer_Run16 (timer16_id, time) Start counting 16-bit timer Service uses system timer
OS_Oldtimer_Run24 (timer24_id, time) Start counting 24-bit timer Service uses system timer
OS_Oldtimer_Run32 (timer32_id, time) Start counting 32-bit timer Service uses system timer
OS_Oldtimer_Stop (timer_id) Stop/pause static timer. Timeout flag is set. Service uses system timer
Checking
bool
OS_Oldtimer_Check
(timer_id) Chek for static timer overflowed Service uses system timer
Waiting
OS_Oldtimer_Wait (timer_id) Wait for static timer overflowed Service uses system timerAllowed only in taskSwitches contexts
 
en/osa/ref/services/brieflist.1268225726.txt.gz · Last modified: 10.03.2010 15:55 by osa_chief
 
Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki