Driver object¶
The driver object manages the panel and the board. It sends the image from the frame-buffer to the screen and refreshes the panel. It is based on the film and the size of the screen.
All the libraries support the EXT3, EXT3.1 and EXT4 extension boards.
The driver library is common to all the PDLS editions.
The driver libraries are developed and maintained by Pervasive Displays.
Configure¶
Warning
Ensure the peripherals are declared and initialised according to the configuration procedure.
``` cpp
include “Pervasive_Wide_Small.h”¶
```
The pre-processor statement includes the driver library.
The exposed class has the same name as the driver library.
cpp linenums="1"
Pervasive_Wide_Small myDriver(eScreen_EPD_271_KS_09,
boardRaspberryPiPico_RP2040);
Pervasive_Wide_Small
- The constructor creates the driver object.
The required parameters are
-
The first line sets the model of the screen;
-
The second line selects the configuration of the main controller board connected to the EXT3, EXT3.1 or EXT4 extension board.
Screen model¶
The header file of the driver library lists the screens it supports.
The screen constant starts with eScreen_EPD
, contains the size, the film and the controller taken from the product number and separated with a _
.
The product number of the panel is printed on the back of the screen, on the top line close to the QR-code.
Example
The screen with product number CE2271KS094
corresponds to a 2.71” panel with film KS
and controler 09
. The last digit 4
is ignored.
- | Size | Film | Controller | - |
---|---|---|---|---|
CE2 |
271 |
KS |
09 |
4 |
eScreen_EPD |
_271 |
_KS |
_09 |
The screen model for the constructor is eScreen_EPD_271_KS_09
.
Pervasive_Wide_Small myDriver(eScreen_EPD_271_KS_09, boardRaspberryPiPico_RP2040);
The product number of the panel may differ from its commercial name.
Example
The screen with product number CE2417KS0D1
corresponds to a 4.17” panel with Spectra 4 colour film KS
and controler 0D
. The commercial name is 4.2” Spectra 4.
The dedicated section Screen constants explains how the screen constants used by the constructor are built from the screen product numbers.
Board configuration¶
The board configuration defines all the GPIOs connected to the EXT3, EXT3.1 and EXT4 extension boards.
Example
boardRaspberryPiPico_RP204
sets the Raspberry Pi Pico as main controller board.
``` cpp // Driver
include “Pervasive_Wide_Small.h”¶
Pervasive_Wide_Small myDriver(eScreen_EPD_271_KS_09, boardRaspberryPiPico_RP2040);
// Screen
include “PDLS_Basic.h”¶
Screen_EPD myScreen(&myDriver); ```
The dedicated section Boards definition details the content of the configuration and lists the pre-configured main controller boards.
Use¶
The driver is entirely managed by the PDLS library when used with it.
Otherwise, when used alone, the driver needs to be initialised.
cpp
myDriver.begin();
begin()
- initialises the driver, including the required GPIOs, and the SPI and I²C ports.
cpp
myDriver.setTemperatureC(25);
myDriver.setTemperatureF(77);
setTemperatureC()
- sets the temperature in degrees Celsius, with default value 25 °C.
setTemperatureF()
- sets the temperature in degrees Fahrenheit, with default value 77 °F.
cpp
myDriver.updateNormal(imageNew, imageSize);
myDriver.updateFast(imageNew, imageOld, imageSize);
updateNormal()
- performs the update of the screen in normal mode. It requires one image and the size of the frame.
updateFast()
- performs the update of the screen in fast mode. It requires two images, the next and the previous, and the size of the frame.
For more information, please refer to the documentation of the driver library.