I want to find...

Search

Shares

Table of Content

EthercatDevice_DmpLCD_Generic Class

[EthercatDevice_Dmp]

EthercatDevice_DmpLCD_Generic is an EtherCAT slave class specifically developed by ICOP for LCD EtherCAT slave modules. It provides a variety of drawing APIs.

The class relationships of EthercatDevice_DmpLCD_Generic are illustrated in the following diagram:

EthercatDevice_DmpLCD_Generic Class

EthercatDevice_DmpLCD_Generic inherits from _EthercatDevice_DmpCommonDriver.

Base Class:

  • _EthercatDevice_CommonDriver

Derived Class:

Class NameVendor IDProduct Code
EthercatDevice_QECR11UN010x00000bc30x0086d103
EthercatDevice_QECR00UN010x00000bc30x0086d100

LCD Module Table:

IDLCM Driver ICResolutionXpYpXmYm
0ILI9341240 X 320D9A2A3D8
1ILI9341240 X 320D6A1A2D7
2ILI9488320 X 480D8A3A2D9
3ILI9486320 X 480XXXX
4HX8347-I(T)240 X 320D9A2A3D8
5HX8347-D240 X 320D9A2A3D8

LCD Module List:

  • ECAT_LCD_UNKNOWN_ID (0xFFFF)
  • ECAT_LCD_ILI9341_1  (0)
  • ECAT_LCD_ILI9341_2  (1)
  • ECAT_LCD_ILI9488_1  (2)
  • ECAT_LCD_ILI9486_1  (3)
  • ECAT_LCD_HX8347I_1  (4)
  • ECAT_LCD_HX8347D_1  (5)

About RGB565

RGB565 is a color format used to represent color information for pixels in an image. It utilizes 16 bits (2 bytes) to encode the color information for a single pixel. The name “RGB565” indicates the distribution of bits among the three primary colors: red, green, and blue.

  • Red (R): 5 bits
  • Green (G): 6 bits
  • Blue (B): 5 bits

This prioritizes green over red and blue because the human eye is more sensitive to variations in green compared to red and blue.

RGB565

Due to the fewer bits allocated to each color component, RGB565 offers a smaller color palette compared to 24-bit RGB or 16-bit RGB. It can represent 25 = 32 possible values for red and blue, and 26 = 64 possible values for green, resulting in a total of 32 x 64 x 32 = 65,536 possible colors.

Here are some RGB565 color codes for quick reference and easy testing:

RGB565 color codes

Converting RGB888 to RGB565

Converting from 24-bit RGB to RGB565 involves a process called color quantization. Similar to converting between 24-bit and 16-bit RGB, this process reduces the number of colors and assigns them the closest available color within the RGB565 palette. This can introduce some color loss, but for certain applications, the trade-off in color accuracy for efficiency might be acceptable. The following is an example of converting RGB888 to RGB565 in C code.

uint16_t rgb888_to_rgb565(uint8_t r, uint8_t g, uint8_t b)
{
    return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
}

Initialization Functions

Initialization-related functions for the EthercatDevice_DmpLCD_Generic class.

Control Functions

Control functions for the EthercatDevice_DmpLCD_Generic class.

LCD Functions

LCD functions for the EthercatDevice_DmpLCD_Generic class.

Touch Screen Functions

Touch Screen functions for the EthercatDevice_DmpLCD_Generic class.


Please see the EtherCAT Library User Manual for more QEC EtherCAT instructions and API usage.

Leave a Comment

Scroll to Top