[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 inherits from _EthercatDevice_DmpCommonDriver.
Base Class:
- _EthercatDevice_CommonDriver
Derived Class:
Class Name | Vendor ID | Product Code |
EthercatDevice_QECR11UN01 | 0x00000bc3 | 0x0086d103 |
EthercatDevice_QECR00UN01 | 0x00000bc3 | 0x0086d100 |
LCD Module Table:
ID | LCM Driver IC | Resolution | Xp | Yp | Xm | Ym |
0 | ILI9341 | 240 X 320 | D9 | A2 | A3 | D8 |
1 | ILI9341 | 240 X 320 | D6 | A1 | A2 | D7 |
2 | ILI9488 | 320 X 480 | D8 | A3 | A2 | D9 |
3 | ILI9486 | 320 X 480 | X | X | X | X |
4 | HX8347-I(T) | 240 X 320 | D9 | A2 | A3 | D8 |
5 | HX8347-D | 240 X 320 | D9 | A2 | A3 | D8 |
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.
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:
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.
- lcdInit()
- lcdFlush()
- lcdWidth()
- lcdHeight()
- lcdGetRotation()
- lcdSetRotation()
- lcdDrawPixel()
- lcdDrawFastHLine()
- lcdDrawFastVLine()
- lcdDrawLine()
- lcdFillRect()
- lcdDrawRect()
- lcdFillCircle()
- lcdDrawCircle()
- lcdFillTriangle()
- lcdDrawTriangle()
- lcdFillRoundRect()
- lcdDrawRoundRect()
- lcdFillScreen()
- lcdSetAddrWindow()
- lcdPushColors()
- lcdSetTextCursor()
- lcdSetTextColor()
- lcdSetTextSize()
- lcdSetTextWrap()
- lcdPrint()
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.