Difference between revisions of "Component: GLCD (SH1106) SPI (Graphical Monochrome)"
From Flowcode Help
Jump to navigationJump to search| Line 15: | Line 15: | ||
| Graphical display component designed to work with the SH1106 type monochrome displays. Transfers data using a 4-wire SPI interface.   | Graphical display component designed to work with the SH1106 type monochrome displays. Transfers data using a 4-wire SPI interface.   | ||
| − | ==Component  | + | ==Component Source Code== | 
| − | + | Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_glcd_SH1106_SPI.fcfx FC_Comp_Source_glcd_SH1106_SPI.fcfx] | |
| ==Detailed description== | ==Detailed description== | ||
| + | |||
| + | |||
| Line 32: | Line 34: | ||
| ==Examples== | ==Examples== | ||
| + | |||
| + | |||
| Line 501: | Line 505: | ||
| | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | ||
| | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''   | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''   | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Dimensions | ||
| |- | |- | ||
| |- | |- | ||
| Line 512: | Line 520: | ||
| |- | |- | ||
| | colspan="2" | Heigt of gLCD canvas measured in pixels.  | | colspan="2" | Heigt of gLCD canvas measured in pixels.  | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Colour | ||
| + | |- | ||
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
| Line 527: | Line 539: | ||
| |- | |- | ||
| | colspan="2" | Specifies the initial background color.  | | colspan="2" | Specifies the initial background color.  | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Bit Depth | ||
| + | |- | ||
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
| Line 547: | Line 563: | ||
| |- | |- | ||
| | colspan="2" | Number of bits of Blue colour depth on the display  | | colspan="2" | Number of bits of Blue colour depth on the display  | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Connections | ||
| + | |- | ||
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| − | | width="90%" |  | + | | width="90%" | Channel | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | SPI Channel selector  | 
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| − | | width="90%" |  | + | | width="90%" | Prescale | 
| + | |- | ||
| + | | colspan="2" | Prescale option selector  | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
| + | | width="90%" | MOSI | ||
| + | |- | ||
| + | | colspan="2" | SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode.  | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
| + | | width="90%" | MISO | ||
| + | |- | ||
| + | | colspan="2" | SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode.  | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
| + | | width="90%" | CLK | ||
| + | |- | ||
| + | | colspan="2" | SPI Clock Pin CLK - The Clock signal is driven by the SPI master.  | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | ||
| + | | width="90%" | CS / SS | ||
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | Chip Select / Slave Select Pin  Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device.   | 
| |- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | 
| − | | width="90%" |  | + | | width="90%" | DC | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | Address pin to tell the display if we are sending commands or data  | 
| |- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-5-icon.png]] | 
| − | | width="90%" |  | + | | width="90%" | Reset | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | Reset pin on the display, used during initialise to force a clean startup of the display  | 
| |- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | 
| − | | width="90%" |  | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Fonts | 
| |- | |- | ||
| − | |||
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| − | | width="90%" |  | + | | width="90%" | Font Count | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | Specifies the number of fonts available to use on the display.  | 
| |- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | 
| − | | width="90%" |  | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Font 0 | 
| |- | |- | ||
| − | |||
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| Line 598: | Line 636: | ||
| | colspan="2" | Sets the number of horizontal pixels used to represent a space character.  | | colspan="2" | Sets the number of horizontal pixels used to represent a space character.  | ||
| |- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | 
| − | | width="90%" |  | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation | 
| |- | |- | ||
| − | |||
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| − | | width="90%" |  | + | | width="90%" | Component Label | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" |   | 
| |- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-15-icon.png]] | 
| − | | width="90%" |  | + | | width="90%" | Component Label Scale | 
| |- | |- | ||
| − | | colspan="2" |  | + | | colspan="2" | The label scale can be change if the amout of text is too wide for the display   | 
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-16-icon.png]] | ||
| Line 622: | Line 659: | ||
| |- | |- | ||
| | colspan="2" | Allows the communications to be simulated to either see the waveforms on the data recorder or to drive an injector component.  | | colspan="2" | Allows the communications to be simulated to either see the waveforms on the data recorder or to drive an injector component.  | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Communications | ||
| + | |- | ||
| |- | |- | ||
| | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
| Line 637: | Line 678: | ||
| |- | |- | ||
| | colspan="2" |   | | colspan="2" |   | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| |} | |} | ||
Revision as of 17:53, 9 November 2022
| Author | Matrix Ltd | 
| Version | 2.0 | 
| Category | Graphical Monochrome | 
Contents
GLCD (SH1106) SPI component
Graphical display component designed to work with the SH1106 type monochrome displays. Transfers data using a 4-wire SPI interface.
Component Source Code
Please click here for the component source code: FC_Comp_Source_glcd_SH1106_SPI.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Downloadable macro reference
|   | DrawLine | 
| Draws a line with the current foreground colour from pixel location X1, Y1 to pixel location X2, Y2. | |
|  - UINT | X1 | 
|  - UINT | Y1 | 
|  - UINT | X2 | 
|  - UINT | Y2 | 
|  - VOID | Return | 
|   | Plot | 
| Sets a pixel with the current foreground colour at pixel location X, Y. | |
|  - UINT | X1 | 
|  - UINT | Y1 | 
|  - VOID | Return | 
|   | BPlot | 
| Sets a pixel with the current background colour at pixel location X, Y. | |
|  - UINT | X1 | 
|  - UINT | Y1 | 
|  - VOID | Return | 
|   | ReadFontStat | 
| Gets a stat from the selected embedded ASCII font data. | |
|  - BYTE | Font | 
| Font selection range: 0 to (NumFonts - 1) | |
|  - BYTE | Index | 
| 0=SpaceWidth, 1=PixelHeight | |
|  - BYTE | Return | 
|   | ClearDisplay | 
| This macro clears the display of any previous output by overwriting the entire display with the background colour. | |
|  - VOID | Return | 
|   | SetBackgroundColour | 
| Specifies the colour of the foreground | |
|  - BYTE | PixelColour | 
| 0=White, 1=Black | |
|  - VOID | Return | 
|   | Write_Command | 
|  - BYTE | Command | 
|  - VOID | Return | 
|   | SetForegroundColour | 
| Specifies the colour of the foreground. | |
|  - BYTE | PixelColour | 
| 0=White, 1=Black | |
|  - VOID | Return | 
|   | Initialise | 
| The Init macro must be called once to initialise the Graphical LCD display before any other Graphical LCD component macros are called. | |
|  - VOID | Return | 










