GetPinMode

From chipKIT
Jump to: navigation, search

Synopsis

 uint8_t getPinMode(uint8_t pin)

Description

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().

Return Value

The pin mode; one of:

  • OUTPUT
  • INPUT
  • OPEN

Bugs

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.

Conforming To

getPinMode() does not conform to any external API and is unique to the chipKIT system.

Examples

 int mode = getPinMode(3);

See Also

digitalRead(), digitalWrite(), pinMode(), pulseIn(), shiftIn(), shiftOut()