Using the Adafruit_GFX fork for STM32Cube, PicoSDK and mbed
10-09-2020
Visit associated GitHub repository
Visit reference documentation page

In this guide we show how to use our Adafruit_GFX port for STM32Cube/PicoSDK/mbed to renderer menu items with tcMenu. This rendering driver for Adafruit_GFX is built into the core menu designer, meaning it's available out of the box when either mbed, PicoSDK or STM32Cube are selected.

This fork of Adafruit_GFX library supports the following displays.

  • OLED: SSD1306/SH1106 monochrome displays with a memory buffer. Both SPI and I2C are supported.
  • LTDC: STM32Cube LTDC displays with a memory mapped frame buffer.
  • Framebuffer: A general purpose framebuffer that can be specialized to other cases.

If you follow the instructions in either the PicoSDK examples, or the STM32Cube examples they include setting up this library. Given that this library is a fork of Adafruit_GFX, it is therefore nearly 100% compatible with it. As such you can consult the Adafruit_GFX library documentation if you're not familiar with the library already.

Related documentation:

Plugin and Library details

  • Library required: https://github.com/TcMenu/Adafruit-GFX-mbed-fork
  • What we've tested: STM32Cube, PicoSDK, mbed 6

Options for framebuffers such as LTDC

  • Width and height represent the width and height of the framebuffer
  • Memory location is the address in memory of the framebuffer's memory
  • Y is inverted if this property is true

Options for OLED displays such as SSD1306 and SH1106

  • Bus type - either I2C or SPI
  • Serial Bus - the bus variable of the wire type for the platform
  • Display I2C address for I2C cases
  • RESET, CS and RS pins for SPI cases
  • SPI Frequency, the frequency of the SPI bus (not always supported)
  • Text Encoding, the encoding of the text, either UTF8 or ASCII

General options for all displays

  • Rotation. The rotation of the display between 0 and 3, 0 is not rotated
  • Display variable and type. The name and type of the display variable
  • Updates per second. How many times the menu structure should be scanned for changes and redrawn if needed. TcMenu tries to minimise redraws where reasonably possible.

Back to tcMenu main page

These may be of interest

Want to let us know about something?

We use cookies to analyse traffic and to personalise content. We also embed Twitter and Youtube on some pages, these companies have their own privacy policies.

See the privacy policy and terms of use of this site should you need more information or wish to adjust your settings.