|
MaxMatrix
Drive chained 8x8 LED dot matrix modules with MAX7219.
|
The matrix as it is wired: the buffer of what the LEDs show, and what of it changed. More...
#include <Wired.h>
Public Member Functions | |
| Wired (uint8_t data_in_pin, uint8_t chip_select_pin, uint8_t clock_pin, span< Byte > buffer) | |
| Makes the matrix of the chain at these pins, and empties its buffer. | |
| Chain & | GetChain () |
| Returns the chain the matrix sends to. | |
| MAXMATRIX_NODISCARD Chain const & | GetChain () const |
| Returns the chain the matrix sends to. | |
| MAXMATRIX_NODISCARD uint8_t | GetNumberOfColumns () const |
| Returns the columns of the chain, eight per module. | |
| MAXMATRIX_NODISCARD uint8_t | GetNumberOfModules () const |
| Returns the modules in the chain, one per eight bytes of buffer. | |
| Byte | GetColumn (uint8_t column) |
| Returns a column of the buffer, unchecked. | |
| void | StoreBit (uint8_t column, uint8_t bit, bool value) |
| Sets one bit of the buffer. | |
| void | Clear () |
| Turns every LED off in the buffer, and marks every column as changed. | |
| void | Send () |
| Sends what has changed. | |
The matrix as it is wired: the buffer of what the LEDs show, and what of it changed.
The buffer mirrors the LEDs, one byte per column, columns of all modules in a row, module 0 first. Drawing only changes the buffer; Send() brings what changed to the chain.
| max_matrix::internal::Wired::Wired | ( | uint8_t | data_in_pin, |
| uint8_t | chip_select_pin, | ||
| uint8_t | clock_pin, | ||
| span< Byte > | buffer ) |
Makes the matrix of the chain at these pins, and empties its buffer.
| [in] | data_in_pin | The pin DIN of the chain is connected to. |
| [in] | chip_select_pin | The pin CS of the chain is connected to. |
| [in] | clock_pin | The pin CLK of the chain is connected to. |
| [out] | buffer | The buffer, BufferSize() of the modules in the chain, 1 to kMaxNumberOfModules; it has to live as long as the matrix. |
| void max_matrix::internal::Wired::Clear | ( | ) |
Turns every LED off in the buffer, and marks every column as changed.
Even a column that was empty already is marked: after power-up the registers of the MAX7219 hold anything, and Matrix::Init() clears them this way.
|
inline |
Returns the chain the matrix sends to.
|
inline |
Returns a column of the buffer, unchecked.
For Panel, whose coordinates are checked and mapped already.
| [in] | column | The column in the buffer. |
| void max_matrix::internal::Wired::Send | ( | ) |
Sends what has changed.
Every changed column of a module goes out in one frame for all modules; nothing goes out when nothing has changed.
| void max_matrix::internal::Wired::StoreBit | ( | uint8_t | column, |
| uint8_t | bit, | ||
| bool | value ) |
Sets one bit of the buffer.
Send() brings the change to the chain. The column is marked as changed only when its value changes, so that drawing what is shown already sends nothing.
| [in] | column | The column in the buffer. |
| [in] | bit | The bit in the column, the row as wired. |
| [in] | value | True for a lit LED. |