Enum Class MCP23S17.Pin
- All Implemented Interfaces:
Serializable,Comparable<MCP23S17.Pin>,Constable
- Enclosing class:
- MCP23S17
Enum for each physical GPIO pin on the MCP23S17 chip.
The pins are renumbered so that port A's pins are in order as PIN0 through PIN7 and port B's pins
are in order as PIN8 through PIN15.
- Author:
- Robert Russell
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic MCP23S17.PinfromPinNumber(int pinNumber) Get thePincorresponding to the given pin number.intGet the pin number.booleanisPortA()Get whether or not thisPinis in port A.booleanisPortB()Get whether or not thisPinis in port B.static MCP23S17.PinReturns the enum constant of this class with the specified name.static MCP23S17.Pin[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PIN0
-
PIN1
-
PIN2
-
PIN3
-
PIN4
-
PIN5
-
PIN6
-
PIN7
-
PIN8
-
PIN9
-
PIN10
-
PIN11
-
PIN12
-
PIN13
-
PIN14
-
PIN15
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getPinNumber
public int getPinNumber()Get the pin number.
The pins are numbered so that port A's pins are in order as
0through7and port B's pins are in order as8through15.- Returns:
- the pin number.
-
isPortA
public boolean isPortA()Get whether or not thisPinis in port A.- Returns:
- whether or not this
Pinis in port A.
-
isPortB
public boolean isPortB()Get whether or not thisPinis in port B.- Returns:
- whether or not this
Pinis in port B.
-
fromPinNumber
Get thePincorresponding to the given pin number.- Parameters:
pinNumber- the pin number.- Returns:
- the
Pincorresponding to the given pin number. - Throws:
IllegalArgumentException- if the given pin number is invalid (i.e. less than 0 or greater than 15).
-