is31fl3741 – Creates an in-memory framebuffer for a IS31FL3741 device.

Available on these boards
  • Adafruit LED Glasses Driver nRF52840

class is31fl3741.IS31FL3741_FrameBuffer(is31: IS31FL3741, width: int, height: int, mapping: Tuple[int, Ellipsis], *, framebuffer: Optional[circuitpython_typing.WriteableBuffer] = None, scale: bool = False, gamma: bool = False)

Create a IS31FL3741_FrameBuffer object with the given attributes.

The framebuffer is in “RGB888” format using 4 bytes per pixel. Bits 24-31 are ignored. The format is in RGB order.

If a framebuffer is not passed in, one is allocated and initialized to all black. In any case, the framebuffer can be retrieved by passing the Is31fl3741 object to memoryview().

A Is31fl3741 is often used in conjunction with a framebufferio.FramebufferDisplay.

Parameters
  • is31 (is31fl3741.IS31FL3741) – base IS31FL3741 instance to drive the framebuffer

  • width (int) – width of the display

  • height (int) – height of the display

  • mapping (Tuple[int, ...]) – mapping of matrix locations to LEDs

  • framebuffer (Optional[WriteableBuffer]) – Optional buffer to hold the display

  • scale (bool) – if True display is scaled down by 3 when displayed

  • gamma (bool) – if True apply gamma correction to all LEDs

brightness :float

In the current implementation, 0.0 turns the display off entirely and any other value up to 1.0 turns the display on fully.

width :int

The width of the display, in pixels

height :int

The height of the display, in pixels

deinit(self) None

Free the resources associated with this IS31FL3741 instance. After deinitialization, no further operations may be performed.

refresh(self) None

Transmits the color data in the buffer to the pixels so that they are shown.

class is31fl3741.IS31FL3741(i2c: busio.I2C, *, addr: int = 48)

Driver for an IS31FL3741 device.

Create a IS31FL3741 object with the given attributes.

Designed to work low level or passed to and object such as IS31FL3741_FrameBuffer.

Parameters
  • i2c (I2C) – I2C bus the IS31FL3741 is on

  • addr (int) – device address

deinit(self) None

Free the resources associated with this IS31FL3741 instance. After deinitialization, no further operations may be performed.

is31fl3741.reset(self) None

Resets the IS31FL3741 chip.

is31fl3741.enable(self) None

Enables the IS31FL3741 chip.

is31fl3741.set_global_current(self, current: int) None

Sets the global current of the IS31FL3741 chip.

Parameters

current (int) – global current value 0x00 to 0xFF

is31fl3741.set_led(self, led: int, value: int, page: int) None

Resets the IS31FL3741 chip.

Parameters
  • led (int) – which LED to set

  • value (int) – value to set the LED to 0x00 to 0xFF

  • page (int) – page to write to 0 or 2. If the LED is a >= 180 the routine will automatically write to page 1 or 3 (instead of 0 or 2)

is31fl3741.write(mapping: Tuple[int, Ellipsis], buf: circuitpython_typing.ReadableBuffer) None

Write buf out on the I2C bus to the IS31FL3741.

Parameters
  • mapping (~Tuple[int, ...]) – map the pixels in the buffer to the order addressed by the driver chip

  • buf (ReadableBuffer) – The bytes to clock out. No assumption is made about color order