00001 00002 00003 00036 00037 /********************************************************************* 00038 * Software License Agreement 00039 * 00040 * Copyright (C) 2002-2008 Microchip Technology Inc. All rights 00041 * reserved. 00042 * 00043 * Microchip licenses to you the right to use, modify, copy, and 00044 * distribute: 00045 * (i) the Software when embedded on a Microchip microcontroller or 00046 * digital signal controller product ("Device") which is 00047 * integrated into Licensee's product; or 00048 * (ii) ONLY the Software driver source files ENC28J60.c and 00049 * ENC28J60.h ported to a non-Microchip device used in 00050 * conjunction with a Microchip ethernet controller for the 00051 * sole purpose of interfacing with the ethernet controller. 00052 * 00053 * You should refer to the license agreement accompanying this 00054 * Software for additional information regarding your rights and 00055 * obligations. 00056 * 00057 * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT 00058 * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT 00059 * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A 00060 * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL 00061 * MICROCHIP BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR 00062 * CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF 00063 * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS 00064 * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE 00065 * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER 00066 * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT 00067 * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE. 00068 * 00069 * 00070 * Author Date Comment 00071 *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 00072 * Nilesh Rajbharti 6/28/01 Original (Rev 1.0) 00073 * Nilesh Rajbharti 2/9/02 Cleanup 00074 * Nilesh Rajbharti 5/22/02 Rev 2.0 (See version.log for detail) 00075 ********************************************************************/ 00076 #ifndef __TICK_H 00077 #define __TICK_H 00078 00079 #include "TCPIP.h" 00080 00081 // All TICKS are stored as 32-bit unsigned integers. 00082 typedef DWORD TICK; 00083 00084 // This value is used by TCP to implement timeout actions. 00085 // For this definition, the Timer must be initialized to use 00086 // a 1:256 prescaler in Tick.c. 00087 #define TICKS_PER_SECOND ((GetPeripheralClock()+128ull)/256ull) // Internal core clock drives timer 00088 00089 // Represents one second in Ticks 00090 #define TICK_SECOND ((QWORD)TICKS_PER_SECOND) 00091 // Represents one minute in Ticks 00092 #define TICK_MINUTE ((QWORD)TICKS_PER_SECOND)*60ull) 00093 // Represents one hour in Ticks 00094 #define TICK_HOUR ((QWORD)TICKS_PER_SECOND*3600ull) 00095 00096 // Deprecated. Do not use this function. 00097 #define TickGetDiff(a, b) ((a)-(b)) 00098 00099 void TickInit(void); 00100 DWORD TickGet(void); 00101 DWORD TickGetDiv256(void); 00102 // MODIFIX: Removed Prototype for TickGetDiv64K as not needed for eWicht. 00103 DWORD TickConvertToMilliseconds(DWORD dwTickValue); 00104 // MODIFIX: Removed Prototype for TickUpdate(void) because its replaced by 00105 // an ISR. 00106 00108 #endif
1.5.5