Lucky Resistors AS1130 Library
This is a library to access the functionality of the AS1130 chip.
Public Types | Public Member Functions | List of all members
lr::AS1130 Class Reference

A low-level AS1130 chip access class. More...

#include <LRAS1130.h>

Public Types

enum  ChipAddress : uint8_t {
  ChipBaseAddress = 0b0110000, ChipAddress0 = ChipBaseAddress+0x0, ChipAddress1 = ChipBaseAddress+0x1, ChipAddress2 = ChipBaseAddress+0x2,
  ChipAddress3 = ChipBaseAddress+0x3, ChipAddress4 = ChipBaseAddress+0x4, ChipAddress5 = ChipBaseAddress+0x5, ChipAddress6 = ChipBaseAddress+0x6,
  ChipAddress7 = ChipBaseAddress+0x7, ChipAddress8 = ChipBaseAddress+0x8, ChipAddress9 = ChipBaseAddress+0x9, ChipAddressA = ChipBaseAddress+0xa,
  ChipAddressB = ChipBaseAddress+0xb, ChipAddressC = ChipBaseAddress+0xc, ChipAddressD = ChipBaseAddress+0xd, ChipAddressE = ChipBaseAddress+0xe,
  ChipAddressF = ChipBaseAddress+0xf
}
 The chip address. More...
 
enum  RamConfiguration : uint8_t {
  RamConfiguration1 = 1, RamConfiguration2 = 2, RamConfiguration3 = 3, RamConfiguration4 = 4,
  RamConfiguration5 = 5, RamConfiguration6 = 6
}
 The RAM configuration. More...
 
enum  InterruptMaskFlag : uint8_t {
  IMF_MovieFinished = 0b00000001, IMF_ShortTestError = 0b00000010, IMF_OpenTestError = 0b00000100, IMF_LowVdd = 0b00001000,
  IMF_OverTemperature = 0b00010000, IMF_POR = 0b00100000, IMF_WatchDog = 0b01000000, IMF_SelectedPicture = 0b10000000
}
 The interrupt mask flags. More...
 
enum  Synchronization : uint8_t { SynchronizationOff = 0b00, SynchronizationIn = 0b01, SynchronizationOut = 0b10 }
 The synchronization mode. More...
 
enum  ClockFrequency : uint8_t { Clock1MHz = 0b0000, Clock500kHz = 0b0100, Clock125kHz = 0b1000, Clock32kHz = 0b1100 }
 The clock frequency. More...
 
enum  Current : uint8_t {
  Current0mA = 0x00, Current5mA = 0x2b, Current10mA = 0x55, Current15mA = 0x80,
  Current20mA = 0xaa, Current25mA = 0xd5, Current30mA = 0xff
}
 The current for the LEDs. More...
 
enum  ScanLimit : uint8_t {
  ScanLimit1 = 0x0, ScanLimit2 = 0x1, ScanLimit3 = 0x2, ScanLimit4 = 0x3,
  ScanLimit5 = 0x4, ScanLimit6 = 0x5, ScanLimit7 = 0x6, ScanLimit8 = 0x7,
  ScanLimit9 = 0x8, ScanLimit10 = 0x9, ScanLimit11 = 0xa, ScanLimit12 = 0xb,
  ScanLimitFull = ScanLimit12
}
 The scan limit. More...
 
enum  MovieEndFrame : uint8_t { MovieEndWithFirstFrame, MovieEndWithLastFrame }
 The movie end frame. More...
 
enum  ScrollingBlockSize : uint8_t { ScrollInFullMatrix, ScrollIn5LedBlocks }
 The scrolling block size. More...
 
enum  ScrollingDirection : uint8_t { ScrollingLeft, ScrollingRight }
 The scrolling direction. More...
 
enum  BlinkFrequency : uint8_t { BlinkFrequency1_5s, BlinkFrequency3s }
 The blink frequency. More...
 
enum  MovieLoopCount : uint8_t {
  MovieLoopInvalid = 0b00000000, MovieLoop1 = 0b00100000, MovieLoop2 = 0b01000000, MovieLoop3 = 0b01100000,
  MovieLoop4 = 0b10000000, MovieLoop5 = 0b10100000, MovieLoop6 = 0b11000000, MovieLoopEndless = 0b11100000
}
 The movie loop count. More...
 
enum  LedStatus : uint8_t { LedStatusOk, LedStatusOpen, LedStatusDisabled }
 The status of a LED. More...
 
Low-Level Definitions.

Definitions used for low-level operations.

enum  RegisterSelection : uint8_t {
  RS_NOP = 0x00, RS_OnOffFrame = 0x01, RS_BlinkAndPwmSet = 0x40, RS_DotCorrection = 0x80,
  RS_Control = 0xc0
}
 The register selection (base) value.
 
enum  ControlRegister : uint8_t {
  CR_Picture = 0x00, CR_Movie = 0x01, CR_MovieMode = 0x02, CR_FrameTimeScroll = 0x03,
  CR_DisplayOption = 0x04, CR_CurrentSource = 0x05, CR_Config = 0x06, CR_InterruptMask = 0x07,
  CR_InterruptFrameDefinition = 0x08, CR_ShutdownAndOpenShort = 0x09, CR_InterfaceMonitoring = 0x0a, CR_ClockSynchronization = 0x0b,
  CR_InterruptStatus = 0x0e, CR_Status = 0x0f, CR_OpenLedBase = 0x20
}
 The control register address.
 
enum  PictureFlag : uint8_t { PF_PictureAddressMask = 0b00111111, PF_DisplayPicture = 0b01000000, PF_BlinkPicture = 0b10000000 }
 The flags and masks for the picture register.
 
enum  MovieFlag : uint8_t { MF_MovieAddressMask = 0b00111111, MF_DisplayMovie = 0b01000000, MF_BlinkMovie = 0b10000000 }
 The flags and masks for the movie register.
 
enum  MovieModeFlag : uint8_t { MMF_MovieFramesMask = 0b00111111, MMF_EndLast = 0b01000000, MMF_BlinkEnabled = 0b10000000 }
 The flags and masks for the movie mode register.
 
enum  FrameTimeScrollFlag : uint8_t {
  FTSF_FrameDelay = 0b00001111, FTSF_EnableScrolling = 0b00010000, FTSF_BlockSize = 0b00100000, FTSF_ScrollDirection = 0b01000000,
  FTSF_FrameFade = 0b10000000
}
 The flags and masks for the frame time/scroll register.
 
enum  DisplayOptionFlag : uint8_t { DOF_ScanLimitMask = 0b00001111, DOF_BlinkFrequency = 0b00010000, DOF_LoopsMask = 0b11100000 }
 The flags and masks for the display option register.
 
enum  ConfigFlag : uint8_t {
  CF_MemoryConfigMask = 0b00000111, CF_CommonAddress = 0b00001000, CF_DotCorrection = 0b00010000, CF_LedErrorCorrection = 0b00100000,
  CF_LowVddStatus = 0b01000000, CF_LowVddReset = 0b10000000
}
 The flags and masks for the config register.
 
enum  ShutdownAndOpenShortFlag : uint8_t {
  SOSF_Shutdown = 0b00000001, SOSF_Initialize = 0b00000010, SOSF_ManualTest = 0b00000100, SOSF_AutoTest = 0b00001000,
  SOSF_TestAll = 0b00010000
}
 Flags/masks for the shutdown & open/short register.
 
enum  StatusFlag : uint8_t { SF_TestOn = 0b00000001, SF_MovieOn = 0b00000010, SF_FrameOnMask = 0b11111100 }
 Flags/masks for the status register.
 

Public Member Functions

 AS1130 (ChipAddress chipAddress=ChipAddress0)
 Create a new driver instance. More...
 
bool isChipConnected ()
 Check the chip communication. More...
 
void setRamConfiguration (RamConfiguration ramConfiguration)
 Set the RAM configuration. More...
 
void setOnOffFrame (uint8_t frameIndex, const AS1130Picture12x11 &picture, uint8_t pwmSetIndex=0)
 Set-up a on/off frame. More...
 
void setOnOffFrame (uint8_t frameIndex, const AS1130Picture24x5 &picture, uint8_t pwmSetIndex=0)
 Set-up a on/off frame. More...
 
void setOnOffFrame24x5 (uint8_t frameIndex, const uint8_t *data, uint8_t pwmSetIndex=0)
 Set-up a on/off frame with data. More...
 
void setOnOffFrame12x11 (uint8_t frameIndex, const uint8_t *data, uint8_t pwmSetIndex=0)
 Set-up a on/off frame with data. More...
 
void setOnOffFrameAllOff (uint8_t frameIndex, uint8_t pwmSetIndex=0)
 Set-up a on/off frame with all LEDs disabled. More...
 
void setOnOffFrameAllOn (uint8_t frameIndex, uint8_t pwmSetIndex=0)
 Set-up a on/off frame with all LEDs enabled. More...
 
void setBlinkAndPwmSetAll (uint8_t setIndex, bool doesBlink=false, uint8_t pwmValue=0xff)
 Set-up a blink&PWM set with values for all LEDs. More...
 
void setPwmValue (uint8_t setIndex, uint8_t ledIndex, uint8_t value)
 Set a PWM value in a given blink&PWM set. More...
 
uint8_t getLedIndex24x5 (uint8_t x, uint8_t y)
 Get the LED index for a coordinate in a 24x5 LED setup. More...
 
uint8_t getLedIndex12x11 (uint8_t x, uint8_t y)
 Get the LED index for a coordinate in a 12x11 LED setup. More...
 
void setDotCorrection (const uint8_t *data)
 Set the dot correction data. More...
 
void setInterruptMask (uint8_t mask)
 Set the interrupt mask. More...
 
void setInterruptFrame (uint8_t lastFrame)
 Set the interrupt frame. More...
 
void setInterfaceMonitoring (uint8_t timeout, bool enabled)
 Set the I2C monitoring. More...
 
void setClockSynchronization (Synchronization synchronization, ClockFrequency clockFrequency)
 Set the clock synchronization. More...
 
void setCurrentSource (Current current)
 Set the current source. More...
 
void setScanLimit (ScanLimit scanLimit)
 Set the scan limit. More...
 
void setBlinkEnabled (bool enabled)
 Set if blinking is enabled or not for all modes. More...
 
void startPicture (uint8_t frameIndex, bool blinkAll=false)
 Start displaying a picture. More...
 
void stopPicture ()
 Stop displaying a picture.
 
void setMovieEndFrame (MovieEndFrame movieEndFrame)
 Sets at which frame the movie ends. More...
 
void setMovieFrameCount (uint8_t count)
 Set the number of movie frames to play. More...
 
void setFrameDelayMs (uint16_t delayMs)
 Set the frame delay. More...
 
void setScrollingEnabled (bool enable)
 Set scrolling enabled or disabled. More...
 
void setScrollingBlockSize (ScrollingBlockSize scrollingBlockSize)
 Set the block size for scrolling. More...
 
void setScrollingDirection (ScrollingDirection scrollingDirection)
 Set the scroll direction. More...
 
void setFrameFadingEnabled (bool enable)
 Enable or disable frame fading. More...
 
void setBlinkFrequency (BlinkFrequency blinkFrequency)
 Change the blink frequency. More...
 
void setMovieLoopCount (MovieLoopCount movieLoopCount)
 Set the loop count for the movie. More...
 
void startMovie (uint8_t firstFrameIndex, bool blinkAll=false)
 Start displaying a movie. More...
 
void stopMovie ()
 Stop displaying a movie.
 
void setLowVddResetEnabled (bool enabled)
 Enable or disable low VDD reset. More...
 
void setLowVddStatusEnabled (bool enabled)
 Enable or diable low VDD status. More...
 
void setLedErrorCorrectionEnabled (bool enabled)
 Enable or disable LED error correction. More...
 
void setDotCorrectionEnabled (bool enabled)
 Enable or disable analog current dot correction. More...
 
void setTestAllLedsEnabled (bool enabled)
 Enable test on all LED locations. More...
 
void setAutomaticTestEnabled (bool enabled)
 Enable the automatic LED test. More...
 
void startChip ()
 Start the chip. More...
 
void stopChip ()
 Stop the chip. More...
 
void resetChip ()
 Reset the chip. More...
 
void runManualTest ()
 Start a manual LED test. More...
 
LedStatus getLedStatus (uint8_t ledIndex)
 Get the status of a LED. More...
 
bool isLedTestRunning ()
 Check if a LED test is running. More...
 
bool isMovieRunning ()
 Check if a movie is runnning. More...
 
uint8_t getDisplayedFrame ()
 Get the current displayed frame. More...
 
uint8_t getInterruptStatus ()
 Get the interrupt status register. More...
 
Low-Level Functions.

Functions used for low-level operations.

void writeToChip (uint8_t address, uint8_t data)
 Write a two byte sequence to the chip. More...
 
void writeToMemory (uint8_t registerSelection, uint8_t address, uint8_t data)
 Write a byte to a given memory location. More...
 
void writeToMemory (uint8_t registerSelection, uint8_t address, const uint8_t *data, uint8_t size)
 Write a block of data to a given memory location. More...
 
void fillMemory (uint8_t registerSelection, uint8_t address, uint8_t value, uint8_t size)
 Fill a memory location block with a single byte/. More...
 
uint8_t readFromMemory (uint8_t registerSelection, uint8_t address)
 Read a byte from a given memory location. More...
 
void writeControlRegister (ControlRegister controlRegister, uint8_t data)
 Write a byte to a control register. More...
 
uint8_t readControlRegister (ControlRegister controlRegister)
 Read a byte from a control register. More...
 
void writeControlRegisterBits (ControlRegister controlRegister, uint8_t mask, uint8_t data)
 Write bits in a control register. More...
 
void setControlRegisterBits (ControlRegister controlRegister, uint8_t mask)
 Set selected bits in a control register. More...
 
void clearControlRegisterBits (ControlRegister controlRegister, uint8_t mask)
 Clear selected bits in a control register. More...
 
void setOrClearControlRegisterBits (ControlRegister controlRegister, uint8_t mask, bool setBits)
 Set or clear selected bits in a control register. More...
 

Detailed Description

A low-level AS1130 chip access class.

You have to initialize the chip in the order shown below.

  1. Set the RAM configuration using setRamConfiguration().
  2. Set the On/Off frames with your data using setOnOffFrame24x5() and similar functions.
  3. Set the Blink&PWM sets with your data using setBlinkAndPwmSetAll() and similar functions.
  4. Set the dot correction data (if required).
  5. Set control registers for interrupt masks, interface and clock synchronization.
  6. Set the current source level using setCurrentSource().
  7. Set the display options like picture/movie etc, using e.g. setMovieFrameCount() and similar.
  8. Start displaying a picture or movie using startPicture() or startMovie().
  9. Enable the chip using startChip().

After this you can use most function to change the settings, but you can not change the RAM configuration without resetting the chip first.

Examples:
DisplayAnimation.ino, DisplayPicture.ino, DrawPixels.ino, LedTest.ino, and MovingPixel.ino.

Definition at line 54 of file LRAS1130.h.

Member Enumeration Documentation

◆ BlinkFrequency

The blink frequency.

Enumerator
BlinkFrequency1_5s 

Set the blink frequency to 1.5s.

BlinkFrequency3s 

Set the blink frequency to 3s.

Definition at line 173 of file LRAS1130.h.

◆ ChipAddress

enum lr::AS1130::ChipAddress : uint8_t

The chip address.

Enumerator
ChipBaseAddress 

The base address for all chips.

ChipAddress0 

The (A and B) chip address with 1Mohn resistor or floating address pin.

ChipAddress1 

The (A and B) chip address with 470kohm resistor on the address pin.

ChipAddress2 

The (A and B) chip address with 220kohm resistor on the address pin.

ChipAddress3 

The (A and B) chip address with 100kohm resistor on the address pin.

ChipAddress4 

The (A and B) chip address with 47kohm resistor on the address pin.

ChipAddress5 

The (A and B) chip address with 22kohm resistor on the address pin.

ChipAddress6 

The (A and B) chip address with 10kohm resistor on the address pin.

ChipAddress7 

The (A and B) chip address with 4.7kohm resistor or ground on the address pin.

ChipAddress8 

The (C and D) chip address with 1Mohn resistor or floating address pin.

ChipAddress9 

The (C and D) chip address with 470kohm resistor on the address pin.

ChipAddressA 

The (C and D) chip address with 220kohm resistor on the address pin.

ChipAddressB 

The (C and D) chip address with 100kohm resistor on the address pin.

ChipAddressC 

The (C and D) chip address with 47kohm resistor on the address pin.

ChipAddressD 

The (C and D) chip address with 22kohm resistor on the address pin.

ChipAddressE 

The (C and D) chip address with 10kohm resistor on the address pin.

ChipAddressF 

The (C and D) chip address with 4.7kohm resistor or ground on the address pin.

Definition at line 59 of file LRAS1130.h.

◆ ClockFrequency

The clock frequency.

Enumerator
Clock1MHz 

Use 1 MHz as internal clock.

Clock500kHz 

Use 500 kHz as internal clock.

Clock125kHz 

Use 125 kHz as internal clock.

Clock32kHz 

Use 32 kHz as internal clock.

Definition at line 113 of file LRAS1130.h.

◆ Current

enum lr::AS1130::Current : uint8_t

The current for the LEDs.

Enumerator
Current0mA 

Disable the current source for the LEDs.

Current5mA 

Use 5mA as current source for the LEDs.

Current10mA 

Use 10mA as current source for the LEDs.

Current15mA 

Use 15mA as current source for the LEDs.

Current20mA 

Use 20mA as current source for the LEDs.

Current25mA 

Use 25mA as current source for the LEDs.

Current30mA 

Use 30mA as current source for the LEDs.

Definition at line 122 of file LRAS1130.h.

◆ InterruptMaskFlag

The interrupt mask flags.

Enumerator
IMF_MovieFinished 

Flag set if the movie has finished playing.

IMF_ShortTestError 

Flag set if there is a short while testing the LEDs.

IMF_OpenTestError 

Flag set if there is an open LED connection.

IMF_LowVdd 

Flag set if the VDD is too low for the LEDs.

IMF_OverTemperature 

Flag set if the chip has over temperature.

IMF_POR 

Flag set if there is a POR (power on reset).

IMF_WatchDog 

Flag set if there is a time-out in the interface.

IMF_SelectedPicture 

Flag set if the selected picture is reached.

Definition at line 92 of file LRAS1130.h.

◆ LedStatus

enum lr::AS1130::LedStatus : uint8_t

The status of a LED.

Enumerator
LedStatusOk 

The LED is ok and working.

LedStatusOpen 

The LED is not connected.

LedStatusDisabled 

The LED is disabled in the driver.

Definition at line 193 of file LRAS1130.h.

◆ MovieEndFrame

enum lr::AS1130::MovieEndFrame : uint8_t

The movie end frame.

Enumerator
MovieEndWithFirstFrame 

The movie ends with the first frame.

MovieEndWithLastFrame 

The movie ends with the last frame.

Definition at line 152 of file LRAS1130.h.

◆ MovieLoopCount

The movie loop count.

Enumerator
MovieLoopInvalid 

Invalid movie loop value (this is the default after reset).

MovieLoop1 

Loop the movie once.

MovieLoop2 

Loop the movie twice.

MovieLoop3 

Loop the movie 3 times.

MovieLoop4 

Loop the movie 4 times.

MovieLoop5 

Loop the movie 5 times.

MovieLoop6 

Loop the movie 6 times.

MovieLoopEndless 

Loop the movie endless.

Definition at line 180 of file LRAS1130.h.

◆ RamConfiguration

The RAM configuration.

Enumerator
RamConfiguration1 

Configuration with 1 blink/PWM sets, 36 on/off frames and 35 on/off frames with dot correction.

RamConfiguration2 

Configuration with 2 blink/PWM sets, 30 on/off frames and 29 on/off frames with dot correction.

RamConfiguration3 

Configuration with 3 blink/PWM sets, 24 on/off frames and 23 on/off frames with dot correction.

RamConfiguration4 

Configuration with 4 blink/PWM sets, 18 on/off frames and 17 on/off frames with dot correction.

RamConfiguration5 

Configuration with 5 blink/PWM sets, 12 on/off frames and 11 on/off frames with dot correction.

RamConfiguration6 

Configuration with 6 blink/PWM sets, 6 on/off frames and 5 on/off frames with dot correction.

Definition at line 81 of file LRAS1130.h.

◆ ScanLimit

enum lr::AS1130::ScanLimit : uint8_t

The scan limit.

Enumerator
ScanLimit1 

Set 1 section as scan limit.

ScanLimit2 

Set 2 sections as scan limit.

ScanLimit3 

Set 3 sections as scan limit.

ScanLimit4 

Set 4 sections as scan limit.

ScanLimit5 

Set 5 sections as scan limit.

ScanLimit6 

Set 6 sections as scan limit.

ScanLimit7 

Set 7 sections as scan limit.

ScanLimit8 

Set 8 sections as scan limit.

ScanLimit9 

Set 9 sections as scan limit.

ScanLimit10 

Set 10 sections as scan limit.

ScanLimit11 

Set 11 sections as scan limit.

ScanLimit12 

Set 12 sections as scan limit.

ScanLimitFull 

Set all sections as scan limit.

Definition at line 134 of file LRAS1130.h.

◆ ScrollingBlockSize

The scrolling block size.

Enumerator
ScrollInFullMatrix 

Scroll in full 12x11 matrix mode.

ScrollIn5LedBlocks 

Scroll in the 24x5 matrix mode.

Definition at line 159 of file LRAS1130.h.

◆ ScrollingDirection

The scrolling direction.

Enumerator
ScrollingLeft 

Scroll to the left.

ScrollingRight 

Scroll to the right.

Definition at line 166 of file LRAS1130.h.

◆ Synchronization

The synchronization mode.

Enumerator
SynchronizationOff 

Turn synchronization off.

SynchronizationIn 

Use the synchonization pin for the ineternal clock.

SynchronizationOut 

Send the internal clock to the synchronization pin.

Definition at line 105 of file LRAS1130.h.

Constructor & Destructor Documentation

◆ AS1130()

lr::AS1130::AS1130 ( ChipAddress  chipAddress = ChipAddress0)

Create a new driver instance.

Parameters
chipAddressThe address of the chip.

Definition at line 73 of file LRAS1130.cpp.

Member Function Documentation

◆ clearControlRegisterBits()

void lr::AS1130::clearControlRegisterBits ( ControlRegister  controlRegister,
uint8_t  mask 
)

Clear selected bits in a control register.

Parameters
controlRegisterThe control register to change.
maskThe mask for the bits to clear.

Definition at line 550 of file LRAS1130.cpp.

◆ fillMemory()

void lr::AS1130::fillMemory ( uint8_t  registerSelection,
uint8_t  address,
uint8_t  value,
uint8_t  size 
)

Fill a memory location block with a single byte/.

Parameters
registerSelectionThe register selection address.
startAddressThe address of the register.
valueThe value to write.
sizeThe number of bytes to write.

Definition at line 495 of file LRAS1130.cpp.

◆ getDisplayedFrame()

uint8_t lr::AS1130::getDisplayedFrame ( )

Get the current displayed frame.

Returns
The frame index. A value between 0 and 35.

Definition at line 454 of file LRAS1130.cpp.

◆ getInterruptStatus()

uint8_t lr::AS1130::getInterruptStatus ( )

Get the interrupt status register.

Returns
The bitmask with the interrupt status.

Definition at line 461 of file LRAS1130.cpp.

◆ getLedIndex12x11()

uint8_t lr::AS1130::getLedIndex12x11 ( uint8_t  x,
uint8_t  y 
)

Get the LED index for a coordinate in a 12x11 LED setup.

Warning
There is no range check done for the coordinates. Values outside of the allowed range will result in a undefined return value.
Parameters
xThe X coordinate from 0 to 11.
yThe Y coordinate from 0 to 10.
Returns
The LED index.

Definition at line 202 of file LRAS1130.cpp.

◆ getLedIndex24x5()

uint8_t lr::AS1130::getLedIndex24x5 ( uint8_t  x,
uint8_t  y 
)

Get the LED index for a coordinate in a 24x5 LED setup.

Warning
There is no range check done for the coordinates. Values outside of the allowed range will result in a undefined return value.
Parameters
xThe X coordinate from 0 to 23.
yThe Y coordinate from 0 to 4.
Returns
The LED index.

Definition at line 196 of file LRAS1130.cpp.

◆ getLedStatus()

AS1130::LedStatus lr::AS1130::getLedStatus ( uint8_t  ledIndex)

Get the status of a LED.

If a LED is physically connected to the device and works, this function will return LedStatusOk. If no LED is connected or if there is a problem, the function will return LedStatusOpen. The a led index is disabled in the chip, you will get the status LedStatusDisabled.

You have to start a test, before this function will return a valid value. Use setAutomaticTestEnabled() or runManualTest() for the test.

Parameters
ledIndexThe index of the LED to test. A value between 0x00 and 0xba. This chip has a special LED numbering. 0x00-0x0a, 0x10-0x1a, etc. The LEDs between this values are reported as disabled. Also all values over 0xba report a disabled LED.
Returns
The status for the given LED index.
Examples:
LedTest.ino.

Definition at line 421 of file LRAS1130.cpp.

◆ isChipConnected()

bool lr::AS1130::isChipConnected ( )

Check the chip communication.

This function checks if the chip aknowledges a command on the I2C bus. If it does, this function returns true, otherwise it returns false.

Returns
true if the chip answers, false if there is no answer.
Examples:
DisplayAnimation.ino, DisplayPicture.ino, DrawPixels.ino, LedTest.ino, and MovingPixel.ino.

Definition at line 79 of file LRAS1130.cpp.

◆ isLedTestRunning()

bool lr::AS1130::isLedTestRunning ( )

Check if a LED test is running.

Returns
true if a LED test is running, false if no test is running.

Definition at line 440 of file LRAS1130.cpp.

◆ isMovieRunning()

bool lr::AS1130::isMovieRunning ( )

Check if a movie is runnning.

Returns
true if a movie is running, false if no movie is running.

Definition at line 447 of file LRAS1130.cpp.

◆ readControlRegister()

uint8_t lr::AS1130::readControlRegister ( ControlRegister  controlRegister)

Read a byte from a control register.

Parameters
controlRegisterThe control register to read a byte from.
Returns
The read byte.

Definition at line 529 of file LRAS1130.cpp.

◆ readFromMemory()

uint8_t lr::AS1130::readFromMemory ( uint8_t  registerSelection,
uint8_t  address 
)

Read a byte from a given memory location.

Parameters
registerSelectionThe register selection address.
addressThe address of the register.
Returns
The read byte.

Definition at line 507 of file LRAS1130.cpp.

◆ resetChip()

void lr::AS1130::resetChip ( )

Reset the chip.

This will reset the chip using the initialize flag.

Definition at line 404 of file LRAS1130.cpp.

◆ runManualTest()

void lr::AS1130::runManualTest ( )

Start a manual LED test.

This starts a manual LED test and waits until this test finishes. After running this test you can check with the isLedOpen() function.

Examples:
LedTest.ino.

Definition at line 411 of file LRAS1130.cpp.

◆ setAutomaticTestEnabled()

void lr::AS1130::setAutomaticTestEnabled ( bool  enabled)

Enable the automatic LED test.

This enables an automatic LED test as soon a movie or picture is displayed.

Parameters
enabledTrue to enable this feature, false to disable it.

Definition at line 386 of file LRAS1130.cpp.

◆ setBlinkAndPwmSetAll()

void lr::AS1130::setBlinkAndPwmSetAll ( uint8_t  setIndex,
bool  doesBlink = false,
uint8_t  pwmValue = 0xff 
)

Set-up a blink&PWM set with values for all LEDs.

This will set the given blink&PWM set and set all LEDs to the given values.

Parameters
setIndexThe set index has to be a value between 0 and 5.
doesBlinkIf the LEDs in the set are set to blink or not.
pwmValueThe PWM value for all LEDs.
Examples:
DisplayAnimation.ino, DisplayPicture.ino, DrawPixels.ino, LedTest.ino, and MovingPixel.ino.

Definition at line 175 of file LRAS1130.cpp.

◆ setBlinkEnabled()

void lr::AS1130::setBlinkEnabled ( bool  enabled)

Set if blinking is enabled or not for all modes.

If you disable blinking using this flag, all blinking is disabled. It will ignore any bits set in the blink sets and the blink flags in the picture and movie modes.

Parameters
enabledTrue if the blinking is enabled, false if all blinking is disabled.

Definition at line 257 of file LRAS1130.cpp.

◆ setBlinkFrequency()

void lr::AS1130::setBlinkFrequency ( BlinkFrequency  blinkFrequency)

Change the blink frequency.

Parameters
blinkFrequencyThe frequency for blinking LEDs.

Definition at line 327 of file LRAS1130.cpp.

◆ setClockSynchronization()

void lr::AS1130::setClockSynchronization ( Synchronization  synchronization,
ClockFrequency  clockFrequency 
)

Set the clock synchronization.

Parameters
synchronizationThe synchronization mode.
clockFrequencyThe clock frequency.

Definition at line 239 of file LRAS1130.cpp.

◆ setControlRegisterBits()

void lr::AS1130::setControlRegisterBits ( ControlRegister  controlRegister,
uint8_t  mask 
)

Set selected bits in a control register.

Parameters
controlRegisterThe control register to change.
maskThe mask for the bits to set.

Definition at line 544 of file LRAS1130.cpp.

◆ setCurrentSource()

void lr::AS1130::setCurrentSource ( Current  current)

Set the current source.

This is the current source for all LEDs. It is not the actual current for each LED because of the multiplexing. See the datasheet, section "LED Current Calculation" for an exact calculation of the resulting current for each LED.

Parameters
currentThe current source for all LEDs.
Examples:
DisplayAnimation.ino, DisplayPicture.ino, DrawPixels.ino, LedTest.ino, and MovingPixel.ino.

Definition at line 245 of file LRAS1130.cpp.

◆ setDotCorrection()

void lr::AS1130::setDotCorrection ( const uint8_t *  data)

Set the dot correction data.

This correction data is a correction factor for all 12 segments of the display. You have to pass an array with 12 byte values.

Parameters
dataPointer to an array with 12 bytes.

Definition at line 208 of file LRAS1130.cpp.

◆ setDotCorrectionEnabled()

void lr::AS1130::setDotCorrectionEnabled ( bool  enabled)

Enable or disable analog current dot correction.

Parameters
enabledTrue to enable this feature, false to disable it.

Definition at line 374 of file LRAS1130.cpp.

◆ setFrameDelayMs()

void lr::AS1130::setFrameDelayMs ( uint16_t  delayMs)

Set the frame delay.

Parameters
delayMsThe frame delay in milliseconds. This value has to be between zero and 488 milliseconds. The final value is changed to the next lower matching value. See the datasheet for the final values.
Examples:
DisplayAnimation.ino, DrawPixels.ino, and MovingPixel.ino.

Definition at line 292 of file LRAS1130.cpp.

◆ setFrameFadingEnabled()

void lr::AS1130::setFrameFadingEnabled ( bool  enable)

Enable or disable frame fading.

Parameters
enableTrue to enable the frame fading. False to disable frame fading.

Definition at line 321 of file LRAS1130.cpp.

◆ setInterfaceMonitoring()

void lr::AS1130::setInterfaceMonitoring ( uint8_t  timeout,
bool  enabled 
)

Set the I2C monitoring.

This sets the values for the interface monitoring.

Parameters
timeoutThe timeout value between 0x00 and 0x3f. The resulting timeout is calculated with the following formula: timeout window = (value + 1) * 256 microseconds.
enabledIf set to true, the monitoring is enabled. If set to false, the monitoring is disabled.

Definition at line 228 of file LRAS1130.cpp.

◆ setInterruptFrame()

void lr::AS1130::setInterruptFrame ( uint8_t  lastFrame)

Set the interrupt frame.

Parameters
lastFrameThe index of the frame which triggers the inetrrupt. A value between 0 and 35.

Definition at line 222 of file LRAS1130.cpp.

◆ setInterruptMask()

void lr::AS1130::setInterruptMask ( uint8_t  mask)

Set the interrupt mask.

Parameters
maskA mask with a OR combination of the flags from enum InterruptMaskFlag.

Definition at line 216 of file LRAS1130.cpp.

◆ setLedErrorCorrectionEnabled()

void lr::AS1130::setLedErrorCorrectionEnabled ( bool  enabled)

Enable or disable LED error correction.

Parameters
enabledTrue to enable this feature, false to disable it.

Definition at line 368 of file LRAS1130.cpp.

◆ setLowVddResetEnabled()

void lr::AS1130::setLowVddResetEnabled ( bool  enabled)

Enable or disable low VDD reset.

Parameters
enabledTrue to enable this feature, false to disable it.

Definition at line 356 of file LRAS1130.cpp.

◆ setLowVddStatusEnabled()

void lr::AS1130::setLowVddStatusEnabled ( bool  enabled)

Enable or diable low VDD status.

Parameters
enabledTrue to enable this feature, false to disable it.

Definition at line 362 of file LRAS1130.cpp.

◆ setMovieEndFrame()

void lr::AS1130::setMovieEndFrame ( MovieEndFrame  movieEndFrame)

Sets at which frame the movie ends.

Parameters
movieEndFrameThe frame where the movie ends.
Examples:
DisplayAnimation.ino, DrawPixels.ino, and MovingPixel.ino.

Definition at line 280 of file LRAS1130.cpp.

◆ setMovieFrameCount()

void lr::AS1130::setMovieFrameCount ( uint8_t  count)

Set the number of movie frames to play.

Parameters
countThe number of movie frames to play. Minimum is 2, maximum is 36. This value is converted into the register format.
Examples:
DisplayAnimation.ino, DrawPixels.ino, and MovingPixel.ino.

Definition at line 286 of file LRAS1130.cpp.

◆ setMovieLoopCount()

void lr::AS1130::setMovieLoopCount ( MovieLoopCount  movieLoopCount)

Set the loop count for the movie.

Parameters
movieLoopCountThe number of loops while playing a movie.
Examples:
DisplayAnimation.ino, DrawPixels.ino, and MovingPixel.ino.

Definition at line 333 of file LRAS1130.cpp.

◆ setOnOffFrame() [1/2]

void lr::AS1130::setOnOffFrame ( uint8_t  frameIndex,
const AS1130Picture12x11 picture,
uint8_t  pwmSetIndex = 0 
)

Set-up a on/off frame.

Parameters
frameIndexThe index of the frame. This has to be a value between 0 and 35. Depending on your RAM configuration this can be less. The frame number is not checked to be valid. See the RAM configuration for details.
pwmSetIndexThe PWM set index for this frame. It has to be a value between 0 and 7 selecting one of the PWM sets.
pictureThe picture to write into the frame.
Examples:
DrawPixels.ino, and MovingPixel.ino.

Definition at line 94 of file LRAS1130.cpp.

◆ setOnOffFrame() [2/2]

void lr::AS1130::setOnOffFrame ( uint8_t  frameIndex,
const AS1130Picture24x5 picture,
uint8_t  pwmSetIndex = 0 
)

Set-up a on/off frame.

Parameters
frameIndexThe index of the frame. This has to be a value between 0 and 35. Depending on your RAM configuration this can be less. The frame number is not checked to be valid. See the RAM configuration for details.
pwmSetIndexThe PWM set index for this frame. It has to be a value between 0 and 7 selecting one of the PWM sets.
pictureThe picture to write into the frame.

Definition at line 106 of file LRAS1130.cpp.

◆ setOnOffFrame12x11()

void lr::AS1130::setOnOffFrame12x11 ( uint8_t  frameIndex,
const uint8_t *  data,
uint8_t  pwmSetIndex = 0 
)

Set-up a on/off frame with data.

This function is written for a 12x11 LED matrix. You have to specify 17 bytes of data. The bits are specified horizontally as shown below.

Bits: 01234567 89AB0123 456789AB ...

Parameters
frameIndexThe index of the frame. This has to be a value between 0 and 35. Depending on your RAM configuration this can be less. The frame number is not checked to be valid. See the RAM configuration for details.
pwmSetIndexThe PWM set index for this frame. It has to be a value between 0 and 7 selecting one of the PWM sets.
dataAn array with 17 bytes. Each set bit will enable the corresponding LED.

Definition at line 130 of file LRAS1130.cpp.

◆ setOnOffFrame24x5()

void lr::AS1130::setOnOffFrame24x5 ( uint8_t  frameIndex,
const uint8_t *  data,
uint8_t  pwmSetIndex = 0 
)

Set-up a on/off frame with data.

This function is written for a 24x5 LED matrix. You have to specify 15 bytes of data. The bits are specified horizontally as shown in the example below.

Example array definition:

const uint8_t exampleFrame[] = {
0b11111111, 0b11111111, 0b11111111,
0b10000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000001,
0b10000000, 0b00000000, 0b00000001,
0b11111111, 0b11111111, 0b11111111};
Parameters
frameIndexThe index of the frame. This has to be a value between 0 and 35. Depending on your RAM configuration this can be less. The frame number is not checked to be valid. See the RAM configuration for details.
pwmSetIndexThe PWM set index for this frame. It has to be a value between 0 and 7 selecting one of the PWM sets.
dataAn array with 15 bytes. Each set bit will enable the corresponding LED.
Examples:
DisplayAnimation.ino, and DisplayPicture.ino.

Definition at line 118 of file LRAS1130.cpp.

◆ setOnOffFrameAllOff()

void lr::AS1130::setOnOffFrameAllOff ( uint8_t  frameIndex,
uint8_t  pwmSetIndex = 0 
)

Set-up a on/off frame with all LEDs disabled.

Parameters
frameIndexThe index of the frame. This has to be a value between 0 and 35.
pwmSetIndexThe PWM set index for this frame. It has to a value between 0 and 7 selecting one of the PWM sets.
Examples:
DrawPixels.ino, and MovingPixel.ino.

Definition at line 142 of file LRAS1130.cpp.

◆ setOnOffFrameAllOn()

void lr::AS1130::setOnOffFrameAllOn ( uint8_t  frameIndex,
uint8_t  pwmSetIndex = 0 
)

Set-up a on/off frame with all LEDs enabled.

Parameters
frameIndexThe index of the frame. This has to be a value between 0 and 35.
pwmSetIndexThe PWM set index for this frame. It has to a value between 0 and 7 selecting one of the PWM sets.
Examples:
LedTest.ino.

Definition at line 156 of file LRAS1130.cpp.

◆ setOrClearControlRegisterBits()

void lr::AS1130::setOrClearControlRegisterBits ( ControlRegister  controlRegister,
uint8_t  mask,
bool  setBits 
)

Set or clear selected bits in a control register.

Parameters
controlRegisterThe control register to change.
maskThe mask for the bits to clear.
setBitsTrue to set the bits, false to clear the bits.

Definition at line 556 of file LRAS1130.cpp.

◆ setPwmValue()

void lr::AS1130::setPwmValue ( uint8_t  setIndex,
uint8_t  ledIndex,
uint8_t  value 
)

Set a PWM value in a given blink&PWM set.

Parameters
setIndexThe set index has to be a value between 0 and 5.
ledIndexThe index of the LED. A value between 0x00 and 0xba.
valueThe PWM value between 0x00 and 0xff.

Definition at line 188 of file LRAS1130.cpp.

◆ setRamConfiguration()

void lr::AS1130::setRamConfiguration ( RamConfiguration  ramConfiguration)

Set the RAM configuration.

The RAM configuration defines how many On/Off frames and PWM/blink sets are available. This numbers are not checked if you define frames later, you have to make sure you only use the maximum number of frames and sets as possible for your choosen configuration.

You can not change the configuration as soon as you wrote the first frame without resetting the chip.

Ram Configuration Blink & PWM Sets On/Off Frames On/Off Frames with Dot Connection
1 1 36 35
2 2 30 29
3 3 24 23
4 4 18 17
5 5 12 11
6 6 6 5
Parameters
ramConfigurationThe RAM configuration.
Examples:
DisplayAnimation.ino, DisplayPicture.ino, DrawPixels.ino, LedTest.ino, and MovingPixel.ino.

Definition at line 88 of file LRAS1130.cpp.

◆ setScanLimit()

void lr::AS1130::setScanLimit ( ScanLimit  scanLimit)

Set the scan limit.

Parameters
scanLimitThe scan limit. This is the number of sections which are included in the displayed image or movie.
Examples:
DisplayAnimation.ino, DisplayPicture.ino, DrawPixels.ino, LedTest.ino, and MovingPixel.ino.

Definition at line 251 of file LRAS1130.cpp.

◆ setScrollingBlockSize()

void lr::AS1130::setScrollingBlockSize ( ScrollingBlockSize  scrollingBlockSize)

Set the block size for scrolling.

Parameters
scrollingBlockSizeIf the scrolling uses the full matrix or the 5 LED block mode.

Definition at line 309 of file LRAS1130.cpp.

◆ setScrollingDirection()

void lr::AS1130::setScrollingDirection ( ScrollingDirection  scrollingDirection)

Set the scroll direction.

Parameters
scrollingDirectionThe direction for the scrolling.

Definition at line 315 of file LRAS1130.cpp.

◆ setScrollingEnabled()

void lr::AS1130::setScrollingEnabled ( bool  enable)

Set scrolling enabled or disabled.

Parameters
enableTrue if the scrolling is enabled. False to disable the scrolling.
Examples:
DisplayAnimation.ino, DrawPixels.ino, and MovingPixel.ino.

Definition at line 303 of file LRAS1130.cpp.

◆ setTestAllLedsEnabled()

void lr::AS1130::setTestAllLedsEnabled ( bool  enabled)

Enable test on all LED locations.

Parameters
enabledTrue to enable this feature, false to disable it.

Definition at line 380 of file LRAS1130.cpp.

◆ startChip()

void lr::AS1130::startChip ( )

Start the chip.

This starts the internal state machine and enabled power for the LEDs.

Examples:
DisplayAnimation.ino, DisplayPicture.ino, DrawPixels.ino, LedTest.ino, and MovingPixel.ino.

Definition at line 392 of file LRAS1130.cpp.

◆ startMovie()

void lr::AS1130::startMovie ( uint8_t  firstFrameIndex,
bool  blinkAll = false 
)

Start displaying a movie.

Parameters
firstFrameIndexThe first frame of the movie to start with.
blinkAllIf all LEDs should blink while the movie is displayed.
Examples:
DisplayAnimation.ino.

Definition at line 339 of file LRAS1130.cpp.

◆ startPicture()

void lr::AS1130::startPicture ( uint8_t  frameIndex,
bool  blinkAll = false 
)

Start displaying a picture.

Parameters
frameIndexThe index of the frame to display.
blinkAllIf all LEDs should blink while the picture is displayed.
Examples:
DisplayPicture.ino, DrawPixels.ino, LedTest.ino, and MovingPixel.ino.

Definition at line 263 of file LRAS1130.cpp.

◆ stopChip()

void lr::AS1130::stopChip ( )

Stop the chip.

This puts the chip in shutdown mode and stops the state machine.

Definition at line 398 of file LRAS1130.cpp.

◆ writeControlRegister()

void lr::AS1130::writeControlRegister ( ControlRegister  controlRegister,
uint8_t  data 
)

Write a byte to a control register.

Parameters
controlRegisterThe control register.
dataThe data byte to write to the control register.

Definition at line 523 of file LRAS1130.cpp.

◆ writeControlRegisterBits()

void lr::AS1130::writeControlRegisterBits ( ControlRegister  controlRegister,
uint8_t  mask,
uint8_t  data 
)

Write bits in a control register.

Parameters
controlRegisterThe control register to change.
maskThe mask for the bits. Only the bits set in this mask are changed.
dataThe bits to set. The data is masked with the mask.

Definition at line 535 of file LRAS1130.cpp.

◆ writeToChip()

void lr::AS1130::writeToChip ( uint8_t  address,
uint8_t  data 
)

Write a two byte sequence to the chip.

Parameters
addressThe address byte.
dataThe data byte.

Definition at line 467 of file LRAS1130.cpp.

◆ writeToMemory() [1/2]

void lr::AS1130::writeToMemory ( uint8_t  registerSelection,
uint8_t  address,
uint8_t  data 
)

Write a byte to a given memory location.

Parameters
registerSelectionThe register selection address.
addressThe address of the register.
dataThe data byte to write to the selected register.

Definition at line 476 of file LRAS1130.cpp.

◆ writeToMemory() [2/2]

void lr::AS1130::writeToMemory ( uint8_t  registerSelection,
uint8_t  address,
const uint8_t *  data,
uint8_t  size 
)

Write a block of data to a given memory location.

Parameters
registerSelectionThe register selection address.
startAddressThe address of the register.
dataA pointer to the start of the data to write.
sizeThe number of bytes to write.

Definition at line 483 of file LRAS1130.cpp.


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