好文档 - 专业文书写作范文服务资料分享网站

公交车自动报站系统课程设计

天下 分享 时间: 加入收藏 我要投稿 点赞

/* P3 */

sbit RD = P3^7; sbit WR = P3^6; sbit T1 = P3^5; sbit T0 = P3^4; sbit INT1 = P3^3; sbit INT0 = P3^2; sbit TXD = P3^1; sbit RXD = P3^0;

/* SCON */

sbit SM0 = SCON^7; sbit SM1 = SCON^6; sbit SM2 = SCON^5; sbit REN = SCON^4; sbit TB8 = SCON^3; sbit RB8 = SCON^2; sbit TI = SCON^1; sbit RI = SCON^0;

/* P1 */

sbit T2EX = P1^1; // 8052 only sbit T2 = P1^0; // 8052 only /* T2CON */

sbit TF2 = T2CON^7; sbit EXF2 = T2CON^6; sbit RCLK = T2CON^5; sbit TCLK = T2CON^4; sbit EXEN2 = T2CON^3; sbit TR2 = T2CON^2; sbit C_T2 = T2CON^1; sbit CP_RL2 = T2CON^0; #endif

头文件清单(intrins.h)

/*-------------------------------------------------------------------------- INTRINS.H

Intrinsic functions for C51.

Copyright (c) 1988-2004 Keil Elektronik GmbH and Keil Software, Inc. All rights reserved.

--------------------------------------------------------------------------*/

#ifndef __INTRINS_H__

21

#define __INTRINS_H__

extern void _nop_ (void); extern bit _testbit_ (bit);

extern unsigned char _cror_ (unsigned char, unsigned char); extern unsigned int _iror_ (unsigned int, unsigned char); extern unsigned long _lror_ (unsigned long, unsigned char); extern unsigned char _crol_ (unsigned char, unsigned char); extern unsigned int _irol_ (unsigned int, unsigned char); extern unsigned long _lrol_ (unsigned long, unsigned char); extern unsigned char _chkfloat_(float);

extern void _push_ (unsigned char _sfr); extern void _pop_ (unsigned char _sfr); #endif

头文件清单(string.h)

/*-------------------------------------------------------------------------- STRING.H

String functions.

Copyright (c) 1988-2002 Keil Elektronik GmbH and Keil Software, Inc. All rights reserved.

--------------------------------------------------------------------------*/

#ifndef __STRING_H__ #define __STRING_H__

#ifndef _SIZE_T #define _SIZE_T

typedef unsigned int size_t; #endif

#ifndef NULL

#define NULL ((void *) 0L) #endif

#pragma SAVE

#pragma REGPARMS

extern char *strcat (char *s1, char *s2);

extern char *strncat (char *s1, char *s2, int n);

extern char strcmp (char *s1, char *s2);

extern char strncmp (char *s1, char *s2, int n);

extern char *strcpy (char *s1, char *s2);

22

extern char *strncpy (char *s1, char *s2, int n);

extern int strlen (char *);

extern char *strchr (const char *s, char c); extern int strpos (const char *s, char c); extern char *strrchr (const char *s, char c); extern int strrpos (const char *s, char c);

extern int strspn (char *s, char *set); extern int strcspn (char *s, char *set); extern char *strpbrk (char *s, char *set); extern char *strrpbrk (char *s, char *set); extern char *strstr (char *s, char *sub);

extern char *strtok (char *str, const char *set);

extern char memcmp (void *s1, void *s2, int n); extern void *memcpy (void *s1, void *s2, int n); extern void *memchr (void *s, char val, int n);

extern void *memccpy (void *s1, void *s2, char val, int n); extern void *memmove (void *s1, void *s2, int n); extern void *memset (void *s, char val, int n); #pragma RESTORE

#endif

23

773s61ml7e6gjog0oh073pit886asl004r1
领取福利

微信扫码领取福利

微信扫码分享