Display

Description

Display represents a black and white display.

Usage

erbui

module Example {
   control display Display {        // 1.
      position 19.2mm, 111mm        // 2.
      style 128x64                  // 3.
      label "DISPLAY"               // 4.
      pin Pin1                      // 5.
   }
}
  1. Creates an display control with name display,

  2. Sets the control position on the front panel,

  3. Sets the optional style of the control,

  4. Sets the optional label for the control, using its default theme positioning,

  5. Sets the optional physical board pin to use.

EastRising 1.54” OLED display photo is from BuyDisplay.

c++

Display is a type that abstracts a physical black and white OLED display block.

struct Example
{
   ExampleUi ui;
   
   void idle () {
      ui.display = ExampleData::pic0;  // 1.
      ...
   }
}
  1. Assigns the pic0 picture to the display.

pic0 erbb resource can be automatically generated from a picture in the project using the FormatSsd130x data type.

Note

Note that the display is assigned in the idle thread, as a display doesn’t need to (and can’t) be updated at process rate.

erbui Control Reference

control definition

control <name> Display { ... }

Where <name> is the name of the control. More details can be found in control documentation.

position property

position <x>, <y>

Sets the position of the control, where the axis origin is the top-left corner. The x axis is oriented from left to right, and the y axis is oriented from top to bottom.

The position component values are expressed with their unit, either mm or hp.

Example:

position 2hp, 15mm

More details can be found in position documentation.

style optional property

style <keywords>

Where <keywords> is the first best matching subset of:

  • eastrising, 128x64 (this is the default if not specified),

More details can be found in style documentation.

label optional property

label "<text>"

Where <text> is the text displayed. More details can be found in label documentation.

c++ Member Functions Synopsys

Name

Synopsys

operator =

Assigns the display pixels

operator Storage &

Accesses the display pixels

fill

Sets all pixels to a value

c++ Member Functions

operator =

Display &   operator = (const Storage & data);

Assigns the entire display pixels with the content of data. Each pixel is represented by a bit (and not a byte) and are tightly pack in a continuous array of bytes.

The bit at location (x, y) can be accessed using this formula:

storage [x + (y / 8) * width] & (1 << (y % 8)

operator Storage &

operator Storage & ();

Accesses the entire display pixels. See upper for the pixels structure.

fill

void fill (bool val);

Sets all pixels of the display to val, where false represents absence of light, and true represents emission of light.