8000 Enable framebuf module and fix SSD1306 driver to work with hardware I2C · Issue #15 · adafruit/circuitpython · GitHub
[go: up one dir, main page]

Skip to content
Enable framebuf module and fix SSD1306 driver to work with hardware I2C #15
Closed
@tdicola

Description

@tdicola

We should enable the framebuf module to build in support for a framebuffer and basic font that's used by the SSD1306 (OLED wing) module. Enabling framebuf just requires adding this to the mphalconfigport.h:

#define MICROPY_PY_FRAMEBUF         (1)

However the SSD1306 driver (in drivers/display) doesn't work with SAMD21's I2C interface because it uses low level I2C start and stop bits to manually construct a transaction. This is fine for the ESP port with software I2C, but most hardware I2C interfaces don't support it so we need to do something else.

My quick thought is to expand the size of the framebuffer the SSD1306 class allocates so that it can include the extra address register byte sent before the buffer data: https://github.com/adafruit/micropython/blob/master/drivers/display/ssd1306.py#L118-L121 Then have the SSD1306 class read and write framebuffer data 1 byte shifted up so that it can blast out the framebuffer including address byte in one SPI write transaction.

Not a high priority, for now OLED feather wing support can wait for this fix.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0