RSeries astromech firmware
LedControlMAX7221< numDevices > Class Template Reference

#include <core/LedControlMAX7221.h>

Detailed Description

template<byte numDevices>
class LedControlMAX7221< numDevices >

LED MAX7221 device chain.

Encapsulates an MAX7221 device chain of "numDevices" on "dataPin", "clkPin", and "csPin"

Inherits LedControl.

Public Member Functions

 LedControlMAX7221 (byte dataPin, byte clkPin, byte csPin)
 Constructor. More...
 
virtual byte addDevice (byte count=1) override
 Add device to chain and return index. More...
 
virtual int getDeviceCount () override
 
virtual bool isPowered (byte device) override
 
virtual void setPower (byte device, bool onState, byte count=1) override
 Enable/disable power Params : device The address of the display to control status If true the device goes into power-down mode. More...
 
virtual void setScanLimit (byte device, byte limit, byte count=1) override
 Set the number of digits (or rows) to be displayed. More...
 
virtual void setIntensity (byte device, byte intensity, byte count=1) override
 Set the brightness of the display. More...
 
virtual void clearDisplay (byte device, byte count=1) override
 Switch all Leds on the display off. More...
 
virtual void setLed (byte device, int row, int column, boolean state) override
 Set the status of a single Led. More...
 
virtual void setRow (byte device, int row, byte value) override
 Set all 8 Led's in a row to a new state Params: device address of the display row row which is to be set (0..7) value each bit set to 1 will light up the corresponding Led. More...
 
virtual void setRowNoCache (byte device, int row, byte value) override
 Set all 8 Led's in a row to a new state (no cache) Params: device address of the display row row which is to be set (0..7) value each bit set to 1 will light up the corresponding Led. More...
 
virtual void setColumn (byte device, int column, byte value) override
 Set all 8 Led's in a column to a new state Params: device address of the display column column which is to be set (0..7) value each bit set to 1 will light up the corresponding Led. More...
 
virtual byte getRow (byte device, byte row) override
 

Constructor & Destructor Documentation

◆ LedControlMAX7221()

template<byte numDevices>
LedControlMAX7221< numDevices >::LedControlMAX7221 ( byte  dataPin,
byte  clkPin,
byte  csPin 
)
inline

Constructor.

Member Function Documentation

◆ addDevice()

template<byte numDevices>
virtual byte LedControlMAX7221< numDevices >::addDevice ( byte  count = 1)
inlineoverridevirtual

Add device to chain and return index.

You must ensure that enough devices were reserved for it to function.

◆ clearDisplay()

template<byte numDevices>
virtual void LedControlMAX7221< numDevices >::clearDisplay ( byte  device,
byte  count = 1 
)
inlineoverridevirtual

Switch all Leds on the display off.

Params: device address of the display to control

◆ getDeviceCount()

template<byte numDevices>
virtual int LedControlMAX7221< numDevices >::getDeviceCount ( )
inlineoverridevirtual
Returns
the number of devices in this chain

◆ getRow()

template<byte numDevices>
virtual byte LedControlMAX7221< numDevices >::getRow ( byte  device,
byte  row 
)
inlineoverridevirtual
Returns
the specified row of the specified device

◆ isPowered()

template<byte numDevices>
virtual bool LedControlMAX7221< numDevices >::isPowered ( byte  device)
inlineoverridevirtual
Returns
true if the specified device is powered

◆ setColumn()

template<byte numDevices>
virtual void LedControlMAX7221< numDevices >::setColumn ( byte  device,
int  column,
byte  value 
)
inlineoverridevirtual

Set all 8 Led's in a column to a new state Params: device address of the display column column which is to be set (0..7) value each bit set to 1 will light up the corresponding Led.

◆ setIntensity()

template<byte numDevices>
virtual void LedControlMAX7221< numDevices >::setIntensity ( byte  device,
byte  intensity,
byte  count = 1 
)
inlineoverridevirtual

Set the brightness of the display.

Params: device the address of the display to control intensity the brightness of the display. (0..15)

◆ setLed()

template<byte numDevices>
virtual void LedControlMAX7221< numDevices >::setLed ( byte  device,
int  row,
int  column,
boolean  state 
)
inlineoverridevirtual

Set the status of a single Led.

Params : device address of the display row the row of the Led (0..7) col the column of the Led (0..7) state If true the led is switched on, if false it is switched off

◆ setPower()

template<byte numDevices>
virtual void LedControlMAX7221< numDevices >::setPower ( byte  device,
bool  onState,
byte  count = 1 
)
inlineoverridevirtual

Enable/disable power Params : device The address of the display to control status If true the device goes into power-down mode.

Set to false for normal operation.

◆ setRow()

template<byte numDevices>
virtual void LedControlMAX7221< numDevices >::setRow ( byte  device,
int  row,
byte  value 
)
inlineoverridevirtual

Set all 8 Led's in a row to a new state Params: device address of the display row row which is to be set (0..7) value each bit set to 1 will light up the corresponding Led.

◆ setRowNoCache()

template<byte numDevices>
virtual void LedControlMAX7221< numDevices >::setRowNoCache ( byte  device,
int  row,
byte  value 
)
inlineoverridevirtual

Set all 8 Led's in a row to a new state (no cache) Params: device address of the display row row which is to be set (0..7) value each bit set to 1 will light up the corresponding Led.

◆ setScanLimit()

template<byte numDevices>
virtual void LedControlMAX7221< numDevices >::setScanLimit ( byte  device,
byte  limit,
byte  count = 1 
)
inlineoverridevirtual

Set the number of digits (or rows) to be displayed.

See datasheet for sideeffects of the scanlimit on the brightness of the display. Params : device address of the display to control limit number of digits to be displayed (1..8)


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