Home

Awesome

Website Rss Donate

Raspberry PI Display Library

logo image

Table of contents

Overview

  1. A C++ Library to connect electronic displays to Raspberry Pi single board computers.
  2. Dynamic install-able Raspberry Pi C++ library.
  3. 15 fonts included, new Fonts can easily be added by user
  4. Common graphics + print class included
  5. Dependency: bcm2835 Library, Provides SPI,I2C, system timer and GPIO control.
  6. Mutiple displays supported, see supported-devices, new components can be added.

Installation

  1. Install the dependency bcm2835 Library if not installed

  2. Download the Display_Lib_RPI library

    • Open a Terminal in a folder where you want to download,build & test library
    • Run following command to download latest release from github.
curl -sL https://github.com/gavinlyonsrepo/Display_Lib_RPI/archive/1.3.0.tar.gz | tar xz
  1. Run 'make' and 'sudo make install' to run the makefile to build and then install library.
    • It will be installed to usr/local/lib and usr/local/include by default.
    • You can run 'make help' here to see other make options(uninstall etc).
cd Display_Lib_RPI-1.3.0
make
sudo make install

Test

  1. Next step is to test your display and installed library with the included test example files, connect display.
  2. Enter the example folder.
  3. Enter the appropriate category sub-folder for your type of display.
  4. Edit the makefile in that folder to select the desired display and example file path. Simply edit "SRC" variable at top of the makefile. In the "User SRC directory Option Section" at top of file. Pick an example "SRC" directory path and One ONLY.
  5. Run 'make' commmand. This builds the examples file using the just installed library, and creates a test executable file in "Bin".
  6. Run 'make run' to run that built executable file. This wraps "sudo" as the bcm2835 requires root permissions by default.
  7. User should now see the test routine in that file running on the display. Run 'make help' to see other options.
cd examples
cd <your display category name path here>
make
make run

Display category name path table:

#Display category name pathDisplay types
1seven_segment_displaysLED segment displays
2color16_displays16-bit colour graphic displays
3bicolor_displays1-bit colour graphic displays
4character_displaysCharacter Displays

Documentation

Supported devices

Component nameTypeInterfaceReadme URL link
ILI934116 bit Colour Graphic TFT LCD + touchscreenSPI HW & SWReadme
ST778916 bit Colour Graphic TFT LCDSPI HW & SWReadme
ST773516 bit Colour Graphic TFT LCDSPI HW & SWReadme
ERM19264 UC1609Bi colour Graphic LCDSPI HW & SWReadme
Nokia 5110 PCD8544Bi colour Graphic LCDSPI HW & SWReadme
ERM1 CH1115Bi colour Graphic OLEDSPI HW & SWReadme
SSD1306Bi colour Graphic OLEDI2CReadme
SH1106 SH1107Bi colour Graphic OLEDI2CReadme
HD44780_PCF8574Character LCDI2CReadme
TM1638LED 7 segment display~SPI SWReadme
MAX7219LED 7 segment displaySPI HW & SWReadme

API Documentation

The application programming interface documentation is at link hosted on github pages and generated by Doxygen.

Fonts

The font system readme for the graphic displays is here at link.

Software

File system

There are 5 makefiles.

  1. Root directory, builds and installs library at a system level.
  2. Example directory (4 off) , builds a chosen example file using installed library to an executable. which can then be run. There is one makefile in each of the four categories of components in example folder.

Library naming :

  1. library name = librpidisplaygl
  2. Linker flags for complier = -lrpidisplaygl (also needs -lbcm2835 for bcm2835 library)
  3. Library File suffix = RDL
  4. Project name = Display_Lib_RPI

Basic project overview, see API documentation for more detailed diagrams :

Overview image

Tool chain

Notes and issues

  1. Will not work on Raspberry 5 at present as the bcm2835 Library dependency is not updated to work yet on Rpi5. Hopefully it will be updated soon , If it is not going to be updated, another path forward will be found.