Skip to content

Franzzzzzzzz/PDLS_RPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Modification and extension of the Pervasive Displays Library Suite Basic Edition

This repository modifies the Pervasive Displays API (basic edition, CC-BY-SA) to include several new features:

  • Use with Raspberry Pi 3B single board computer
  • Display to standard video output using Simple DirectMedia Layer 2, for immediate visualisation of the expected display.
  • Format text using Freetype, allowing use of any font.
  • Additional quality of life functions.

Compilation

For compilation for standard computer (without eInk display), use: g++ -o Demo *.cpp -lSDL2 -I/usr/include/freetype2 -lfreetype.

For compilation on Raspberry Pi (with eInk display), the additional define RPI must be set: g++ -o Demo *.cpp -DRPI -lSDL2 -lspidev-lib++ -lwiringPi -I/usr/include/freetype2 -lfreetype

All compilation requires the libsdl2 (eg. : sudo apt install libsdl2-dev). Running on Raspberry Pi requires in addition the wiringPi library and the spidev-lib library.

Hardware

The software has only been tested on a Raspberry Pi 3B with a 4.37" E-ink display Three colours. Any other screen requires modification of the code to work, as the screen size is hardcoded. Any other computer than RPI3B likely requires adjustments of the pinout and spi setup to work properly.

Running on RPI3B

  1. Enable the SPI communication in the raspi-config utility and reboot.
  2. The pins are (wire colours corresponds to the ones when using the EXT3 kit:
  • 3.3V: pin 1. BLACK
  • MOSI: pin 19. BLUE
  • MISO: pin 21. GREEN
  • SCLK: pin 23. BROWN
  • Busy: GPIO5, pin 29. RED
  • D/C: GPIO6, pin 31. ORANGE
  • RST: GPIO13, pin 33. YELLOW
  • Flash CS: GPIO26, pin 37. PURPLE
  • Panel CS: GPIO19, pin 35. GRAY
  • GND: pin 6. WHITE

NB: the pins defined in the c++ code are NEITHER the GPIO number NOR the pin numbers. wiringPi uses different numbers (not sure where they come from), which can be found there if you want to change the pins. The SPI connection use is /dev/spidev0.0. 3. Compile with the -DRPI flag and the other required libraries (cf. above). 4. If you are connected to a headless RPI, you probably need an display connection of SDL may have issues. In ssh, you can use ssh -X .... Check how to set up a X display through ssh to see how that can be achieved. 5. The compiled program needs to be run as root to have access to SPI communication and GPIO: sudo ./Demo. There are probably ways to give the appropriate rights to avoid running as root...

Usefull supplementary functions

  • Sierpinski
  • Paragraph_freetype (int fontsize, int x0, int y0, int line_end_x, int ymax, String s, uint16_t colour, uint16_t bgcolor=myColours.white): display text in a given bounding box (4 ints in the middle), width a given fontsize and colour. Supports newlines (\n), italic and bold using markdown syntax (*word*or _word_, **word**or __word__). The fonts can be changed in the Functions.cpp file.

About

Extension of the Pervasive Display library for Raspberry Pi support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published