uint8_t getPinMode(uint8_t pin)
getPinMode() returns the current mode an I/O pin is operating in. It analyses the current settings for an I/O pin as set by the pinMode() function and returns a value equivalent to what would have been passed to pinMode().
The pin mode; one of:
The function currently does not examine pullup or pulldown resistors to identify the INPUT_PULLUP, INPUT_PULLDOWN or INPUT_PULLUPDOWN modes on chips which support those modes.
getPinMode() does not conform to any external API and is unique to the chipKIT system.
int mode = getPinMode(3);