Skip to content

Migrate from Viewer to Commercial edition and back

This technical note lists how to migrate from Viewer to Commercial edition and back.

At the application level, the code is fully compatible between the Viewer and Commercial editions.

Only a limited set of libraries needs to be adapted.

Include folders and libraries

Shared folders and libraries

Below are listed the names of the folders of the libraries to be provided for building and linking. Differences are in bold.

Libraries Viewer Commercial
Common PDLS_Common
hV_HAL_Peripherals_Viewer
PDLS_Common
hV_HAL_Peripherals
Font hV_Font_DejaVu_Header hV_Font_DejaVu_Header

The include statements are the same for the Viewer and Commercial editions.

// SDK and configuration
#include "PDLS_Common.h"

Screen folders and libraries

Below are listed the names of the folders of the libraries to be provided for building and linking.

Libraries Viewer Commercial
Driver Driver_EPD_Viewer_Touch Pervasive_Touch_Small
Screen PDLS_Viewer_Touch PDLS_Advanced

The include statements differ for the Viewer and Commercial editions.

// Driver
#include "Driver_EPD_Viewer_Touch.h"

// Screen
#include "PDLS_Viewer_Touch.h"
// Driver
#include "Pervasive_Touch_Small.h"

// Screen
#include "PDLS_Advanced.h"

However, both PDLS_Viewer_Touch and PDLS_Advanced are umbrella header files.

By calling the screen header file directly, the include statement is the same for the Viewer and Commercial editions.

// Screen
#include "Screen_EPD.h"

Application folders and libraries

Below are listed the names of the folders of the libraries to be provided for building and linking. Differences are in bold.

Libraries Viewer Commercial
Code hV_Code hV_Code
Graphics hV_Graphics hV_Graphics
GUI hV_GUI hV_GUI
File hV_File_Viewer hV_File
SD
Serial hV_Serial hV_Serial

On the Commercial edition, the file library requires an external third-party SD library compatible with the SDK or API and the MCU.

On the Viewer edition, the file library has two variants, one for Linux and another for Windows.

The include statements are the same for the Viewer and Commercial editions.

// Applications
#include "hV_Code.h"
#include "hV_Graphics.h"
#include "hV_GUI.h"
#include "hV_Serial.h"
#include "hV_File.h"

Check list

Configuration

The Viewer edition requires specific options for the configuration of strings and storage, as detailed at the Configure section:

  • String should be set to C-standard char array;
#define STRING_MODE USE_CHAR_ARRAY
  • Storage should include the Linux or Windows option;
// For Linux
#define STORAGE_MODE USE_SERIAL_CONSOLE + USE_LINUX_FILES ///< Selected options

// For Windows
#define STORAGE_MODE USE_SERIAL_CONSOLE + USE_WINDOWS_FILES ///< Selected options
  • Although the main controller board can be omitted, it is highly recommended to mention the main controller board with the targeted MCU.

Viewer specific functions

The Viewer edition exposes specific functions.

For optimal compatibility with the Commercial edition, use and check the WITH_VIEWER macro.

#if defined(WITH_VIEWER)

    myScreen.setViewerHelp(true);

#endif // WITH_VIEWER

Screen refresh

Although both the Viewer and Commercial editions expose the flush() and flushFast() refresh functions, the Viewer edition performs them the same way.

Files

Both the Viewer and Commercial editions write files in BMP, pixmap or PBM, image and 16-bit image formats.

Both the Viewer and Commercial editions read files in BMP, pixmap or PBM formats.

Additionally, the Viewer edition writes and reads files in PNG format.

Info

For the Commercial edition, files operations are not recommended, as the management of the SD-card by an MCU is rather slow and prone to interferences.