config.h
上传用户:ssllxx2007
上传日期:2022-06-12
资源大小:784k
文件大小:6k
- /****************************************Copyright (c)**************************************************
- ** Guangzou ZLG-MCU Development Co.,LTD.
- ** graduate school
- ** http://www.zlgmcu.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: silentdawn
- ** Modified date:2007-08-04
- ** Version:
- ** Descriptions: 移植到MB2300开发板上(芯片采用LPC2368)
- **
- ********************************************************************************************************/
- #ifndef __CONFIG_H
- #define __CONFIG_H
- //这一段无需改动
- //This segment should not be modified
- #ifndef TRUE
- #define TRUE 1
- #endif
- #ifndef FALSE
- #define FALSE 0
- #endif
- typedef unsigned char uint8; /* defined for unsigned 8-bits integer variable 无符号8位整型变量 */
- typedef signed char int8; /* defined for signed 8-bits integer variable 有符号8位整型变量 */
- typedef unsigned short uint16; /* defined for unsigned 16-bits integer variable 无符号16位整型变量 */
- typedef signed short int16; /* defined for signed 16-bits integer variable 有符号16位整型变量 */
- typedef unsigned int uint32; /* defined for unsigned 32-bits integer variable 无符号32位整型变量 */
- typedef signed int int32; /* defined for signed 32-bits integer variable 有符号32位整型变量 */
- typedef float fp32; /* single precision floating point variable (32bits) 单精度浮点数(32位长度) */
- typedef double fp64; /* double precision floating point variable (64bits) 双精度浮点数(64位长度) */
- /********************************/
- /* uC/OS-II specital code */
- /* uC/OS-II的特殊代码 */
- /********************************/
- #define USER_USING_MODE 0x10 /* User mode ,ARM 32BITS CODE 用户模式,ARM代码 */
- //
- /* Chosen one from 0x10,0x30,0x1f,0x3f.只能是0x10,0x30,0x1f,0x3f之一 */
- #include "Includes.h"
- /********************************/
- /* ARM的特殊代码 */
- /* ARM specital code */
- /********************************/
- //这一段无需改动
- //This segment should not be modify
- //改为LPC2368芯片的头文件
- #include "LPC23xx.h"
- /********************************/
- /* 应用程序配置 */
- /*Application Program Configurations*/
- /********************************/
- //以下根据需要改动
- //This segment could be modified as needed.
- #include <stdio.h>
- #include <ctype.h>
- #include <stdlib.h>
- #include <setjmp.h>
- #include <rt_misc.h>
- /********************************/
- /* 本例子的配置 */
- /*Configuration of the example */
- /********************************/
- //NXP 提供的配置设置
- /* If USB device is used, the CCLK setting needs to be 57.6Mhz, CCO will be 288Mhz
- to get precise USB clock 48Mhz. If USB is not used, you set any clock you want
- based on the table below. If you want to use USB, change "define USE_USB" from 0 to 1 */
- #define USE_USB 1
- /* PLL Setting Table Matrix */
- /*
- Main Osc. CCLKCFG Fcco Fcclk M N
- 12Mhz 29 300Mhz 10Mhz 24 1
- 12Mhz 35 360Mhz 10Mhz 14 0
- 12Mhz 27 336Mhz 12Mhz 13 0
- 12Mhz 14 300Mhz 20Mhz 24 1
- 12Mhz 17 360Mhz 20Mhz 14 0
- 12Mhz 13 336Mhz 24Mhz 13 0
- 12Mhz 11 300Mhz 25Mhz 24 1
- 12Mhz 9 300Mhz 30Mhz 24 1
- 12Mhz 11 360Mhz 30Mhz 14 0
- 12Mhz 9 320Mhz 32Mhz 39 2
- 12Mhz 9 350Mhz 35Mhz 174 11
- 12Mhz 7 312Mhz 39Mhz 12 0
- 12Mhz 8 360Mhz 40Mhz 14 0
- 12Mhz 7 360Mhz 45Mhz 14 0
- 12Mhz 6 336Mhz 48Mhz 13 0
- 12Mhz 5 300Mhz 50Mhz 24 1
- 12Mhz 5 312Mhz 52Mhz 12 0
- 12Mhz 5 336Mhz 56Mhz 13 0
- 12Mhz 4 300Mhz 60Mhz 24 1
- 12Mhz 4 320Mhz 64Mhz 39 2
- 12Mhz 4 350Mhz 70Mhz 174 11
- 12Mhz 4 360Mhz 72Mhz 14 0
- 12Mhz 3 300Mhz 75Mhz 24 1
- 12Mhz 3 312Mhz 78Mhz 12 0
- 12Mhz 3 320Mhz 80Mhz 39 2
- 12Mhz 3 336Mhz 84Mhz 13 0
- */
- #if USE_USB /* 1 is USB, 0 is non-USB related */
- /* Fcck = 57.6Mhz, Fosc = 288Mhz, and USB 48Mhz */
- #define PLL_MValue 11
- #define PLL_NValue 0
- #define CCLKDivValue 4
- #define USBCLKDivValue 5
- /* System configuration: Fosc, Fcclk, Fcco, Fpclk must be defined */
- /* PLL input Crystal frequence range 4KHz~20MHz. */
- #define Fosc 12000000
- /* System frequence,should be less than 80MHz. */
- #define Fcclk 57600000
- #define Fcco 288000000
- #else
- /* Fcck = 50Mhz, Fosc = 300Mhz, and USB 48Mhz */
- #define PLL_MValue 24
- #define PLL_NValue 1
- #define CCLKDivValue 5
- #define USBCLKDivValue 6
- /* System configuration: Fosc, Fcclk, Fcco, Fpclk must be defined */
- /* PLL input Crystal frequence range 4KHz~20MHz. */
- #define Fosc 12000000
- /* System frequence,should be less than 80MHz. */
- #define Fcclk 50000000
- #define Fcco 300000000
- #endif
- /* APB clock frequence , must be 1/2/4 multiples of ( Fcclk/4 ). */
- /* If USB is enabled, the minimum APB must be greater than 16Mhz */
- #if USE_USB
- #define Fpclk (Fcclk / 2)
- #else
- #define Fpclk (Fcclk / 4)
- #endif
- #include "target.h" //This line may not be deleted 这一句不能删除
- //#include "..Arm_Pcpc.h"
- //包括IRQ中断的一些常量,把一些头文件都可以添加到这里
- #include "irq.h"
- #endif
- /*********************************************************************************************************
- ** End Of File
- ********************************************************************************************************/