📄 config.h
字号:
/****************************************Copyright (c)**************************************************
** Guangzhou ZHIYUAN electronics Co.,LTD.
** http://www.zyinside.com
**
**--------------File Info-------------------------------------------------------------------------------
** File Name: config.h
** Last modified Date: 2006-02-22
** Last Version: 1.0
** Descriptions: User Configurable File
**
**------------------------------------------------------------------------------------------------------
** Created By: Chenmingji
** Created date: 2006-02-22
** Version: 1.0
** Descriptions: First version
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Descriptions:
**
********************************************************************************************************/
#ifndef __CONFIG_H
#define __CONFIG_H
//This segment should not be modified
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#ifndef NULL
#define NULL 0L
#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位长度) */
typedef union {
uint8 Reg8;
struct {
uint8 FN :4;
uint8 FCV :1;
uint8 FCB :1;
uint8 PRM :1;
uint8 DIR :1;
} Bits;
} CMode;
typedef union {
uint8 Reg8;
struct {
uint8 SEQ :4;
uint8 CON :1;
uint8 FIN :1;
uint8 FIR :1;
uint8 TpV :1;
} Bits;
} SEQMode;
/********************************/
/* ARM specital code */
/* ARM的特殊代码 */
/********************************/
//This segment should not be modify
//这一段无需改动
#include "LPC2294.h"
#include "target.h"
/********************************/
/* 本例子的配置 */
/*Configuration of the example */
/********************************/
/////////////////
// I/O defines //
/////////////////
#define TXD0 1 //TXD0是引脚P0.0的第2功能
#define RXD0 (1<<2) //RXD0是引脚P0.1的第2功能
#define TXD1 (1<<16) //TXD1是引脚P0.8的第2功能
#define RXD1 (1<<18) //RXD1是引脚P0.9的第2功能
/*#define TXD0 1<<0
#define RXD0 1<<1 */
#define SCL0 1<<2
#define SDA0 1<<3
#define SCK0 1<<4
#define MISO0 1<<5
#define MOSI0 1<<6
#define SSEL0 1<<7
/*#define TXD1 1<<8
#define RXD1 1<<9 */
#define ADIN 1<<10
#define SCL1 1<<11
#define DCIN 1<<12
#define QOUT 1<<13
#define SDA1 1<<14
#define OUT2 1<<15
#define IRQ 1<<16
#define SCK1 1<<17
#define MISO1 1<<18
#define MOSI1 1<<19
#define ADFS 1<<20
#define MCLK 1<<21
#define ADSE 1<<23
#define DE1 1<<25
#define OUT1 1<<27
#define ERR 1<<28
#define OUT3 1<<29
#define LRX 1<<30
#define FMWP 1<<31
#define LTX 1<<16
#define JUMP1 1<<20
#define POUT 1<<21
#define OUT4 1<<22
#define RUN 1<<23
#define ADRES 1<<24
#define DFWP 1<<25
/* System configuration .Fosc、Fcclk、Fcco、Fpclk must be defined */
/* 系统设置, Fosc、Fcclk、Fcco、Fpclk必须定义*/
#define Fosc 11059200 //Crystal frequence,10MHz~25MHz,should be the same as actual status.
//应当与实际一至晶振频率,10MHz~25MHz,应当与实际一至
#define Fcclk (Fosc * 4) //System frequence,should be (1~32)multiples of Fosc,and should be equal or less than 60MHz.
//系统频率,必须为Fosc的整数倍(1~32),且<=60MHZ
#define Fcco (Fcclk * 4) //CCO frequence,should be 2、4、8、16 multiples of Fcclk, ranged from 156MHz to 320MHz.
//CCO频率,必须为Fcclk的2、4、8、16倍,范围为156MHz~320MHz
#define Fpclk (Fcclk / 4) * 1 //VPB clock frequence , must be 1、2、4 multiples of (Fcclk / 4).
//VPB时钟频率,只能为(Fcclk / 4)的1、2、4倍
#if (Fpclk / (Fcclk / 4)) == 2
#define VPBDIV_DATA 2
#else
#if (Fpclk / (Fcclk / 4)) == 4
#define VPBDIV_DATA 1
#else
#define VPBDIV_DATA 0
#endif
#endif
#if (Fcco / Fcclk) == 2
#define PLLCFG_DATA (((Fcclk / Fosc) - 1) | (0 << 5))
#else
#if (Fcco / Fcclk) == 4
#define PLLCFG_DATA (((Fcclk / Fosc) - 1) | (1 << 5))
#else
#if (Fcco / Fcclk) == 8
#define PLLCFG_DATA (((Fcclk / Fosc) - 1) | (2 << 5))
#else
#if (Fcco / Fcclk) == 16
#define PLLCFG_DATA (((Fcclk / Fosc) - 1) | (3 << 5))
#else
#define PLLCFG_DATA 0x100
#endif
#endif
#endif
#endif
#if Fcclk < 20000000
#define MAMTIM_DATA 1
#else
#if Fcclk < 40000000
#define MAMTIM_DATA 2
#else
#if Fcclk < 60000000
#define MAMTIM_DATA 3
#else
#if Fcclk < 80000000
#define MAMTIM_DATA 4
#else
#if Fcclk < 100000000
#define MAMTIM_DATA 5
#else
#if Fcclk < 120000000
#define MAMTIM_DATA 6
#else
#define MAMTIM_DATA 7
#endif
#endif
#endif
#endif
#endif
#endif
/********************************/
/*Application Program Configurations*/
/* 应用程序配置 */
/********************************/
//This segment could be modified as needed.
//以下根据需要改动
#endif
/*********************************************************************************************************
** End Of File
********************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -