📄 ssd_cfm_clk.h
字号:
/*************************************************************************
* Copyright (C) 2003 by Motorola. All rights reserved. *
*************************************************************************
* *
* Motorola reserves the right to make changes without further notice *
* to any product herein to improve reliability, function or design. *
* Motorola does not assume any liability arising out of the *
* application or use of any product, circuit, or software described *
* herein; neither does it convey any license under its patent rights *
* nor the rights of others. *
* *
* Motorola products are not designed, intended, or authorized for *
* use as components in systems intended for surgical implant into *
* the body, or other applications intended to support life, or for *
* any other application in which the failure of the Motorola product *
* could create a situation where personal injury or death may occur. *
* *
* Should Buyer purchase or use Motorola products for any such *
* unintended or unauthorized application, Buyer shall indemnify and *
* hold Motorola and its officers, employees, subsidiaries, *
* affiliates, and distributors harmless against all claims costs, *
* damages, and expenses, and reasonable attorney fees arising out *
* of, directly or indirectly, any claim of personal injury or death *
* associated with such unintended or unauthorized use, even if such *
* claim alleges that Motorola was negligent regarding the design *
* or manufacture of the part. *
* *
* Motorola and the Motorola logo* are registered trademarks of *
* Motorola Ltd. *
* *
*************************************************************************
*************************************************************************
* *
* Standard Software CFM Driver for ColdFire *
* *
* FILE NAME : ssd_cfm_clk.h *
* DATE : May 22, 2003 *
* *
* AUTHOR : Flash Team, GSG China *
* E-mail : flash@sc.mcel.mot.com *
* *
*************************************************************************/
/******************************* CHANGES *********************************
1.00 5.22.2003 Morrison Yang Initial Version
*************************************************************************/
#ifndef _SSD_CFM_CLK_H_
#define _SSD_CFM_CLK_H_
/*************************************************************************
This head file helps user to calculate clock divider at compile time.
User should provide SYS_CLK before including this file.
The unit for clock rate value is in KHz. For example if the real clock
rate is 10 MHz, then the the clock rate value will be 10000.
**************************************************************************/
/*************************************************************************
Macros for Calculating Clock Divider Value
*************************************************************************/
/* Mininum and maximum system clock to CFM */
#define MIN_SYS_CLK 900 /* 900 KHz */
#define MAX_SYS_CLK 204800 /* 204.8 MHz */
/* User needs to define system clock */
#ifndef SYS_CLK
#error "SYS_CLK (system clock frequency in KHz) is not defined!"
#endif
#if (SYS_CLK > MAX_SYS_CLK) || (SYS_CLK < MIN_SYS_CLK)
#error "System clock frequency is out of range!"
#endif
#define FLASH_INPUT_CLOCK_RATE (SYS_CLK / 2)
#if FLASH_INPUT_CLOCK_RATE > 12800
#define FLASH_CLOCK (FLASH_INPUT_CLOCK_RATE / 8)
#define FLASH_CLOCK_PRDIV8 0x40
#else
#define FLASH_CLOCK FLASH_INPUT_CLOCK_RATE
#define FLASH_CLOCK_PRDIV8 0
#endif
#define CLOCK_DIV (FLASH_CLOCK / 200)
#if (FLASH_CLOCK % 200)
#define FLASH_CLOCK_DIV CLOCK_DIV
#else
#define FLASH_CLOCK_DIV (CLOCK_DIV - 1)
#endif
/*user code refer to this macro directly*/
#define FLASH_CLOCK_DIVIDER (FLASH_CLOCK_PRDIV8 | FLASH_CLOCK_DIV)
#endif // _SSD_CFM_CLK_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -