⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 timer.h

📁 ARM9基于WINDOWSCE的BSP源代码
💻 H
字号:
/*   The content of this file or document is CONFIDENTIAL and PROPRIETARY
*   to Jade Technologies Co., Ltd.  It is subjected to the terms of a
*   License Agreement between Licensee and Jade Technologies Co., Ltd.
*   restricting among other things, the use, reproduction, distribution
*   and transfer.  Each of the embodiments, including this information 
*   and any derivative work shall retain this copyright notice.
* 
*   Copyright (c) 2004 - 2005 Jade Technologies Co., Ltd. 
*   All rights reserved.
 * ----------------------------------------------------------------
 * File:     timer.h,v
 * Revision: 1.0
 * ----------------------------------------------------------------
 * $
 *
 */

#ifndef __TIMER_H__
#define __TIMER_H__


#define TVR_FIELD_MAX   0x1FFFF
#define MS_FIELD_MAX    0x7FFF

#define TIMER_PERIOD    1
typedef union
{
    unsigned int u;                   // For KCP_* interface
    struct
    {
        unsigned int tvr : 17;        // Timer Value Register
        unsigned int ms  : 15;        // CurMSec/25
    } field;
} KCPTime_t;


extern  KCPTime_t KCP_GetCurrentTime(void) ;
extern  DWORD KCP_ScaleDown(DWORD N) ;
extern  DWORD KCP_GetStartTime(void) ;
extern  DWORD KCP_GetElapsedTime(DWORD t0) ;

/* Structure containing the mapping of the RTC registers */
typedef volatile struct _rtcif_tag 
{
	const DWORD	DR;			/* Data register    */
	DWORD	    MR;			/* Match register   */
	DWORD	    LR;			/* Load register    */
	DWORD	    CR;			/* Control register */
    DWORD       IMSC;       /* Interupt mask set and clear register */
    const DWORD RIS;        /* Raw interrupt status regisdter       */
    const DWORD MIS;        /* Masked interrupt status register     */
    DWORD       ICR;        /* Interrupt clear register             */
    DWORD   padding0[1008]; /* Allow structure alingment with PCell */
    const DWORD PeriphID0;  /* Peripheral ID register0 bits [7:0]   */
    const DWORD PeriphID1;  /* Peripheral ID register0 bits [15:8]  */
    const DWORD PeriphID2;  /* Peripheral ID register0 bits [23:16] */
    const DWORD PeriphID3;  /* Peripheral ID register0 bits [31:24] */
    const DWORD PCellID0;   /* PrimeCell ID register bits [7:0]     */
    const DWORD PCellID1;   /* PrimeCell ID register bits [15:8]    */
    const DWORD PCellID2;   /* PrimeCell ID register bits [23:16]   */
    const DWORD PCellID3;   /* PrimeCell ID register bits [31:24]   */

}stRTCRegs, *pstRTCRegs;

void Enable_RTC(void);
void Disable_RTC(void);
void Init_RTC(void);
int  Is_leap(int year);


#endif      /* #ifndef __TIMER_H__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -