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

One single bitmap in 24x5 layout for manual modification or storage. More...

#include <LRAS1130Picture24x5.h>

Public Member Functions

 AS1130Picture24x5 ()
 Create a empty bitmap.
 
 AS1130Picture24x5 (const uint8_t *data)
 Create a bitmap using an existing bitmask. More...
 
void setPixel (uint8_t x, uint8_t y, bool enabled)
 Set a pixel in this bitmap. More...
 
bool getPixel (uint8_t x, uint8_t y)
 Get the state of a single pixel. More...
 
const uint8_t * getData () const
 Access the raw bit data. More...
 

Static Public Member Functions

static uint8_t getWidth ()
 Get the width of this bitmap. More...
 
static uint8_t getHeight ()
 Get the height of this bitmap. More...
 
static uint8_t getDataByteCount ()
 Get the number of raw byte for this bitmap. More...
 
static uint8_t getDataBit (uint8_t x, uint8_t y)
 Get the bitmask for a given coordinate. More...
 
static uint8_t getDataIndex (uint8_t x, uint8_t y)
 Get the byte for a given coordinate. More...
 
static void writeRegisters (uint8_t *registerData, const uint8_t *rawData, uint8_t pwmSetIndex)
 Write the registers for this bitmap data. More...
 

Detailed Description

One single bitmap in 24x5 layout for manual modification or storage.

Examples:
DrawPixels.ino, and MovingPixel.ino.

Definition at line 34 of file LRAS1130Picture24x5.h.

Constructor & Destructor Documentation

◆ AS1130Picture24x5()

lr::AS1130Picture24x5::AS1130Picture24x5 ( const uint8_t *  data)

Create a bitmap using an existing bitmask.

The bits from the data are copied to the local structure. All bits in this bitmask has to be in high to low order.

Bits: 01234567 89ABCDEF GHIJKLMN 01234567 89ABCDEF ...

Parameters
dataA bitmask with 15 bytes.

Definition at line 44 of file LRAS1130Picture24x5.cpp.

Member Function Documentation

◆ getData()

const uint8_t* lr::AS1130Picture24x5::getData ( ) const
inline

Access the raw bit data.

Returns
A pointer to the raw bit data.

Definition at line 92 of file LRAS1130Picture24x5.h.

◆ getDataBit()

static uint8_t lr::AS1130Picture24x5::getDataBit ( uint8_t  x,
uint8_t  y 
)
inlinestatic

Get the bitmask for a given coordinate.

Parameters
xThe X coordinate of the pixel.
yThe Y coordinate of the pixel.
Returns
A bitmask with the addressed bit for the given coordinate.

Definition at line 100 of file LRAS1130Picture24x5.h.

◆ getDataByteCount()

static uint8_t lr::AS1130Picture24x5::getDataByteCount ( )
inlinestatic

Get the number of raw byte for this bitmap.

Returns
The number of raw bytes used to store this bitmap.

Definition at line 86 of file LRAS1130Picture24x5.h.

◆ getDataIndex()

static uint8_t lr::AS1130Picture24x5::getDataIndex ( uint8_t  x,
uint8_t  y 
)
inlinestatic

Get the byte for a given coordinate.

Parameters
xThe X coordinate of the pixel.
yThe Y coordinate of the pixel.
Returns
The index of the byte for a given coordinate.

Definition at line 110 of file LRAS1130Picture24x5.h.

◆ getHeight()

static uint8_t lr::AS1130Picture24x5::getHeight ( )
inlinestatic

Get the height of this bitmap.

Returns
The height of the bitmap in pixels.
Examples:
MovingPixel.ino.

Definition at line 80 of file LRAS1130Picture24x5.h.

◆ getPixel()

bool lr::AS1130Picture24x5::getPixel ( uint8_t  x,
uint8_t  y 
)

Get the state of a single pixel.

Parameters
xThe X coordinate of the pixel.
yThe Y coordinate of the pixel.

Definition at line 63 of file LRAS1130Picture24x5.cpp.

◆ getWidth()

static uint8_t lr::AS1130Picture24x5::getWidth ( )
inlinestatic

Get the width of this bitmap.

Returns
The width of the bitmap in pixels.
Examples:
MovingPixel.ino.

Definition at line 74 of file LRAS1130Picture24x5.h.

◆ setPixel()

void lr::AS1130Picture24x5::setPixel ( uint8_t  x,
uint8_t  y,
bool  enabled 
)

Set a pixel in this bitmap.

The coordinates are bounds checked.

Parameters
xThe X coordinate of the pixel.
yThe Y coordinate of the pixel.
enabledtrue to set the pixel and false to clear it.
Examples:
DrawPixels.ino, and MovingPixel.ino.

Definition at line 50 of file LRAS1130Picture24x5.cpp.

◆ writeRegisters()

void lr::AS1130Picture24x5::writeRegisters ( uint8_t *  registerData,
const uint8_t *  rawData,
uint8_t  pwmSetIndex 
)
static

Write the registers for this bitmap data.

Parameters
registerDataA pointer to an array of 24 bytes for all frame registers.
rawDataA pointer to the raw bit data.
pwmSetIndexThe PWM index to write to the register data.

Definition at line 74 of file LRAS1130Picture24x5.cpp.


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