Lucky Resistors AS1130 Library
This is a library to access the functionality of the AS1130 chip.
|
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... | |
A low-level AS1130 chip access class.
You have to initialize the chip in the order shown below.
After this you can use most function to change the settings, but you can not change the RAM configuration without resetting the chip first.
Definition at line 54 of file LRAS1130.h.
enum lr::AS1130::BlinkFrequency : uint8_t |
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.
enum lr::AS1130::ChipAddress : uint8_t |
The chip address.
Definition at line 59 of file LRAS1130.h.
enum lr::AS1130::ClockFrequency : uint8_t |
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.
enum lr::AS1130::Current : uint8_t |
The current for the LEDs.
Definition at line 122 of file LRAS1130.h.
enum lr::AS1130::InterruptMaskFlag : uint8_t |
The interrupt mask flags.
Definition at line 92 of file LRAS1130.h.
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.
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.
enum lr::AS1130::MovieLoopCount : uint8_t |
The movie loop count.
Definition at line 180 of file LRAS1130.h.
enum lr::AS1130::RamConfiguration : uint8_t |
The RAM configuration.
Definition at line 81 of file LRAS1130.h.
enum lr::AS1130::ScanLimit : uint8_t |
The scan limit.
Definition at line 134 of file LRAS1130.h.
enum lr::AS1130::ScrollingBlockSize : uint8_t |
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.
enum lr::AS1130::ScrollingDirection : uint8_t |
The scrolling direction.
Enumerator | |
---|---|
ScrollingLeft | Scroll to the left. |
ScrollingRight | Scroll to the right. |
Definition at line 166 of file LRAS1130.h.
enum lr::AS1130::Synchronization : uint8_t |
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.
lr::AS1130::AS1130 | ( | ChipAddress | chipAddress = ChipAddress0 | ) |
Create a new driver instance.
chipAddress | The address of the chip. |
Definition at line 73 of file LRAS1130.cpp.
void lr::AS1130::clearControlRegisterBits | ( | ControlRegister | controlRegister, |
uint8_t | mask | ||
) |
Clear selected bits in a control register.
controlRegister | The control register to change. |
mask | The mask for the bits to clear. |
Definition at line 550 of file LRAS1130.cpp.
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/.
registerSelection | The register selection address. |
startAddress | The address of the register. |
value | The value to write. |
size | The number of bytes to write. |
Definition at line 495 of file LRAS1130.cpp.
uint8_t lr::AS1130::getDisplayedFrame | ( | ) |
Get the current displayed frame.
Definition at line 454 of file LRAS1130.cpp.
uint8_t lr::AS1130::getInterruptStatus | ( | ) |
Get the interrupt status register.
Definition at line 461 of file LRAS1130.cpp.
uint8_t lr::AS1130::getLedIndex12x11 | ( | uint8_t | x, |
uint8_t | y | ||
) |
Get the LED index for a coordinate in a 12x11 LED setup.
x | The X coordinate from 0 to 11. |
y | The Y coordinate from 0 to 10. |
Definition at line 202 of file LRAS1130.cpp.
uint8_t lr::AS1130::getLedIndex24x5 | ( | uint8_t | x, |
uint8_t | y | ||
) |
Get the LED index for a coordinate in a 24x5 LED setup.
x | The X coordinate from 0 to 23. |
y | The Y coordinate from 0 to 4. |
Definition at line 196 of file LRAS1130.cpp.
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.
ledIndex | The 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. |
Definition at line 421 of file LRAS1130.cpp.
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
.
true
if the chip answers, false
if there is no answer. Definition at line 79 of file LRAS1130.cpp.
bool lr::AS1130::isLedTestRunning | ( | ) |
Check if a LED test is running.
true
if a LED test is running, false
if no test is running. Definition at line 440 of file LRAS1130.cpp.
bool lr::AS1130::isMovieRunning | ( | ) |
Check if a movie is runnning.
true
if a movie is running, false
if no movie is running. Definition at line 447 of file LRAS1130.cpp.
uint8_t lr::AS1130::readControlRegister | ( | ControlRegister | controlRegister | ) |
Read a byte from a control register.
controlRegister | The control register to read a byte from. |
Definition at line 529 of file LRAS1130.cpp.
uint8_t lr::AS1130::readFromMemory | ( | uint8_t | registerSelection, |
uint8_t | address | ||
) |
Read a byte from a given memory location.
registerSelection | The register selection address. |
address | The address of the register. |
Definition at line 507 of file LRAS1130.cpp.
void lr::AS1130::resetChip | ( | ) |
Reset the chip.
This will reset the chip using the initialize flag.
Definition at line 404 of file LRAS1130.cpp.
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.
Definition at line 411 of file LRAS1130.cpp.
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.
enabled | True to enable this feature, false to disable it. |
Definition at line 386 of file LRAS1130.cpp.
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.
setIndex | The set index has to be a value between 0 and 5. |
doesBlink | If the LEDs in the set are set to blink or not. |
pwmValue | The PWM value for all LEDs. |
Definition at line 175 of file LRAS1130.cpp.
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.
enabled | True if the blinking is enabled, false if all blinking is disabled. |
Definition at line 257 of file LRAS1130.cpp.
void lr::AS1130::setBlinkFrequency | ( | BlinkFrequency | blinkFrequency | ) |
Change the blink frequency.
blinkFrequency | The frequency for blinking LEDs. |
Definition at line 327 of file LRAS1130.cpp.
void lr::AS1130::setClockSynchronization | ( | Synchronization | synchronization, |
ClockFrequency | clockFrequency | ||
) |
Set the clock synchronization.
synchronization | The synchronization mode. |
clockFrequency | The clock frequency. |
Definition at line 239 of file LRAS1130.cpp.
void lr::AS1130::setControlRegisterBits | ( | ControlRegister | controlRegister, |
uint8_t | mask | ||
) |
Set selected bits in a control register.
controlRegister | The control register to change. |
mask | The mask for the bits to set. |
Definition at line 544 of file LRAS1130.cpp.
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.
current | The current source for all LEDs. |
Definition at line 245 of file LRAS1130.cpp.
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.
data | Pointer to an array with 12 bytes. |
Definition at line 208 of file LRAS1130.cpp.
void lr::AS1130::setDotCorrectionEnabled | ( | bool | enabled | ) |
Enable or disable analog current dot correction.
enabled | True to enable this feature, false to disable it. |
Definition at line 374 of file LRAS1130.cpp.
void lr::AS1130::setFrameDelayMs | ( | uint16_t | delayMs | ) |
Set the frame delay.
delayMs | The 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. |
Definition at line 292 of file LRAS1130.cpp.
void lr::AS1130::setFrameFadingEnabled | ( | bool | enable | ) |
Enable or disable frame fading.
enable | True to enable the frame fading. False to disable frame fading. |
Definition at line 321 of file LRAS1130.cpp.
void lr::AS1130::setInterfaceMonitoring | ( | uint8_t | timeout, |
bool | enabled | ||
) |
Set the I2C monitoring.
This sets the values for the interface monitoring.
timeout | The timeout value between 0x00 and 0x3f. The resulting timeout is calculated with the following formula: timeout window = (value + 1) * 256 microseconds. |
enabled | If set to true, the monitoring is enabled. If set to false, the monitoring is disabled. |
Definition at line 228 of file LRAS1130.cpp.
void lr::AS1130::setInterruptFrame | ( | uint8_t | lastFrame | ) |
Set the interrupt frame.
lastFrame | The index of the frame which triggers the inetrrupt. A value between 0 and 35. |
Definition at line 222 of file LRAS1130.cpp.
void lr::AS1130::setInterruptMask | ( | uint8_t | mask | ) |
Set the interrupt mask.
mask | A mask with a OR combination of the flags from enum InterruptMaskFlag. |
Definition at line 216 of file LRAS1130.cpp.
void lr::AS1130::setLedErrorCorrectionEnabled | ( | bool | enabled | ) |
Enable or disable LED error correction.
enabled | True to enable this feature, false to disable it. |
Definition at line 368 of file LRAS1130.cpp.
void lr::AS1130::setLowVddResetEnabled | ( | bool | enabled | ) |
Enable or disable low VDD reset.
enabled | True to enable this feature, false to disable it. |
Definition at line 356 of file LRAS1130.cpp.
void lr::AS1130::setLowVddStatusEnabled | ( | bool | enabled | ) |
Enable or diable low VDD status.
enabled | True to enable this feature, false to disable it. |
Definition at line 362 of file LRAS1130.cpp.
void lr::AS1130::setMovieEndFrame | ( | MovieEndFrame | movieEndFrame | ) |
Sets at which frame the movie ends.
movieEndFrame | The frame where the movie ends. |
Definition at line 280 of file LRAS1130.cpp.
void lr::AS1130::setMovieFrameCount | ( | uint8_t | count | ) |
Set the number of movie frames to play.
count | The number of movie frames to play. Minimum is 2, maximum is 36. This value is converted into the register format. |
Definition at line 286 of file LRAS1130.cpp.
void lr::AS1130::setMovieLoopCount | ( | MovieLoopCount | movieLoopCount | ) |
Set the loop count for the movie.
movieLoopCount | The number of loops while playing a movie. |
Definition at line 333 of file LRAS1130.cpp.
void lr::AS1130::setOnOffFrame | ( | uint8_t | frameIndex, |
const AS1130Picture12x11 & | picture, | ||
uint8_t | pwmSetIndex = 0 |
||
) |
Set-up a on/off frame.
frameIndex | The 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. |
pwmSetIndex | The PWM set index for this frame. It has to be a value between 0 and 7 selecting one of the PWM sets. |
picture | The picture to write into the frame. |
Definition at line 94 of file LRAS1130.cpp.
void lr::AS1130::setOnOffFrame | ( | uint8_t | frameIndex, |
const AS1130Picture24x5 & | picture, | ||
uint8_t | pwmSetIndex = 0 |
||
) |
Set-up a on/off frame.
frameIndex | The 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. |
pwmSetIndex | The PWM set index for this frame. It has to be a value between 0 and 7 selecting one of the PWM sets. |
picture | The picture to write into the frame. |
Definition at line 106 of file LRAS1130.cpp.
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 ...
frameIndex | The 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. |
pwmSetIndex | The PWM set index for this frame. It has to be a value between 0 and 7 selecting one of the PWM sets. |
data | An array with 17 bytes. Each set bit will enable the corresponding LED. |
Definition at line 130 of file LRAS1130.cpp.
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:
frameIndex | The 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. |
pwmSetIndex | The PWM set index for this frame. It has to be a value between 0 and 7 selecting one of the PWM sets. |
data | An array with 15 bytes. Each set bit will enable the corresponding LED. |
Definition at line 118 of file LRAS1130.cpp.
void lr::AS1130::setOnOffFrameAllOff | ( | uint8_t | frameIndex, |
uint8_t | pwmSetIndex = 0 |
||
) |
Set-up a on/off frame with all LEDs disabled.
frameIndex | The index of the frame. This has to be a value between 0 and 35. |
pwmSetIndex | The PWM set index for this frame. It has to a value between 0 and 7 selecting one of the PWM sets. |
Definition at line 142 of file LRAS1130.cpp.
void lr::AS1130::setOnOffFrameAllOn | ( | uint8_t | frameIndex, |
uint8_t | pwmSetIndex = 0 |
||
) |
Set-up a on/off frame with all LEDs enabled.
frameIndex | The index of the frame. This has to be a value between 0 and 35. |
pwmSetIndex | The PWM set index for this frame. It has to a value between 0 and 7 selecting one of the PWM sets. |
Definition at line 156 of file LRAS1130.cpp.
void lr::AS1130::setOrClearControlRegisterBits | ( | ControlRegister | controlRegister, |
uint8_t | mask, | ||
bool | setBits | ||
) |
Set or clear selected bits in a control register.
controlRegister | The control register to change. |
mask | The mask for the bits to clear. |
setBits | True to set the bits, false to clear the bits. |
Definition at line 556 of file LRAS1130.cpp.
void lr::AS1130::setPwmValue | ( | uint8_t | setIndex, |
uint8_t | ledIndex, | ||
uint8_t | value | ||
) |
Set a PWM value in a given blink&PWM set.
setIndex | The set index has to be a value between 0 and 5. |
ledIndex | The index of the LED. A value between 0x00 and 0xba. |
value | The PWM value between 0x00 and 0xff. |
Definition at line 188 of file LRAS1130.cpp.
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 |
ramConfiguration | The RAM configuration. |
Definition at line 88 of file LRAS1130.cpp.
void lr::AS1130::setScanLimit | ( | ScanLimit | scanLimit | ) |
Set the scan limit.
scanLimit | The scan limit. This is the number of sections which are included in the displayed image or movie. |
Definition at line 251 of file LRAS1130.cpp.
void lr::AS1130::setScrollingBlockSize | ( | ScrollingBlockSize | scrollingBlockSize | ) |
Set the block size for scrolling.
scrollingBlockSize | If the scrolling uses the full matrix or the 5 LED block mode. |
Definition at line 309 of file LRAS1130.cpp.
void lr::AS1130::setScrollingDirection | ( | ScrollingDirection | scrollingDirection | ) |
Set the scroll direction.
scrollingDirection | The direction for the scrolling. |
Definition at line 315 of file LRAS1130.cpp.
void lr::AS1130::setScrollingEnabled | ( | bool | enable | ) |
Set scrolling enabled or disabled.
enable | True if the scrolling is enabled. False to disable the scrolling. |
Definition at line 303 of file LRAS1130.cpp.
void lr::AS1130::setTestAllLedsEnabled | ( | bool | enabled | ) |
Enable test on all LED locations.
enabled | True to enable this feature, false to disable it. |
Definition at line 380 of file LRAS1130.cpp.
void lr::AS1130::startChip | ( | ) |
Start the chip.
This starts the internal state machine and enabled power for the LEDs.
Definition at line 392 of file LRAS1130.cpp.
void lr::AS1130::startMovie | ( | uint8_t | firstFrameIndex, |
bool | blinkAll = false |
||
) |
Start displaying a movie.
firstFrameIndex | The first frame of the movie to start with. |
blinkAll | If all LEDs should blink while the movie is displayed. |
Definition at line 339 of file LRAS1130.cpp.
void lr::AS1130::startPicture | ( | uint8_t | frameIndex, |
bool | blinkAll = false |
||
) |
Start displaying a picture.
frameIndex | The index of the frame to display. |
blinkAll | If all LEDs should blink while the picture is displayed. |
Definition at line 263 of file LRAS1130.cpp.
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.
void lr::AS1130::writeControlRegister | ( | ControlRegister | controlRegister, |
uint8_t | data | ||
) |
Write a byte to a control register.
controlRegister | The control register. |
data | The data byte to write to the control register. |
Definition at line 523 of file LRAS1130.cpp.
void lr::AS1130::writeControlRegisterBits | ( | ControlRegister | controlRegister, |
uint8_t | mask, | ||
uint8_t | data | ||
) |
Write bits in a control register.
controlRegister | The control register to change. |
mask | The mask for the bits. Only the bits set in this mask are changed. |
data | The bits to set. The data is masked with the mask. |
Definition at line 535 of file LRAS1130.cpp.
void lr::AS1130::writeToChip | ( | uint8_t | address, |
uint8_t | data | ||
) |
Write a two byte sequence to the chip.
address | The address byte. |
data | The data byte. |
Definition at line 467 of file LRAS1130.cpp.
void lr::AS1130::writeToMemory | ( | uint8_t | registerSelection, |
uint8_t | address, | ||
uint8_t | data | ||
) |
Write a byte to a given memory location.
registerSelection | The register selection address. |
address | The address of the register. |
data | The data byte to write to the selected register. |
Definition at line 476 of file LRAS1130.cpp.
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.
registerSelection | The register selection address. |
startAddress | The address of the register. |
data | A pointer to the start of the data to write. |
size | The number of bytes to write. |
Definition at line 483 of file LRAS1130.cpp.