chipKIT® Development Platform

Inspired by Arduino™

Last edit: 2021-03-21 22:34 by Majenko

GetPinMode

  1. Synopsis

  2. Description

  3. Return Value

  4. Bugs

  5. Conforming To

  6. Examples

  7. See Also

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