XPoint 0.1.0
Hardware-agnostic crosspoint matrix routing library
Loading...
Searching...
No Matches
HC595Helper.h
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-only
2// Copyright (c) 2026 Douglas Quigg (dstroy0) <dquigg123@gmail.com>
3// https://github.com/dstroy0/XPoint
4
20#ifndef HC595_HELPER_H
21#define HC595_HELPER_H
22
23#include <stdint.h>
24
28namespace HC595Helper
29{
30
42inline uint16_t rowMajorIndex(uint8_t row, uint8_t col, uint8_t cols)
43{
44 return (uint16_t)(row * cols + col);
45}
46
47} // namespace HC595Helper
48
49#endif // HC595_HELPER_H
Utilities for 74HC595 daisy-chain index computation.
Definition HC595Helper.h:29
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