XPoint 0.1.0
Hardware-agnostic crosspoint matrix routing library
Loading...
Searching...
No Matches
XPointStatic< ROWS, COLS > Class Template Reference

Zero-heap variant of XPoint with embedded state arrays. More...

#include <XPoint.h>

Inheritance diagram for XPointStatic< ROWS, COLS >:
XPoint

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
 
XPointoperator= (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.
 

Detailed Description

template<uint8_t ROWS, uint8_t COLS>
class XPointStatic< ROWS, COLS >

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.

matrix.setDriver(&myDriver);
matrix.begin();
@ RE_NON_LATCHING
energize to connect; de-energize to disconnect.
Definition XPoint.h:57
Zero-heap variant of XPoint with embedded state arrays.
Definition XPoint.h:256
Template Parameters
ROWSNumber of matrix rows (compile-time constant).
COLSNumber of matrix columns (compile-time constant).

Constructor & Destructor Documentation

◆ XPointStatic()

template<uint8_t ROWS, uint8_t COLS>
XPointStatic< ROWS, COLS >::XPointStatic ( RelayType  type = RE_NON_LATCHING,
uint16_t  pdur = 0 
)
inline
Parameters
[in]typeRelay operating mode (default RE_NON_LATCHING).
[in]pdurCoil pulse duration in ms (default 0).

The documentation for this class was generated from the following file: