Elements:
port is A, B, C, D, E, F, G, H, J or ALL
Purpose:
This directive affects how the compiler will generate code for input and output instructions that follow. This directive takes effect until another #USE XXX_IO directive is encountered. The standard method of doing I/O will cause the compiler to generate code to make an I/O pin either input or output every time it is used. On the 5X processors this requires one byte of RAM for every port set to standard I/O.
Standard_io is the default I/O method for all ports.
When linking multiple compilation units be aware this directive only applies to the current compilation unit.
语法:#use fast_io(port)
port是A~G
目的:影响编译器如何产生输入输出代码,说明如下.这种指令有效,直到出现下一个#use xxxx_io为止.执行I/O的快速方法将使编译器不用对I/O方向寄存器进行编程就可执行I/O操作,但用户必须保证通过set_tris_X()来设置I/O方向寄存器.
例子:#use fast_io(A)例子文件:ex_cust.c;该文件在前面已经叙述过了
#USE FIXED_IO
语法:#use fixed_io(port_outputs=pin.pin?)
port是A~G.
pin是在device.h文件中定义的脚数之一.
目的: 影响编译器如何产生输入输出代码,说明如下. 这种指令有效,直到出现下一个#use xxxx_io为止. 执行设置I/O的方法将使编译器产生代码,这种代码使I/O在每次使用的时候,要么是输入,要么是输出.根据I/O方向寄存器中的信息对引脚进行编程(I/O方向寄存器实际上被执行但不操作),这将存储一个字节到标准I/O使用的RAM中.
例子:#use fixed_io(a_outputs=PIN_A2,PIN_A3) //将PINA2和PIN_A3设置为输出
Syntax:
#USE STANDARD_IO (port)
Elements:
port is A, B, C, D, E, F, G, H, J or ALL
Purpose:
This directive affects how the compiler will generate code for input and output instructions that follow. This directive takes effect until another #USE XXX_IO directive is encountered. The standard method of doing I/O will cause the compiler to generate code to make an I/O pin either input or output every time it is used. On the 5X processors this requires one byte of RAM for every port set to standard I/O.
Standard_io is the default I/O method for all ports.
When linking multiple compilation units be aware this directive only applies to the current compilation unit.
Examples:
#use standard_io(A
一周热门 更多>