Control Surface
1.0.0
MIDI Control Surface library for Arduino
|
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 (UNUSED_PARAM pin_t pin, UNUSED_PARAM 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... | |
virtual void | pinMode (pin_t pin, uint8_t mode)=0 |
Set the mode of a given pin. 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 18 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 26 of file MAX7219.hpp.
|
inlineoverridevirtual |
Initialize.
Implements ExtendedIOElement.
Definition at line 30 of file MAX7219.hpp.
|
inlineoverride |
The pinMode function is not implemented because the mode is OUTPUT
by definition.
Definition at line 36 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 ExtendedIOElement.
Definition at line 48 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 ExtendedIOElement.
Definition at line 63 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 ExtendedIOElement.
Definition at line 75 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 ExtendedIOElement.
Definition at line 92 of file MAX7219.hpp.
|
inlineoverridevirtual |
Write the buffer to the display.
Implements ExtendedIOElement.
Definition at line 102 of file MAX7219.hpp.
|
inlineinherited |
Initialize the Arduino pins, SPI, and the MAX7219.
Definition at line 36 of file MAX7219_Base.hpp.
|
inlineinherited |
Turn off all LEDs.
Definition at line 51 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 64 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 76 of file MAX7219_Base.hpp.
|
inlineinherited |
Set the intensity of the LEDs.
intensity | The intensity [0, 15]. |
Definition at line 91 of file MAX7219_Base.hpp.
|
inlineinherited |
Get an array containing all pins of the element.
Definition at line 24 of file StaticSizeExtendedIOElement.hpp.
|
inlinestaticconstexprinherited |
Definition at line 28 of file StaticSizeExtendedIOElement.hpp.
|
pure virtualinherited |
Set the mode of a given pin.
pin | The (zero-based) pin of this IO element. |
mode | The mode to set the pin to (e.g. INPUT , OUTPUT or INPUT_PULLUP ). |
|
staticinherited |
Initialize all extended IO elements.
Definition at line 21 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 26 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 41 of file ExtendedIOElement.cpp.
|
inherited |
Get the number of pins this IO element has.
Definition at line 43 of file ExtendedIOElement.cpp.
|
inherited |
Get the largest global extended IO pin number that belongs to this extended IO element.
Definition at line 45 of file ExtendedIOElement.cpp.
|
inherited |
Get the smallest global extended IO pin number that belongs to this extended IO element.
Definition at line 47 of file ExtendedIOElement.cpp.
|
staticinherited |
Get the list of all Extended IO elements.
Definition at line 49 of file ExtendedIOElement.cpp.
|
private |
Definition at line 108 of file MAX7219.hpp.
|
staticconstexprinherited |
Definition at line 27 of file MAX7219_Base.hpp.
|
staticconstexprinherited |
Definition at line 28 of file MAX7219_Base.hpp.
|
staticconstexprinherited |
Definition at line 29 of file MAX7219_Base.hpp.
|
staticconstexprinherited |
Definition at line 30 of file MAX7219_Base.hpp.
|
staticconstexprinherited |
Definition at line 31 of file MAX7219_Base.hpp.
|
privateinherited |
Definition at line 96 of file MAX7219_Base.hpp.
|
privateinherited |
Definition at line 97 of file MAX7219_Base.hpp.
|
privateinherited |
Definition at line 190 of file ExtendedIOElement.hpp.
|
privateinherited |
Definition at line 191 of file ExtendedIOElement.hpp.
|
staticprivateinherited |
Definition at line 192 of file ExtendedIOElement.hpp.
|
staticprivateinherited |
Definition at line 194 of file ExtendedIOElement.hpp.
|
protectedinherited |
Definition at line 301 of file LinkedList.hpp.
|
protectedinherited |
Definition at line 302 of file LinkedList.hpp.