File ShiftBus.h
FileList > Firmware > Libraries > PanelGroup > Helpers > ShiftBus > ShiftBus.h
Go to the source code of this file
Shared SPI shift-register bus — 74HC165 input chain + 74HC595 output chain. More...
#include <Arduino.h>#include <SPI.h>
Namespaces
| Type | Name |
|---|---|
| namespace | OpenSkyhawk Thin wrapper over Adafruit_ADS1115; see ADS1115.h . |
Classes
| Type | Name |
|---|---|
| class | ShiftBus One shared SPI shift-register bus ('165 inputs + '595 outputs). |
Public Attributes
| Type | Name |
|---|---|
| OpenSkyhawk::ShiftBus | ShiftBus1 Pre-defined bus on the standard pins — SPI1-remap SCK=PB3 / MISO=PB4 / MOSI=PB5, LOAD=PB8, LATCH=PB9 (one contiguous header run with I2C1: PB9..PB3). |
Detailed Description
One ShiftBus instance owns one SPI bus carrying both chains: '165 (parallel-in/serial-out) on MISO and '595 (serial-in/parallel-out) on MOSI, sharing SCK. A '165 read clocks the shared SCK and scrambles the '595 shift stage (latched outputs are unaffected), so every transaction is one full-duplex transfer(): pulse LOAD to capture the '165 inputs, shift the complete output frame while receiving the complete input frame, pulse LATCH to publish the '595 outputs. There is no partial read and no partial write.
Sketches normally use the pre-defined global instance ShiftBus1 (the TwoWire/Wire pattern) and perform no setup at all — declaring an SR-backed PinRef is the only opt-in. PinRef::configureAsInput()/configureAsOutput() notify the bus (direction, chain length); PanelGroup::setup() then begin()s every active bus. A bus with no SR pins stays dormant: SPI.begin() is never called.
TechSpec: Firmware/ScratchPad/TechSpec/PanelGroup/Helpers/ShiftBus.md (issues #197 / #133).
Version:
0.1.0
Copyright:
GPL-2.0-only — see Firmware/LICENSE
Public Attributes Documentation
variable ShiftBus1
Pre-defined bus on the standard pins — SPI1-remap SCK=PB3 / MISO=PB4 / MOSI=PB5, LOAD=PB8, LATCH=PB9 (one contiguous header run with I2C1: PB9..PB3).
OpenSkyhawk::ShiftBus ShiftBus1;
Override per board with -DSHIFTBUS_SCK=... / _MISO / _MOSI / _LOAD / _LATCH. Dormant (zero cost) unless a sketch declares a PinRef on it.
The documentation for this class was generated from the following file Firmware/Libraries/PanelGroup/Helpers/ShiftBus/ShiftBus.h