?? config.h
字號(hào):
/****************************************Copyright (c)**************************************************
** Guangzhou ZHIYUAN electronics Co.,LTD.
**
** http://www.embedtools.com
**
**--------------File Info-------------------------------------------------------------------------------
** File Name: config.h
** Last modified Date: 2004-09-17
** Last Version: 1.0
** Descriptions: User Configurable File
**
**------------------------------------------------------------------------------------------------------
** Created By: Chenmingji
** Created date: 2004-09-17
** Version: 1.0
** Descriptions: First version
**
**------------------------------------------------------------------------------------------------------
** Modified by: LinEnqiang
** Modified date: 2007-05-15
** Version: 1.0
** Descriptions: Modified for NXP23xx
**
** Modified by: Zhangmingjie
** Modified date: 2008-04-18
** Version: 1.0
** Descriptions: Modified for NXP24xx
********************************************************************************************************/
#ifndef __CONFIG_H
#define __CONFIG_H
#ifdef __cplusplus
extern "C" {
#endif
/* 這一段無(wú)需改動(dòng) */
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
typedef unsigned char uint8; /* 無(wú)符號(hào)8位整型變量 */
typedef signed char int8; /* 有符號(hào)8位整型變量 */
typedef unsigned short uint16; /* 無(wú)符號(hào)16位整型變量 */
typedef signed short int16; /* 有符號(hào)16位整型變量 */
typedef unsigned int uint32; /* 無(wú)符號(hào)32位整型變量 */
typedef signed int int32; /* 有符號(hào)32位整型變量 */
typedef float fp32; /* 單精度浮點(diǎn)數(shù)(32位長(zhǎng)度) */
typedef double fp64; /* 雙精度浮點(diǎn)數(shù)(64位長(zhǎng)度) */
#define GLOBAL extern
#include "LPC24xx.h"
/*
* 應(yīng)用程序配置
* 以下根據(jù)需要改動(dòng)
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <stdlib.h>
#include <setjmp.h>
#include <rt_misc.h>
#include "target.h" /* 這一句不能刪除 */
#define USE_USB 1
#define Fosc 12000000 /* OSC = 12MHz */
#if USE_USB
#define Fusbclk 48000000
#define Fcclk (Fosc * 4) /* 主頻 Fcclk = 60MHz */
/*
* 如果用了USB,則Fcco是Fcclk
* 與Fusbclk在275~550M之間的
* 最小公倍數(shù)
* Fcco是Fcclk在275~550M之間
* 的最小倍數(shù)
*/
#define Fcco (Fusbclk * (USBCLKDivValue+1))
#define Fpclk (Fcclk / 2)
#define PLL_NValue 1
#define PLL_MValue (((Fcco/Fosc)*(PLL_NValue+1)/2)-1)
#define CCLKDivValue (Fcco/Fcclk-1)
#define USBCLKDivValue 5
#else
#define Fcclk (Fosc * 4) /* 主頻 Fcclk = 48MHz */
#define Fcco (Fcclk* 6)
#define Fpclk (Fcclk / 4)
#define PLL_NValue 1
#define PLL_MValue (((Fcco/Fosc)*(PLL_NValue+1)/2)-1)
#define CCLKDivValue (Fcco/Fcclk-1)
#define USBCLKDivValue 254
#endif
#ifdef __cplusplus
}
#endif
#endif
/*********************************************************************************************************
** End Of File
********************************************************************************************************/