|
XPoint 0.1.0
Hardware-agnostic crosspoint matrix routing library
|
Zero-heap variant of XPoint with embedded state arrays. More...
#include <XPoint.h>
Public Member Functions | |
| XPointStatic (RelayType type=RE_NON_LATCHING, uint16_t pdur=0) | |
Public Member Functions inherited from XPoint | |
| XPoint (uint8_t rows, uint8_t cols, RelayType type=RE_NON_LATCHING, uint16_t pdur=0) | |
| Heap-allocating constructor. | |
| XPoint (uint8_t rows, uint8_t cols, bool *state, bool *ilock, bool *excl, RelayType type=RE_NON_LATCHING, uint16_t pdur=0) | |
| Zero-heap buffer constructor. | |
| ~XPoint () | |
| Destructor. Frees heap buffers only when constructed with the heap constructor. | |
| XPoint (const XPoint &)=delete | |
| XPoint & | operator= (const XPoint &)=delete |
| void | setDriver (XPointDriver *drv) |
| Attach a driver backend. | |
| void | begin () |
Initialize hardware by calling drv->begin(). | |
| bool | connect (uint8_t row, uint8_t col) |
Connect row row to column col. | |
| bool | disconnect (uint8_t row, uint8_t col) |
Disconnect row row from column col. | |
| bool | setLevel (uint8_t row, uint8_t col, uint16_t level) |
| analog-level connect / disconnect (PWM drivers). | |
| void | clearAll () |
| Disconnect all connected nodes and zero the state table. | |
| void | lockRows (uint8_t rowA, uint8_t rowB) |
| Prevent rowA and rowB from connecting to the same column simultaneously. | |
| void | exclusiveInput (uint8_t col) |
Mark column col as exclusive: at most one row may connect at a time. | |
| void | update () |
| Expire latching-relay coil pulses and call releaseNode() as needed. | |
Zero-heap variant of XPoint with embedded state arrays.
All three state arrays are embedded directly inside the object so no heap allocation ever occurs. Declare as a global or static local on AVR to keep everything in BSS / data segment.
| ROWS | Number of matrix rows (compile-time constant). |
| COLS | Number of matrix columns (compile-time constant). |
|
inline |
| [in] | type | Relay operating mode (default RE_NON_LATCHING). |
| [in] | pdur | Coil pulse duration in ms (default 0). |