|
API Guide Home (Online version only) |
![]() |
00001 /****************************************************************************** 00002 * Copyright (c) 2005 palmOne, Inc. or its subsidiaries. 00003 * All rights reserved. 00004 *****************************************************************************/ 00005 /** 00006 * @ingroup HiRes 00007 * 00008 */ 00009 00010 /** 00011 * @file PalmHiResTime.h 00012 * @version 1.0 00013 * 00014 * @brief Exported High Resolution timer definitions. 00015 * 00016 * 00017 * <hr> 00018 */ 00019 00020 00021 00022 #ifndef __PalmHiResTime_H__ 00023 #define __PalmHiResTime_H__ 00024 00025 // Palm OS common definitions 00026 #include <PalmTypes.h> 00027 #include <ErrorBase.h> 00028 #include <SystemMgr.h> 00029 00030 // To Define when building the library 00031 #if (CPU_TYPE != CPU_68K) || (defined BUILDING_CAM_LIB) 00032 #define ARM_NATIVECODE /**< */ 00033 #define CAM_LIB_TRAP(trapNum) /**< */ 00034 #else 00035 #include <LibTraps.h> 00036 #define CAM_LIB_TRAP(trapNum) SYS_TRAP(trapNum) /**< */ 00037 #endif 00038 00039 /** 00040 * @name Type and creator of the Library 00041 * 00042 */ 00043 /*@{*/ 00044 #define kHiResTimeLibType 'libr' /**< database type */ 00045 #define kHiResTimeLibCreator 'pHRT' /**< database creator */ 00046 /*@}*/ 00047 00048 /** Internal library name which can be passed to SysLibFind() */ 00049 #define kHiResTimeLibName "HRTimer-Lib" 00050 00051 /** 00052 * @name Library versionning 00053 * 00054 */ 00055 /*@{*/ 00056 #define kHiResTimeLibVersion1 sysMakeROMVersion(1, 0, 0, sysROMStageRelease, 0) /**< */ 00057 #define kHiResTimeLibVersion kCamLibVersion1 /**< */ 00058 /*@}*/ 00059 00060 /** HiRes Timer result codes */ 00061 #define kHiResTimeErrorClass (oemErrorClass + 0x100) 00062 00063 /** 00064 * @name Library trap 00065 * 00066 */ 00067 /*@{*/ 00068 #define kHRLibTrapTimerTicksPerSecond (sysLibTrapCustom) /**< */ 00069 #define kHRLibTrapTimerGetTime (sysLibTrapCustom+1) /**< */ 00070 /*@}*/ 00071 00072 /*********************************************************************** 00073 * API Prototypes 00074 ***********************************************************************/ 00075 00076 #ifdef __cplusplus 00077 extern "C" { 00078 #endif 00079 00080 #ifndef ARM_NATIVECODE 00081 00082 /** 00083 * @brief Standard library open function 00084 * 00085 * @param refNum: IN: 00086 * @retval Err error code. 00087 **/ 00088 extern Err HRTimeLibOpen(UInt16 refNum) 00089 CAM_LIB_TRAP(sysLibTrapOpen); 00090 00091 /** 00092 * @brief Standard library close function 00093 * 00094 * @param refNum: IN: 00095 * @retval Err error code. 00096 **/ 00097 extern Err HRTimeLibClose(UInt16 refNum) 00098 CAM_LIB_TRAP(sysLibTrapClose); 00099 00100 /** 00101 * @brief Custom library API functions 00102 * 00103 * @param refNum: IN: 00104 * @param *ticksP: IN: 00105 * @retval Err error code. 00106 **/ 00107 extern Err HRTimeLibTicksPerSecond(UInt16 refNum, UInt32 *ticksP ) 00108 CAM_LIB_TRAP(kHRLibTrapTimerTicksPerSecond); 00109 00110 /** 00111 * @brief 00112 * 00113 * @param refNum: IN: 00114 * @param *ticksP: IN: 00115 * @param *rolloverP: IN: 00116 * @retval Err error code. 00117 **/ 00118 extern Err HRTimeLibGetTime(UInt16 refNum, UInt32 *ticksP, UInt32 *rolloverP) 00119 CAM_LIB_TRAP(kHRLibTrapTimerGetTime); 00120 00121 #else 00122 /** 00123 * @brief Currently only used by 68K app. ARM code can directly call to the HAL 00124 * functions. The HAL function prototypes are included here. 00125 * 00126 * @param *ticksP: IN: 00127 * @retval Err error code. 00128 **/ 00129 Err HRTimeLibTicksPerSecond( UInt32 *ticksP ); 00130 00131 /** 00132 * @brief 00133 * 00134 * @param *ticksP: IN: 00135 * @param *rolloverP: IN: 00136 * @retval Err error code. 00137 **/ 00138 Err HRTimeLibGetTime( UInt32 *ticksP, UInt32 *rolloverP ); 00139 00140 #endif 00141 00142 00143 #ifdef __cplusplus 00144 } 00145 #endif 00146 00147 #endif // __PalmHiResTime_H__
| Top | Palm Developer Network © 2004-2008, Palm, Inc. All rights reserved. Generated on Fri Jun 13 10:06:54 2008 for Palm API Guide |