XPoint 0.1.0
Hardware-agnostic crosspoint matrix routing library
Loading...
Searching...
No Matches
XPoint.h File Reference

XPoint crosspoint matrix connection manager. More...

#include "drivers/BitPool.h"
#include "drivers/XPointDriver.h"
#include <stdint.h>

Go to the source code of this file.

Classes

struct  PulseEvent
 Internal pulse-event slot for non-blocking latching-relay coil timing. More...
 
class  XPoint
 Hardware-agnostic crosspoint matrix connection manager. More...
 
class  XPointStatic< ROWS, COLS >
 Zero-heap XPoint with a compile-time-sized embedded bit pool. More...
 

Enumerations

enum  RelayType {
  RE_NON_LATCHING = 0 ,
  RE_LATCHING_DUAL_COIL
}
 Relay operating mode. More...
 

Detailed Description

XPoint crosspoint matrix connection manager.

Maintains a logical R×C connection state table and forwards every change to an XPointDriver backend. Supports:

  • Non-latching relays: energize to connect, de-energize to disconnect
  • Dual-coil latching relays: non-blocking SET/RESET coil pulse management
  • Row interlock: prevent two rows from connecting to the same column
  • Exclusive-input columns: only one row permitted at a time
  • Analog level control via setLevel() for PWM-capable drivers

Bit-pool layout — three sections packed into one flat uint32_t array managed by a BitPool instance:

Section Bit offset Bit count
state 0 rows × cols
ilock rows × cols rows × rows
excl rows × cols + rows² cols

Total words = ceil((rows×cols + rows² + cols) / 32). For an 8×8 matrix: 64 + 64 + 8 = 136 bits → 5 uint32_t (vs 136 bool bytes).

Construction options:

Constructor Heap use Typical target
Heap constructor Yes Desktop / large MCU
Pool constructor No Caller manages pool buffer
XPointStatic<R,C> No AVR global / BSS

Latching relay pulse table:

  • MAX_PULSES = 8 simultaneous in-flight coil pulses.
  • connect() / disconnect() return false while a pulse is in-flight for the target node; call update() in each loop() iteration to clear slots.

Enumeration Type Documentation

◆ RelayType

enum RelayType

Relay operating mode.

Enumerator
RE_NON_LATCHING 

Energize to connect; de-energize to disconnect.

RE_LATCHING_DUAL_COIL 

SET coil to connect; RESET coil to disconnect.