00001 /********************************************************************************* 00002 00003 Copyright 2006-2008 MakingThings 00004 00005 Licensed under the Apache License, 00006 Version 2.0 (the "License"); you may not use this file except in compliance 00007 with the License. You may obtain a copy of the License at 00008 00009 http://www.apache.org/licenses/LICENSE-2.0 00010 00011 Unless required by applicable law or agreed to in writing, software distributed 00012 under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 00013 CONDITIONS OF ANY KIND, either express or implied. See the License for 00014 the specific language governing permissions and limitations under the License. 00015 00016 *********************************************************************************/ 00017 00018 /* 00019 RTOS.H 00020 00021 MakingThings 00022 */ 00023 00024 #ifndef RTOS_H 00025 #define RTOS_H 00026 00027 #include "types.h" 00028 00029 void Sleep( int timems ); 00030 void* TaskCreate( void (taskCode)(void*), char* name, int stackDepth, void* parameters, int priority ); 00031 void TaskYield( void ); 00032 void TaskDelete( void* task ); 00033 void TaskEnterCritical( void ); 00034 void TaskExitCritical( void ); 00035 int TaskGetRemainingStack( void* task ); 00036 void* getTaskByName( char *taskName ); 00037 void* getTaskByID( int taskID ); 00038 int TaskGetPriority( void* task ); 00039 void TaskSetPriority( void* task, int priority ); 00040 int TaskGetIDNumber( void* task ); 00041 char* TaskGetName( void* task ); 00042 int TaskGetStackAllocated( void* task ); 00043 void* TaskGetCurrent( void ); 00044 void* TaskGetNext( void* task ); 00045 int GetNumberOfTasks( void ); 00046 int TaskGetTopPriorityUsed( void ); 00047 int TaskGetTickCount( void ); 00048 00049 void* Malloc( int size ); 00050 void* MallocWait( int size, int interval ); 00051 void Free( void* memory ); 00052 00053 void* QueueCreate( uint length, uint itemSize ); 00054 int QueueSendToFront( void* queue, void* itemToQueue, int msToWait ); 00055 int QueueSendToBack( void* queue, void* itemToQueue, int msToWait ); 00056 int QueueReceive( void* queue, void* buffer, int msToWait ); 00057 int QueueMessagesWaiting( void* queue ); 00058 void QueueDelete( void* queue ); 00059 int QueueSendToFrontFromISR( void* queue, void* itemToSend, int taskPreviouslyWoken ); 00060 int QueueSendToBackFromISR( void* queue, void* itemToSend, int taskPreviouslyWoken ); 00061 int QueueReceiveFromISR( void* queue, void* buffer, long* taskWoken ); 00062 00063 void* SemaphoreCreate( void ); 00064 void* MutexCreate( void ); 00065 int SemaphoreTake( void* semaphore, int blockTime ); 00066 int SemaphoreGive( void* semaphore ); 00067 int SemaphoreGiveFromISR( void* semaphore, int taskPreviouslyWoken ); 00068 00069 #endif
The Make Controller Kit is an open source project maintained by MakingThings.
MakingThings code is released under the Apache 2.0 license.
Bug tracker, development wiki and status can be found at http://dev.makingthings.com.
This document was last updated on 18 May 2009.