Plotting and display
This category contains instructions for drawing shapes and printing text with format.
0x50
Pixel Dots on Background
Plot 16 black and white pixel dots in a row at given cooredinates on the background graphic buffer and display on the secondary display (OLED). The coordinates can be directly by literal values or indirectly by registers.
INST_MARK_GFX_BG_DOTS | HEX | sOP00 | sOP01 | OP-1 |
---|---|---|---|---|
Plot 16 black and white pixel dots in a row at location (00 ,04 ) on the OLED | 50 | 00 | 04 | 3603 |
The pixel area on the display is , or in hexadecimal.
Pixels are binary, 0 for a black pxiel ■, and 1 for a white pixel.
In the example, OP-1 is 3603
, in binary:
Starting at location (0,4), plot the following line:
Secondary Display
■■□□■□□■■■■■■■□□
info
OP/sOP | Value/Range | Remarks |
---|---|---|
sOP00 | 00 ~7F | Horizontal coordinate X |
sOP01 | 00 ~3F | Vertical coordinate Y |
OP-1 | 0000 ~FFFF | Binary pixels in hexadecimal |
0x51
Pixel Dots on Texture Buffers
Plot 16 binary pixel dots on a specified row of a chosen texture buffer.
tip
There are 16 texture buffers, indexed 00
~ 0F
.
INST_MARK_GFX_FG_DOTS | HEX | sOP00 | sOP01 | OP-1 |
---|---|---|---|---|
Plot 16 pixel dots on texture buffer 0F , row 07 | 51 | 0F | 07 | 3603 |
info
OP/sOP | Value/Range | Remarks |
---|---|---|
sOP00 | 00 ~0F | Texture buffer index |
sOP01 | 00 ~0F | Row |
OP-1 | 0000 ~FFFF | Hexadecimal for pixel dots |
0x55
Printing Formatted Values
Print formatted values of registers at specific coordinates on the secondary display.
INST_PUT_TEXT_WITH_FMT | HEX | sOP00 | sOP01 | sOP10 | sOP11 |
---|---|---|---|---|---|
At (0,16) print the value of register 01 , with format code 0x11 | 55 | 11 | 01 | 00 | 10 |
At coordinates stored in R04 , print the value of register 01 , with format code 0x12 | 55 | 12 | 01 | 80 | 04 |
info
sOP00 Format code for numbers and font size, e.g.
0x11
is for unsigned decimal integer numbers with midium sized fonts:High Byte:
Value Format Value Format 00 Signed decimal integer 04 Hexadecimal 01 Unsigned decimal integer 08 Option 0 with Fixed Length 02 Binary 09 Option 1 with Fixed Length 03 Octal 0B String buffer (experimental) Low Byte:
Value/Range Font size 0 Small 1 Medium 2 Large
sOP01 Register index;
sOP10
Value/Range Remarks 0x00
~0x7F
X coordinate of background,ranging from 0~127 in decimal 0x80
Get X and Y coordinates from register specified by sOP11 sOP11: Depends on sOP10
sOP10 0x00
~0x7F
Y coordinate of background,ranging from 0~63 in decimal 0x80
Index of register for coordinates, high byte for X and low byte for Y coordinates
tip
- Coordinates ranges: 0 ≤ X ≤ 127,0 ≤ Y ≤ 63;
- In example 1, the value in register
01
will be displayed in format0x11
, i.e. unsigned decimal integer with medium font size, at (0, 16) on the secondary display; - In example 2, suppose the value in
R04
is0x0420
, the value in register01
will be displayed in format0x12
, i.e. unsigned decimal integer with large font size, at (0x04, 0x20) or (4, 32) indecimal, on the secondary display.
0x56
Draw a Circle
Draw a circle at specified coordinates, with desired radius.
INST_DRAW_CIRCLE | HEX | sOP00 | sOP01 | sOP10 | sOP11 |
---|---|---|---|---|---|
At (16,16) draw a white edge circle with 5 pixels radius | 56 | 05 | 00 | 10 | 10 |
At coordinates stored in R04 , draw a black edge circle with 18 pixels radius | 56 | 12 | 01 | 80 | 04 |
info
sOP00 radius,
00
~FF
sOP01 colour of the edge
Value/Range Remarks 0x00
Black edge 0x01
White edge sOP10
Value/Range Remarks 0x00
~0x7F
X coordinate of background,ranging from 0~127 in decimal 0x80
Get X and Y coordinates from register specified by sOP11 sOP11: Depends on sOP10
sOP10 0x00
~0x7F
Y coordinate of background,ranging from 0~63 in decimal 0x80
Index of register for coordinates, high byte for X and low byte for Y coordinates
特别说明
- Coordinates ranges: 0 ≤ X ≤ 127,0 ≤ Y ≤ 63;
- In example 2, suppose the value in
R04
is0x0420
, a black edged circle with radius of 18 pixels will be shown at (0x04, 0x20) or (4, 32) indecimal, on the secondary display.
0x5C
Display Two Chars
Display two ASCII characters at specified coordinates.
INST_DISP_CHAR | HEX | sOP00 | sOP01 | sOP10 | sOP11 |
---|---|---|---|---|---|
At (16,16), display "AB" | 5C | 41 | 42 | 10 | 10 |
At coordinates stored in R04 , display two characters "CD" | 5C | 63 | 64 | 80 | 04 |
info
sOP00 ASCII character,starts from 0x20 (space)
sOP01 ASCII character,starts from 0x20 (space)
sOP10
Value/Range Remarks 0x00
~0x7F
X coordinate of background,ranging from 0~127 in decimal 0x80
Get X and Y coordinates from register specified by sOP11 sOP11: Depends on sOP10
sOP10 0x00
~0x7F
Y coordinate of background,ranging from 0~63 in decimal 0x80
Index of register for coordinates, high byte for X and low byte for Y coordinates
tip
- In example 2, suppose the value in
R04
is0x0420
, two characters "AB" will be shown at (0x04, 0x20) or (4, 32) indecimal, on the secondary display.
0x5D
Show Characters in Multiple Registers
Display a series of ASCII characters at specified coordinates.
INST_DRAW_REGx_CHAR | HEX | sOP00 | sOP01 | sOP10 | sOP11 |
---|---|---|---|---|---|
At (16,16), display 5 ASCII characters stored in a series of registers starting from R01 | 5D | 05 | 01 | 10 | 10 |
At coordinates stored in R04 , display 5 ASCII characters stored in a series of registers starting from R01 | 5D | 05 | 01 | 80 | 04 |
info
sOP00 Number of characters to display
sOP01 Starting register index
sOP10
Value/Range Remarks 0x00
~0x7F
X coordinate of background,ranging from 0~127 in decimal 0x80
Get X and Y coordinates from register specified by sOP11 sOP11: Depends on sOP10
sOP10 0x00
~0x7F
Y coordinate of background,ranging from 0~63 in decimal 0x80
Index of register for coordinates, high byte for X and low byte for Y coordinates
Explanation
- In example 1,suppose
R01
is0x4865
('H' and 'e'),R02
is0x6C6C
('l' and 'l'),R03
is0x6F21
('o' and'!'). At (16,16) display a series of characters 'Hello'. As number of characters is set to 5, '!' as the sixth will not be shown. - In example 2,suppose the value in
R04
is0x0420
, then the same wordhello
is displayed at (0x04, 0x20), or (4, 32) in decimal.