17.02.2015 Views

CCS C Compiler Manual PCB / PCM / PCH

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Built-in Functions<br />

Availability:<br />

Requires:<br />

All devices.<br />

None<br />

Examples:<br />

pin_check = input_change_b( );<br />

Example<br />

Files:<br />

Also See:<br />

None<br />

input( ), input_x( ), output_x( ), #USE FIXED_IO, #USE FAST_IO, #USE<br />

STANDARD_IO, General Purpose I/O<br />

input_state( )<br />

Syntax:<br />

Parameters:<br />

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

Examples:<br />

Example Files:<br />

Also See:<br />

value = input_state(pin)<br />

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

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

5*8+3 or 43 . This is defined as follows: #define PIN_A3 43 .<br />

Bit specifying whether pin is high or low. A 1 indicates the pin is high and<br />

a 0 indicates it is low.<br />

This function reads the level of a pin without changing the direction of the<br />

pin as INPUT() does.<br />

All devices.<br />

Nothing<br />

level = input_state(pin_A3);<br />

printf("level: %d",level);<br />

None<br />

input(), set_tris_x(), output_low(), output_high(), General Purpose I/O<br />

input_x( )<br />

Syntax:<br />

value = input_a()<br />

value = input_b()<br />

value = input_c()<br />

value = input_d()<br />

207

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

Saved successfully!

Ooh no, something went wrong!