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.Pin
fromPinNumber
(int pinNumber) Get thePin
corresponding to the given pin number.int
Get the pin number.boolean
isPortA()
Get whether or not thisPin
is in port A.boolean
isPortB()
Get whether or not thisPin
is in port B.static MCP23S17.Pin
Returns 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
0
through7
and port B's pins are in order as8
through15
.- Returns:
- the pin number.
-
isPortA
public boolean isPortA()Get whether or not thisPin
is in port A.- Returns:
- whether or not this
Pin
is in port A.
-
isPortB
public boolean isPortB()Get whether or not thisPin
is in port B.- Returns:
- whether or not this
Pin
is in port B.
-
fromPinNumber
Get thePin
corresponding to the given pin number.- Parameters:
pinNumber
- the pin number.- Returns:
- the
Pin
corresponding to the given pin number. - Throws:
IllegalArgumentException
- if the given pin number is invalid (i.e. less than 0 or greater than 15).
-