00001 /*--------------------------------------------------------------------------- 00002 * Copyright (C) 2003-2006 Dallas Semiconductor Corporation, All Rights Reserved. 00003 * 00004 * Permission is hereby granted, free of charge, to any person obtaining a 00005 * copy of this software and associated documentation files (the "Software"), 00006 * to deal in the Software without restriction, including without limitation 00007 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 00008 * and/or sell copies of the Software, and to permit persons to whom the 00009 * Software is furnished to do so, subject to the following conditions: 00010 * 00011 * The above copyright notice and this permission notice shall be included 00012 * in all copies or substantial portions of the Software. 00013 * 00014 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00015 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00016 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00017 * IN NO EVENT SHALL DALLAS SEMICONDUCTOR BE LIABLE FOR ANY CLAIM, DAMAGES 00018 * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00019 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00020 * OTHER DEALINGS IN THE SOFTWARE. 00021 * 00022 * Except as contained in this notice, the name of Dallas Semiconductor 00023 * shall not be used except as stated in the Dallas Semiconductor 00024 * Branding Policy. 00025 * --------------------------------------------------------------------------- 00026 * 00027 * This file contains function definitions for the built-in ROM functions 00028 * of the Dallas Semiconductor 400 processor. This file is intended for use 00029 * with the Keil MicroVision (uVision) C compiler. 00030 * 00031 * --------------------------------------------------------------------------- 00032 */ 00033 #ifndef __rom400_task_ 00034 #define __rom400_task_ 00035 00036 #pragma SAVE 00037 #pragma REGPARMS 00038 00060 #define ROM400_TASK_VERSION 9 00061 00063 #define ROM400_SCHED_VERSION ROM400_TASK_VERSION 00064 00068 #define RELOAD_14_746 0xfb33 00069 00073 #define RELOAD_18_432 0xfa00 00074 00078 #define RELOAD_29_491 0xfd99 00079 00083 #define RELOAD_36_864 0xfd00 00084 00088 #define RELOAD_58_982 0xfecc 00089 00093 #define RELOAD_73_728 0xfe80 00094 00095 00099 #define MIN_PRIORITY 1 00100 00103 #define NORM_PRIORITY 128 00104 00107 #define MAX_PRIORITY 255 00108 00111 #define FLAG_SLEEPING 1 00112 00114 #define FLAG_IO_WAIT 2 00115 00117 #define FLAG_DHCP_WAIT 4 00118 00120 #define FLAG_USER0 8 00121 00123 #define FLAG_USER1 0x10 00124 00126 #define FLAG_USER2 0x20 00127 00129 #define FLAG_USER3 0x40 00130 00132 #define FLAG_USER4 0x80 00133 00136 #define ROM_SAVESIZE 384 00137 00141 struct TIME 00142 { 00144 unsigned char msb; 00146 unsigned long millis; 00147 }; 00148 00149 00154 struct FARPTR 00155 { 00157 unsigned char msb; 00159 unsigned short offset; 00160 }; 00161 00165 struct TCB 00166 { 00167 unsigned char Priority; 00168 unsigned char ID; 00169 struct FARPTR Next; 00170 unsigned short MemHandle; 00171 unsigned char Flags; 00172 struct TIME WakeupTime; 00173 unsigned short StateSize; 00174 struct FARPTR StatePtr; 00175 }; 00176 00188 //--------------------------------------------------------------------------- 00189 void task_genesis(unsigned int savesize); 00190 00206 //--------------------------------------------------------------------------- 00207 unsigned char task_getcurrent(void); 00208 00228 //--------------------------------------------------------------------------- 00229 unsigned char task_getpriority(unsigned char task_id); 00230 00252 //--------------------------------------------------------------------------- 00253 unsigned char task_setpriority(unsigned char task_id, unsigned char priority); 00254 00281 //--------------------------------------------------------------------------- 00282 unsigned int task_fork(unsigned char priority, unsigned int savesize); 00283 00301 //--------------------------------------------------------------------------- 00302 unsigned char task_kill(unsigned char task_id); 00303 00325 //--------------------------------------------------------------------------- 00326 unsigned char task_suspend(unsigned char task_id, unsigned char event_mask); 00327 00330 unsigned char task_synch_wait(unsigned int millis_h, unsigned int millis_l, unsigned int task_event); 00332 00361 //--------------------------------------------------------------------------- 00362 unsigned char task_wait(unsigned char task_id, unsigned char event_mask, long millis); 00363 00390 //--------------------------------------------------------------------------- 00391 unsigned char task_signal(unsigned char task_id, unsigned char event_mask); 00392 00416 //--------------------------------------------------------------------------- 00417 void task_gettimemillis(struct TIME* t); 00418 00435 //--------------------------------------------------------------------------- 00436 unsigned char task_getthreadid(); 00437 00461 //--------------------------------------------------------------------------- 00462 unsigned char task_threadresume(unsigned char thread, unsigned char task); 00463 00487 //--------------------------------------------------------------------------- 00488 unsigned char task_threadiosleep(unsigned char infinite, unsigned long timeout); 00489 00517 //--------------------------------------------------------------------------- 00518 unsigned char task_threadiosleepnc(unsigned char infinite, unsigned long timeout); 00519 00520 00539 //--------------------------------------------------------------------------- 00540 void task_threadsave(void); 00541 00559 //--------------------------------------------------------------------------- 00560 void task_threadrestore(void); 00561 00564 unsigned char task_synch_sleep(unsigned int timeout_h, unsigned int timeout_l, unsigned char task); 00566 00590 //--------------------------------------------------------------------------- 00591 unsigned char task_sleep(unsigned char task, long timeout); 00592 00611 //--------------------------------------------------------------------------- 00612 unsigned char task_gettaskid(); 00613 00630 //--------------------------------------------------------------------------- 00631 void task_entercritsection(void); 00632 00649 //--------------------------------------------------------------------------- 00650 void task_leavecritsection(void); 00651 00668 //--------------------------------------------------------------------------- 00669 unsigned int task_gettickreload(void); 00670 00703 //--------------------------------------------------------------------------- 00704 void task_settickreload(unsigned int reload); 00705 00706 00715 //--------------------------------------------------------------------------- 00716 unsigned int task_version(void); 00717 00718 00737 //--------------------------------------------------------------------------- 00738 void xdata *task_reentrant_stack(unsigned int size); 00739 00740 #pragma RESTORE 00741 #endif
| Copyright 2005 Dallas Semiconductor, Inc.. | Documentation generated by Doxygen. |