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.

Returns:<br />

Function:<br />

Availability:<br />

Requires:<br />

updated unless the FAST_IO mode is set on port A. note that doing I/O with a<br />

variable instead of a constant will take much longer time.<br />

0 (or FALSE) if the pin is low,<br />

1 (or TRUE) if the pin is high<br />

This function returns the state of the indicated pin. The method of I/O is<br />

dependent on the last USE *_IO directive. By default with standard I/O before<br />

the input is done the data direction is set to input.<br />

All devices.<br />

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

Examples:<br />

while ( !input(PIN_B1) );<br />

// waits for B1 to go high<br />

if( input(PIN_A0) )<br />

printf("A0 is now high\r\n");<br />

int16 i=PIN_B1;<br />

while(!i);<br />

//waits for B1 to go high<br />

Example Files:<br />

Also See:<br />

ex_pulse.c<br />

input_x(), output_low(), output_high(), #USE FIXED_IO, #USE FAST_IO,<br />

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

input_change_x( )<br />

Syntax: value = input_change_a( );<br />

value = input_change_b( );<br />

value = input_change_c( );<br />

value = input_change_d( );<br />

value = input_change_e( );<br />

value = input_change_f( );<br />

value = input_change_g( );<br />

value = input_change_h( );<br />

value = input_change_j( );<br />

value = input_change_k( );<br />

Parameters: None<br />

Returns:<br />

Function:<br />

An 8-bit or 16-bit int representing the changes on the port.<br />

This function reads the level of the pins on the port and compares them to the<br />

results the last time the input_change_x( ) function was called. A 1 is returned if<br />

the value has changed, 0 if the value is unchanged.<br />

206

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

Saved successfully!

Ooh no, something went wrong!