Arduino Helpers master
Utility library for Arduino
SPIShiftRegisterOut.hpp
Go to the documentation of this file.
1/* ✔ */
2
3#pragma once
4
6
7#include <AH/Arduino-Wrapper.h> // MSBFIRST, SS
9#include <SPI.h>
11
13
27template <uint16_t N, class SPIDriver = decltype(SPI) &>
29 public:
56 SPIShiftRegisterOut(SPIDriver spi, pin_t latchPin = SS,
57 BitOrder_t bitOrder = MSBFIRST);
58
64 void begin() override;
65
69 void updateBufferedOutputs() override;
70
71 private:
72 SPIDriver spi;
73
74 public:
75 SPISettings settings{SPI_MAX_SPEED, this->bitOrder, SPI_MODE0};
76};
77
79
uint8_t BitOrder_t
uint16_t pin_t
The type for Arduino pins (and ExtendedIOElement pins).
#define END_AH_NAMESPACE
#define BEGIN_AH_NAMESPACE
static constexpr Frequency SPI_MAX_SPEED
Definition: Settings.hpp:92
#define AH_DIAGNOSTIC_EXTERNAL_HEADER()
Definition: Warnings.hpp:51
#define AH_DIAGNOSTIC_POP()
Definition: Warnings.hpp:50
A class for serial-in/parallel-out shift registers, like the 74HC595 that are connected to the SPI bu...
A class for serial-in/parallel-out shift registers, like the 74HC595.