time.h

来自「这是一个uC/OS-II For cs8900的移植项目源代码.可以在uCOSV」· C头文件 代码 · 共 63 行

H
63
字号

/******************************************************************************
* Filename     : time.h                                                       *
* Program      : loader.                                                      *
* Copyright    : Copyright (C) 2001, Young-Su, Ahn.                           *
* Author       : Young-Su, Ahn <nurie@dreamwiz.com>                           *
* Description  : Header file for time.c.                                      *
* Created at   : Wed Mar 13 2001.                                             *
* Based on     : blob-1.0.8-pre2 (http://www.lart.tudelft.nl)                 *
* Modified by  :                                                              *
* Modified at  :                                                              *
******************************************************************************/
/* This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

#ifndef _TIME_H_416463482947123749237434
#define _TIME_H_416463482947123749237434

#include "types.h"

#define HZ						(32768)

#define TICKS_PER_SECOND 				(3686400)


#define RCNR					(*((volatile ulong *)(0x90010004)))
#define PCFR					(*((volatile ulong *)(0x90020010)))
#define RTSR					(*((volatile ulong *)(0x90010010)))

#define PCFR_FO					(0x00000008)

#define RTSR_AL					(0x00000001)
#define RTSR_HZ					(0x00000002)
#define RTSR_ALE				(0x00000004)
#define RTSR_HZE				(0x00000008)


// Prototypes.


void TimerInit(void);
void TimerInit2(void);

/* returns the time in 1/TICKS_PER_SECOND seconds */
ulong	GetTime(void);
ulong  TimerGetTime(void);
int TimerDetectOverflow(void);

void TimerClearOverflow(void);

/* suspend execution for interval of milliseconds */
void msleep(unsigned int msec);

#endif		// end _TIME_H_416463482947123749237434.

⌨️ 快捷键说明

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