Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. MicroPython
  3. st7789_mpy

st7789_mpy

MITC

A fast pure-C MicroPython driver for displays using the ST7789 chip, supporting ESP8266, ESP32, and STM32.

GitHubGitHub
229 stars46 forks0 contributors

What is st7789_mpy?

ST7789_mpy is a high-performance display driver for MicroPython that interfaces with ST7789-based LCD screens. It enables embedded developers to render graphics and text on low-cost displays commonly used in DIY electronics and IoT projects. The driver solves the problem of slow graphics rendering in pure Python by offering a fast, compiled C implementation.

Target Audience

Embedded systems developers and hobbyists working with MicroPython on microcontrollers like ESP8266, ESP32, or STM32 who need to add a display interface to their projects.

Value Proposition

Developers choose ST7789_mpy for its significant performance gains over pure Python drivers, its support for multiple microcontroller platforms, and its optimized graphics primitives that make it ideal for real-time embedded applications.

Overview

Fast pure-C driver for MicroPython that can handle display modules on ST7789 chip

Use Cases

Best For

  • Adding displays to MicroPython-based IoT devices
  • Building embedded systems with graphical user interfaces
  • Creating visual indicators or dashboards on ESP32/ESP8266 projects
  • Developing educational tools for microcontroller programming with displays
  • Optimizing graphics performance in resource-constrained environments
  • Interfacing with cheap 240x240 or 135x240 ST7789 LCD modules

Not Ideal For

  • Projects requiring pre-compiled MicroPython firmware without custom builds
  • Developers using microcontrollers not listed (e.g., Raspberry Pi Pico, other ARM boards)
  • Displays with resolutions other than 240x240 or 135x240 without manual offset tuning
  • ESP32 applications where maximum graphics speed is critical

Pros & Cons

Pros

Raw Graphics Speed

Written in pure C, it dramatically outperforms Python alternatives; e.g., line drawing on ESP8266 is 37.5x faster than st7789py_mpy, as shown in performance benchmarks.

Cross-Platform Hardware Support

Tested and documented for ESP8266, ESP32, and STM32, providing flexibility for various embedded projects, as evidenced by working examples in the README.

Efficient Drawing Primitives

Includes optimized hline and vline methods that minimize SPI calls, speeding up common graphics operations, as detailed in the Methods section.

Direct Buffer Manipulation

Blit_buffer function enables high-speed updates by copying byte arrays directly to display memory, useful for custom graphics or font rendering with helper functions.

Cons

Mandatory Firmware Compilation

Since it's a C module, users must compile their own MicroPython firmware, which adds setup complexity, requires build tools, and isn't plug-and-play.

ESP32 Performance Penalty

Admitted in the README, drawing operations are significantly slower on ESP32 (47 ms vs 12 ms on ESP8266 for a line), making it less ideal for performance-sensitive ESP32 apps.

Platform-Specific Configuration Hurdles

ESP32 has fixed SPI pin requirements (CLK:18, MOSI:23) and baudrate limits (max 40MHz); ESP8266 may need manual linker edits to avoid iram1_0_seg overflow.

Restricted Display Compatibility

Only officially supports 240x240 and 135x240 displays; other resolutions require non-trivial workarounds using xstart and ystart parameters, as noted in Troubleshooting.

Frequently Asked Questions

Quick Stats

Stars229
Forks46
Contributors0
Open Issues9
Last commit2 years ago
CreatedSince 2019

Tags

#c-library#spi#embedded-systems#micropython#esp32#esp8266#display-driver#embedded-graphics#st7789#stm32#micropython-driver

Built With

M
MicroPython
C
C++

Included in

MicroPython1.8k
Auto-fetched 2 hours ago

Related Projects

st7789_mpyst7789_mpy

Fast MicroPython driver for ST7789 display module written in C

Stars717
Forks136
Last commit3 months ago
micropython-ili9341micropython-ili9341

MicroPython ILI9341Display & XPT2046 Touch Screen Driver

Stars300
Forks58
Last commit1 year ago
MicroPython-ST7735MicroPython-ST7735

ST7735 TFT LCD driver for MicroPython

Stars273
Forks68
Last commit3 years ago
st7789py_mpyst7789py_mpy

Driver for 320x240, 240x240, 135x240 and 128x128 ST7789 displays written in MicroPython

Stars247
Forks69
Last commit1 year ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub