12#ifndef MAXMATRIX_SRC_MAX7219_CHAIN_H_
13#define MAXMATRIX_SRC_MAX7219_CHAIN_H_
117 uint8_t data_in_pin_;
118 uint8_t chip_select_pin_;
128 uint8_t chip_select_port_{0};
129 uint8_t chip_select_mask_{0};
130#if (MAXMATRIX_USE_SPI == STD_OFF)
131 uint8_t data_in_port_{0};
132 uint8_t data_in_mask_{0};
133 uint8_t clock_port_{0};
134 uint8_t clock_mask_{0};
144 void StartTransmission();
145 void StopTransmission();
146 void Transfer(uint8_t register_address, uint8_t register_value);
147#if (MAXMATRIX_USE_SPI == STD_OFF)
148 void ShiftOut(uint8_t value);
150 static void WritePin(uint8_t port, uint8_t mask,
bool high);
160 Chain(uint8_t data_in_pin, uint8_t chip_select_pin, uint8_t clock_pin);
167 return chip_select_pin_;
188 chip_select_pin_ = chip_select_pin;
206 void Init(uint8_t number_of_modules);
219 uint8_t number_of_modules);
A byte of raw data, as a column of dots, which is no number.
The attributes of a later standard, as macros, where the compiler has them.
#define MAXMATRIX_NODISCARD
Marks a function whose result must not be dropped: the compiler warns where it is.
Definition MaxMatrixAttributes.h:37
Configuration of the MaxMatrix library.
MAXMATRIX_NODISCARD uint8_t GetDataInPin() const
Returns the pin DIN of the chain is connected to.
Definition Chain.h:163
MAXMATRIX_NODISCARD uint8_t GetClockPin() const
Returns the pin CLK of the chain is connected to.
Definition Chain.h:171
void SetChipSelectPin(uint8_t chip_select_pin)
Sets the pin CS of the chain is connected to.
Definition Chain.h:187
void WriteRegisterEach(uint8_t register_address, span< Byte const > buffer, uint8_t column)
Writes the same register of every MAX7219, each with its own value: one column of every module,...
MAXMATRIX_NODISCARD uint8_t GetChipSelectPin() const
Returns the pin CS of the chain is connected to.
Definition Chain.h:166
Chain(uint8_t data_in_pin, uint8_t chip_select_pin, uint8_t clock_pin)
Makes the chain at these pins; nothing is sent until Init().
void Init(uint8_t number_of_modules)
Sets the pins up, and every MAX7219 to drive an 8x8 matrix.
void SetDataInPin(uint8_t data_in_pin)
Sets the pin DIN of the chain is connected to.
Definition Chain.h:179
void SetClockPin(uint8_t clock_pin)
Sets the pin CLK of the chain is connected to.
Definition Chain.h:197
void WriteRegisterAll(uint8_t register_address, uint8_t register_value, uint8_t number_of_modules)
Writes the same register of every MAX7219, with the same value.
A view of size() elements that another owns: a font, a bitmap, a text or a buffer.
Definition span.h:64
The registers of the MAX7219 and their values, as Matrix::RegisterWrite() takes them.
Definition Chain.h:27
constexpr uint8_t kDecodeModeCodeBDecodeDigit7To0
Definition Chain.h:67
constexpr uint8_t kDigit5Address
Definition Chain.h:43
constexpr uint8_t kIntensityMinValue
Definition Chain.h:71
constexpr uint8_t kDisplayTestNormalOperation
Definition Chain.h:101
constexpr uint8_t kDigit3Address
Definition Chain.h:39
constexpr uint8_t kDecodeModeCodeBDecodeDigit0
Definition Chain.h:63
constexpr uint8_t kScanLimitAddress
Definition Chain.h:53
constexpr uint8_t kDisplayTestAddress
Definition Chain.h:57
constexpr uint8_t kDigit0Address
Definition Chain.h:33
constexpr uint8_t kScanLimitDisplayDigit0To5
Definition Chain.h:87
constexpr uint8_t kDecodeModeAddress
Definition Chain.h:49
constexpr uint8_t kShutdownModeNormalOperation
Definition Chain.h:97
constexpr uint8_t kDigit1Address
Definition Chain.h:35
constexpr uint8_t kScanLimitDisplayDigit0To6
Definition Chain.h:89
constexpr uint8_t kScanLimitDisplayDigit0
Definition Chain.h:77
constexpr uint8_t kDecodeModeCodeBDecodeDigit3To0
Definition Chain.h:65
constexpr uint8_t kIntensityAddress
Definition Chain.h:51
constexpr uint8_t kIntensityMaxValue
Definition Chain.h:73
constexpr uint8_t kShutdownModeShutdownMode
Definition Chain.h:95
constexpr uint8_t kDecodeModeNoDecode
Definition Chain.h:61
constexpr uint8_t kDisplayTestDisplayTestMode
Definition Chain.h:103
constexpr uint8_t kScanLimitDisplayDigit0To3
Definition Chain.h:83
constexpr uint8_t kDigit7Address
Definition Chain.h:47
constexpr uint8_t kScanLimitDisplayDigit0To4
Definition Chain.h:85
constexpr uint8_t kShutdownAddress
Definition Chain.h:55
constexpr uint8_t kDigit6Address
Definition Chain.h:45
constexpr uint8_t kScanLimitDisplayDigit0To2
Definition Chain.h:81
constexpr uint8_t kDigit4Address
Definition Chain.h:41
constexpr uint8_t kDigit2Address
Definition Chain.h:37
constexpr uint8_t kScanLimitDisplayDigit0To7
Definition Chain.h:91
constexpr uint8_t kNoOpAddress
Definition Chain.h:31
constexpr uint8_t kScanLimitDisplayDigit0To1
Definition Chain.h:79
Elements that lie elsewhere, reached by index within their size, as std::span.