Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
50
Добавлен:
14.04.2015
Размер:
1.37 Mб
Скачать

228

Chapter 8. Library Reference

 

 

Include Files

The include files that are provided with the Cx51 standard library are found in the INC subdirectory. These files contain constant and macro definitions, type definitions, and function prototypes. The following sections describe the use and contents of each include file. Macros and functions included in the file are listed as well.

8051 Special Function Register Include Files

The Cx51 compiler package provides you with a number of include files that define manifest constants for the special function registers found on many 8051 derivatives. These files can be found in the folder KEIL\C51\INC and the sub-folders. For example, the Special Function Registers (SFR) of the Philips 80C554 device are defined in the file KEIL\C51\INC\PHILIPS\REG554.H.

Within the µVision2 editor context menu that opens on a right mouse click in an editor window, you can insert the SFR defintion that matches the selected device.

SFR definition files for all 8051 variants can be downloaded from www.keil.com. The device database available on this web page contains the header file for the Special Function Registers file of almost all 8051 devices.

80C517.H

The 80C517.H include file contains routines that use the enhanced operational features of the 80C517 CPU and its derivatives. These routines are:

 

acos517

log10517

sqrt517

 

asin517

log517

sscanf517

 

atan517

printf517

strtod517

 

atof517

scanf517

tan517

8

cos517

sin517

 

 

 

 

exp517

sprintf517

 

 

 

 

 

C51 Compiler

229

 

 

ABSACC.H

The ABSACC.H include file contains definitions for macros that allow you to directly access the different memory areas of the 8051.

CBYTE

FARRAY

PBYTE

CWORD

FCARRAY

PWORD

DBYTE

FCVAR

XBYTE

DWORD

FVAR

XWORD

ASSERT.H

The ASSERT.H include file defines the assert macro you can use to create test conditions in your programs.

CTYPE.H

The CTYPE.H include file contains definitions and prototypes for routines which classify ASCII characters and routines which perform character conversions. The following is a list of these routines:

isalnum

isprint

toint

isalpha

ispunct

tolower

iscntrl

isspace

_tolower

isdigit

isupper

toupper

isgraph

isxdigit

_toupper

islower

toascii

 

INTRINS.H

The INTRINS.H include file contains prototypes for routines that instruct the compiler to generate in-line intrinsic code.

_chkfloat_

_irol_

_crol_

_iror_

_cror_

_lrol_

_lror_

 

 

_nop_

8

_testbit_

 

 

 

230

Chapter 8. Library Reference

 

 

MATH.H

The MATH.H include file contains prototypes and definitions for all routines that perform floating-point math calculations. Other math functions are also included in this file. All of the math function routines are listed below:

abs

exp

modf

acos

fabs

pow

asin

floor

sin

atan

fmod

sinh

atan2

fprestore

sqrt

cabs

fpsave

tan

ceil

labs

tanh

cos

log

 

cosh

log10

 

SETJMP.H

The SETJMP.H include file defines the jmp_buf type and prototypes the setjmp and longjmp routines which use it.

STDARG.H

The STDARG.H include file defines macros that allow you to access arguments in functions with variable-length argument lists. The macros include:

va_arg

va_end

va_start

In addition, the va_list type is defined in this file.

STDDEF.H

The STDDEF.H include file defines the offsetof macro you can use to determine

the offset of members of a structure.

8

C51 Compiler

231

 

 

STDIO.H

The STDIO.H include file contains prototypes and definitions for stream I/O routines. They are:

getchar

putchar

sscanf

_getkey

puts

ungetchar

gets

scanf

vprintf

printf

sprintf

vsprintf

The STDIO.H include file also defines the EOF manifest constant.

STDLIB.H

The STDLIB.H include file contains prototypes and definitions for the type conversion and memory allocation routines listed below:

atof

init_mempool

strtod

atoi

malloc

strtol

atol

rand

strtoul

calloc

realloc

 

free

srand

 

The STDLIB.H include file also defines the NULL manifest constant.

STRING.H

The STRING.H include file contains prototypes for the following string and buffer manipulation routines:

memccpy

strchr

strncpy

 

memchr

strcmp

strpbrk

 

memcmp

strcpy

strpos

 

memcpy

strcspn

strrchr

8

memmove

strlen

strrpbrk

memset

strncat

strrpos

strcat

strncmp

strspn

 

 

 

 

The STRING.H include file also defines the NULL manifest constant.

Соседние файлы в папке HLP