#include <virtualinputport.h>
Virtual 8 bit port consisting of 8 pins of type InputPin. This is a convenience wrapper for PinArray implementing the InputPort interface.
◆ VirtualInputPort()
Constructor. Assigns pins to internal PinArray. The parameters intentionally don't have default values so that you have to make up your mind. See notes.
- Parameters
-
pin0 | Pin to be used for bit position 0. |
pin1 | Pin to be used for bit position 1. |
pin2 | Pin to be used for bit position 2. |
pin3 | Pin to be used for bit position 3. |
pin4 | Pin to be used for bit position 4. |
pin5 | Pin to be used for bit position 5. |
pin6 | Pin to be used for bit position 6. |
pin7 | Pin to be used for bit position 7. |
- Note
- You can specify null pointers for pins that should not be used (meaning bits that will read always 0).
-
You can specify the same pin multiple times. But be aware of race conditions when reading the pin state.
◆ getValue()
virtual uint8_t VirtualInputPort::getValue |
( |
void |
| ) |
const |
|
inlineoverridevirtual |
Get value being represented by set of pins.
- Returns
- Value read from pins.
- Note
- Bits that are not associated with a pin read as 0.
Implements InputPort.