Adafruit IS31FL3741 Library
Adafruit_IS31FL3741.h
1 #ifndef _ADAFRUIT_IS31FL3741_H_
2 #define _ADAFRUIT_IS31FL3741_H_
3 
4 #include <Adafruit_BusIO_Register.h>
5 #include <Adafruit_GFX.h>
6 #include <Adafruit_I2CDevice.h>
7 #include <Arduino.h>
8 
9 #define IS3741_ADDR_DEFAULT 0x30
10 
11 #define IS3741_COMMANDREGISTER 0xFD
12 #define IS3741_COMMANDREGISTERLOCK 0xFE
13 #define IS3741_INTMASKREGISTER 0xF0
14 #define IS3741_INTSTATUSREGISTER 0xF1
15 #define IS3741_IDREGISTER 0xFC
16 
17 #define IS3741_FUNCREG_CONFIG 0x00
18 #define IS3741_FUNCREG_GCURRENT 0x01
19 #define IS3741_FUNCREG_RESET 0x3F
20 
21 // RGB pixel color order permutations
22 typedef enum {
23  // Offset: R G B
24  IS3741_RGB = ((0 << 4) | (1 << 2) | (2)), // Encode as R,G,B
25  IS3741_RBG = ((0 << 4) | (2 << 2) | (1)), // Encode as R,B,G
26  IS3741_GRB = ((1 << 4) | (0 << 2) | (2)), // Encode as G,R,B
27  IS3741_GBR = ((2 << 4) | (0 << 2) | (1)), // Encode as G,B,R
28  IS3741_BRG = ((1 << 4) | (2 << 2) | (0)), // Encode as B,R,G
29  IS3741_BGR = ((2 << 4) | (1 << 2) | (0)), // Encode as B,G,R
30 } IS3741_order;
31 
32 // 8-bit gamma correction table for the gamma8() and gamma32() funcs.
33 static const uint8_t PROGMEM _IS31GammaTable[256] = {
34  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
35  0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
36  1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3,
37  3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6,
38  6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10,
39  11, 11, 11, 12, 12, 13, 13, 13, 14, 14, 15, 15, 16, 16, 17,
40  17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 24, 24, 25,
41  25, 26, 27, 27, 28, 29, 29, 30, 31, 31, 32, 33, 34, 34, 35,
42  36, 37, 38, 38, 39, 40, 41, 42, 42, 43, 44, 45, 46, 47, 48,
43  49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
44  64, 65, 66, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 80, 81,
45  82, 84, 85, 86, 88, 89, 90, 92, 93, 94, 96, 97, 99, 100, 102,
46  103, 105, 106, 108, 109, 111, 112, 114, 115, 117, 119, 120, 122, 124, 125,
47  127, 129, 130, 132, 134, 136, 137, 139, 141, 143, 145, 146, 148, 150, 152,
48  154, 156, 158, 160, 162, 164, 166, 168, 170, 172, 174, 176, 178, 180, 182,
49  184, 186, 188, 191, 193, 195, 197, 199, 202, 204, 206, 209, 211, 213, 215,
50  218, 220, 223, 225, 227, 230, 232, 235, 237, 240, 242, 245, 247, 250, 252,
51  255};
52 
53 // BASE IS31 CLASSES -------------------------------------------------------
54 
55 /**************************************************************************/
63 /**************************************************************************/
65 public:
70  bool begin(uint8_t addr = IS3741_ADDR_DEFAULT, TwoWire *theWire = &Wire);
71  bool reset(void);
72  bool enable(bool en);
73 
74  bool unlock(void);
75 
76  bool setGlobalCurrent(uint8_t current);
77  uint8_t getGlobalCurrent(void);
78 
79  bool setLEDscaling(uint16_t lednum, uint8_t scale);
80  bool setLEDscaling(uint8_t scale);
81 
82  bool setLEDPWM(uint16_t lednum, uint8_t pwm);
83  bool fill(uint8_t fillpwm = 0);
84 
93  inline void show(void) {}
94 
95  // Although Adafruit_IS31FL3741 itself has no concept of color, most of
96  // its subclasses do. These color-related operations go here so that all
97  // subclasses have access. Any 'packed' 24-bit colors received or returned
98  // by these functions are always in 0xRRGGBB order; RGB reordering for
99  // specific devices takes place elsewhere, in subclasses.
100 
114  static uint16_t color565(uint8_t red, uint8_t green, uint8_t blue) {
115  return ((red & 0xF8) << 8) | ((green & 0xFC) << 3) | (blue >> 3);
116  }
117 
124  static uint16_t color565(uint32_t color) {
125  return ((color >> 8) & 0xF800) | ((color >> 5) & 0x07E0) |
126  ((color >> 3) & 0x001F);
127  }
128 
140  static uint32_t Color(uint8_t r, uint8_t g, uint8_t b) {
141  return ((uint32_t)r << 16) | ((uint32_t)g << 8) | b;
142  }
143 
156  static uint8_t gamma8(uint8_t x) {
157  return pgm_read_byte(&_IS31GammaTable[x]); // 0-255 in, 0-255 out
158  }
159 
160  // These are documented in .cpp file:
161  static uint32_t gamma32(uint32_t x);
162  static uint32_t ColorHSV(uint16_t hue, uint8_t sat = 255, uint8_t val = 255);
163 
164 protected:
165  bool selectPage(uint8_t page);
166  bool setLEDvalue(uint8_t first_page, uint16_t lednum, uint8_t value);
167  bool fillTwoPages(uint8_t first_page, uint8_t value);
168 
169  int8_t _page = -1;
170  Adafruit_I2CDevice *_i2c_dev = NULL;
171 };
172 
173 /**************************************************************************/
182 /**************************************************************************/
184 public:
186  bool begin(uint8_t addr = IS3741_ADDR_DEFAULT, TwoWire *theWire = &Wire);
187  void show(void); // DON'T const this
192  uint8_t *getBuffer(void) { return &ledbuf[1]; } // See notes in show()
193 protected:
194  uint8_t ledbuf[352];
195 };
196 
197 // INTERMEDIARY CLASSES FOR COLORS AND GFX ---------------------------------
198 
199 /**************************************************************************/
207 /**************************************************************************/
209 public:
214  Adafruit_IS31FL3741_ColorOrder(IS3741_order order)
215  : rOffset((order >> 4) & 3), gOffset((order >> 2) & 3),
216  bOffset(order & 3) {}
217  uint8_t rOffset;
218  uint8_t gOffset;
219  uint8_t bOffset;
220 };
221 
222 /**************************************************************************/
231 /**************************************************************************/
234  public Adafruit_GFX {
235 public:
243  Adafruit_IS31FL3741_colorGFX(uint8_t width, uint8_t height,
244  IS3741_order order);
245  // Overload the base (monochrome) fill() with a GFX RGB565-style color.
246  void fill(uint16_t color = 0);
247 };
248 
249 /**************************************************************************/
257 /**************************************************************************/
261  public Adafruit_GFX {
262 public:
270  Adafruit_IS31FL3741_colorGFX_buffered(uint8_t width, uint8_t height,
271  IS3741_order order);
272  // Overload the base (monochrome) fill() with a GFX RGB565-style color.
273  void fill(uint16_t color = 0);
274 };
275 
276 /* =======================================================================
277  So, IN PRINCIPLE, additional classes Adafruit_IS31FL3741_monoGFX and
278  Adafruit_IS31FL3741_monoGFX_buffered could go here for hypothetical
279  single-color "grayscale" matrices -- they'd be similar to the two
280  colorGFX classes above, but without inheriting ColorOrder. Since no
281  actual hardware along such lines currently exists, they are not
282  implemented, but this is where they'd be. I've got deadlines.
283 
284  Now we'll build on the classes above to create specific LED board
285  varieties. These "complete" items are then instantiated in user code.
286  There are two of each -- a direct (unbuffered) and buffered version.
287  It's done this way (rather than a single class with a buffer flag) to
288  avoid dynamic allocation -- object & buffer just go on heap or stack
289  as needed (the optional canvas in glasses is an exception).
290  =======================================================================*/
291 
292 /**************************************************************************/
297 /**************************************************************************/
299 public:
306  Adafruit_IS31FL3741_EVB(IS3741_order order = IS3741_BGR)
307  : Adafruit_IS31FL3741_colorGFX(9, 13, order) {}
308  void drawPixel(int16_t x, int16_t y, uint16_t color);
309 };
310 
311 /**************************************************************************/
315 /**************************************************************************/
318 public:
325  Adafruit_IS31FL3741_EVB_buffered(IS3741_order order = IS3741_BGR)
326  : Adafruit_IS31FL3741_colorGFX_buffered(9, 13, order) {}
327  void drawPixel(int16_t x, int16_t y, uint16_t color);
328 };
329 
330 /**************************************************************************/
335 /**************************************************************************/
337 public:
344  Adafruit_IS31FL3741_QT(IS3741_order order = IS3741_BGR)
345  : Adafruit_IS31FL3741_colorGFX(13, 9, order) {}
346  void drawPixel(int16_t x, int16_t y, uint16_t color);
347 };
348 
349 /**************************************************************************/
353 /**************************************************************************/
356 public:
362  Adafruit_IS31FL3741_QT_buffered(IS3741_order order = IS3741_BGR)
363  : Adafruit_IS31FL3741_colorGFX_buffered(13, 9, order) {}
364  void drawPixel(int16_t x, int16_t y, uint16_t color);
365 };
366 
367 /* =======================================================================
368  This is the newer and simpler way (to the user) of using Adafruit
369  EyeLights LED glasses. Declaring an EyeLights object (direct or
370  buffered) gets you the matrix and rings automatically; no need to
371  instantiate as separate objects, nor does one need to explicitly
372  declare a base Adafruit_IS31FL3741 object and pass it in. Internally
373  the code has a few more layers but the user doesn't need to see that.
374  =======================================================================*/
375 
376 /**************************************************************************/
381 /**************************************************************************/
383 public:
384  Adafruit_EyeLights_Ring_Base(void *parent, bool isRight);
389  uint8_t numPixels(void) const { return 24; }
397  void setBrightness(uint8_t b) { _brightness = b + 1; }
398 
399 protected:
400  uint16_t _brightness = 256;
401  void *parent;
402  const uint16_t *ring_map;
403 };
404 
405 /**************************************************************************/
409 /**************************************************************************/
411 public:
418  Adafruit_EyeLights_Ring(void *parent, bool isRight)
419  : Adafruit_EyeLights_Ring_Base(parent, isRight) {}
420  void setPixelColor(int16_t n, uint32_t color);
421  void setPixelColor(int16_t n, uint8_t t, uint8_t g, uint8_t b);
422  void fill(uint32_t color);
423  void fill(uint8_t r, uint8_t g, uint8_t b);
424 };
425 
426 /**************************************************************************/
430 /**************************************************************************/
432 public:
439  Adafruit_EyeLights_Ring_buffered(void *parent, bool isRight)
440  : Adafruit_EyeLights_Ring_Base(parent, isRight) {}
441  void setPixelColor(int16_t n, uint32_t color);
442  void setPixelColor(int16_t n, uint8_t r, uint8_t g, uint8_t b);
443  void fill(uint32_t color);
444  void fill(uint8_t r, uint8_t g, uint8_t b);
445 };
446 
447 /**************************************************************************/
452 /**************************************************************************/
454 public:
462  Adafruit_EyeLights_Base(bool withCanvas) {
463  if (withCanvas)
464  canvas = new GFXcanvas16(18 * 3, 5 * 3);
465  }
470  GFXcanvas16 *getCanvas(void) const { return canvas; }
471 
472 protected:
473  GFXcanvas16 *canvas = NULL;
474 };
475 
476 /**************************************************************************/
480 /**************************************************************************/
483 public:
493  Adafruit_EyeLights(bool withCanvas = false, IS3741_order order = IS3741_BGR)
494  : Adafruit_EyeLights_Base(withCanvas),
495  Adafruit_IS31FL3741_colorGFX(18, 5, order), left_ring(this, false),
496  right_ring(this, true) {}
497  void drawPixel(int16_t x, int16_t y, uint16_t color);
498  void scale();
501 };
502 
503 /**************************************************************************/
507 /**************************************************************************/
509  : public Adafruit_EyeLights_Base,
511 public:
521  Adafruit_EyeLights_buffered(bool withCanvas = false,
522  IS3741_order order = IS3741_BGR)
523  : Adafruit_EyeLights_Base(withCanvas),
525  left_ring(this, false), right_ring(this, true) {}
526  void drawPixel(int16_t x, int16_t y, uint16_t color);
527  void scale();
530 };
531 
532 /* =======================================================================
533  This is the older (likely deprecated) way of using Adafruit EyeLights.
534  It requires a few extra steps of the user for object declarations, and
535  doesn't handle different RGB color orders.
536  =======================================================================*/
537 
538 /**************************************************************************/
544 /**************************************************************************/
545 class Adafruit_IS31FL3741_GlassesMatrix : public Adafruit_GFX {
546 public:
552  : Adafruit_GFX(18, 5), _is31(controller) {}
553  void drawPixel(int16_t x, int16_t y, uint16_t color);
554 
555 protected:
556  Adafruit_IS31FL3741 *_is31 = NULL;
557 };
558 
559 /**************************************************************************/
567 /**************************************************************************/
569 public:
571  bool isRight);
572  void setPixelColor(int16_t n, uint32_t color);
573  void fill(uint32_t color);
578  uint8_t numPixels(void) const { return 24; }
586  void setBrightness(uint8_t b) { _brightness = b + 1; }
587 
588 protected:
589  Adafruit_IS31FL3741 *_is31 = NULL;
590  uint16_t _brightness = 256;
591  const uint16_t *ring_map;
592 };
593 
594 /**************************************************************************/
600 /**************************************************************************/
603 public:
609  : Adafruit_IS31FL3741_GlassesRing(controller, false) {}
610 };
611 
612 /**************************************************************************/
618 /**************************************************************************/
621 public:
627  : Adafruit_IS31FL3741_GlassesRing(controller, true) {}
628 };
629 
630 /**************************************************************************/
638 /**************************************************************************/
639 class Adafruit_IS31FL3741_GlassesMatrix_buffered : public Adafruit_GFX {
640 public:
642  Adafruit_IS31FL3741_buffered *controller = NULL, bool withCanvas = false);
643  void drawPixel(int16_t x, int16_t y, uint16_t color);
644  void scale();
649  GFXcanvas16 *getCanvas(void) const { return canvas; }
650 
651 protected:
653  GFXcanvas16 *canvas = NULL;
654 };
655 
656 /**************************************************************************/
665 /**************************************************************************/
667 public:
669  Adafruit_IS31FL3741_buffered *controller, bool isRight);
670  void setPixelColor(int16_t n, uint32_t color);
671  void fill(uint32_t color);
676  uint8_t numPixels(void) const { return 24; }
684  void setBrightness(uint8_t b) { _brightness = b + 1; }
685 
686 protected:
688  uint16_t _brightness = 256;
689  const uint16_t *ring_map;
690 };
691 
692 /**************************************************************************/
700 /**************************************************************************/
703 public:
709  Adafruit_IS31FL3741_buffered *controller)
710  : Adafruit_IS31FL3741_GlassesRing_buffered(controller, false) {}
711 };
712 
713 /**************************************************************************/
721 /**************************************************************************/
724 public:
730  Adafruit_IS31FL3741_buffered *controller)
731  : Adafruit_IS31FL3741_GlassesRing_buffered(controller, true) {}
732 };
733 
734 #endif // _ADAFRUIT_IS31FL3741_H_
Adafruit_IS31FL3741()
Constructor for IS31FL3741 LED driver.
Definition: Adafruit_IS31FL3741.h:69
uint8_t numPixels(void) const
Return number of LEDs in ring (a la NeoPixel)
Definition: Adafruit_IS31FL3741.h:389
Adafruit_IS31FL3741_EVB_buffered(IS3741_order order=IS3741_BGR)
Constructor for Lumissil IS31FL3741 OEM evaluation board, 13x9 pixels, buffered.
Definition: Adafruit_IS31FL3741.h:325
bool unlock(void)
Allows changing of command register by writing 0xC5 to 0xFE.
Definition: Adafruit_IS31FL3741.cpp:152
void setBrightness(uint8_t b)
Set brightness of LED ring. This is a mathematical brightness scale applied to setPixel() colors when...
Definition: Adafruit_IS31FL3741.h:397
bool selectPage(uint8_t page)
Select a given bank/page in the chip memory for subsequent reads/writes.
Definition: Adafruit_IS31FL3741.cpp:167
Base class for EyeLights LED glasses. Holds a few items that are common to direct or buffered instanc...
Definition: Adafruit_IS31FL3741.h:453
const uint16_t * ring_map
Pointer to LED index lookup table.
Definition: Adafruit_IS31FL3741.h:402
Class for Lumissil IS31FL3741 LED driver. This is the base class upon which the rest of this code bui...
Definition: Adafruit_IS31FL3741.h:64
Class for Adafruit LED Glasses (matrix portion) with LED data being buffered on the microcontroller a...
Definition: Adafruit_IS31FL3741.h:639
uint8_t getGlobalCurrent(void)
Get the global current-mirror register setting.
Definition: Adafruit_IS31FL3741.cpp:139
Adafruit_IS31FL3741_ColorOrder(IS3741_order order)
Constructor for Adafruit_IS31FL3741_ColorOrder.
Definition: Adafruit_IS31FL3741.h:214
Adafruit_EyeLights(bool withCanvas=false, IS3741_order order=IS3741_BGR)
Constructor for Adafruit_EyeLights object.
Definition: Adafruit_IS31FL3741.h:493
Adafruit_IS31FL3741_EVB(IS3741_order order=IS3741_BGR)
Constructor for Lumissil IS31FL3741 OEM evaluation board, 13x9 pixels, direct (unbuffered).
Definition: Adafruit_IS31FL3741.h:306
Class for buffered EyeLights LED ring, left or right.
Definition: Adafruit_IS31FL3741.h:431
const uint16_t * ring_map
Pointer to lookup table.
Definition: Adafruit_IS31FL3741.h:689
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(...
Definition: Adafruit_IS31FL3741.cpp:333
Class for a "buffered" Lumissil IS31FL3741 LED driver – LED PWM state is staged in RAM (requiring 35...
Definition: Adafruit_IS31FL3741.h:183
Adafruit_EyeLights_Ring right_ring
Right LED ring object.
Definition: Adafruit_IS31FL3741.h:500
bool reset(void)
Perform software reset, update all registers to POR values.
Definition: Adafruit_IS31FL3741.cpp:96
Class for Lumissil IS31FL3741 Glasses (left ring) with LED data being buffered on the microcontroller...
Definition: Adafruit_IS31FL3741.h:701
void setBrightness(uint8_t b)
Set brightness of LED ring. This is a mathematical brightness scale applied to setPixel() colors when...
Definition: Adafruit_IS31FL3741.h:586
bool begin(uint8_t addr=IS3741_ADDR_DEFAULT, TwoWire *theWire=&Wire)
Initialize I2C and IS31FL3741 hardware.
Definition: Adafruit_IS31FL3741.cpp:71
Class for Adafruit LED Glasses (ring portion). Not used by user code directly, the left and right cla...
Definition: Adafruit_IS31FL3741.h:568
uint8_t rOffset
Index of red element within RGB triplet.
Definition: Adafruit_IS31FL3741.h:217
Adafruit_EyeLights_Ring left_ring
Left LED ring object.
Definition: Adafruit_IS31FL3741.h:499
Class for Adafruit EyeLights, buffered.
Definition: Adafruit_IS31FL3741.h:508
Class for Adafruit EyeLights, direct (unbuffered).
Definition: Adafruit_IS31FL3741.h:481
Adafruit_IS31FL3741_GlassesRightRing(Adafruit_IS31FL3741 *controller)
Constructor for glasses right LED ring.
Definition: Adafruit_IS31FL3741.h:626
Adafruit_IS31FL3741_buffered * _is31
Pointer to core object.
Definition: Adafruit_IS31FL3741.h:652
Adafruit_IS31FL3741_GlassesLeftRing(Adafruit_IS31FL3741 *controller)
Constructor for glasses left LED ring.
Definition: Adafruit_IS31FL3741.h:608
Adafruit_EyeLights_Ring_buffered right_ring
Right LED ring object.
Definition: Adafruit_IS31FL3741.h:529
Class for IS31FL3741 Adafruit STEMMA QT board, direct (unbuffered).
Definition: Adafruit_IS31FL3741.h:336
GFXcanvas16 * getCanvas(void) const
Get pointer to GFX canvas for smooth drawing.
Definition: Adafruit_IS31FL3741.h:649
Class for Adafruit LED Glasses (left ring).
Definition: Adafruit_IS31FL3741.h:601
bool setLEDscaling(uint16_t lednum, uint8_t scale)
Set the scaling level for a single LED.
Definition: Adafruit_IS31FL3741.cpp:266
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 setLE...
Definition: Adafruit_IS31FL3741.cpp:225
bool setLEDPWM(uint16_t lednum, uint8_t pwm)
Set the PWM level for a single LED.
Definition: Adafruit_IS31FL3741.cpp:294
uint8_t bOffset
Index of blue element within RGB triplet.
Definition: Adafruit_IS31FL3741.h:219
Class for IS31FL3741 Adafruit STEMMA QT board, buffered.
Definition: Adafruit_IS31FL3741.h:354
Adafruit_IS31FL3741_QT_buffered(IS3741_order order=IS3741_BGR)
Constructor for STEMMA QT version (13 x 9 LEDs), buffered.
Definition: Adafruit_IS31FL3741.h:362
const uint16_t * ring_map
Pointer to lookup table.
Definition: Adafruit_IS31FL3741.h:591
void setBrightness(uint8_t b)
Set brightness of LED ring. This is a mathematical brightness scale applied to setPixel() colors when...
Definition: Adafruit_IS31FL3741.h:684
uint8_t numPixels(void) const
Return number of LEDs in ring (a la NeoPixel)
Definition: Adafruit_IS31FL3741.h:578
GFXcanvas16 * getCanvas(void) const
Get pointer to GFX canvas for smooth drawing.
Definition: Adafruit_IS31FL3741.h:470
Adafruit_EyeLights_buffered(bool withCanvas=false, IS3741_order order=IS3741_BGR)
Constructor for Adafruit_EyeLights_buffered object.
Definition: Adafruit_IS31FL3741.h:521
Adafruit_IS31FL3741_QT(IS3741_order order=IS3741_BGR)
Constructor for STEMMA QT version (13 x 9 LEDs), direct (unbuffered).
Definition: Adafruit_IS31FL3741.h:344
Class for Adafruit LED Glasses (right ring) with LED data being buffered on the microcontroller and s...
Definition: Adafruit_IS31FL3741.h:722
Adafruit_I2CDevice * _i2c_dev
Pointer to I2C device.
Definition: Adafruit_IS31FL3741.h:170
void * parent
Pointer back to EyeLights object.
Definition: Adafruit_IS31FL3741.h:401
uint8_t numPixels(void) const
Return number of LEDs in ring (a la NeoPixel)
Definition: Adafruit_IS31FL3741.h:676
Class for specifying RGB byte sequence order when above classes are used with RGB LEDs...
Definition: Adafruit_IS31FL3741.h:208
Adafruit_EyeLights_Ring(void *parent, bool isRight)
Constructor for one of the EyeLights ring objects (direct, unbuffered). Used internally by the librar...
Definition: Adafruit_IS31FL3741.h:418
Base class for EyeLights LED ring. Holds a few items that are common to direct or buffered instances...
Definition: Adafruit_IS31FL3741.h:382
static uint16_t color565(uint32_t color)
Converter for RGB888-format color (packed) to RGB565-format.
Definition: Adafruit_IS31FL3741.h:124
Class for Lumissil IS31FL3741 OEM evaluation board, direct (unbuffered).
Definition: Adafruit_IS31FL3741.h:298
Class for Adafruit LED Glasses (matrix portion).
Definition: Adafruit_IS31FL3741.h:545
static uint32_t gamma32(uint32_t x)
A gamma-correction function for 32-bit packed RGB colors. Makes color transitions appear more percept...
Definition: Adafruit_IS31FL3741.cpp:422
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.
Definition: Adafruit_IS31FL3741.h:140
Adafruit_EyeLights_Base(bool withCanvas)
Constructor for Adafruit_EyeLights_Base object. This is used internally by the library, not user code.
Definition: Adafruit_IS31FL3741.h:462
Class for direct (unbuffered) EyeLights LED ring, left or right.
Definition: Adafruit_IS31FL3741.h:410
Adafruit_EyeLights_Ring_buffered left_ring
Left LED ring object.
Definition: Adafruit_IS31FL3741.h:528
static uint8_t gamma8(uint8_t x)
An 8-bit gamma-correction function for basic pixel brightness adjustment. Makes color transitions app...
Definition: Adafruit_IS31FL3741.h:156
Class encapsulating a buffered IS31FL3741, ColorOrder and GFX all in one – mostly so a common fill()...
Definition: Adafruit_IS31FL3741.h:258
Adafruit_IS31FL3741_GlassesRightRing_buffered(Adafruit_IS31FL3741_buffered *controller)
Constructor for buffered glasses right LED ring.
Definition: Adafruit_IS31FL3741.h:729
bool fill(uint8_t fillpwm=0)
Set the PWM value for all LEDs - great for clearing the whole display at once. Optimized for fewer I2...
Definition: Adafruit_IS31FL3741.cpp:307
Class for Adafruit LED Glasses (right ring).
Definition: Adafruit_IS31FL3741.h:619
Class for Lumissil IS31FL3741 OEM evaluation board, buffered.
Definition: Adafruit_IS31FL3741.h:316
Adafruit_IS31FL3741_GlassesLeftRing_buffered(Adafruit_IS31FL3741_buffered *controller)
Constructor for buffered glasses left LED ring.
Definition: Adafruit_IS31FL3741.h:708
Adafruit_EyeLights_Ring_buffered(void *parent, bool isRight)
Constructor for one of the EyeLights ring objects (buffered). Used internally by the library...
Definition: Adafruit_IS31FL3741.h:439
Class encapsulating a direct (unbuffered) IS31FL3741, ColorOrder and GFX all in one – mostly so a co...
Definition: Adafruit_IS31FL3741.h:232
bool enable(bool en)
Enable/disable output via the shutdown register bit.
Definition: Adafruit_IS31FL3741.cpp:110
Class for Adafruit LED Glasses (ring portion) with LED data being buffered on the microcontroller and...
Definition: Adafruit_IS31FL3741.h:666
uint8_t * getBuffer(void)
Return address of LED buffer.
Definition: Adafruit_IS31FL3741.h:192
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() fun...
Definition: Adafruit_IS31FL3741.cpp:197
uint8_t gOffset
Index of green element within RGB triplet.
Definition: Adafruit_IS31FL3741.h:218
void show(void)
Empty function makes direct & buffered code more interchangeable. Direct classes have an immediate effect...
Definition: Adafruit_IS31FL3741.h:93
int8_t _page
Cached value of the page we&#39;re currently addressing.
Definition: Adafruit_IS31FL3741.h:169
Adafruit_IS31FL3741_GlassesMatrix(Adafruit_IS31FL3741 *controller)
Constructor for LED glasses (matrix portion, 18x5 LEDs)
Definition: Adafruit_IS31FL3741.h:551
bool setGlobalCurrent(uint8_t current)
Set global current-mirror from 0 (off) to 255 (brightest).
Definition: Adafruit_IS31FL3741.cpp:126
static uint16_t color565(uint8_t red, uint8_t green, uint8_t blue)
Converter for RGB888-format color (separate) to RGB565-format.
Definition: Adafruit_IS31FL3741.h:114