Segment LCD Synchronous Driver

An LCD display is made of several segments (pixels or complete symbols) which can block the light or let it through. In each segment one electrode is connected to the common terminal (COM pin) and one is connected to the segment terminal (SEG pin). When a voltage above a certain threshold level is applied across the liquid crystal, the crystal orientation will change and either let the light through or block it.

The driver supports segment on/off/blink, animation, and character display.

Each segment has a unique int32 segment ID which is used by the driver. The ID is combined by a common number(COM) and a segment number(SEG). The COM and SEG start from 0. The unique segment ID is calculated by this formula: (COM << 16) | SEG. For example an 8(coms)*8(segments)SLCD, the unique segment ID for a segment should be:
+-----+-----+---------+
| COM | SEG |   ID    |
+-----+-----+---------+
|  0  |  0  | 0x00000 |
+-----+-----+---------+
|  1  |  0  | 0x10000 |
+-----+-----+---------+
|  7  |  7  | 0x70007 |
+-----+-----+---------+

The segment ID can be calculated using the pre-defined macro SLCD_SEGID(com, seg).

For character display, the "segment character mapping table" and "character mapping table" should be set up during the configuration. The driver has no API to set up/change those mapping settings.

There are two pre-defined "segment character mapping tables" in this driver, the 7-segments and the 14-segments. The 7-segments character mapping can display 0-9 and a-f, the 14-segments character mapping can display 0-9, A-Z and some special ASCII. For more details refer to hpl_slcd_cm_7_seg_mapping.h and hpl_slcd_cm_14_seg_mapping.h. The application can also adjust this mapping table in the configuration header file to add more character mappings or remove some unused characters.

The "character mapping" is used to set up each character in SLCD display screen. The driver supports multiple character mapping, the max. number varies according to which MCU/MPU is used. For example, if an LCD display screen has five 7-segments character and eight 14-segments character, and the MCU supports max. 44 characters setting, then the 13 characters should have been set up during the configuration. Application can select any position from those 44 characters setting to save those 13 characters. The index of the character setting will be used in the driver API. For example, five 7-segments character settings to 0 to 4 and eight 14-segments character settings to 10 to 17. Then the application can use the index from 0 to 4 to display the 7-segments character and use the index from 10 to 14 to display the 14-segments character.

The driver can be used in following applications:
  • SLCD display control, segment on/off/blink

  • Play battery animation, running wheel, WIFI signal, etc.

  • Display Time Clock by 7 segments character mapping

  • Display ASCII character by 14 segments character mapping

Summary of the API's Functional Features

The API provides functions to:
  • Initialize and deinitialize the driver and associated hardware

  • Enable or disable the SLCD hardware

  • Switch segment on/off

  • Set segment blink

  • Autonomous animation

  • Character display

Dependencies

  • The SLCD capable hardware