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

📄 delay.h

📁 TDK 6521 SOC 芯片 DEMO程序
💻 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 + -