DIR
 
Syntax

 

int DIR (int expression ) ;

Description


DIR (expression) can be used to read the direction of the up to 32 configurable Port 0 pins.  If DIR (expression) is 1 then the corresponding pin is an output.  If the value is 0 then that pin is an input.

With the SuperPRO and PROplus, NXP has added more configurable port pins.  We are adopting their convention for control of those pins.  FIO0DIR, FIO1DIR, FIO2DIR, and FIO4DIR control the input/output status.  Writing 1 to a bit  will make it an output.  More details in the NXP user manuals.

Example

// Set pin 4 as an input
INPUT(4);

// Check the direction of pin 4
dir4 = DIR(4);

See also