时间触发嵌入式系统设计模式:使用8051系列微控制器开发可靠应用

源代码在线查看: port.h

软件大小: 35052 K
上传用户: jjdgtsd80ux
关键词: 8051 时间触发 嵌入式系统 微控制器
下载地址: 免注册下载 普通下载 VIP

相关代码

				/*------------------------------------------------------------------*-
				
				   Port.H (v1.00)
				
				  ------------------------------------------------------------------
				
				  'Port Header' (see Chap 10) for project LCD_KEYP (see Chap 22)
				
				
				   COPYRIGHT
				   ---------
				
				   This code is from the book:
				
				   PATTERNS FOR TIME-TRIGGERED EMBEDDED SYSTEMS by Michael J. Pont 
				   [Pearson Education, 2001; ISBN: 0-201-33138-1].
				
				   This code is copyright (c) 2001 by Michael J. Pont.
				 
				   See book for copyright details and other information.
				
				-*------------------------------------------------------------------*/
				
				// ------ Sch51.C ----------------------------------------
				
				// Comment this line out if error reporting is NOT required
				#define SCH_REPORT_ERRORS
				
				#ifdef SCH_REPORT_ERRORS
				// The port on which error codes will be displayed
				// ONLY USED IF ERRORS ARE REPORTED
				#define Error_port P1
				
				#endif
				
				// ------ Keypad.C ------------------------------------------------
				
				#define KEYPAD_PORT P2
				
				sbit C1 = KEYPAD_PORT^0;
				sbit C2 = KEYPAD_PORT^1;
				sbit C3 = KEYPAD_PORT^2;
				
				sbit R1 = KEYPAD_PORT^6;
				sbit R2 = KEYPAD_PORT^5;
				sbit R3 = KEYPAD_PORT^4;
				sbit R4 = KEYPAD_PORT^3;
				
				// ------ LCD_A.c --------------------------------------------------
				
				// NOTE: Any combination of 6 pins may be used (any ports, any order)
				// NOTE: Number in [] are pin numbers on *MANY* LCDs  
				
				sbit LCD_D4 = P3^2; // DB4 [11]
				sbit LCD_D5 = P3^3; // DB5 [12]
				sbit LCD_D6 = P3^4; // DB6 [13]
				sbit LCD_D7 = P3^5; // DB7 [14]
				
				sbit LCD_RS = P3^6; // Display register select output [4]
				sbit LCD_EN = P3^7; // Display enable output [6]
				
				// Connect Vss [1] on LCD to Gnd
				// Connect Vcc [2] on LCD to +5V
				// Connect Vo  [3] on LCD to Gnd
				// Connect RW  [5] on LCD to Gnd
				
				/*------------------------------------------------------------------*-
				  ---- END OF FILE -------------------------------------------------
				-*------------------------------------------------------------------*/
				
				
				
							

相关资源