developer | e0cea0f | 2021-12-16 16:08:26 +0800 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | /* |
| 3 | * $Id: Timer.h 109 2008-10-22 19:45:09Z lajordan@SILABS.COM $ |
| 4 | * |
| 5 | * This file is system specific and should be edited for your hardware platform |
| 6 | * |
| 7 | * This file is used by proslic_timer_intf.h and proslic_spiGci.h |
| 8 | */ |
| 9 | #ifndef TIME_TYPE_H |
| 10 | #define TIME_TYPE_H |
| 11 | |
| 12 | typedef long long _int64; |
| 13 | |
| 14 | /* |
| 15 | ** System timer interface structure |
| 16 | */ |
| 17 | typedef struct{ |
| 18 | _int64 ticksPerSecond; |
| 19 | } systemTimer_S; |
| 20 | |
| 21 | /* |
| 22 | ** System time stamp |
| 23 | */ |
| 24 | typedef struct{ |
| 25 | _int64 time; |
| 26 | } timeStamp; |
| 27 | |
| 28 | /* |
| 29 | ** Function: SYSTEM_TimerInit |
| 30 | ** |
| 31 | ** Description: |
| 32 | ** Initializes the timer used in the delay and time measurement functions |
| 33 | ** by doing a long inaccurate sleep and counting the ticks |
| 34 | ** |
| 35 | ** Input Parameters: |
| 36 | ** |
| 37 | ** Return: |
| 38 | ** none |
| 39 | */ |
| 40 | void TimerInit (systemTimer_S *pTimerObj); |
| 41 | /* |
| 42 | ** Function: DelayWrapper |
| 43 | ** |
| 44 | ** Description: |
| 45 | ** Waits the specified number of ms |
| 46 | ** |
| 47 | ** Input Parameters: |
| 48 | ** hTimer: timer pointer |
| 49 | ** timeInMs: time in ms to wait |
| 50 | ** |
| 51 | ** Return: |
| 52 | ** none |
| 53 | */ |
| 54 | int time_DelayWrapper (void *hTimer, int timeInMs); |
| 55 | |
| 56 | |
| 57 | /* |
| 58 | ** Function: TimeElapsedWrapper |
| 59 | ** |
| 60 | ** Description: |
| 61 | ** Calculates number of ms that have elapsed |
| 62 | ** |
| 63 | ** Input Parameters: |
| 64 | ** hTImer: pointer to timer object |
| 65 | ** startTime: timer value when function last called |
| 66 | ** timeInMs: pointer to time elapsed |
| 67 | ** |
| 68 | ** Return: |
| 69 | ** timeInMs: time elapsed since start time |
| 70 | */ |
| 71 | int time_TimeElapsedWrapper (void *hTimer, void *startTime, int *timeInMs); |
| 72 | |
| 73 | int time_GetTimeWrapper (void *hTimer, void *time); |
| 74 | #endif |
| 75 | /* |
| 76 | ** $Log: Timer.h,v $ |
| 77 | ** Revision 1.2 2007/02/21 16:55:18 lajordan |
| 78 | ** moved function prototypes here |
| 79 | ** |
| 80 | ** Revision 1.1 2007/02/16 23:55:07 lajordan |
| 81 | ** no message |
| 82 | ** |
| 83 | ** Revision 1.2 2007/02/15 23:33:25 lajordan |
| 84 | ** no message |
| 85 | ** |
| 86 | ** Revision 1.1.1.1 2006/07/13 20:26:08 lajordan |
| 87 | ** no message |
| 88 | ** |
| 89 | */ |