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

📄 config.h

📁 在ucos-ii下用LPC2290的spi端口驱动M65的液晶屏
💻 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 NULL
#define NULL  0L
#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位长度) */


typedef unsigned char	INT8U;                   /* 无符号8位整型变量                       */
typedef signed   char	INT8S;                   /* 有符号8位整型变量                       */
typedef unsigned short	INT16U;                  /* 无符号16位整型变量                      */
typedef signed   short	INT16S;                  /* 有符号16位整型变量                      */
typedef unsigned int	INT32U;                  /* 无符号32位整型变量                      */
typedef signed   int	INT32S;                  /* 有符号32位整型变量                      */
typedef float			FP32;                    /* 单精度浮点数(32位长度)                */
typedef double			FP64;                    /* 双精度浮点数(64位长度)				*/
#define BOOL			INT8U


/********************************/
/*      uC/OS-II specital code  */
/*      uC/OS-II的特殊代码      */
/********************************/
//This segment can not be modify
//这一段不能改动
#define     USER_USING_MODE    0x30                   /*  User mode ,ARM 32BITS CODE 用户模式,ARM代码                  */
#include    "Includes.h"

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

#include    "LPC2294.h"
#include    "target.h"

#include    "..\system\CFG_NET.h"
#include    "..\system\rcf_socket.h"
#include    "..\system\system.h"
#include    "..\system\OSFile.h"
#include 	"..\CAN\CAN.h"

#define     MAX_FTP_LINKS           1
#define     FTP_TASK_START_PRIO     10


//This segment can not be modify
//这一段不能改动

/* 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倍


/********************************/
/*Application Program Configurations*/
/*     应用程序配置             */
/********************************/
//This segment could be modified as needed.
//以下根据需要改动

#include    <stdio.h>
#include    <stdlib.h>
#include    <math.h>


#define     LED                 1<<19   // P0.19
#define     KEY1                1<<20   // P0.20
#define     KEY2                1<<22   // P0.22
#define     BUZZER              1<<21   // P0.21



#define     LCD_CS	  			1<<17    //P2.17片选
#define     LCD_RESET 			1<<18    //P2.18重启
#define     LCD_RS	  		    1<<19    //P2.19高为命令低为数据


#define     LCD_CS_Clr()        IO2CLR =LCD_CS;
#define     LCD_CS_Set()        IO2SET =LCD_CS;
#define     LCD_RESET_Clr()     IO2CLR =LCD_RESET;
#define     LCD_RESET_Set()     IO2SET =LCD_RESET;
#define     LCD_RS_Clr()        IO2CLR =LCD_RS;
#define     LCD_RS_Set()        IO2SET =LCD_RS;


#define     BUZZER_Set()        IO0SET = BUZZER;
#define     BUZZER_Clr()        IO0CLR = BUZZER; 
#define     LED_Set()           IO0CLR = LED;
#define     LED_Clr()           IO0SET = LED;

#define CPU_IORD_8(ADDR)        *((volatile uint8 *)(ADDR))
#define CPU_IORD_16(ADDR)       *((volatile uint16 *)(ADDR))
#define CPU_IORD_32(ADDR)       *((volatile uint32 *)(ADDR))
#define CPU_IOWR_8(ADDR,DATA)   *((volatile uint8 *)(ADDR)) = (DATA)
#define CPU_IOWR_16(ADDR,DATA)  *((volatile uint16 *)(ADDR)) = (DATA)
#define CPU_IOWR_32(ADDR,DATA)  *((volatile uint32 *)(ADDR)) = (DATA)

/********************************/
/*Configuration of the example */
/*     本例子的配置             */
/********************************/

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

⌨️ 快捷键说明

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