#include <inputportpin.h>
Input pin that can be asked for its state, returning a boolean value. The InputPortPin works with any InputPort interface, for example a GpioPort.
- Note
- You have to make sure that pins being used for a InputPortPin to operate on must be configured as input. The InputPortPin doesn't know about setting a direction. So if you plan to use a GpioPort for this, first set it up correctly using its setDirection() method. This also includes activating or deactivating internal pullup resistors.
◆ InputPortPin()
InputPortPin::InputPortPin |
( |
InputPort * |
port, |
|
|
uint8_t |
index |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
port | Pointer to input port the pin is located on. |
index | Zero based index of the pin within the port (e.g. index 2 on PortB results in the pin commonly called PB2). |
◆ getValue()
virtual bool InputPortPin::getValue |
( |
void |
| ) |
const |
|
inlineoverridevirtual |
Gets the value of the pin.
- Returns
- Value of the pin, true for HIGH level, false for LOW level.
Implements InputPin.