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

Utility for mapping matrix nodes to 74HC595 shift-register output bits. More...

#include <stdint.h>

Go to the source code of this file.

Namespaces

namespace  HC595Helper
 Utilities for 74HC595 daisy-chain index computation.
 

Functions

uint16_t HC595Helper::rowMajorIndex (uint8_t row, uint8_t col, uint8_t cols)
 Compute the row-major bit index for node (row, col).
 

Detailed Description

Utility for mapping matrix nodes to 74HC595 shift-register output bits.

Because the driver MapFn signature is a plain function pointer (no closure), column count must be captured as a compile-time constant in the mapper:

static const uint8_t COLS = 4;
static uint16_t myMapper(uint8_t r, uint8_t c) {
return HC595Helper::rowMajorIndex(r, c, COLS);
}
uint16_t rowMajorIndex(uint8_t row, uint8_t col, uint8_t cols)
Compute the row-major bit index for node (row, col).
Definition HC595Helper.h:42