Difference between revisions of "Component: GLCD (ST7920) (Graphical Monochrome)"
From Flowcode Help
Jump to navigationJump to search (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd |- | width="20%" style="color:gray;" | Version | 1.4 |- | width="20%" style="color:gray...") |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
|- | |- | ||
| width="20%" style="color:gray;" | Version | | width="20%" style="color:gray;" | Version | ||
− | | 1. | + | | 1.6 |
|- | |- | ||
| width="20%" style="color:gray;" | Category | | width="20%" style="color:gray;" | Category | ||
Line 16: | Line 16: | ||
==Version information== | ==Version information== | ||
+ | |||
+ | Library Version, Component Version, Date, Author, Info | ||
+ | 11, 1.0, 22-07-24, BR, Added DrawArc and DrawRoundedRectangle functions | ||
Library Version, Component Version, Date, Author, Info | Library Version, Component Version, Date, Author, Info | ||
11, 1.4, 03-05-24, BR, Added SPI data mode to the component to work with serial displays | 11, 1.4, 03-05-24, BR, Added SPI data mode to the component to work with serial displays | ||
12, 1.4, 20-06-24, BR, Fixed a bug where read SPI pixel data was being repacked incorrectly | 12, 1.4, 20-06-24, BR, Fixed a bug where read SPI pixel data was being repacked incorrectly | ||
− | + | 13, 1.5, 25-06-24, BR, Added an option to allow the pixel data to be buffer locally | |
− | + | 14, 1.5, 25-06-24, BR, Fixed minor bug in pixel buffer addressing | |
+ | 15, 1.6, 25-06-24, BR, Allows buffer addressing to work better with variable pixel width/height | ||
+ | 16, 1.6, 26-06-24, BR, Fixed minor bug in pixel buffer addressing | ||
==Detailed description== | ==Detailed description== | ||
Line 105: | Line 110: | ||
| colspan="2" | This macro clears the display of any previous output by overwriting the entire display with the background colour. | | colspan="2" | This macro clears the display of any previous output by overwriting the entire display with the background colour. | ||
|- | |- | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===DrawArc=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DrawArc''' | ||
+ | |- | ||
+ | | colspan="2" | Draws an arc either as an outline or as a filled object. | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | X | ||
+ | |- | ||
+ | | colspan="2" | Center X coordinate | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Y | ||
+ | |- | ||
+ | | colspan="2" | Center Y coordinate | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Radius | ||
+ | |- | ||
+ | | colspan="2" | Radius, distance of edge from the centre coordinates | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" | StartAngle | ||
+ | |- | ||
+ | | colspan="2" | Angle to start drawing, in degrees | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-f32-icon.png]] - FLOAT | ||
+ | | width="90%" | EndAngle | ||
+ | |- | ||
+ | | colspan="2" | Angle to end drawing, in degrees | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Resolution | ||
+ | |- | ||
+ | | colspan="2" | Number of lines to draw from the center to the outer edge, 0=Fill | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Transparent | ||
+ | |- | ||
+ | | colspan="2" | Chooses the transparency - 0 = Arc contains background colour, 1 = Arc contains previous pixel data. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Solid | ||
+ | |- | ||
+ | | colspan="2" | Chooses to fill with colour - 0 = Arc transparency data, 1 = Arc contains foreground colour. | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 254: | Line 313: | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| width="90%" | Y2 | | width="90%" | Y2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Transparent | ||
+ | |- | ||
+ | | colspan="2" | Chooses the transparency of the box - 0 = Box contains background colour, 1 = Box contains previous pixel data. | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Solid | ||
+ | |- | ||
+ | | colspan="2" | Chooses to fill the box with colour - 0 = Box contains transparency data, 1 = Box contains foreground colour. | ||
+ | |- | ||
+ | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
+ | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
+ | |} | ||
+ | |||
+ | |||
+ | ===DrawRoundedRectangle=== | ||
+ | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
+ | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DrawRoundedRectangle''' | ||
+ | |- | ||
+ | | colspan="2" | Draws a rectangle with rounded corners | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | X1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Y1 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | X2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Y2 | ||
+ | |- | ||
+ | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
+ | | width="90%" | Radius | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
Line 628: | Line 736: | ||
|- | |- | ||
| colspan="2" | | | colspan="2" | | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
+ | | width="90%" | Local Buffer | ||
+ | |- | ||
+ | | colspan="2" | The display needs pixels to be assigned in blocks of 8 so for the display to function correctly we need to be able to know the value of pixels on the display to be able to draw without corruption. No - Use the display itself as a pixel buffer Yes - Use the local RAM as a pixel buffer | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] |
Latest revision as of 09:49, 23 July 2024
Author | Matrix Ltd |
Version | 1.6 |
Category | Graphical Monochrome |
Contents
- 1 GLCD (ST7920) component
- 2 Version information
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 BPlot
- 5.2 ClearDisplay
- 5.3 DrawArc
- 5.4 DrawCircle
- 5.5 DrawEllipse
- 5.6 DrawLine
- 5.7 DrawRectangle
- 5.8 DrawRoundedRectangle
- 5.9 Initialise
- 5.10 Plot
- 5.11 Print
- 5.12 PrintNumber
- 5.13 ReadFontStat
- 5.14 ReadFontWidth
- 5.15 SetBackgroundColour
- 5.16 SetDisplayOrientation
- 5.17 SetFontScaler
- 5.18 SetForegroundColour
- 5.19 Write_Command
- 5.20 Write_Data
- 6 Property reference
- 7 Component Source Code
GLCD (ST7920) component
Graphical display component designed to work with the ST7920 type monochrome displays. Transfers data using an 8-bit/4-bit/SPI digital data bus.
Version information
Library Version, Component Version, Date, Author, Info 11, 1.0, 22-07-24, BR, Added DrawArc and DrawRoundedRectangle functions
Library Version, Component Version, Date, Author, Info 11, 1.4, 03-05-24, BR, Added SPI data mode to the component to work with serial displays 12, 1.4, 20-06-24, BR, Fixed a bug where read SPI pixel data was being repacked incorrectly 13, 1.5, 25-06-24, BR, Added an option to allow the pixel data to be buffer locally 14, 1.5, 25-06-24, BR, Fixed minor bug in pixel buffer addressing 15, 1.6, 25-06-24, BR, Allows buffer addressing to work better with variable pixel width/height 16, 1.6, 26-06-24, BR, Fixed minor bug in pixel buffer addressing
Detailed description
Click here for an in depth guide to graphical LCDs using Flowcode.
Information on the Fonts available for this component are available here. GLCD Font Subcomponent
Examples
No additional examples
Macro reference
BPlot
![]() |
BPlot |
Sets a pixel with the current background colour at pixel location X, Y. | |
![]() |
X1 |
![]() |
Y1 |
![]() |
Return |
ClearDisplay
![]() |
ClearDisplay |
This macro clears the display of any previous output by overwriting the entire display with the background colour. | |
![]() |
Return |
DrawArc
DrawCircle
DrawEllipse
DrawLine
![]() |
DrawLine |
Draws a line with the current foreground colour from pixel location X1, Y1 to pixel location X2, Y2. | |
![]() |
X1 |
![]() |
Y1 |
![]() |
X2 |
![]() |
Y2 |
![]() |
Return |
DrawRectangle
DrawRoundedRectangle
Initialise
![]() |
Initialise |
The Init macro must be called once to initialise the Graphical LCD display before any other Graphical LCD component macros are called. | |
![]() |
Return |
Plot
![]() |
Plot |
Sets a pixel with the current foreground colour at pixel location X, Y. | |
![]() |
X1 |
![]() |
Y1 |
![]() |
Return |
PrintNumber
ReadFontStat
![]() |
ReadFontStat |
Gets a stat from the selected embedded ASCII font data. | |
![]() |
Font |
Font selection range: 0 to (NumFonts - 1) | |
![]() |
Index |
0=SpaceWidth, 1=PixelHeight | |
![]() |
Return |
ReadFontWidth
SetBackgroundColour
![]() |
SetBackgroundColour |
Specifies the colour of the foreground | |
![]() |
PixelColour |
0=White, 1=Black | |
![]() |
Return |
SetDisplayOrientation
SetFontScaler
SetForegroundColour
![]() |
SetForegroundColour |
Specifies the colour of the foreground. | |
![]() |
PixelColour |
0=White, 1=Black | |
![]() |
Return |
Write_Command
![]() |
Write_Command |
![]() |
Command |
![]() |
Return |
Write_Data
![]() |
Write_Data |
![]() |
data |
![]() |
Return |
Property reference
Component Source Code
Please click here to download the component source project: FC_Comp_Source_GLCD_ST7920.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_GLCD_ST7920.fcfx