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

📄 config.h

📁 关键字:LCD液晶显示屏 串行 并行 ST7920 RT12864
💻 H
字号:
/****************************************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:
** 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

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代码                  */
#define		LEDALL				(0xFF<<16)
#define		LEDn(n)				(0x01<<(15+n))
#define		LEDInit()			(IO2DIR |= LEDALL)
#define		LEDOnAll()			(IO2CLR = LEDALL)
#define		LEDOffAll()			(IO2SET = LEDALL)
#define		LEDOn(n)			(IO2CLR = LEDn(n))
#define		LEDOff(n)			(IO2SET = LEDn(n))

#define 	KEYPIN      		(1<<20)
#define		KeyInit()			PINSEL1 &=~(0x03<<8);IO0DIR &= ~KEYPIN;
#define		GetKey()			(((IO0PIN & KEYPIN) == 0)?1:0)// 

/* 设置引脚为第几号功能,参数n为引脚号,m为功能号 */
#define		_IO0Init_Lower(n,m)		(PINSEL0 = (PINSEL0 & ~(0x03<<(n+n))) | (m<<(n+n)))		// IO0低16位
#define		_IO0Init_Upper(n,m)		(PINSEL1 = (PINSEL1 & ~(0x03<<(n+n-32))) | (m<<(n+n-32)))	// IO0高16位
//#define		IO0Init(n,m)	(n<16)?_IO0Init_Lower(n,m):_IO0Init_Upper(n,m)					// 初始化引脚功能
#define		IO0Init(n,m)	(n<16)?_IO0Init_Lower(n,m):_IO0Init_Upper(n,m)					// 初始化引脚功能

/* 设定管脚方向 */
#define 	OUT		1					// 输出
#define 	IN		0					// 输入
#define		GPIO0_DIR(n,dir)		IO0DIR = (IO0DIR & ~(1<<n)) | (dir<<n)
#define		GPIO1_DIR(n,dir)		IO1DIR = (IO1DIR & ~(1<<n)) | (dir<<n)

/* 引脚置位 */ 
#define		GPIO0_SET(n)			IO0SET = 1<<n
#define		GPIO1_SET(n)			IO1SET = 1<<n
#define		GPIO2_SET(n)			IO2SET = 1<<n

/* 引脚清零 */
#define		GPIO0_CLR(n)			IO0CLR = 1<<n
#define		GPIO1_CLR(n)			IO1CLR = 1<<n
#define		GPIO2_CLR(n)			IO2CLR = 1<<n

#include "Includes.h"


/********************************/
/*      ARM的特殊代码           */
/*      ARM specital code       */
/********************************/
//这一段无需改动
//This segment should not be modify

#include    "LPC2294.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 */
/********************************/
/* 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倍

#include    "target.h"              //This line may not be deleted 这一句不能删除
#include    "..\..\Arm_Pc\pc.h"

#endif
/*********************************************************************************************************
**                            End Of File
********************************************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -