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/XPointDriver.h"
#include <stdint.h>
#include <string.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 variant of XPoint with embedded state arrays. 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

Flat array layout (all indices zero-based):

Array Size Meaning
_state rows × cols Connection flag per node
_ilock rows × rows Symmetric row-pair interlock flags
_excl cols Exclusive-input column flags

Construction options:

Constructor Heap use Typical target
Heap constructor Yes Desktop / large MCU
Buffer constructor No Caller manages static arrays
XPointStatic<R,C> No AVR global / BSS

RAM cost per instance:

  • Object overhead: ~71 B on AVR (8-bit, 2-byte ptrs), ~152 B on 64-bit.
  • State buffers: rows*cols + rows² + cols bytes.

Latching relay pulse table:

  • MAX_PULSES = 8 simultaneous in-flight coil pulses.
  • Operations beyond this limit silently drop the pulse event.
  • Do not issue more than 8 connect/disconnect calls before calling update().
  • 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.

Passed to the XPoint / XPointStatic constructor to select coil behavior.

Enumerator
RE_NON_LATCHING 

energize to connect; de-energize to disconnect.

RE_LATCHING_DUAL_COIL 

SET coil to connect; RESET coil to disconnect.