Host-only virtual shift-register driver — no hardware dependency.
More...
#include <ShiftRegisterDriver.h>
|
| typedef uint16_t(* | MapFn) (uint8_t r, uint8_t c) |
| | Function pointer type: (row, col) → output bit index.
|
| |
|
| | ShiftRegisterDriver (uint16_t nOut, MapFn map) |
| | Construct with an output count and a node-to-bit-index mapper.
|
| |
| | ~ShiftRegisterDriver () |
| | Destructor — frees the shadow buffer.
|
| |
| void | begin () override |
| | Zero the shadow buffer.
|
| |
| void | setNodeHardware (uint8_t r, uint8_t c, bool state) override |
| | Set or clear one bit in the shadow buffer.
|
| |
| void | commitPhysicalUpdates () override |
| | No-op for this virtual driver (no physical chain to clock).
|
| |
| uint8_t | byteAt (uint16_t idx) const |
| | Read one byte from the shadow buffer.
|
| |
| uint16_t | byteCount () const |
| | Return the number of bytes in the shadow buffer.
|
| |
| 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 shift-register driver — no hardware dependency.
Useful for verifying bit-packing logic without Arduino headers or SPI/GPIO hardware. The shadow buffer is directly readable via byteAt().
◆ MapFn
| typedef uint16_t(* ShiftRegisterDriver::MapFn) (uint8_t r, uint8_t c) |
Function pointer type: (row, col) → output bit index.
◆ ShiftRegisterDriver()
| ShiftRegisterDriver::ShiftRegisterDriver |
( |
uint16_t |
nOut, |
|
|
MapFn |
map |
|
) |
| |
Construct with an output count and a node-to-bit-index mapper.
- Parameters
-
| [in] | nOut | Total number of shift-register output bits. |
| [in] | map | Mapper; must return indices in [0, nOut). |
◆ ~ShiftRegisterDriver()
| ShiftRegisterDriver::~ShiftRegisterDriver |
( |
| ) |
|
Destructor — frees the shadow buffer.
◆ begin()
| void ShiftRegisterDriver::begin |
( |
| ) |
|
|
overridevirtual |
◆ byteAt()
| uint8_t ShiftRegisterDriver::byteAt |
( |
uint16_t |
idx | ) |
const |
Read one byte from the shadow buffer.
- Parameters
-
| [in] | idx | Byte index in [0, byteCount). |
- Returns
- Shadow byte value, or
0 if idx is out of range.
◆ byteCount()
| uint16_t ShiftRegisterDriver::byteCount |
( |
| ) |
const |
|
inline |
Return the number of bytes in the shadow buffer.
- Returns
ceil(nOut / 8).
◆ commitPhysicalUpdates()
| void ShiftRegisterDriver::commitPhysicalUpdates |
( |
| ) |
|
|
overridevirtual |
No-op for this virtual driver (no physical chain to clock).
Reimplemented from XPointDriver.
◆ setNodeHardware()
| void ShiftRegisterDriver::setNodeHardware |
( |
uint8_t |
r, |
|
|
uint8_t |
c, |
|
|
bool |
state |
|
) |
| |
|
overridevirtual |
Set or clear one bit in the shadow buffer.
- Parameters
-
| [in] | r | Row index. |
| [in] | c | Column index. |
| [in] | state | true = set bit, false = clear bit. |
Implements XPointDriver.
The documentation for this class was generated from the following files: