This is an old revision of the document!
Third column of table consist service's proprties:
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 | |
OS_Timer | | Insrease all active timers. | |
Waiting | |||
OS_Yield | | Return to scheduler | |
OS_Delay | (delaytime) | Delay current task for delaytime system ticks | |
OS_Wait | (condition) | Wait for condition is true | |
OS_Wait_TO | (condition, timeout) | Wait for condition is true. Exit if timeout expired. | |
Checking | |||
bool OS_IsTimeout | | Return true if timeout occured in previos wait service. | |
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 | |
OS_LeaveInt | | For PICC16 and PICC18: restore saved FSR in the end of ISR function | |
char OS_DI | | Disable all interrupts and save previos state of GIEx flags | |
OS_EI | | Enable all interrupts | |
OS_RI | (char) | Restore previosly saved by OS_DI service GIEx flags | |
OS_EnterCriticalSection | | Enter critical section | |
OS_LeaveCriticalSection | | Leave critical section |
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 | |
OS_Task_Replace | (priority, TaskName) | Stop and delete current task and create new task | |
OS_Task_Delete | (tp) | Delete task | |
Menagement | |||
OST_TASK_POINTER OS_Task_GetCur | | Get pointer to currect task's descriptor | |
OST_TASK_POINTER OS_Task_GetCreated | | Get pointer to just created task's descriptor | |
OS_Task_Pause | (tp) | Pause task | |
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 |
Service | Arguments | Description | Properties |
---|---|---|---|
Menagement | |||
OS_Bsem_Set | (bsem) | Signal binary semaphore | |
OS_Bsem_Reset | (bsem) | Reset binary semaphore | |
OS_Bsem_Switch | (bsem) | Change binary semaphore's state | |
Checking | |||
bool OS_Bsem_Check | (bsem) | Check for binary semaphore is set | |
Waiting | |||
OS_Bsem_Wait | (bsem) | Wait for binary semaphore is set | |
OS_Bsem_Wait_TO | (bsem, timeout) | Wait for binary semaphore is set. Exit if timeout expired. |
Service | Arguments | Description | Properties |
---|---|---|---|
Creating | |||
OS_Csem_Create | (csem) | Create and zero counting semaphore | |
Menagement | |||
OS_Csem_Signal | (csem) | Increase counting semaphore's value by 1 (wait when overflow) | |
OS_Csem_Signal_Now | (csem) | Increase counting semaphore's value by 1 (don't wait when overflow) | |
OS_Csem_Set | (csem) | Set counting semaphore's value to 1. | |
OS_Csem_SetValue | (csem, value) | Set counting semaphore's value to given value. | |
OS_Csem_Reset | (csem) | Zero counting semaphore | |
Checking | |||
bool OS_Csem_Check | (csem) | Check for counting semaphore is set (not eq. to 0) | |
OS_Csem_Accept | (csem) | Accept counting semaphore. Decrease it's value by 1. | |
Waiting | |||
OS_Csem_Wait | (csem) | Wait for counting semaphore. Then decrease it's value by 1 | |
OS_Csem_Wait_TO | (csem, timeout) | Wait for counting semaphore. Then decrease it's value by 1. Exit if timeout expired |
Service | Arguments | Description | Properties |
---|---|---|---|
Creating | |||
OS_Msg_Create | (msg_cb) | Create message and zero it. | |
Sending | |||
OS_Msg_Send | (msg_cb, message) | Send message. If message is already exists then wait when it became free. | |
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. | |
OS_Msg_Send_Now | (msg_cb, message) | Send message. If message is already exists then it will be overwritten. | |
Checking | |||
bool OS_Msg_Check | (msg_cb) | Check for message exists | |
OS_Msg_Accept | (msg_cb, os_msg_type_var) | Accept existing message. After accepting message is set free. | |
Waiting | |||
OS_Msg_Wait | (msg_cb, os_msg_type_var) | Wait for message. After waiting message is set free | |
OS_Msg_Wait_TO | (msg_cb, os_msg_type_var, timeout) | Wait for message. Exit if timeout expired. |
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. | |
OS_Smsg_Send_TO | (smsg, smessage, timeout) | Send simple message. If message already exists then wait when it became free. Exit if timeout expired. | |
OS_Smsg_Send_Now | (smsg, smessage) | Send simple message. If message already exists then it will be overwritten. | |
Checking | |||
bool OS_Smsg_Check | (smsg) | Check for simple message exists | |
OS_Smsg_Accept | (smsg, os_smsg_type_var) | Accept existing simple message. After accepting message is cleared. | |
Waiting | |||
OS_Smsg_Wait | (smsg, os_smsg_type_var) | Wait for simple message. After accepting simple message is cleared. | |
OS_Smsg_Wait_TO | (smsg, os_smsg_type_var, timeout) | Wait for simple message. After accepting simple message is cleared. Exit if timeout expired. |
Service | Arguments | Description | Properties |
---|---|---|---|
Creating | |||
OS_Queue_Create | (queue, buffer, size) | Create and clear queue. | |
Sending | |||
OS_Queue_Send | (queue, message) | Send message via queue. If queue full then wait for free place | |
OS_Queue_Send_TO | (queue, message, timeout) | Send message via queue. If queue full then wait for free place. Exit if timeout expired. | |
OS_Queue_Send_Now | (queue, message) | Send message via queue. If queue is full then most rearly message will be pushed out. | |
Checking | |||
bool OS_Queue_Check | (queue) | Check for there is any message in queue. | |
bool OS_Queue_IsFull | (queue) | Check for queue of messages is full. | |
bool OS_Queue_IsEmpty | (queue) | Check for queue of messages is empty. | |
Waiting | |||
OS_Queue_Wait | (queue, os_msg_type_var) | Wait message from queue. After accepting message will be deleted from queue. | |
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. |
Service | Arguments | Description | Properties |
---|---|---|---|
Creating | |||
OS_Squeue_Create | (squeue, buffer, size) | Create and clear queue. | |
Sending | |||
OS_Squeue_Send | (squeue, smessage) | Send simple message via queue. If queue full then wait for free place | |
OS_Squeue_Send_TO | (squeue, smessage, timeout) | Send message via queue. If queue full then wait for free place. Exit if timeout expired. | |
OS_Squeue_Send_Now | (squeue, smessage) | Send message via queue. If queue is full then most rearly message will be pushed out. | |
Checking | |||
bool OS_Squeue_Check | (squeue) | Check for there is any simple message in queue. | |
bool OS_Squeue_IsFull | (squeue) | Check for queue of simple messages is full. | |
bool OS_Squeue_IsEmpty | (squeue) | Check for queue of simple messages is empty. | |
Waiting | |||
OS_Squeue_Wait | (squeue, os_smsg_type_var) | Wait message from queue. After accepting message will be deleted from queue. | |
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. |
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 | |
OS_Flag_Set_1 | (flags, mask) | (flag = flags | mask) Set bits in flag by given mask | |
OS_Flag_Set_0 | (flags, mask) | (flag &= ~mask) Clear bits in flag by given mask | |
Checking | |||
bool OS_Flag_Check_11 | (flags, mask) | ( if ((flag & mask)==mask) ) Check for all bits in flags are set by given mask | |
bool OS_Flag_Check_1x | (flags, mask) | ( if ((flag & mask)!=0) ) Check for any bit in flags is set by given mask | |
bool OS_Flag_Check_00 | (flags, mask) | ( if ((flag & mask)==0) ) Check for all bits in flag are cleared by given mask | |
bool OS_Flag_Check_0x | (flags, mask) | ( if ((flag & mask)!=mask) ) Check for any bit in flag is cleared by given mask | |
Waiting | |||
OS_Flag_Wait_11 | (flags, mask) | ( if ((flag & mask)==mask) ) Wait for all bits in flags are set by given mask | |
OS_Flag_Wait_1x | (flags, mask) | ( wait ((flag & mask)!=0) ) Wait for any bit in flags is set by given mask | |
OS_Flag_Wait_00 | (flags, mask) | ( wait ((flag & mask)==0) ) Wait for all bits in flag are cleared by given mask | |
OS_Flag_Wait_0x | (flags, mask) | ( wait ((flag & mask)!=mask) ) Wait for any bit in flag is cleared by given mask | |
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. | |
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. | |
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. | |
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. |
Service | Arguments | Description | Properties |
---|---|---|---|
Control | |||
OS_Ttimer_Run | (time) | Start counting current task's timer | |
OS_Ttimer_Break | () | Stop and reset current task's timer. Timeout flag is set. | |
OS_Ttimer_Wait | () | Wait for current task's timer overflowed | |
OS_Ttimer_Delay | (delay) | Delay using current task's timer (same as OS_Delay) | |
Checking | |||
_OST_TTIMER OS_Ttimer_Get | () | Get current task's timer's remaining time | |
bool OS_Ttimer_Check | () | Check for current task's timer overflowed | |
bool OS_Ttimer_IsRun | () | Check for current task's timer is counting | |
Additional | |||
OS_Ttimer_Pause | () | Pause current task's timer. Overflow bit will be set. | |
OS_Ttimer_Continue | () | Continue counting after pause |
Service | Arguments | Description | Properties |
---|---|---|---|
Create/Delete | |||
OS_Stimer_Alloc | (var_stimer_id) | Allocate static timer | |
OS_Stimer_Free | (stimer_id) | Free static timer | |
bool OS_Stimer_Found | () | Check for free timers enable to allocate | |
Control | |||
OS_Stimer_Run | (stimer_id, time) | Start counting static timer | |
OS_Stimer_Break | (stimer_id) | Stop and reset static timer. Timeout flag is set. | |
OS_Stimer_Wait | (stimer_id) | Wait for static timer overflowed | |
OS_Stimer_Delay | (stimer_id, delay) | Delay current task using static timer | |
Checking | |||
_OST_STIMER OS_Stimer_Get | (stimer_id) | Get static timer's remaining time | |
bool OS_Stimer_Check | (stimer_id) | Check for static timer overflowed | |
bool OS_Stimer_IsRun | (stimer_id) | Check for static timer is counting | |
Additional | |||
OS_Stimer_Pause | (stimer_id) | Pause timer. Overflow bit will be set. | |
OS_Stimer_Continue | (stimer_id) | Continue counting after pause |
Service | Arguments | Description | Properties |
---|---|---|---|
Creating/Deleting | |||
OS_Qtimer_Create | (qtimer) | Add timer in quque of active timers | |
OS_Qtimer_Delete | (qtimer) | Delete timer from queue of active timers | |
Control | |||
OS_Qtimer_Run | (qtimer, newtime) | Start counting with given newtime. Timeout flag is cleared. | |
OS_Qtimer_Break | (qtimer) | Stop timer and delete it from queue. Timeout flag became set. | |
OS_Qtimer_Wait | (qtimer) | Wait for timer will be overflowed | |
OS_Qtimer_Delay | (qtimer, delay) | Delay current task using timer | |
Checking | |||
_OST_QTIMER OS_Qtimer_Get | (qtimer) | Get dinamic timer's remaining time. | |
bool OS_Qtimer_Check | (qtimer) | Check for timer is overflowed | |
bool OS_Qtimer_IsRun | (qtimer) | Check for timer is counting |
Service | Arguments | Description | Properties |
---|---|---|---|
Creating/Deleting | |||
OS_Dtimer_Create | (dtimer) | Add dynamic timer in list of active timers | |
OS_Dtimer_Delete | (dtimer) | Delete dynamic timer from list of active timers | |
Control | |||
OS_Dtimer_Run | (dtimer, newtime) | Start counting with given newtime. Timeout flag is cleared. | |
OS_Dtimer_Break | (dtimer) | Stop dynamic timer. Timeout flag became set. | |
OS_Dtimer_Wait | (dtimer) | Wait for dynamic timer overflowed | |
OS_Dtimer_Delay | (dtimer, delay) | Delay current task using dynamic timer | |
Checking | |||
_OST_DTIMER OS_Dtimer_Get | (dtimer) | Get dinamic timer's remaining time. | |
bool OS_Dtimer_Check | (dtimer) | Check for dynamic timer overflowed | |
bool OS_Dtimer_IsRun | (dtimer) | Check for dynamic timer is counting | |
Additional | |||
OS_Dtimer_Pause | (dtimer) | Stop/pause dynamic timer. Timeout flag remain unchanged. | |
OS_Dtimer_Continue | (dtimer) | Continue dinamic timer's counting after pause. Timeout flag remain unchanged. | |
OS_Dtimer_Update | (dtimer, time) | Re-run static timer for time time since last overflow. Timeout flag is cleared. | |
OS_Dtimer_Add | (dtimer, addtime) | Increase time of dinamic timer counter. Timeout flag remain unchanged. | |
bool OS_Dtimer_IsActive | (dtimer) | Check for dynamic timer present in list of active timers | |
bool OS_Dtimer_IsStopped | (dtimer) | Check for dynamic timer is stopped |
Service | Arguments | Description | Properties |
---|---|---|---|
Control | |||
OS_Oldtimer_Run8 | (timer8_id, time) | Start counting 8-bit timer | |
OS_Oldtimer_Run16 | (timer16_id, time) | Start counting 16-bit timer | |
OS_Oldtimer_Run24 | (timer24_id, time) | Start counting 24-bit timer | |
OS_Oldtimer_Run32 | (timer32_id, time) | Start counting 32-bit timer | |
OS_Oldtimer_Stop | (timer_id) | Stop/pause static timer. Timeout flag is set. | |
Checking | |||
bool OS_Oldtimer_Check | (timer_id) | Chek for static timer overflowed | |
Waiting | |||
OS_Oldtimer_Wait | (timer_id) | Wait for static timer overflowed |