Arduino Filters master
Filter library for Arduino
SPIShiftRegisterOut.hpp
Go to the documentation of this file.
1/* ✔ */
2
3#pragma once
4
6AH_DIAGNOSTIC_WERROR() // Enable errors on warnings
7
8#include "ShiftRegisterOutBase.hpp"
9
11#include <AH/Arduino-Wrapper.h> // MSBFIRST, SS
12#include <SPI.h>
14
16
30template <uint16_t N, class SPIDriver = decltype(SPI) &>
32 public:
59 SPIShiftRegisterOut(SPIDriver spi, pin_t latchPin = SS,
60 BitOrder_t bitOrder = MSBFIRST);
61
67 void begin() override;
68
72 void updateBufferedOutputs() override;
73
74 private:
75 SPIDriver spi;
76
77 public:
78 SPISettings settings{SPI_MAX_SPEED, this->bitOrder, SPI_MODE0};
79};
80
82
84
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:87
#define AH_DIAGNOSTIC_EXTERNAL_HEADER()
Definition: Warnings.hpp:37
#define AH_DIAGNOSTIC_POP()
Definition: Warnings.hpp:36
#define AH_DIAGNOSTIC_WERROR()
Definition: Warnings.hpp:35
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.