Elements Sub Func: Difference between revisions
From Smart LCD
| (2 intermediate revisions by the same user not shown) | |||
| Line 242: | Line 242: | ||
E.g. VP(BUFF)=“123”, after call VP(BUFF)=“12” | E.g. VP(BUFF)=“123”, after call VP(BUFF)=“12” | ||
|} | |} | ||
== Draw Pad (DPD) in-memory command Functions == | |||
* Draw Pad element is an element that execute a drawing function that store inside VP_N16which point by its properties VP_address. | |||
* Host could send the Function Pack into VP by using Multi_Write (0x82) or N16_Write (0x3D) command. | |||
* it is possible to adjust the function or parameter by VPK, TPK or Page_Call. | |||
* And it will refresh/update the Draw Pad content accordingly. | |||
* Each Draw Pad Element could only execute ONE command multiple times. | |||
* The coordinate of the drawing content is based on the page coordinate. | |||
* The Draw Pad element area is the valid area that shows the content. | |||
=== Draw Pad Element Function Pack Structure === | |||
{| class="wikitable" | |||
!'''Address''' | |||
!'''Content''' | |||
!'''Descriptions''' | |||
|- | |||
|VP | |||
|CMD | |||
|Command function | |||
|- | |||
|VP+2 | |||
|Number_of_Parmeter_SET | |||
|Number of parameter set (*2) | |||
|- | |||
|VP+4 | |||
|Parameter_set | |||
|Parameter sets for command (*1) | |||
|} | |||
=== Draw Pad Element Functions === | |||
{| class="wikitable" | |||
! rowspan="2" |'''CMD''' | |||
! rowspan="2" |'''Name''' | |||
! colspan="3" |'''Parameter Set''' | |||
! | |||
|- | |||
!'''Relative Add Seq''' | |||
!'''Size''' | |||
'''in byte''' | |||
!'''Definitions''' | |||
!'''Descriptions''' | |||
|- | |||
| rowspan="2" |0x0001 | |||
| rowspan="2" |Draw_dot | |||
|0x00 | |||
|4 | |||
|xh,xl,yh,yl | |||
|Dot coordinate (*1) | |||
|- | |||
|0x04 | |||
|2 | |||
|Color | |||
|Dot color | |||
|- | |||
| rowspan="5" |0x0002 | |||
| rowspan="5" |Draw_successive_line | |||
|0x00 | |||
|2 | |||
|Color | |||
|Line color (*3) | |||
|- | |||
|0x02 | |||
|4 | |||
|x0h,x0l,y0h,y0l | |||
|Coordinate of the line starting point (*1) | |||
|- | |||
|0x06 | |||
|4 | |||
|X1h,x1l,y1h,y1l | |||
|Line to this coordinate | |||
|- | |||
|: | |||
|4 | |||
|: | |||
|: | |||
|- | |||
|0x02+4*n | |||
|4 | |||
|xnh,xnl,ynh,ynl | |||
|Last coordinate for line | |||
|- | |||
| rowspan="3" |0x0003 | |||
| rowspan="3" |Draw_line | |||
|0x00 | |||
|4 | |||
|xsh,xsl,ysh,ysl | |||
|Line start coordinate (*1) | |||
|- | |||
|0x04 | |||
|4 | |||
|xeh,xel,yeh,yel | |||
|Line end coordinate | |||
|- | |||
|0x08 | |||
|2 | |||
|Color | |||
|Line color | |||
|- | |||
| rowspan="3" |0x0004 | |||
| rowspan="3" |Draw_rectangle | |||
|0x00 | |||
|4 | |||
|xsh,xsl,ysh,ysl | |||
|Top-left corner coordinate (*1) | |||
|- | |||
|0x04 | |||
|4 | |||
|xeh,xel,yeh,yel | |||
|Bottom-right corner coordinate | |||
|- | |||
|0x08 | |||
|2 | |||
|Color | |||
|Rectangle line color | |||
|- | |||
| rowspan="3" |0x0005 | |||
| rowspan="3" |Fill_rectangle | |||
|0x00 | |||
|4 | |||
|xsh,xsl,ysh,ysl | |||
|Top-left corner coordinate (*1) | |||
|- | |||
|0x04 | |||
|4 | |||
|xeh,xel,yeh,yel | |||
|Bottom-right corner coordinate | |||
|- | |||
|0x08 | |||
|2 | |||
|Color | |||
|Rectangle fill color | |||
|- | |||
| rowspan="4" |0x0006 | |||
| rowspan="4" |Show_crop_Page_BKG | |||
|0x00 | |||
|2 | |||
|PAGE_IDh,PAGE_IDl | |||
|PAGE's background image (NOT IMG_BKG) to be crop and show (*1) | |||
|- | |||
|0x02 | |||
|4 | |||
|xsh,xsl,ysh,ysl | |||
|Top-left corner coordinate for crop | |||
|- | |||
|0x06 | |||
|4 | |||
|xeh,xel,yeh,yel | |||
|Bottom-right corner coordinate for crop | |||
|- | |||
|0x0a | |||
|4 | |||
|xh,xl,yh,yl | |||
|Top-left corner coordinate for showing the cropped image on screen | |||
|- | |||
| rowspan="2" |0x0007 | |||
| rowspan="2" |Show_IMG_ICO | |||
|0x00 | |||
|4 | |||
|xh,xl,yh,yl | |||
|Top-left corner coordinate for showing the cropped image on screen (*1) | |||
|- | |||
|0x04 | |||
|2 | |||
|IMG_ICO_ID | |||
|IMG_ICON to be show | |||
|- | |||
| rowspan="5" |0x0008 | |||
| rowspan="5" |Show_text | |||
|0x00 | |||
|4 | |||
|xh,xl,yh,yl | |||
|Top-left corner coordinate for showing the text on screen (*1) | |||
|- | |||
|0x04 | |||
|2 | |||
|Color | |||
|Text color | |||
|- | |||
|0x06(0x06H) | |||
|1 | |||
|FONT_ID | |||
|Font ID | |||
|- | |||
|0x07(0x06L) | |||
|1 | |||
|Text_len | |||
|Text length in no. of byte | |||
|- | |||
|0x08 | |||
|n | |||
|Text_STRING | |||
|Text content | |||
|} | |||
Note. | |||
<nowiki>*</nowiki>1. First byte of this parameter could "control" the functionality | |||
- 0xFF terminate the following draw function | |||
- 0xFE terminate current parmeter_set, jump to next parameter_set | |||
<nowiki>*</nowiki>2. Draw_successive_line need n set for (n-1) lines | |||
<nowiki>*</nowiki>3. Color is excluded from Number_of_Parmeter_SET | |||
Latest revision as of 15:00, 10 May 2025
TPK, VPK Call Functions
Call functions are functions which could be called up by TPK or VPK.
Call Functions - Operations
| Function | Descriptions |
| VP:= VP XOR Value |
Predefine VP variable XOR with a constant stay in Value, and store the result back into the VP variable E.g. VP_N32(0x020000)=0x0055, properties' Value= 0x00AA; result VP_N32 (0x020000)=0x00FF |
| BUFF:= VP |
Copy the VP variable content to the BUFF(string format) location. E.g. VP_N32(0x020000)=123; result VP_STR(BUFF)=“123” (note: number converted to string) |
| VP:= BUFF |
Copy the BUFF content to a VP variable (integer or a string) E.g. VP(BUFF)=“123”, result VP_N32(0x020000)=123 (note: string converted to interger) |
| VP:= Value |
Copy a constant stay in Value to a VP variable E.g. properties' Value= 123; result VP_N32(0x020000)=123 |
| VP:= VP + Value |
Predefine VP variable add with a constant stay in Value, and store the result back into the VP variable E.g. VP_N32(0x020000)=666, Value=2; result VP_N32 (0x020000)=668 |
| VP:= VP - Value |
Predefine VP variable minus by a constant stay in Value, and store the result back into the VP variable E.g. VP_N32(0x020000)=666, Value=10; result VP_N32 (0x020000)=656 |
| VP:= VP + Value, loop |
Predefine VP variable times by a constant stay in Value, and store the result back into the VP variable If the value is bigger than the predefined maximum, it will "loop" to the predefined minimum. E.g. VP_N32(0x020000)=666, Value=2; result VP_N32 (0x020000)=668 |
| VP:= VP - Value, loop |
Predefine VP variable minus by a constant stay in Value, and store the result back into the VP variable If the value is smaller than the predefined minimum, it will "loop" to the predefined maximum. E.g. VP_N32(0x020000)=666, Value=10; result VP_N32 (0x020000)=656 |
| VP:= VP * Value |
Predefine VP variable times by a constant stay in Value, and store the result back into the VP variable Eg: VP_N32(0x020000)=666, Value=10; result VP_N32 (0x020000)=6660 |
| VP:= VP/Value |
Predefine VP variable divided by a constant stay in Value, and store the result back into the VP variable E.g. VP_N32(0x020000)=666, Value=2; result VP_N32 (0x020000)=333 |
| Byte0(VP):= Byte0(Value) |
Copy the constant byte0(lowest byte) stay in Value to VP variable byte0(Lowest byte) location E.g. VP_N32(0x020000)=0x5555, Value=0x0A; result VP_N32 (0x020000)=0x550A |
| Byte1(VP):= Byte0(Value) |
Copy the constant byte0(lowest byte) stay in Value to VP variable byte1 location E.g. VP_N32(0x020000)=0x5555, Value=0x0A; result VP_N32 (0x020000)=0x0A55 |
| Byte2(VP):= Byte0(Value) |
Copy the constant byte0(lowest byte) stay in Value to VP variable byte2 location E.g. VP_N32(0x020000)=0x5555, Value=0x0A; result VP_N32 (0x020000)=0x0A5555 |
| Byte3(VP):= Byte0(Value) |
Copy the constant byte0(lowest byte) stay in Value to VP variable byte3(Highest byte) location E.g. VP_N32(0x020000)=0x5555, Value=0x0A; result VP_N32 (0x020000)=0x0A005555 |
| Bit0(VP):= LSB(Value) |
Copy the constant LSB stay in Value to VP variable bit0(LSB) location E.g. VP_N32(0x020000)=0x0000, Value=0x01; result VP_N32 (0x020000)=0x0001 |
| Bit1(VP):= LSB(Value) |
Copy the constante LSB stay in Value to VP variable bit1 location Eg: VP_N32(0x020000)=0x0000, Value=0x01; result VP_N32 (0x020000)=0x0002 |
| Bit2(VP):= LSB(Value) |
Copy the constant LSB stay in Value to VP variable bit2 location E.g. VP_N32(0x020000)=0x0000, Value=0x01; result VP_N32 (0x020000)=0x0004 |
| Bit3(VP):= LSB(Value) |
Copy the constant LSB stay in Value to VP variable bit3 location E.g. VP_N32(0x020000)=0x0000, Value=0x01; result VP_N32 (0x020000)=0x0008 |
| Bit4(VP):= LSB(Value) |
Copy the constant LSB stay in Value to VP variable bit4 location E.g. VP_N32(0x020000)=0x0000, Value=0x01; result VP_N32 (0x020000)=0x0010 |
| Bit5(VP):= LSB(Value) |
Copy the constant LSB stay in Value to VP variable bit5 location E.g. VP_N32(0x020000)=0x0000, Value= 0x01; result VP_N32 (0x020000)=0x0020 |
| Bit6(VP):= LSB(Value) |
Copy the constant LSB stay in Value to VP variable bit6 location E.g. VP_N32(0x020000)=0x0000, Value= 0x01; result VP_N32 (0x020000)=0x0040 |
| Bit7(VP):= LSB(Value) |
Copy the constant LSB stay in Value to VP variable bit7 location E.g. VP_N32(0x020000)=0x0000, Value= 0x01; result VP_N32 (0x020000)=0x0080 |
Call Functions - Keyboards
| Function | Descriptions |
| Keyboard Number |
Number Keyboard for number value input and report the value to the host.(*1) The input value will be stored inside the predefined VP Variable |
| Keyboard Password |
Password Keyboard for number password input. (display as *, 9char max.) and report the input value to the host. (*1) The input value will be stored inside the predefined VP Variable |
| Keyboard English |
English Keyboard for English input and report the input value to the host. (*1) The input value will be stored inside the predefined VP Variable |
| Keyboard Chinese |
Chinese Pinyin Keyboard for number value input and report the value to the host. (*1) The input value will be stored inside the predefined VP Variable |
| PIP Menu |
Page-in-page Menu is a customizable menu. It pop-up a little window of another page as a menu selection input and report the input value to the host. (*1) The input value will be stored inside the predefined VP Variable |
| PIP Keyboard |
Page-in-page Keyboard is a customizable keyboard. It could pop up a little window of another page as a keyboard keys and report the input value to the host. (*1) The input value will be stored inside the predefined VP Variable. |
| PIP Number Keyboard |
Page-in-page Number Keyboard is a customizable keyboard. It pop up a little window of another page as a keyboard keys and report the input value to the host. (*1) The input value will be stored inside the predefined VP Variable. |
| PIP RTC |
Page-in-page RTC is a customizable interface to adjust the Real Time Clock time. It could pop up a little window of another page as a keyboard keys. |
| Adjust Backlight |
Backlight brightness level setting. |
| Adjust RTC |
Real Time Clock time adjust interface. |
| Slider Single |
Single slider input interface input is corresponding ratio of the predefined max. min. value and report the input value to the host. (*1) The input value will be stored inside the predefined VP Variable. |
| Slider Dual |
Dual slider input interface function as Single Slider with two VP Variable input, Where, the two slider will limit each other for non-overlapped value input and report the input value to the host. (*1) The two input value will be stored inside two successive predefined VP Variable. |
| Listing |
VP_STR listing window Display the VP_STR content with predefined VP_STR Address and no. of VP_STR to be display. Providing touch and scroll interface. |
| Listing with Slider |
VP_STR listing window Display the VP_STR content with predefined VP_STR Address and no. of VP_STR to be display. Providing slider bar for scroll. |
Note: *1. Entered value that report to host with command header 0x77
Call Functions - PIP Keyboard's keys
| Function | Descriptions |
| Enter |
Enter key for PIP keyboard for finishing and confirming the input. |
| Esc |
Escape key for PIP keyboard/menu. It could cancel the input and close the PIP keyboard/menu. |
| CapsLock |
CapsLock key function for PIP Keyboard |
| VP:= Value, Enter |
Directly assigning the value into VP variable and follow with a Enter to confirm the input. Mainly for PIP menu items selection |
| Buff:=Con(Buff,Cap,
Nom(Byte0/Byte1)) |
Generally key call for PIP keyboard with (Capslock feature) It will put the lower byte value into the end of Buff area. If the CapsLock toggled, the high byte will be insert into the end of the Buff area (note: its value in properties should be a 16bit formatted value) |
| VP:=Concatenate(VP,Value) |
Put its properties value to the end of the content of the predefined VP value Mainly work with BUFF as a general char input E.g. VP(BUFF)= “123”, Properties' Value = 4, after call VP(BUFF)=“1234” |
| VP:= DelLastChar(VP) |
Delete the last byte of the the VP variable Mainly for VP(BUFF) as a backspace funciton. E.g. VP(BUFF)=“123”, after call VP(BUFF)=“12” |
Draw Pad (DPD) in-memory command Functions
- Draw Pad element is an element that execute a drawing function that store inside VP_N16which point by its properties VP_address.
- Host could send the Function Pack into VP by using Multi_Write (0x82) or N16_Write (0x3D) command.
- it is possible to adjust the function or parameter by VPK, TPK or Page_Call.
- And it will refresh/update the Draw Pad content accordingly.
- Each Draw Pad Element could only execute ONE command multiple times.
- The coordinate of the drawing content is based on the page coordinate.
- The Draw Pad element area is the valid area that shows the content.
Draw Pad Element Function Pack Structure
| Address | Content | Descriptions |
|---|---|---|
| VP | CMD | Command function |
| VP+2 | Number_of_Parmeter_SET | Number of parameter set (*2) |
| VP+4 | Parameter_set | Parameter sets for command (*1) |
Draw Pad Element Functions
| CMD | Name | Parameter Set | |||
|---|---|---|---|---|---|
| Relative Add Seq | Size
in byte |
Definitions | Descriptions | ||
| 0x0001 | Draw_dot | 0x00 | 4 | xh,xl,yh,yl | Dot coordinate (*1) |
| 0x04 | 2 | Color | Dot color | ||
| 0x0002 | Draw_successive_line | 0x00 | 2 | Color | Line color (*3) |
| 0x02 | 4 | x0h,x0l,y0h,y0l | Coordinate of the line starting point (*1) | ||
| 0x06 | 4 | X1h,x1l,y1h,y1l | Line to this coordinate | ||
| : | 4 | : | : | ||
| 0x02+4*n | 4 | xnh,xnl,ynh,ynl | Last coordinate for line | ||
| 0x0003 | Draw_line | 0x00 | 4 | xsh,xsl,ysh,ysl | Line start coordinate (*1) |
| 0x04 | 4 | xeh,xel,yeh,yel | Line end coordinate | ||
| 0x08 | 2 | Color | Line color | ||
| 0x0004 | Draw_rectangle | 0x00 | 4 | xsh,xsl,ysh,ysl | Top-left corner coordinate (*1) |
| 0x04 | 4 | xeh,xel,yeh,yel | Bottom-right corner coordinate | ||
| 0x08 | 2 | Color | Rectangle line color | ||
| 0x0005 | Fill_rectangle | 0x00 | 4 | xsh,xsl,ysh,ysl | Top-left corner coordinate (*1) |
| 0x04 | 4 | xeh,xel,yeh,yel | Bottom-right corner coordinate | ||
| 0x08 | 2 | Color | Rectangle fill color | ||
| 0x0006 | Show_crop_Page_BKG | 0x00 | 2 | PAGE_IDh,PAGE_IDl | PAGE's background image (NOT IMG_BKG) to be crop and show (*1) |
| 0x02 | 4 | xsh,xsl,ysh,ysl | Top-left corner coordinate for crop | ||
| 0x06 | 4 | xeh,xel,yeh,yel | Bottom-right corner coordinate for crop | ||
| 0x0a | 4 | xh,xl,yh,yl | Top-left corner coordinate for showing the cropped image on screen | ||
| 0x0007 | Show_IMG_ICO | 0x00 | 4 | xh,xl,yh,yl | Top-left corner coordinate for showing the cropped image on screen (*1) |
| 0x04 | 2 | IMG_ICO_ID | IMG_ICON to be show | ||
| 0x0008 | Show_text | 0x00 | 4 | xh,xl,yh,yl | Top-left corner coordinate for showing the text on screen (*1) |
| 0x04 | 2 | Color | Text color | ||
| 0x06(0x06H) | 1 | FONT_ID | Font ID | ||
| 0x07(0x06L) | 1 | Text_len | Text length in no. of byte | ||
| 0x08 | n | Text_STRING | Text content | ||
Note.
*1. First byte of this parameter could "control" the functionality
- 0xFF terminate the following draw function
- 0xFE terminate current parmeter_set, jump to next parameter_set
*2. Draw_successive_line need n set for (n-1) lines
*3. Color is excluded from Number_of_Parmeter_SET