A class for LED outputs using the MAX7219 LED display driver. More...
#include <MAX7219.hpp>
Public Member Functions | |
MAX7219 (pin_t loadPin) | |
Create a MAX7219 ExtendedIOElement. More... | |
void | begin () override |
Initialize. More... | |
void | pinMode (pin_t pin, uint8_t mode) override __attribute__((deprecated)) |
The pinMode function is not implemented because the mode is OUTPUT by definition. More... | |
void | digitalWrite (pin_t pin, uint8_t val) override |
Set the state of a given output pin. More... | |
int | digitalRead (pin_t pin) override |
Get the current state of a given output. More... | |
analog_t | analogRead (pin_t pin) override __attribute__((deprecated)) |
The analogRead function is deprecated because a MAX7219 is always digital. More... | |
void | analogWrite (pin_t pin, analog_t val) override __attribute__((deprecated)) |
The analogWrite function is deprecated because a MAX7219 is always digital. More... | |
void | update () override |
Write the buffer to the display. More... | |
void | init () |
Initialize the Arduino pins, SPI, and the MAX7219. More... | |
void | clear () |
Turn off all LEDs. More... | |
void | send (uint8_t digit, uint8_t value) |
Send the value to the given digit. More... | |
void | sendRaw (uint8_t opcode, uint8_t value) |
Send a raw opcode and value to the MAX7219. More... | |
void | setIntensity (uint8_t intensity) |
Set the intensity of the LEDs. More... | |
Array< pin_t, N > | pins () const |
Get an array containing all pins of the element. More... | |
pin_t | pin (pin_t pin) const |
Get the extended IO pin number of a given physical pin of this extended IO element. More... | |
pin_t | operator[] (pin_t pin) const |
Get the extended IO pin number of a given physical pin of this extended IO element. More... | |
pin_t | getLength () const |
Get the number of pins this IO element has. More... | |
pin_t | getEnd () const |
Get the largest global extended IO pin number that belongs to this extended IO element. More... | |
pin_t | getStart () const |
Get the smallest global extended IO pin number that belongs to this extended IO element. More... | |
Static Public Member Functions | |
static constexpr uint16_t | length () |
static void | beginAll () |
Initialize all extended IO elements. More... | |
static DoublyLinkedList< ExtendedIOElement > & | getAll () |
Get the list of all Extended IO elements. More... | |
Static Public Attributes | |
static constexpr uint8_t | DECODEMODE = 9 |
static constexpr uint8_t | INTENSITY = 10 |
static constexpr uint8_t | SCANLIMIT = 11 |
static constexpr uint8_t | SHUTDOWN = 12 |
static constexpr uint8_t | DISPLAYTEST = 15 |
Protected Attributes | |
ExtendedIOElement * | next |
ExtendedIOElement * | previous |
Private Attributes | |
BitArray< 8 *8 > | buffer |
pin_t | loadPin |
SPISettings | settings = {SPI_MAX_SPEED, MSBFIRST, SPI_MODE0} |
const pin_t | start |
const pin_t | end |
Static Private Attributes | |
static pin_t | offset = NUM_DIGITAL_PINS + NUM_ANALOG_INPUTS |
static DoublyLinkedList< ExtendedIOElement > | elements |
A class for LED outputs using the MAX7219 LED display driver.
The SPI interface is used.
Definition at line 21 of file MAX7219.hpp.
|
inline |
Create a MAX7219 ExtendedIOElement.
loadPin | The pin connected to the load pin (C̄S̄) of the MAX7219. |
Definition at line 29 of file MAX7219.hpp.
|
inlineoverridevirtual |
Initialize.
Implements AH::ExtendedIOElement.
Definition at line 33 of file MAX7219.hpp.
|
inlineoverridevirtual |
The pinMode function is not implemented because the mode is OUTPUT
by definition.
Implements AH::ExtendedIOElement.
Definition at line 39 of file MAX7219.hpp.
|
inlineoverridevirtual |
Set the state of a given output pin.
pin | The output pin to set. |
val | The value to set the output to. (Either HIGH (1) or LOW (0)) |
Implements AH::ExtendedIOElement.
Definition at line 53 of file MAX7219.hpp.
|
inlineoverridevirtual |
Get the current state of a given output.
pin | The output to read the state from. |
0 | The state of the output is LOW . |
1 | The state of the output is HIGH . |
Implements AH::ExtendedIOElement.
Definition at line 68 of file MAX7219.hpp.
The analogRead function is deprecated because a MAX7219 is always digital.
pin | The output to read the state from. |
0 | The state of the output is LOW . |
1023 | The state of the output is HIGH . |
Implements AH::ExtendedIOElement.
Definition at line 80 of file MAX7219.hpp.
The analogWrite function is deprecated because a MAX7219 is always digital.
pin | The output to set. |
val | The value to set the output to. A value greater or equal to 0x80 will set the output to a HIGH state, a value less than 0x80 will set the output to a LOW state. |
Implements AH::ExtendedIOElement.
Definition at line 97 of file MAX7219.hpp.
|
inlineoverridevirtual |
Write the buffer to the display.
Implements AH::ExtendedIOElement.
Definition at line 107 of file MAX7219.hpp.
|
inlineinherited |
Initialize the Arduino pins, SPI, and the MAX7219.
update
. Definition at line 43 of file MAX7219_Base.hpp.
|
inlineinherited |
Turn off all LEDs.
Definition at line 58 of file MAX7219_Base.hpp.
|
inlineinherited |
Send the value to the given digit.
digit | The digit or row to set [0, 7]. |
value | The value to set the row to. |
Definition at line 71 of file MAX7219_Base.hpp.
|
inlineinherited |
Send a raw opcode and value to the MAX7219.
opcode | The opcode to send. |
value | The value to send. |
Definition at line 83 of file MAX7219_Base.hpp.
|
inlineinherited |
Set the intensity of the LEDs.
intensity | The intensity [0, 15]. |
Definition at line 98 of file MAX7219_Base.hpp.
|
inlineinherited |
Get an array containing all pins of the element.
Definition at line 27 of file StaticSizeExtendedIOElement.hpp.
|
inlinestaticconstexprinherited |
Definition at line 31 of file StaticSizeExtendedIOElement.hpp.
|
staticinherited |
Initialize all extended IO elements.
Definition at line 23 of file ExtendedIOElement.cpp.
Get the extended IO pin number of a given physical pin of this extended IO element.
pin | The zero-based physical pin number of this IO element. |
Definition at line 28 of file ExtendedIOElement.cpp.
Get the extended IO pin number of a given physical pin of this extended IO element.
It is alias for ExtendedIOElement::pin
.
pin | The zero-based physical pin number of this IO element. |
Definition at line 43 of file ExtendedIOElement.cpp.
|
inherited |
Get the number of pins this IO element has.
Definition at line 45 of file ExtendedIOElement.cpp.
|
inherited |
Get the largest global extended IO pin number that belongs to this extended IO element.
Definition at line 47 of file ExtendedIOElement.cpp.
|
inherited |
Get the smallest global extended IO pin number that belongs to this extended IO element.
Definition at line 49 of file ExtendedIOElement.cpp.
|
staticinherited |
Get the list of all Extended IO elements.
Definition at line 51 of file ExtendedIOElement.cpp.
|
private |
Definition at line 113 of file MAX7219.hpp.
|
staticconstexprinherited |
Definition at line 33 of file MAX7219_Base.hpp.
|
staticconstexprinherited |
Definition at line 34 of file MAX7219_Base.hpp.
|
staticconstexprinherited |
Definition at line 35 of file MAX7219_Base.hpp.
|
staticconstexprinherited |
Definition at line 36 of file MAX7219_Base.hpp.
|
staticconstexprinherited |
Definition at line 37 of file MAX7219_Base.hpp.
|
privateinherited |
Definition at line 103 of file MAX7219_Base.hpp.
|
privateinherited |
Definition at line 104 of file MAX7219_Base.hpp.
|
privateinherited |
Definition at line 193 of file ExtendedIOElement.hpp.
|
privateinherited |
Definition at line 194 of file ExtendedIOElement.hpp.
|
staticprivateinherited |
Definition at line 195 of file ExtendedIOElement.hpp.
|
staticprivateinherited |
Definition at line 197 of file ExtendedIOElement.hpp.
|
protectedinherited |
Definition at line 305 of file LinkedList.hpp.
|
protectedinherited |
Definition at line 306 of file LinkedList.hpp.