EN

In STONE TOOL software the instructions of description pointer

Since the Intelligent TFT LCD Module is driven by variables, the displayed characters or icons have been defined as variables with their storage addresses of variables and the display formats distributed. When the customer needs to temporarily modify the variable display format, they need to use the description pointer to implement it. To change the attributes of the variable by the description pointer, each attribute of the displayed variable can be read and written through it, and the address range of the descriptive pointer is 0x0000 to 0xFFFF, which is also stored in the user variable data storage area. Thus, the variable address defined by  user cannot conflict with the address of the descriptive pointer.

 

Take changing the color of the text display as an example to introduce the simple application of the description pointer. Add the text display control to the background picture, set the description pointer to 0x2000 and the variable storage Address to 0x0200, as shown  in the following figure:

 

stone tools

 

The following figure is a description of text display which details some attributes of the text display that can be changed by the describing pointer.

 

Text display(0x11)

 

Address Offset (double byte)

Definition

Data Length

(byte)

Instructions

0x00

*VP

2

Text pointer

0x01

X, Y

4

Initial display position, display upper-left coordinates of character strings

0x03

Color

2

Display text color

0x04

Xs, Ys, Xe, Ye

8

Text box

0x08

Text_Length

2

Display the number of the bytes. When encountering 0xFFFF data or displaying it at the end of the text box, it will no longer be displayed.

0x09: H

Font 0_ID

1

The location of the ASCII font library when the encoding mode is 0x01 to 0x04.

0x09: L

Font 1_ID

1

The font library location of the non ASCII bytes when the encoding mode is 0x00, 0x05 or 0x01-- 0x04.

0x0A: H

Font_X_Dots

1

Number of dots in the X direction of font, the ASCII bytes are calculated by Y/2 when the encoding mode is 0x01 --to 0x04.

0x0A: L

Font_Y_Dots

1

Number of dots in the Y direction of font, the number of dots in the Y direction in the font library must be even number.

0x0B:H

Encode_Mode

1

.7 defines whether text display character spacing is automatically adjusted:

.7=0 the character spacing is adjusted automatically

.7=1 the character spacing is not adjusted automatically, and the character width is the fixed number of dots

.6-.0 define the encoding mode of the text:

0x00=8bit encoding, 0x01=GB2312 internal code, 0x02=GBK, 0x03=BIG5, 0x04=SJIS, 0x05=UNICODE

0x0B:L

HOR_Dis

1

Horizontal spacing between characters

0x0C:H

VER_Dis

1

Vertical spacing between characters

0x0C:L

Undefined

1

Write in 0x00

 

 

As can be seen from the above figure, the address offset corresponding to the color is 03, and the variable storage address corresponding to the color attribute is 0x2000 + 03 = 0x2003. Then the data in 0x2003 can be modified by the command 0x82, and the display color of the text display can be changed. The default text color in the attribute settings of the text display control is red, as shown in the following figure:

 

stone tools

 

Next, send the data A5 5A 05 82 20 03 07 E0, so that the display color can be changed into green, as shown in the following figure:

 

stone tools

 

In this way, the attributes can be modified, and so do other attributes in the text display description. Through the introduction, we hope to help customers get familiar with the application of description pointers.

 

Description of the command A5 5A 05 82 20 03 07 E0:

 

A5 5A: the frame  header (the customer can modify it in the screen parameter configuration);

05: the data length;

82:  write variable address command (fixed);

203: the address of the variable;

07 E0: the corresponding color value.

 

The following links may help you

 

14 STONE TOOLBOX instruction tutorial

https://www.stoneitech.com/news/instructions