?? delay.h
字號:
/***************************************************************************
* This code and information is provided "as is" without warranty of any *
* kind, either expressed or implied, including but not limited to the *
* implied warranties of merchantability and/or fitness for a particular *
* purpose. *
* *
* Copyright (C) 2006 Teridian Semiconductor Corp. All Rights Reserved. *
***************************************************************************/
//**************************************************************************
//
// DESCRIPTION: 71M65xx - Delay Routines.
//
// AUTHOR: RGV
//
// HISTORY: See end of file
//
//**************************************************************************
//
// File: DELAY.C
// This implements a looped delay. The delay unit is one cycle
// of the crystal. It adapts to clock rate changes.
//
//**************************************************************************
// delay loop API.
//
#ifndef DELAY_H
#define DELAY_H 1
void delay_clks (uint8_t cclk) small reentrant;
void delay (uint32_t cclk) small reentrant;
// the compiler will simplify this for constants;
// calls to delay() will work, too, but with more overhead
#define DELAY(__x__) if (__x__ < 255) \
delay_clks (__x__); \
else \
delay ((uint32_t)__x__);
#define US2CLK(__y__) (((__y__ * XTAL_FREQ) + 500000) / 1000000)
#define MS2CLK(__y__) (((__y__ * XTAL_FREQ) + 500) / 1000)
#endif // delay
/***************************************************************************
* $Log: delay.h,v $
* Revision 1.1 2006/09/06 02:10:26 tvander
* Separated delay loop into its own file. Copes with different speeds, as best it can.
*
* 2006 september 5 First Version
*
* Copyright (C) 2006 Teridian Semiconductor Corp. All Rights Reserved. *
* this program is fully protected by the United States copyright *
* laws and is the property of Teridian Semiconductor Corporation. *
***************************************************************************/
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -