Graphic Lcd Library
mikroPascal PRO for ARM provides a library for operating Graphic Lcd 128x64 (with commonly used Samsung KS108/KS107 controller).
For creating a custom set of Glcd images use Glcd Bitmap Editor Tool.
Library Dependency Tree
External dependencies of Graphic Lcd Library
Stellaris
The following variables must be defined in all projects using Graphic Lcd Library: | Description : | Example : |
---|---|---|
var GLCD_D0 : sbit; sfr; external; |
Data 0 line. | var GLCD_D0 : sbit at GPIO_PORTA_DATA.B0; |
var GLCD_D1 : sbit; sfr; external; |
Data 1 line. | var GLCD_D1 : sbit at GPIO_PORTA_DATA.B1; |
var GLCD_D2 : sbit; sfr; external; |
Data 2 line. | var GLCD_D2 : sbit at GPIO_PORTA_DATA.B2; |
var GLCD_D3 : sbit; sfr; external; |
Data 3 line. | var GLCD_D3 : sbit at GPIO_PORTA_DATA.B3; |
var GLCD_D4 : sbit; sfr; external; |
Data 4 line. | var GLCD_D4 : sbit at GPIO_PORTA_DATA.B4; |
var GLCD_D5 : sbit; sfr; external; |
Data 5 line. | var GLCD_D5 : sbit at GPIO_PORTA_DATA.B5; |
var GLCD_D6 : sbit; sfr; external; |
Data 6 line. | var GLCD_D6 : sbit at GPIO_PORTA_DATA.B6; |
var GLCD_D7 : sbit; sfr; external; |
Data 7 line. | var GLCD_D7 : sbit at GPIO_PORTA_DATA.B7; |
var GLCD_CS1 : sbit; sfr; external; |
Chip Select 1 line. | var GLCD_CS1 : sbit at GPIO_PORTD_DATA.B0; |
var GLCD_CS2 : sbit; sfr; external; |
Chip Select 2 line. | var GLCD_CS2 : sbit at GPIO_PORTD_DATA.B1; |
var GLCD_RS : sbit; sfr; external; |
Register select line. | var GLCD_RS : sbit at GPIO_PORTD_DATA.B2; |
var GLCD_RW : sbit; sfr; external; |
Read/Write line. | var GLCD_RW : sbit at GPIO_PORTD_DATA.B3; |
var GLCD_EN : sbit; sfr; external; |
Enable line. | var GLCD_EN : sbit at GPIO_PORTD_DATA.B4; |
var GLCD_RST : sbit; sfr; external; |
Reset line. | var GLCD_RST : sbit at GPIO_PORTD_DATA.B5; |
var GLCD_D0_Direction : sbit; sfr; external; |
Direction of the Data 0 pin. | var GLCD_D0_Direction : sbit at GPIO_PORTA_DIR.B0; |
var GLCD_D1_Direction : sbit; sfr; external; |
Direction of the Data 1 pin. | var GLCD_D1_Direction : sbit at GPIO_PORTA_DIR.B1; |
var GLCD_D2_Direction : sbit; sfr; external; |
Direction of the Data 2 pin. | var GLCD_D2_Direction : sbit at GPIO_PORTA_DIR.B2; |
var GLCD_D3_Direction : sbit; sfr; external; |
Direction of the Data 3 pin. | var GLCD_D3_Direction : sbit at GPIO_PORTA_DIR.B3; |
var GLCD_D4_Direction : sbit; sfr; external; |
Direction of the Data 4 pin. | var GLCD_D4_Direction : sbit at GPIO_PORTA_DIR.B4; |
var GLCD_D5_Direction : sbit; sfr; external; |
Direction of the Data 5 pin. | var GLCD_D5_Direction : sbit at GPIO_PORTA_DIR.B5; |
var GLCD_D6_Direction : sbit; sfr; external; |
Direction of the Data 6 pin. | var GLCD_D6_Direction : sbit at GPIO_PORTA_DIR.B6; |
var GLCD_D7_Direction : sbit; sfr; external; |
Direction of the Data 7 pin. | var GLCD_D7_Direction : sbit at GPIO_PORTA_DIR.B7; |
var GLCD_CS1_Direction : sbit; sfr; external; |
Direction of the Chip Select 1 pin. | var GLCD_CS1_Direction : sbit at GPIO_PORTD_DIR.B0; |
var GLCD_CS2_Direction : sbit; sfr; external; |
Direction of the Chip Select 2 pin. | var GLCD_CS2_Direction : sbit at GPIO_PORTD_DIR.B1; |
var GLCD_RS_Direction : sbit; sfr; external; |
Direction of the Register select pin. | var GLCD_RS_Direction : sbit at GPIO_PORTD_DIR.B2; |
var GLCD_RW_Direction : sbit; sfr; external; |
Direction of the Read/Write pin. | var GLCD_RW_Direction : sbit at GPIO_PORTD_DIR.B3; |
var GLCD_EN_Direction : sbit; sfr; external; |
Direction of the Enable pin. | var GLCD_EN_Direction : sbit at GPIO_PORTD_DIR.B4; |
var GLCD_RST_Direction : sbit; sfr; external; |
Direction of the Reset pin. | var GLCD_RST_Direction : sbit at GPIO_PORTD_DIR.B5; |
MSP432
The following variables must be defined in all projects using Graphic Lcd Library: | Description : | Example : |
---|---|---|
var GLCD_DataPort_Input : word; sfr; external; |
Data input port. | var GLCD_DataPort_Input : word at DIO_P5IN; |
var GLCD_DataPort_Output : word; sfr; external; |
Data output port. | var GLCD_DataPort_Output : word at DIO_P5OUT; |
var GLCD_DataPort_Direction : word; sfr; external; |
Data direction port. | var GLCD_DataPort_Direction : word at DIO_P5DIR; |
var GLCD_CS1 : sbit; sfr; external; |
Chip Select 1 line. | var GLCD_CS1 : sbit at DIO_P6OUT.B0; |
var GLCD_CS2 : sbit; sfr; external; |
Chip Select 2 line. | var GLCD_CS2 : sbit at DIO_P6OUT.B1; |
var GLCD_RS : sbit; sfr; external; |
Register select line. | var GLCD_RS : sbit at DIO_P6OUT.B2; |
var GLCD_RW : sbit; sfr; external; |
Read/Write line. | var GLCD_RW : sbit at DIO_P6OUT.B3; |
var GLCD_EN : sbit; sfr; external; |
Enable line. | var GLCD_EN : sbit at DIO_P6OUT.B4; |
var GLCD_RST : sbit; sfr; external; |
Reset line. | var GLCD_RST : sbit at DIO_P6OUT.B5; |
var GLCD_CS1_Direction : sbit; sfr; external; |
Direction of the Chip Select 1 pin. | var GLCD_CS1_Direction : sbit at DIO_P6DIR.B0; |
var GLCD_CS2_Direction : sbit; sfr; external; |
Direction of the Chip Select 2 pin. | var GLCD_CS2_Direction : sbit at DIO_P6DIR.B1; |
var GLCD_RS_Direction : sbit; sfr; external; |
Direction of the Register select pin. | var GLCD_RS_Direction : sbit at DIO_P6DIR.B2; |
var GLCD_RW_Direction : sbit; sfr; external; |
Direction of the Read/Write pin. | var GLCD_RW_Direction : sbit at DIO_P6DIR.B3; |
var GLCD_EN_Direction : sbit; sfr; external; |
Direction of the Enable pin. | var GLCD_EN_Direction : sbit at DIO_P6DIR.B4; |
var GLCD_RST_Direction : sbit; sfr; external; |
Direction of the Reset pin. | var GLCD_RST_Direction : sbit at DIO_P6DIR.B5; |
STM32
The following variables must be defined in all projects using Graphic Lcd Library: | Description : | Example : |
---|---|---|
var GLCD_DataPort_Input : dword; sfr; external; |
Data input port. | var GLCD_DataPort_Input : dword at GPIOE_IDR; |
var GLCD_DataPort_Output : dword; sfr; external; |
Data output port. | var GLCD_DataPort_Output : dword at GPIOE_ODR; |
var GLCD_CS1 : sbit; sfr; external; |
Chip Select 1 line. | var GLCD_CS1 : sbit at GPIOE_ODR.B10; |
var GLCD_CS2 : sbit; sfr; external; |
Chip Select 2 line. | var GLCD_CS2 : sbit at GPIOE_ODR.B11; |
var GLCD_RS : sbit; sfr; external; |
Register select line. | var GLCD_RS : sbit at GPIOE_ODR.B12; |
var GLCD_RW : sbit; sfr; external; |
Read/Write line. | var GLCD_RW : sbit at GPIOE_ODR.B13; |
var GLCD_EN : sbit; sfr; external; |
Enable line. | var GLCD_EN : sbit at GPIOE_ODR.B15; |
var GLCD_RST : sbit; sfr; external; |
Reset line. | var GLCD_RST : sbit at GPIOE_ODR.B8; |
CEC1x02
The following variables must be defined in all projects using Graphic Lcd Library: | Description : | Example : |
---|---|---|
var GLCD_DataPort_Input : byte; sfr; external; |
Data input port. | var GLCD_DataPort_Input : byte at GPIO_INPUT_010_017; |
var GLCD_DataPort_Output : byte; sfr; external; |
Data output port. | var GLCD_DataPort_Output : byte at GPIO_OUTPUT_010_017; |
var GLCD_CS1 : sbit; sfr; external; |
Chip Select 1 line. | var GLCD_CS1 : sbit at GPIO_OUTPUT_PIN_001_bit; |
var GLCD_CS2 : sbit; sfr; external; |
Chip Select 2 line. | var GLCD_CS2 : sbit at GPIO_OUTPUT_PIN_002_bit; |
var GLCD_RS : sbit; sfr; external; |
Register select line. | var GLCD_RS : sbit at GPIO_OUTPUT_PIN_003_bit; |
var GLCD_RW : sbit; sfr; external; |
Read/Write line. | var GLCD_RW : sbit at GPIO_OUTPUT_PIN_004_bit; |
var GLCD_EN : sbit; sfr; external; |
Enable line. | var GLCD_EN : sbit at GPIO_OUTPUT_PIN_005_bit; |
var GLCD_RST : sbit; sfr; external; |
Reset line. | var GLCD_RST : sbit at GPIO_OUTPUT_PIN_006_bit; |
Library Routines
Basic routines:
Advanced routines:
- Glcd_Fill
- Glcd_Dot
- Glcd_Line
- Glcd_V_Line
- Glcd_H_Line
- Glcd_Rectangle
- Glcd_Rectangle_Round_Edges
- Glcd_Rectangle_Round_Edges_Fill
- Glcd_Box
- Glcd_Circle
- Glcd_Circle_Fill
- Glcd_Set_Font
- Glcd_Set_Font_Adv
- Glcd_Set_Ext_Font_Adv
- Glcd_Write_Char
- Glcd_Write_Char_Adv
- Glcd_Write_Text
- Glcd_Write_Text_Adv
- Glcd_Image
- Glcd_Ext_Image
- Glcd_PartialImage
- Glcd_Ext_PartialImage
Glcd_Init
Prototype |
procedure Glcd_Init(); |
---|---|
Description |
Initializes the Glcd module. Each of the control lines are both port and pin configurable, while data lines must be on a single port (pins <0:7>). |
Parameters |
None. |
Returns |
Nothing. |
Requires |
External dependencies of the library from the top of the page must be defined before using this function. |
Example |
Stellaris// Glcd module connections var GLCD_D7 : sbit at GPIO_PORTA_DATA.B7; GLCD_D6 : sbit at GPIO_PORTA_DATA.B6; GLCD_D5 : sbit at GPIO_PORTA_DATA.B5; GLCD_D4 : sbit at GPIO_PORTA_DATA.B4; GLCD_D3 : sbit at GPIO_PORTA_DATA.B3; GLCD_D2 : sbit at GPIO_PORTA_DATA.B2; GLCD_D1 : sbit at GPIO_PORTA_DATA.B1; GLCD_D0 : sbit at GPIO_PORTA_DATA.B0; GLCD_D7_Direction : sbit at GPIO_PORTA_DIR.B7; GLCD_D6_Direction : sbit at GPIO_PORTA_DIR.B6; GLCD_D5_Direction : sbit at GPIO_PORTA_DIR.B5; GLCD_D4_Direction : sbit at GPIO_PORTA_DIR.B4; GLCD_D3_Direction : sbit at GPIO_PORTA_DIR.B3; GLCD_D2_Direction : sbit at GPIO_PORTA_DIR.B2; GLCD_D1_Direction : sbit at GPIO_PORTA_DIR.B1; GLCD_D0_Direction : sbit at GPIO_PORTA_DIR.B0; var GLCD_CS1 : sbit at GPIO_PORTD_DATA.B0; GLCD_CS2 : sbit at GPIO_PORTD_DATA.B1; GLCD_RS : sbit at GPIO_PORTD_DATA.B2; GLCD_RW : sbit at GPIO_PORTD_DATA.B3; GLCD_EN : sbit at GPIO_PORTD_DATA.B4; GLCD_RST : sbit at GPIO_PORTD_DATA.B5; GLCD_CS1_Direction : sbit at GPIO_PORTD_DIR.B0; GLCD_CS2_Direction : sbit at GPIO_PORTD_DIR.B1; GLCD_RS_Direction : sbit at GPIO_PORTD_DIR.B2; GLCD_RW_Direction : sbit at GPIO_PORTD_DIR.B3; GLCD_EN_Direction : sbit at GPIO_PORTD_DIR.B4; GLCD_RST_Direction : sbit at GPIO_PORTD_DIR.B5; // End Glcd module connections ... Glcd_Init(); MSP432// Glcd module connections var GLCD_DataPort_Input: word at DIO_P5IN; var GLCD_DataPort_Output: word at DIO_P5OUT; var GLCD_DataPort_Direction: word at DIO_P5DIR; var GLCD_CS1: sbit at DIO_P6OUT.B0; var GLCD_CS2: sbit at DIO_P6OUT.B1; var GLCD_RS: sbit at DIO_P6OUT.B2; var GLCD_RW: sbit at DIO_P6OUT.B3; var GLCD_EN: sbit at DIO_P6OUT.B4; var GLCD_RST: sbit at DIO_P6OUT.B5; var GLCD_CS1_Direction : sbit at DIO_P6DIR.B0; var GLCD_CS2_Direction : sbit at DIO_P6DIR.B1; var GLCD_RS_Direction : sbit at DIO_P6DIR.B2; var GLCD_RW_Direction : sbit at DIO_P6DIR.B3; var GLCD_EN_Direction : sbit at DIO_P6DIR.B4; var GLCD_RST_Direction : sbit at DIO_P6DIR.B5; // End Glcd module connections ... Glcd_Init(); STM32// Glcd module connections var GLCD_DataPort_Input: dword at GPIOE_IDR; var GLCD_DataPort_Output: dword at GPIOE_ODR; var GLCD_CS1: sbit at GPIOE_ODR.B10; var GLCD_CS2: sbit at GPIOE_ODR.B11; var GLCD_RS: sbit at GPIOE_ODR.B12; var GLCD_RW: sbit at GPIOE_ODR.B13; var GLCD_EN: sbit at GPIOE_ODR.B15; var GLCD_RST: sbit at GPIOE_ODR.B8; // End Glcd module connections ... Glcd_Init(); CEC1x02// Glcd module connections var GLCD_DataPort_Input : byte at GPIO_INPUT_010_017; var GLCD_DataPort_Output : byte at GPIO_OUTPUT_010_017; var GLCD_CS1: sbit at GPIO_OUTPUT_PIN_001_bit; var GLCD_CS2: sbit at GPIO_OUTPUT_PIN_002_bit; var GLCD_RS: sbit at GPIO_OUTPUT_PIN_003_bit; var GLCD_RW: sbit at GPIO_OUTPUT_PIN_004_bit; var GLCD_EN: sbit at GPIO_OUTPUT_PIN_005_bit; var GLCD_RST: sbit at GPIO_OUTPUT_PIN_006_bit; // End Glcd module connections ... Glcd_Init(); |
Notes |
None. |
Glcd_Set_Side
Prototype |
procedure Glcd_Set_Side(x_pos: byte); |
---|---|
Description |
Selects Glcd side. Refer to the Glcd datasheet for detailed explanation. |
Parameters |
|
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
The following two lines are equivalent, and both of them select the left side of Glcd: Glcd_Select_Side(0); Glcd_Select_Side(10); |
Notes |
For side, x axis and page layout explanation see schematic at the bottom of this page. |
Glcd_Set_X
Prototype |
procedure Glcd_Set_X(x_pos: byte); |
---|---|
Description |
Sets x-axis position to |
Parameters |
|
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
Glcd_Set_X(25); |
Notes |
For side, x axis and page layout explanation see schematic at the bottom of this page. |
Glcd_Set_Page
Prototype |
procedure Glcd_Set_Page(page: byte); |
---|---|
Description |
Selects page of the Glcd. |
Parameters |
|
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
Glcd_Set_Page(5); |
Notes |
For side, x axis and page layout explanation see schematic at the bottom of this page. |
Glcd_Read_Data
Prototype |
function Glcd_Read_Data() : byte; |
---|---|
Description |
Reads data from from the current location of Glcd memory and moves to the next location. |
Parameters |
None. |
Returns |
One byte from Glcd memory, formatted as a word (16-bit). |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. Glcd side, x-axis position and page should be set first. See functions Glcd_Set_Side, Glcd_Set_X, and Glcd_Set_Page. |
Example |
var data_ : byte; ... Glcd_Read_Data(); data_ := Glcd_Read_Data(); |
Notes |
This routine needs to be called twice; After the first call, data is placed in the buffer register. After the second call, data is passed from the buffer register to data lines. |
Glcd_Write_Data
Prototype |
procedure Glcd_Write_Data(data_: byte); |
---|---|
Returns |
Nothing. |
Description |
Writes one byte to the current location in Glcd memory and moves to the next location. Parameters :
|
Requires |
Glcd needs to be initialized, see Glcd_Init routine. Glcd side, x-axis position and page should be set first. See functions Glcd_Set_Side, Glcd_Set_X, and Glcd_Set_Page. |
Example |
var data_ : byte; ... Glcd_Write_Data(data_); |
Glcd_Set_Ext_Buffer
Prototype |
procedure Glcd_Set_Ext_Buffer(getExtDataPtr : ^TGlcd_Get_Ext_Data_Ptr); |
---|---|
Returns |
Nothing. |
Description |
Function sets pointer to the user function which manipulates the external resource. Parameters :
User function prototype should be in the following format: Parameters used in the function have the following meaning :
|
Requires |
Glcd module needs to be initialized. See the Glcd_Init routine. |
Example |
Glcd_Set_Ext_Buffer(@ReadExternalBuffer); |
Glcd_Fill
Prototype |
procedure Glcd_Fill(pattern: byte); |
---|---|
Description |
Fills Glcd memory with the byte To clear the Glcd screen, use To fill the screen completely, use |
Parameters |
|
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Clear screen Glcd_Fill(0); |
Notes |
None. |
Glcd_Dot
Prototype |
procedure Glcd_Dot(x_pos, y_pos, color: byte); |
---|---|
Description |
Draws a dot on Glcd at coordinates ( |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Invert the dot in the upper left corner Glcd_Dot(0, 0, 2); |
Notes |
For x and y axis layout explanation see schematic at the bottom of this page. |
Glcd_Line
Prototype |
procedure Glcd_Line(x_start, y_start, x_end, y_end: integer; color: byte); |
---|---|
Description |
Draws a line on Glcd. |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Draw a line between dots (0,0) and (20,30) Glcd_Line(0, 0, 20, 30, 1); |
Notes |
None. |
Glcd_V_Line
Prototype |
procedure Glcd_V_Line(y_start, y_end, x_pos, color: byte); |
---|---|
Description |
Draws a vertical line on Glcd. |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Draw a vertical line between dots (10,5) and (10,25) Glcd_V_Line(5, 25, 10, 1); |
Notes |
None. |
Glcd_H_Line
Prototype |
procedure Glcd_H_Line(x_start, x_end, y_pos, color: byte); |
---|---|
Description |
Draws a horizontal line on Glcd. |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Draw a horizontal line between dots (10,20) and (50,20) Glcd_H_Line(10, 50, 20, 1); |
Notes |
None. |
Glcd_Rectangle
Prototype |
procedure Glcd_Rectangle(x_upper_left, y_upper_left, x_bottom_right, y_bottom_right, color: byte); |
---|---|
Description |
Draws a rectangle on Glcd. |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Draw a rectangle between dots (5,5) and (40,40) Glcd_Rectangle(5, 5, 40, 40, 1); |
Notes |
None. |
Glcd_Rectangle_Round_Edges
Prototype |
procedure Glcd_Rectangle_Round_Edges(x_upper_left: byte; y_upper_left: byte; x_bottom_right: byte; y_bottom_right: byte; radius: byte; color: byte); |
---|---|
Description |
Draws a rounded edge rectangle on Glcd. |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Draw a rounded edge rectangle between dots (5,5) and (40,40) with the radius of 12 Glcd_Rectangle_Round_Edges(5, 5, 40, 40, 12, 1); |
Notes |
None. |
Glcd_Rectangle_Round_Edges_Fill
Prototype |
procedure Glcd_Rectangle_Round_Edges_Fill(x_upper_left: byte; y_upper_left: byte; x_bottom_right: byte; y_bottom_right: byte; radius: byte; color: byte); |
---|---|
Description |
Draws a filled rounded edge rectangle on Glcd. |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Draws a filled rounded edge rectangle between dots (5,5) and (40,40) with the radius of 12 Glcd_Rectangle_Round_Edges_Fill(5, 5, 40, 40, 12, 1); |
Notes |
None. |
Glcd_Box
Prototype |
procedure Glcd_Box(x_upper_left, y_upper_left, x_bottom_right, y_bottom_right, color: byte); |
---|---|
Description |
Draws a box on Glcd. |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Draw a box between dots (5,15) and (20,40) Glcd_Box(5, 15, 20, 40, 1); |
Notes |
None. |
Glcd_Circle
Prototype |
procedure Glcd_Circle(x_center, y_center, radius: integer; color: byte); |
---|---|
Description |
Draws a circle on Glcd. |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Draw a circle with center in (50,50) and radius=10 Glcd_Circle(50, 50, 10, 1); |
Notes |
None. |
Glcd_Circle_Fill
Prototype |
procedure Glcd_Circle_Fill(x_center: integer; y_center: integer; radius: integer; color: byte); |
---|---|
Description |
Draws a filled circle on Glcd. |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Draws a filled circle with center in (50,50) and radius=10 Glcd_Circle_Fill(50, 50, 10, 1); |
Notes |
None. |
Glcd_Set_Font
Prototype |
procedure Glcd_Set_Font(const activeFont: ^byte; aFontWidth, aFontHeight : byte; aFontOffs : byte); |
---|---|
Description |
Sets font that will be used with Glcd_Write_Char and Glcd_Write_Text routines. |
Parameters |
The user can use fonts given in the file “__Lib_GLCDFonts” file located in the Uses folder or create his own fonts. List of supported fonts:
For the sake of the backward compatibility, these fonts are supported also:
|
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Use the custom 5x7 font "myfont" which starts with space (32): Glcd_Set_Font(@myfont, 5, 7, 32); |
Notes |
None. |
Glcd_Set_Font_Adv
Prototype |
procedure Glcd_Set_Font_Adv(const activeFont : ^byte; font_color : word; font_orientation : byte); |
---|---|
Description |
Sets font that will be used with Glcd_Write_Char_Adv and Glcd_Write_Text_Adv routines. |
Parameters |
|
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
Glcd_Set_Font_Adv(@myfont, 0, 0); |
Notes |
None. |
Glcd_Set_Ext_Font_Adv
Prototype |
procedure Glcd_Set_Ext_Font_Adv(activeFont : dword; font_color : word; font_orientation : word); |
---|---|
Description |
Sets font that will be used with Glcd_Write_Char_Adv and Glcd_Write_Text_Adv routines. Font is located in an external resource. |
Parameters |
|
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
Glcd_Set_Ext_Font_Adv(173296, 5, 7, 32); |
Notes |
None. |
Glcd_Write_Char
Prototype |
procedure Glcd_Write_Char(character, x_pos, page_num, color : byte); |
---|---|
Description |
Prints character on the Glcd. |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. Use Glcd_Set_Font to specify the font for display. |
Example |
// Write character 'C' on the position 10 inside the page 2: Glcd_Write_Char('C', 10, 2, 1); |
Notes |
For x axis and page layout explanation see schematic at the bottom of this page. |
Glcd_Write_Char_Adv
Prototype |
procedure Glcd_Write_Char_Adv(ch, x, y : word); |
---|---|
Returns |
Nothing. |
Description |
Writes a char on the glcd at coordinates (x, y).
|
Requires |
glcd module needs to be initialized. See the Glcd_Init routine. |
Example |
Glcd_Write_Char_Adv("A",22,23); |
Glcd_Write_Text
Prototype |
procedure Glcd_Write_Text(var text: string; x_pos, page_num, color : byte); |
---|---|
Description |
Prints text on Glcd. |
Parameters |
The parameter |
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. Use Glcd_Set_Font to specify the font for display. |
Example |
// Write text "Hello world!" on the position 10 inside the page 2: Glcd_Write_Text('Hello world!', 10, 2, 1); |
Notes |
For x axis and page layout explanation see schematic at the bottom of this page. |
Glcd_Write_Text_Adv
Prototype |
procedure Glcd_Write_Text_Adv(var text : string; x, y : word); |
---|---|
Returns |
Nothing. |
Description |
Writes text on the glcd at coordinates (x, y). Parameters :
|
Requires |
Glcd module needs to be initialized. See the Glcd_Init routine. |
Example |
Glcd_Write_Text_Adv("GLCD LIBRARY DEMO, WELCOME !", 0, 0); |
Glcd_Image
Prototype |
procedure Glcd_Image(const image: ^byte); |
---|---|
Description |
Displays bitmap on Glcd. |
Parameters |
|
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Draw image my_image on Glcd Glcd_Image(@my_image); |
Notes |
Use the mikroPascal PRO for ARM integrated Glcd Bitmap Editor, Tools > Glcd Bitmap Editor, to convert image to a constant array suitable for displaying on Glcd. |
Glcd_Ext_Image
Prototype |
procedure Glcd_Ext_Image(image : dword); |
---|---|
Description |
Displays a bitmap from an external resource. |
Parameters |
|
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
Glcd_Ext_Image(153608); |
Notes |
Use the mikroPascal PRO for ARM integrated Glcd Bitmap Editor, Tools > Glcd Bitmap Editor, to convert image to a constant array suitable for displaying on Glcd. |
Glcd_PartialImage
Prototype |
procedure Glcd_PartialImage(x_left, y_top, width, height, picture_width, picture_height : word; const image : ^byte); |
---|---|
Description |
Displays a partial area of the image on a desired location. |
Parameters |
|
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
// Draws a 10x15 part of the image starting from the upper left corner on the coordinate (10,12). Original image size is 16x32. Glcd_PartialImage(10, 12, 10, 15, 16, 32, @image); |
Notes |
Use the mikroPascal PRO for ARM integrated Glcd Bitmap Editor, Tools > Glcd Bitmap Editor, to convert image to a constant array suitable for displaying on Glcd. |
Glcd_Ext_PartialImage
Prototype |
procedure Glcd_Ext_PartialImage(x_left, y_top, width, height, picture_width, picture_height : word; image : dword); |
---|---|
Description |
Displays a partial area of the image, located on an external resource, on a desired location of the screen. |
Parameters |
|
Returns |
Nothing. |
Requires |
Glcd needs to be initialized, see Glcd_Init routine. |
Example |
Glcd_Ext_PartialImage(10, 12, 10, 15, 16, 32, 0); |
Notes |
Use the mikroPascal PRO for ARM integrated Glcd Bitmap Editor, Tools > Glcd Bitmap Editor, to convert image to a constant array suitable for displaying on Glcd. |