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.

Built-in Functions<br />

take much longer time.<br />

Value is a 1 or a 0.<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

undefined<br />

Outputs the specified value (0 or 1) to the specified I/O pin. The<br />

method of setting the direction register is determined by the last<br />

#USE *_IO directive.<br />

All devices.<br />

Pin constants are defined in the devices .h file<br />

Examples:<br />

output_bit( PIN_B0, 0);<br />

// Same as output_low(pin_B0);<br />

output_bit( PIN_B0,input( PIN_B1 ) );<br />

// Make pin B0 the same as B1<br />

output_bit( PIN_B0,shift_left(&data,1,input(PIN_B1)));<br />

// Output the MSB of data to<br />

// B0 and at the same time<br />

// shift B1 into the LSB of data<br />

int16 i=PIN_B0;<br />

ouput_bit(i,shift_left(&data,1,input(PIN_B1)));<br />

//same as above example, but<br />

//uses a variable instead of a constant<br />

Example Files: ex_extee.c with 9356.c<br />

Also See:<br />

input(), output_low(), output_high(), output_float(), output_x(), #USE<br />

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

output_drive( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

output_drive(pin)<br />

Pins are defined in the devices .h file. The actual value is a bit<br />

address. For example, port a (byte 5 ) bit 3 would have a value of 5*8+3 or<br />

43 . This is defined as follows: #DEFINE PIN_A3 43 .<br />

undefined<br />

Sets the specified pin to the output mode.<br />

All devices.<br />

Pin constants are defined in the devices.h file.<br />

227

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

Saved successfully!

Ooh no, something went wrong!