tkernel_2/include/tk/ptimer.h | bare source | permlink (0.02 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * T-Kernel 2.0 Software Package 4: * 5: * Copyright 2011 by Ken Sakamura. 6: * This software is distributed under the latest version of T-License 2.x. 7: *---------------------------------------------------------------------- 8: * 9: * Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17. 10: * Modified by TRON Forum(http://www.tron.org/) at 2015/06/01. 11: * 12: *---------------------------------------------------------------------- 13: */ 14: 15: /* 16: * ptimer.h 17: * 18: * Physical Timer 19: */ 20: 21: #ifndef __TK_PTIMER_H__ 22: #define __TK_PTIMER_H__ 23: 24: #include <basic.h> 25: #include "typedef.h" 26: 27: #ifdef __cplusplus 28: extern "C" { 29: #endif 30: 31: /* 32: * mode of StartPhysicalTimer 33: */ 34: #define TA_ALM_PTMR 0 /* one shot timer */ 35: #define TA_CYC_PTMR 1 /* cyclic timer */ 36: 37: /* 38: * Definition of Physical Timer Handler 39: */ 40: typedef struct t_dptmr { 41: void *exinf; /* extended information */ 42: ATR ptmratr; /* physical timer attribute */ 43: FP ptmrhdr; /* physical timer handler address */ 44: } T_DPTMR; 45: 46: #define TA_ASM 0x00000000U /* written in assembly langauge */ 47: #define TA_HLNG 0x00000001U /* written in high-level language */ 48: 49: /* 50: * Configuration Information of Physical Timer 51: */ 52: typedef struct t_rptmr { 53: UW ptmrclk; /* clock frequency of physical timer (Hz) */ 54: UW maxcount; /* maximum count */ 55: BOOL defhdr; /* can define a physical handler for it */ 56: } T_RPTMR; 57: 58: IMPORT ER StartPhysicalTimer( UINT ptmrno, UW limit, UINT mode ); 59: IMPORT ER StopPhysicalTimer( UINT ptmrno ); 60: IMPORT ER GetPhysicalTimerCount( UINT ptmrno, UW *p_count ); 61: IMPORT ER DefinePhysicalTimerHandler( UINT ptmrno, CONST T_DPTMR *pk_dptmr ); 62: IMPORT ER GetPhysicalTimerConfig( UINT ptmrno, T_RPTMR *pk_rptmr ); 63: 64: #ifdef __cplusplus 65: } 66: #endif 67: #endif /* __TK_PTIMER_H__ */