Skip to content

Viewer

The screen of the Viewer is used by all other functions and libraries.

Configure

Parameters

The Viewer edition requires specific parameters defined in the common library.

#define STRING_MODE USE_CHAR_ARRAY

Ensure the string is set to the C-standard char array supported by the cstring library among the parameters.

// For Linux
#define STORAGE_MODE USE_LINUX_FILES | USE_SERIAL_CONSOLE

// For Windows
#define STORAGE_MODE USE_WINDOWS_FILES | USE_SERIAL_CONSOLE

Ensure the storage is set to Linux or Windows among the parameters. Serial could be added as an option.

Driver

Select the library Driver_EPD_Viewer_Touch corresponding to the Viewer edition.

#include "Driver_EPD_Viewer_Touch.h"

The pre-processor statement includes the driver library.

1
2
Pervasive_Touch_Small myDriver(eScreen_EPD_370_PS_0C_Touch,
    boardNone);

The constructor Pervasive_Touch_Small creates the driver object.

The required parameter is

The optional parameter is

This parameter is ignored and can be omitted.

However, it is recommended to specify the main controller board of the project.

Warning

Although the main controller board can be omitted, it is highly recommended to mention the main controller board with the targeted MCU.

Screen

Select the library PDLS_Viewer_Touch corresponding to the Viewer edition.

// Screen
#include "PDLS_Viewer_Touch.h"

The pre-processor statement includes the screen library.

1
2
Screen_EPD myScreen(&myDriver,
    frameBuffer);

The constructor Screen_EPD creates the screen object.

The required parameter is

  • The first line links to the driver declared just before.

The optional parameter is

  • The second line links to the frame-buffer if declared statically at build-time.

Frame-buffer

Please refer to the Frame-buffer procedure for the screen.

Use

  • Please refer to the Use procedure for the screen.

Except the driver and screen libraries and the specific peripherals, all the other libraries are identical: shared libraries for fonts, common graphic and text primitives, configuration; all the application libraries for graphics, bar- and QR-code, GUI, Files, serial; and the main program.

At run-time, Viewer offers the keyboard commands and their corresponding functions.

Example

This is the core of the code from the example WhoAmI.ino with two version: simulated with the Viewer edition and connected to an actual screen with the Commercial edition.

Using Driver_EPD_Viewer_Touch and PDLS_Viewer_Touch of the Viewer edition

// SDK
#include "hV_HAL_Peripherals.h"

// Configuration
#include "hV_Configuration.h"

// Driver
#include "Driver_EPD_Viewer_Touch.h"
Pervasive_Touch_Small myDriver(eScreen_EPD_370_PS_0C_Touch, boardRaspberryPiPico_RP2040);

// Screen
#include "PDLS_Viewer_Touch.h"
Screen_EPD myScreen(&myDriver);

hV_HAL_begin();
myScreen.begin();

myScreen.gText(4, 4, myScreen.WhoAmI());
myScreen.flushFast();
hV_HAL_demayMilliseconds(4000);

myScreen.regenerate();
hV_HAL_end();

Using Pervasive_Touch_Small and PDLS_Advanced of the Commercial edition

// SDK
#include "hV_HAL_Peripherals.h"

// Configuration
#include "hV_Configuration.h"

// Driver
#include "Pervasive_Touch_Small.h"
Pervasive_Touch_Small myDriver(eScreen_EPD_370_PS_0C_Touch, boardRaspberryPiPico_RP2040);

// Screen
#include "PDLS_Advanced.h"
Screen_EPD myScreen(&myDriver);

hV_HAL_begin();
myScreen.begin();

myScreen.gText(4, 4, myScreen.WhoAmI());
myScreen.flushFast();
hV_HAL_demayMilliseconds(4000);

myScreen.regenerate();
hV_HAL_end();