Control Surface  1.1.1
MIDI Control Surface library for Arduino
Public Member Functions | Static Public Attributes | Private Attributes | List of all members
MAX7219_Base Class Reference

A base class for classes that control MAX7219 LED drivers. More...

#include <AH/Hardware/LEDs/MAX7219_Base.hpp>

Inheritance diagram for MAX7219_Base:
Collaboration diagram for MAX7219_Base:

Public Member Functions

 MAX7219_Base (pin_t loadPin)
 Create a MAX7219_Base object. 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...
 

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
 

Private Attributes

pin_t loadPin
 
SPISettings settings = {SPI_MAX_SPEED, MSBFIRST, SPI_MODE0}
 

Detailed Description

A base class for classes that control MAX7219 LED drivers.

The SPI interface is used.

Todo:
Wiring diagram for SPI connection.

Definition at line 23 of file MAX7219_Base.hpp.

Constructor & Destructor Documentation

◆ MAX7219_Base()

MAX7219_Base ( pin_t  loadPin)
inline

Create a MAX7219_Base object.

Parameters
loadPinThe pin connected to the load pin (C̄S̄) of the MAX7219.

Definition at line 31 of file MAX7219_Base.hpp.

Member Function Documentation

◆ init()

void init ( )
inline

Initialize the Arduino pins, SPI, and the MAX7219.

Todo:
Rename to begin.

Definition at line 43 of file MAX7219_Base.hpp.

◆ clear()

void clear ( )
inline

Turn off all LEDs.

Definition at line 58 of file MAX7219_Base.hpp.

◆ send()

void send ( uint8_t  digit,
uint8_t  value 
)
inline

Send the value to the given digit.

Parameters
digitThe digit or row to set [0, 7].
valueThe value to set the row to.

Definition at line 71 of file MAX7219_Base.hpp.

◆ sendRaw()

void sendRaw ( uint8_t  opcode,
uint8_t  value 
)
inline

Send a raw opcode and value to the MAX7219.

Parameters
opcodeThe opcode to send.
valueThe value to send.

Definition at line 83 of file MAX7219_Base.hpp.

◆ setIntensity()

void setIntensity ( uint8_t  intensity)
inline

Set the intensity of the LEDs.

Parameters
intensityThe intensity [0, 15].

Definition at line 98 of file MAX7219_Base.hpp.

Member Data Documentation

◆ DECODEMODE

constexpr uint8_t DECODEMODE = 9
staticconstexpr

Definition at line 33 of file MAX7219_Base.hpp.

◆ INTENSITY

constexpr uint8_t INTENSITY = 10
staticconstexpr

Definition at line 34 of file MAX7219_Base.hpp.

◆ SCANLIMIT

constexpr uint8_t SCANLIMIT = 11
staticconstexpr

Definition at line 35 of file MAX7219_Base.hpp.

◆ SHUTDOWN

constexpr uint8_t SHUTDOWN = 12
staticconstexpr

Definition at line 36 of file MAX7219_Base.hpp.

◆ DISPLAYTEST

constexpr uint8_t DISPLAYTEST = 15
staticconstexpr

Definition at line 37 of file MAX7219_Base.hpp.

◆ loadPin

pin_t loadPin
private

Definition at line 103 of file MAX7219_Base.hpp.

◆ settings

SPISettings settings = {SPI_MAX_SPEED, MSBFIRST, SPI_MODE0}
private

Definition at line 104 of file MAX7219_Base.hpp.


The documentation for this class was generated from the following file: