Adafruit IS31FL3741 Library
Public Member Functions | Public Attributes | List of all members
Adafruit_EyeLights_buffered Class Reference

Class for Adafruit EyeLights, buffered. More...

#include <Adafruit_IS31FL3741.h>

Inheritance diagram for Adafruit_EyeLights_buffered:
Adafruit_EyeLights_Base Adafruit_IS31FL3741_colorGFX_buffered Adafruit_IS31FL3741_buffered Adafruit_IS31FL3741_ColorOrder Adafruit_IS31FL3741

Public Member Functions

 Adafruit_EyeLights_buffered (bool withCanvas=false, IS3741_order order=IS3741_BGR)
 Constructor for Adafruit_EyeLights_buffered object. More...
 
void drawPixel (int16_t x, int16_t y, uint16_t color)
 Adafruit GFX low level accessor - sets an RGB pixel value on buffered EyeLights LED matrix. No immediate effect on LEDs, must follow up with show(). More...
 
void scale ()
 Scales associated canvas (if one was requested via constructor) 1:3 with antialiasing & gamma correction. No immediate effect on LEDs; must follow up with show(). Note that this overwrites ALL pixels within the matrix area, including those shared with the rings. This is different than using normal drawing operations directly to the low-resolution matrix, where these ops are "transparent" and empty pixels don't overwrite the rings.
 
- Public Member Functions inherited from Adafruit_EyeLights_Base
 Adafruit_EyeLights_Base (bool withCanvas)
 Constructor for Adafruit_EyeLights_Base object. This is used internally by the library, not user code. More...
 
GFXcanvas16 * getCanvas (void) const
 Get pointer to GFX canvas for smooth drawing. More...
 
- Public Member Functions inherited from Adafruit_IS31FL3741_colorGFX_buffered
 Adafruit_IS31FL3741_colorGFX_buffered (uint8_t width, uint8_t height, IS3741_order order)
 Constructor for Adafruit_IS31FL3741_colorGFX_buffered object. This is used internally by the library, not user code. More...
 
void fill (uint16_t color=0)
 Sets all pixels of a buffered-and-GFX-subclassed object. Saves us implementing this in every subclass. More...
 
- Public Member Functions inherited from Adafruit_IS31FL3741_buffered
 Adafruit_IS31FL3741_buffered ()
 Constructor for buffered IS31FL3741. LED data is stored in RAM and only pushed to device when show() is explicitly called.
 
bool begin (uint8_t addr=IS3741_ADDR_DEFAULT, TwoWire *theWire=&Wire)
 Initialize I2C and IS31FL3741 hardware, clear LED buffer. More...
 
void show (void)
 Push buffered LED data from RAM to device. More...
 
uint8_t * getBuffer (void)
 Return address of LED buffer. More...
 
- Public Member Functions inherited from Adafruit_IS31FL3741
 Adafruit_IS31FL3741 ()
 Constructor for IS31FL3741 LED driver.
 
bool begin (uint8_t addr=IS3741_ADDR_DEFAULT, TwoWire *theWire=&Wire)
 Initialize I2C and IS31FL3741 hardware. More...
 
bool reset (void)
 Perform software reset, update all registers to POR values. More...
 
bool enable (bool en)
 Enable/disable output via the shutdown register bit. More...
 
bool unlock (void)
 Allows changing of command register by writing 0xC5 to 0xFE. More...
 
bool setGlobalCurrent (uint8_t current)
 Set global current-mirror from 0 (off) to 255 (brightest). More...
 
uint8_t getGlobalCurrent (void)
 Get the global current-mirror register setting. More...
 
bool setLEDscaling (uint16_t lednum, uint8_t scale)
 Set the scaling level for a single LED. More...
 
bool setLEDscaling (uint8_t scale)
 Set the scaling level for all LEDs. Optimized for fewer I2C transfers vs. setting each individually. More...
 
bool setLEDPWM (uint16_t lednum, uint8_t pwm)
 Set the PWM level for a single LED. More...
 
bool fill (uint8_t fillpwm=0)
 Set the PWM value for all LEDs - great for clearing the whole display at once. Optimized for fewer I2C transfers vs. setting each individually. More...
 
void show (void)
 Empty function makes direct & buffered code more interchangeable. Direct classes have an immediate effect when setting LED states, only buffered ones need an explicit call to show(), but it gets annoying when moving code back and forth. So this does nothing in the direct case. For code that you KNOW will always be strictly unbuffered, don't call this, it sets a bad precedent.
 
- Public Member Functions inherited from Adafruit_IS31FL3741_ColorOrder
 Adafruit_IS31FL3741_ColorOrder (IS3741_order order)
 Constructor for Adafruit_IS31FL3741_ColorOrder. More...
 

Public Attributes

Adafruit_EyeLights_Ring_buffered left_ring
 Left LED ring object.
 
Adafruit_EyeLights_Ring_buffered right_ring
 Right LED ring object.
 
- Public Attributes inherited from Adafruit_IS31FL3741_ColorOrder
uint8_t rOffset
 Index of red element within RGB triplet.
 
uint8_t gOffset
 Index of green element within RGB triplet.
 
uint8_t bOffset
 Index of blue element within RGB triplet.
 

Additional Inherited Members

- Static Public Member Functions inherited from Adafruit_IS31FL3741
static uint16_t color565 (uint8_t red, uint8_t green, uint8_t blue)
 Converter for RGB888-format color (separate) to RGB565-format. More...
 
static uint16_t color565 (uint32_t color)
 Converter for RGB888-format color (packed) to RGB565-format. More...
 
static uint32_t Color (uint8_t r, uint8_t g, uint8_t b)
 Convert separate red, green and blue values into a single "packed" 24-bit RGB color. More...
 
static uint8_t gamma8 (uint8_t x)
 An 8-bit gamma-correction function for basic pixel brightness adjustment. Makes color transitions appear more perceptially correct. More...
 
static uint32_t gamma32 (uint32_t x)
 A gamma-correction function for 32-bit packed RGB colors. Makes color transitions appear more perceptially correct. More...
 
static uint32_t ColorHSV (uint16_t hue, uint8_t sat=255, uint8_t val=255)
 Convert hue, saturation and value into a packed 32-bit RGB color that can be passed to setPixelColor() or Color565(). Swiped directly from Adafruit_NeoPixel. More...
 
- Protected Member Functions inherited from Adafruit_IS31FL3741
bool selectPage (uint8_t page)
 Select a given bank/page in the chip memory for subsequent reads/writes. More...
 
bool setLEDvalue (uint8_t first_page, uint16_t lednum, uint8_t value)
 Set either the PWM or scaling level for a single LED; used by the setLEDPWM() and setLEDscaling() functions, not directly. More...
 
bool fillTwoPages (uint8_t first_page, uint8_t value)
 Fill two pages of IS31FL3741 registers related to PWM levels or scaling; used by the fill() and setLEDscaling() functions, not directly. More...
 
- Protected Attributes inherited from Adafruit_EyeLights_Base
GFXcanvas16 * canvas = NULL
 Pointer to GFX canvas.
 
- Protected Attributes inherited from Adafruit_IS31FL3741_buffered
uint8_t ledbuf [352]
 LEDs in RAM. +1 byte is intentional, see show()
 
- Protected Attributes inherited from Adafruit_IS31FL3741
int8_t _page = -1
 Cached value of the page we're currently addressing.
 
Adafruit_I2CDevice * _i2c_dev = NULL
 Pointer to I2C device.
 

Detailed Description

Class for Adafruit EyeLights, buffered.

Constructor & Destructor Documentation

◆ Adafruit_EyeLights_buffered()

Adafruit_EyeLights_buffered::Adafruit_EyeLights_buffered ( bool  withCanvas = false,
IS3741_order  order = IS3741_BGR 
)
inline

Constructor for Adafruit_EyeLights_buffered object.

Parameters
withCanvastrue to also allocate a 3X size GFXcanvas16 object (can be used for antialiasing via the smooth() function), false for normal direct-to-matrix drawing. Default is false.
orderOne of the IS3741_order enumeration types for RGB sequence. Default is IS3741_BGR.

Member Function Documentation

◆ drawPixel()

void Adafruit_EyeLights_buffered::drawPixel ( int16_t  x,
int16_t  y,
uint16_t  color 
)

Adafruit GFX low level accessor - sets an RGB pixel value on buffered EyeLights LED matrix. No immediate effect on LEDs, must follow up with show().

Parameters
xThe x position, starting with 0 for left-most side
yThe y position, starting with 0 for top-most side
color16-bit RGB565 packed color (expands to 888 for LEDs).

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