- Project Name: Display_Lib_RPI
- Author: Gavin Lyons.
- Description:
- A C++ Library to connect electronic displays to Raspberry Pi single board computers.
- Dynamic install-able Raspberry Pi C++ library.
- 15 fonts included, new Fonts can easily be added by user
- Common graphics + print class included
- Dependency: bcm2835 Library, Provides SPI,I2C, system timer and GPIO control.
- Mutiple displays supported, see supported-devices, new components can be added.
-
Install the dependency bcm2835 Library if not installed
- Install the C libraries of bcm2835, Installation instructions here
-
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
- 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
- Next step is to test your display and installed library with the included test example files, connect display.
- Enter the example folder.
- Enter the appropriate category sub-folder for your type of display.
- 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.
- Run 'make' commmand. This builds the examples file using the just installed library, and creates a test executable file in "Bin".
- Run 'make run' to run that built executable file. This wraps "sudo" as the bcm2835 requires root permissions by default.
- 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 path | Display types |
---|---|---|
1 | seven_segment_displays | LED segment displays |
2 | color16_displays | 16-bit colour graphic displays |
3 | bicolor_displays | 1-bit colour graphic displays |
4 | character_displays | Character Displays |
Component name | Type | Interface | Readme URL link |
---|---|---|---|
ILI9341 | 16 bit Colour Graphic TFT LCD + touchscreen | SPI HW & SW | Readme |
ST7789 | 16 bit Colour Graphic TFT LCD | SPI HW & SW | Readme |
ST7735 | 16 bit Colour Graphic TFT LCD | SPI HW & SW | Readme |
ERM19264 UC1609 | Bi colour Graphic LCD | SPI HW & SW | Readme |
Nokia 5110 PCD8544 | Bi colour Graphic LCD | SPI HW & SW | Readme |
ERM1 CH1115 | Bi colour Graphic OLED | SPI HW & SW | Readme |
SSD1306 | Bi colour Graphic OLED | I2C | Readme |
SH1106 SH1107 | Bi colour Graphic OLED | I2C | Readme |
HD44780_PCF8574 | Character LCD | I2C | Readme |
TM1638 | LED 7 segment display | ~SPI SW | Readme |
MAX7219 | LED 7 segment display | SPI HW & SW | Readme |
The application programming interface documentation is at link hosted on github pages and generated by Doxygen.
The font system readme for the graphic displays is here at link.
There are 5 makefiles.
- Root directory, builds and installs library at a system level.
- 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 :
- library name = librpidisplaygl
- Linker flags for complier = -lrpidisplaygl (also needs -lbcm2835 for bcm2835 library)
- Library File suffix = RDL
- Project name = Display_Lib_RPI
Basic project overview, see API documentation for more detailed diagrams :
- Development Tool chain.
- Raspberry PI 3 model b
- C++, g++ (Debian 12.2.0)
- Raspbian , Debian 12 bookworm OS, 64 bit.
- kernel : aarch64 Linux 6.1.0-rpi7-rpi-v8
- bcm2835 Library v1.75 dependency.
- 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.