![]() |
SikendeRTOS
RTOS for ARM Cortex M3+ SoCs designed and written from scratch
|
Functions for OS. More...
Go to the source code of this file.
Data Structures | |
struct | Sema4 |
struct | MailBox |
Typedefs | |
typedef struct Sema4 | Sema4Type |
typedef struct MailBox | MailBoxType |
Functions | |
void | OS_Init (void) |
initialize operating system, disable interrupts until OS_Launch initialize OS controlled I/O: serial, ADC, systick, LaunchPad I/O and timers More... | |
void | OS_InitSemaphore (Sema4Type *semaPt, INT32 value) |
Initialize semaphore to given value. More... | |
void | OS_Wait (Sema4Type *semaPt) |
semaphore value decrement More... | |
void | OS_Signal (Sema4Type *semaPt) |
This function(Spinlock) will signal that a mutual exclusion is taking place in a function. More... | |
void | OS_bWait (Sema4Type *semaPt) |
Wait on semaphore, binary. More... | |
void | OS_bSignal (Sema4Type *semaPt) |
Signal semaphore to be free, set to 1. More... | |
void | OS_ASM_Signal (Sema4Type *semaPt) |
Spinlock semaphore signal using ARM exclusion. More... | |
void | OS_ASM_Wait (Sema4Type *semaPt) |
Spinlock semaphore wait using ARM exclusion. More... | |
INT8 | OS_AddThread (void(*task)(void), INT32U priority) |
This function decides next thread to run, now uses priority scheduler. More... | |
INT32U | OS_IdThread (void) |
Get current thread ID. More... | |
INT8 | OS_AddPeriodicThread (void(*task)(void), INT32U period, INT32U priority) |
Adds periodic background thread. Cannot spin, sleep, die, rest, etc. cause it's ISR, depends on hardware for number of tasks possible No ID for this thread, must have mid-high priority to run properly. More... | |
INT8 | OS_AddSW1Task (void(*task)(void), INT32U priority) |
This function adds a thread to run and its priority when a button is pressed. More... | |
INT8 | OS_AddSW2Task (void(*task)(void), INT32U priority) |
This function adds a thread to run and its priority when a button is pressed. More... | |
void | OS_Sleep (INT32U sleepTime) |
This function puts a thread to sleep. More... | |
void | OS_Kill (void) |
This function kill/deletes current thread from schedule. More... | |
void | OS_Suspend (void) |
This function suspends current thread by forcing context switch call. More... | |
void | OS_Fifo_Init (void) |
INT8 | OS_Fifo_Put (FIFO_t data) |
FIFO_t | OS_Fifo_Get (void) |
INT32U | OS_Fifo_Size (void) |
Gets current size of FiFo. More... | |
void | OS_MailBox_Init (void) |
Initialize mailbox for OS. More... | |
void | OS_MailBox_Send (INT32U data) |
This function will be called from a foreground thread It will spin/block if the MailBox contains data not yet received. More... | |
INT32U | OS_MailBox_Recv (void) |
This function will be called from a foreground thread It will spin/block if the MailBox is empty. More... | |
INT32U | OS_Time (void) |
INT32U | OS_TimeDifference (INT32U start, INT32U stop) |
void | OS_ClearMsTime (void) |
INT32U | OS_ReadMsTime (void) |
void | OS_Launch (INT32U theTimeSlice) |
This function starts the scheduler and enables interrupts. More... | |
Functions for OS.
Definition in file OS.h.
typedef struct MailBox MailBoxType |
Adds periodic background thread. Cannot spin, sleep, die, rest, etc. cause it's ISR, depends on hardware for number of tasks possible No ID for this thread, must have mid-high priority to run properly.
OS_AddPeriodicThread Add new thread to OS that runs periodically, uses Timer4
task | task to run for thread |
stackSize | size of stack |
priority | priority of thread |
OS_AddPeriodicThread
task | task to run in background |
period | |
priority | 5-0 only, else you'll break OS :( |
Definition at line 593 of file OS.c.
This function adds a thread to run and its priority when a button is pressed.
OS_AddSW1Task Add thread to button PF4
task | task to run for thread |
priority | priority of thread |
OS_AddSW1Task
task | function/thread to run when button pressed |
priority |
Definition at line 626 of file OS.c.
This function adds a thread to run and its priority when a button is pressed.
OS_AddSW1Task Add thread to button PF0
task | task to run for thread |
priority | priority of thread |
OS_AddSW2Task
task | function/thread to run when button pressed |
priority |
Definition at line 638 of file OS.c.
This function decides next thread to run, now uses priority scheduler.
OS_AddThread Add new thread to OS, Linked List style
task | task to run for thread |
stackSize | size of stack |
priority | priority of thread |
OS_AddThread
task | |
stackSize | |
priority |
Definition at line 386 of file OS.c.
void OS_ASM_Signal | ( | Sema4Type * | semaPt | ) |
Spinlock semaphore signal using ARM exclusion.
OS_ASM_Signal
void OS_ASM_Wait | ( | Sema4Type * | semaPt | ) |
Spinlock semaphore wait using ARM exclusion.
OS_ASM_Signal
void OS_bSignal | ( | Sema4Type * | semaPt | ) |
void OS_bWait | ( | Sema4Type * | semaPt | ) |
void OS_ClearMsTime | ( | void | ) |
FIFO_t OS_Fifo_Get | ( | void | ) |
void OS_Fifo_Init | ( | void | ) |
INT32U OS_Fifo_Size | ( | void | ) |
INT32U OS_IdThread | ( | void | ) |
void OS_Init | ( | void | ) |
initialize operating system, disable interrupts until OS_Launch initialize OS controlled I/O: serial, ADC, systick, LaunchPad I/O and timers
OS_Init Initializes operating system, disables interrupts until OS_Launch Initializes all I/O and interthread communication
OS_Init
Definition at line 188 of file OS.c.
Initialize semaphore to given value.
OS_InitSemaphore Initializes semaphore to default value sent
semaPt | pointer to semaphore |
value | value of semaphore |
OS_InitSemaphore
semaPt | semaphore ptr |
Definition at line 456 of file OS.c.
void OS_Kill | ( | void | ) |
void OS_Launch | ( | INT32U | theTimeSlice | ) |
This function starts the scheduler and enables interrupts.
OS_Launch Start OS, setup SysTick
theTimeSlice | Time between context switches |
OS_Launch
theTimeSlice | period of round robin scheduler |
Definition at line 285 of file OS.c.
void OS_MailBox_Init | ( | void | ) |
INT32U OS_MailBox_Recv | ( | void | ) |
void OS_MailBox_Send | ( | INT32U | data | ) |
This function will be called from a foreground thread It will spin/block if the MailBox contains data not yet received.
OS_MailBox_Send Puts data in mailbox
data |
OS_MailBox_Send Enter mail into the Mailbox
data | data to put into mailbox |
Definition at line 715 of file OS.c.
INT32U OS_ReadMsTime | ( | void | ) |
void OS_Signal | ( | Sema4Type * | semaPt | ) |
void OS_Sleep | ( | INT32U | sleepTime | ) |
This function puts a thread to sleep.
OS_Sleep Put current thread to sleep then yield
sleepTime | amount of time to sleep (ms) |
OS_Sleep
sleepTime | time to put thread to sleep |
Definition at line 528 of file OS.c.
void OS_Suspend | ( | void | ) |
INT32U OS_Time | ( | void | ) |
void OS_Wait | ( | Sema4Type * | semaPt | ) |