Giter Site home page Giter Site logo

arduino_gfx's Introduction

Arduino_GFX

Arduino_GFX is a Arduino graphics library supporting various displays with various data bus interfaces.

This library start rewrite from Adafruit_GFX, LovyanGFX, TFT_eSPI, Ucglib, and more...

GitHub release (latest by date) GitHub Release Date GitHub commits since latest release (by date) GitHub last commit

GitHub Sponsors Twitter Follow

Various data bus interfaces

Arduino_GFX utilize Arduino Built-in SPI class to support 8-bit SPI for most platform.

Most tiny display in hobbiest electronics world support 8-bit SPI. But some requires 9-bit SPI. Arduino_GFX should be the first Arduino display library that can use ESP32 SPI to support 9-bit hardware SPI. 9-bit hardware SPI is important to support the displays that require 9-bit SPI interface. (e.g. HX8357B, ...)

Larger display most likely not support standalone SPI since it is not fast enough to refresh the full screen details. Most of them support 8-bit/16-bit Parallel interface.

Some larger display requires 3-bit SPI + RGB combo interface, i.e. requires more than 3 + 24 pins. Most dev board have not enough GPIO to support this. Arduino_GFX will finally support this combo interface but will be in very low priority. Huge monthly donation may make it happen :P

Ease of use

Simple Declaration

(not require touch the header files in libraries folder)

#include <Arduino_GFX_Library.h>
Arduino_DataBus *bus = new Arduino_HWSPI(16 /* DC */, 5 /* CS */);
Arduino_GFX *gfx = new Arduino_ILI9341(bus, 17 /* RST */);

And Simple Usage

gfx->begin();
gfx->fillScreen(BLACK);
gfx->setCursor(10, 10);
gfx->setTextColor(RED);
gfx->println("Hello World!");

Performance

This library is not putting speed at the first priority, but still paid much effort to make the display look smooth.

Figures

Below are some figures compare with other 3 Arduino common display libraries.

  • Arduino IDE: 1.8.15
  • arduino-esp32: 1.0.6
  • Dev Board: TTGO T8 v1.8
  • PSRAM: disable
  • Display: ILI9341
  • Interface: SPI
  • SPI Frequency: 40MHz
  • Test time: 2021 Jun 16
Benchmark Adafruit_GFX Arduino_GFX Lovyan_GFX TFT_eSPI
Screen fill 195,782 160,094 154,341 155,938
Text 97,662 18,960 22,473 21,752
Pixels 1,365,211 903,549 867,702 775,781
Lines 1,062,311 412,026 269,060 264,950
Horiz/Vert Lines 17,637 14,197 13,692 13,833
Rectangles-filled 406,817 332,696 320,761 323,908
Rectangles 11,641 9,254 8,545 8,714
Triangles-filled 150,941 118,010 105,661 109,675
Triangles 58,843 23,570 15,884 16,277
Circles-filled 76,739 52,170 42,787 45,827
Circles 118,125 40,955 25,959 25,269
Arcs-filled N/A 33,381 21,546 N/A
Arcs N/A 66,054 47,901 N/A
Rounded rects-fill 408,534 338,136 318,882 323,189
Rounded rects 43,185 21,562 13,089 15,371

Why Run Fast?

  • No read operation. Since not all display provide read back graphic memories API, Arduino_GFX skip all read operations. It can reduce the library size footprint and sometimes reduce the operation time.
  • Tailor-made data bus classes. Arduino_GFX decouple data bus operation from display driver, it is more easy to write individual data bus class for each platform.

Currently Supported data bus [Wiki]

  • 8-bit and 9-bit hardware SPI (ESP32SPI)
  • 8-bit hardware SPI (HWSPI, ESP8266SPI, mbedSPI, NRFXSPI, RPiPicoSPI)
  • 8-bit and 9-bit software SPI (SWSPI)
  • 8-bit parallel interface (AVRPAR8, ESP32PAR8, ESP32S2PAR8, RPiPicoPAR8, RTLPAR8)
  • 16-bit parallel interface (ESP32PAR16, ESP32S2PAR8, RPiPicoPAR16)

Tobe Support data bus (Donation can make it happen)

  • ESP32 I2S 8-bit/16-bit parallel interface
  • FastLED

Currently Supported Dev Board

  • Ameba RTL8722DM Board (AMB 21)
  • Ameba RTL8722DM MINI Board (AMB 23)
  • Arduino Nano
  • Arduino Nano BLE 33
  • Arduino Pro Micro
  • ESP8266 Series
  • ESP32 Series
  • ESP32-C3 Series
  • ESP32-S2 Series
  • Raspberry Pi Pico
  • rtlduino BW16 (by Ai-Thinker)
  • Sony Spresense
  • WeAct BlackPill V2.0 (BlackPill F411CE)

Tobe Support Dev Board (Donation can make it happen)

  • Arduino ATMega2560
  • ESP32-S3 Series

Currently Supported Dev Device [Wiki]

  • ESP32 LCDKIT
  • Makerfabs ESP32 3.5" TFT Touch with Camera
  • TTGO T-DISPLAY
  • wireless-tag WT-32-SC01
  • Wio Terminal
  • M5Stack Core Family
  • Odroid Go
  • TTGO T-Watch

Currently Supported Display [Wiki]

Tobe Support Display (Donation can make it happen)

  • FastLED Martix supported by co-operate with Canvas
  • Mono display supported by co-operate with Canvas
  • Multi-color e-ink display supported by co-operate with Canvas

Canvas (framebuffer) [Wiki]

  • Canvas (16-bit pixel)
  • Canvas_Indexed (half memory space)
  • Canvas_3bit (1/4 memory space framebuffer)
  • Canvas_Mono (1/16 memory space framebuffer)

Using source code come from:

arduino_gfx's People

Contributors

dl9rdz avatar moononournation avatar pkendall64 avatar shridattdudhat avatar xidameng avatar

Forkers

cameloah

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.