17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Examples:<br />

Example<br />

Files:<br />

Also See:<br />

#use fast_io(A)<br />

ex_cust.c<br />

#USE FIXED_IO, #USE STANDARD_IO, set_tris_X() , General Purpose I/O<br />

#use fixed_io<br />

Syntax:<br />

Elements:<br />

Purpose:<br />

Examples:<br />

Example<br />

Files:<br />

Also See:<br />

#USE FIXED_IO (port_outputs=pin, pin?)<br />

port is A-G, pin is one of the pin constants defined in the devices .h file.<br />

This directive affects how the compiler will generate code for input and output<br />

instructions that follow. This directive takes effect until another #USE XXX_IO directive<br />

is encountered. The fixed method of doing I/O will cause the compiler to generate code<br />

to make an I/O pin either input or output every time it is used. The pins are programmed<br />

according to the information in this directive (not the operations actually<br />

performed). This saves a byte of RAM used in standard I/O. When linking multiple<br />

compilation units be aware this directive only applies to the current compilation unit.<br />

#use fixed_io(a_outputs=PIN_A2, PIN_A3)<br />

None<br />

#USE FAST_IO, #USE STANDARD_IO, General Purpose I/O<br />

#use i2c<br />

Syntax:<br />

Elements:<br />

#USE I2C (options)<br />

Options are separated by commas and may be:<br />

MASTER Sets to the master mode<br />

MULTI_MASTER Set the multi_master mode<br />

SLAVE<br />

Set the slave mode<br />

SCL=pin<br />

Specifies the SCL pin (pin is a bit address)<br />

SDA=pin<br />

Specifies the SDA pin<br />

ADDRESS=nn Specifies the slave mode address<br />

FAST<br />

Use the fast I2C specification.<br />

FAST=nnnnnn Sets the speed to nnnnnn hz<br />

136

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!