This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
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 <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 17 of file MAX7219_Base.hpp.

Constructor & Destructor Documentation

◆ MAX7219_Base()

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 25 of file MAX7219_Base.hpp.

Member Function Documentation

◆ init()

void MAX7219_Base::init ( )
inline

Initialize the Arduino pins, SPI, and the MAX7219.

Definition at line 36 of file MAX7219_Base.hpp.

◆ clear()

void MAX7219_Base::clear ( )
inline

Turn off all LEDs.

Definition at line 51 of file MAX7219_Base.hpp.

◆ send()

void MAX7219_Base::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 64 of file MAX7219_Base.hpp.

◆ sendRaw()

void MAX7219_Base::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 76 of file MAX7219_Base.hpp.

◆ setIntensity()

void MAX7219_Base::setIntensity ( uint8_t  intensity)
inline

Set the intensity of the LEDs.

Parameters
intensityThe intensity [0, 15].

Definition at line 91 of file MAX7219_Base.hpp.

Member Data Documentation

◆ DECODEMODE

constexpr uint8_t MAX7219_Base::DECODEMODE = 9
staticconstexpr

Definition at line 27 of file MAX7219_Base.hpp.

◆ INTENSITY

constexpr uint8_t MAX7219_Base::INTENSITY = 10
staticconstexpr

Definition at line 28 of file MAX7219_Base.hpp.

◆ SCANLIMIT

constexpr uint8_t MAX7219_Base::SCANLIMIT = 11
staticconstexpr

Definition at line 29 of file MAX7219_Base.hpp.

◆ SHUTDOWN

constexpr uint8_t MAX7219_Base::SHUTDOWN = 12
staticconstexpr

Definition at line 30 of file MAX7219_Base.hpp.

◆ DISPLAYTEST

constexpr uint8_t MAX7219_Base::DISPLAYTEST = 15
staticconstexpr

Definition at line 31 of file MAX7219_Base.hpp.

◆ loadPin

pin_t MAX7219_Base::loadPin
private

Definition at line 96 of file MAX7219_Base.hpp.

◆ settings

SPISettings MAX7219_Base::settings = {SPI_MAX_SPEED, MSBFIRST, SPI_MODE0}
private

Definition at line 97 of file MAX7219_Base.hpp.


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