Host-only virtual GPIO driver — no hardware dependency.
More...
#include <DirectGPIODriver.h>
|
| typedef uint16_t(* | MapFn) (uint8_t r, uint8_t c) |
| | Function pointer type: (row, col) → pin index.
|
| |
|
| | DirectGPIODriver (uint16_t nPins, MapFn map) |
| | Construct with a virtual pin count and a node-to-pin mapper.
|
| |
| | ~DirectGPIODriver () |
| | Destructor — frees the virtual pin array.
|
| |
| void | begin () override |
| | Zero all virtual pins.
|
| |
| void | setNodeHardware (uint8_t r, uint8_t c, bool state) override |
| | Set the virtual pin for node (r, c) to state.
|
| |
| void | commitPhysicalUpdates () override |
| | No-op for this virtual driver (writes are immediate).
|
| |
| bool | pinState (uint16_t idx) const |
| | Read the logical state of virtual pin idx.
|
| |
| uint16_t | pinCount () const |
| | Return the total virtual pin count.
|
| |
| virtual | ~XPointDriver () |
| |
| virtual void | setNodeLevel (uint8_t r, uint8_t c, uint16_t level) |
| | Set an analog drive level for node (r, c).
|
| |
| virtual void | releaseNode (uint8_t, uint8_t) |
| | De-energize the coil that was pulsed on node (r, c).
|
| |
Host-only virtual GPIO driver — no hardware dependency.
Useful for unit tests and simulation. Does not link against any Arduino headers, making it safe to build with a plain C++ toolchain.
◆ MapFn
| typedef uint16_t(* DirectGPIODriver::MapFn) (uint8_t r, uint8_t c) |
Function pointer type: (row, col) → pin index.
◆ DirectGPIODriver()
| DirectGPIODriver::DirectGPIODriver |
( |
uint16_t |
nPins, |
|
|
MapFn |
map |
|
) |
| |
Construct with a virtual pin count and a node-to-pin mapper.
- Parameters
-
| [in] | nPins | Total number of virtual pins to allocate (heap). |
| [in] | map | Mapper function; must return indices in [0, nPins). |
◆ ~DirectGPIODriver()
| DirectGPIODriver::~DirectGPIODriver |
( |
| ) |
|
Destructor — frees the virtual pin array.
◆ begin()
| void DirectGPIODriver::begin |
( |
| ) |
|
|
overridevirtual |
◆ commitPhysicalUpdates()
| void DirectGPIODriver::commitPhysicalUpdates |
( |
| ) |
|
|
overridevirtual |
No-op for this virtual driver (writes are immediate).
Reimplemented from XPointDriver.
◆ pinCount()
| uint16_t DirectGPIODriver::pinCount |
( |
| ) |
const |
|
inline |
Return the total virtual pin count.
- Returns
- Number of pins allocated at construction.
◆ pinState()
| bool DirectGPIODriver::pinState |
( |
uint16_t |
idx | ) |
const |
Read the logical state of virtual pin idx.
- Parameters
-
| [in] | idx | Pin index in [0, pinCount). |
- Returns
true if the pin is HIGH, false if LOW or out of range.
◆ setNodeHardware()
| void DirectGPIODriver::setNodeHardware |
( |
uint8_t |
r, |
|
|
uint8_t |
c, |
|
|
bool |
state |
|
) |
| |
|
overridevirtual |
Set the virtual pin for node (r, c) to state.
- Parameters
-
| [in] | r | Row index. |
| [in] | c | Column index. |
| [in] | state | true = pin HIGH, false = pin LOW. |
Implements XPointDriver.
The documentation for this class was generated from the following files: