Mikroelektronika%27s Glcd Bmp Editor Download

Graphic Lcd Library

  1. GLCD Tools Download | SourceForge.net
  2. Photo Editors
  3. Glcd Bitmap Editor Free Download - SourceForge
  4. Cached
  5. Mikroelektronika 27s Glcd Bmp Editor Download 1
  6. GLCD Bitmap Editor And Importing BMPs - Mikroelektronika

The mikroC PRO for PIC provides a library for operating Graphic Lcd 128x64 (with commonly used Samsung KS108/KS107 controller).

MikroElektronika's GLCD BMP editor Here I am using a NT7107/8 based (compatible with Samsung KS0107/8) 128×64 graphics LCD display. I will show how to convert the Microchip Technology logo into a constant data array and display it on the LCD that is driven by a PIC microcontroller.

  1. Feb 06, 2008 By GLCD Tools Software. Bitmap Converter is a development tool, which helps you convert any bitmaps or icons from a PC format to a C file representing that image for your embedded project.
  2. Buy among 1000+ MikroElektronika original products: Compilers, Development boards, Add-on Boards, Programmers Debuggers and more.

For creating a custom set of Glcd images use Glcd Bitmap Editor Tool.

Important : PIC16 family of MCUs does not support working with external resources.

Library Dependency Tree

External dependencies of Graphic Lcd Library

The following variables must be defined in all projects using Graphic Lcd Library:Description : Example :
extern sfr char GLCD_DataPort;Glcd Data Port.char GLCD_DataPort at PORTD;
extern sfr sbit GLCD_CS1;Chip Select 1 line.sbit GLCD_CS1 at RB0_bit;
extern sfr sbit GLCD_CS2;Chip Select 2 line.sbit GLCD_CS2 at RB1_bit;
extern sfr sbit GLCD_RS;Register select line.sbit GLCD_RS at RB2_bit;
extern sfr sbit GLCD_RW;Read/Write line.sbit GLCD_RW at RB3_bit;
extern sfr sbit GLCD_EN;Enable line.sbit GLCD_EN at RB4_bit;
extern sfr sbit GLCD_RST;Reset line.sbit GLCD_RST at RB5_bit;
extern sfr sbit GLCD_CS1_Direction;Direction of the Chip Select 1 pin.sbit GLCD_CS1_Direction at TRISB0_bit;
extern sfr sbit GLCD_CS2_Direction;Direction of the Chip Select 2 pin.sbit GLCD_CS2_Direction at TRISB1_bit;
extern sfr sbit GLCD_RS_Direction;Direction of the Register select pin.sbit GLCD_RS_Direction at TRISB2_bit;
extern sfr sbit GLCD_RW_Direction;Direction of the Read/Write pin.sbit GLCD_RW_Direction at TRISB3_bit;
extern sfr sbit GLCD_EN_Direction;Direction of the Enable pin.sbit GLCD_EN_Direction at TRISB4_bit;
extern sfr sbit GLCD_RST_Direction;Direction of the Reset pin.sbit GLCD_RST_Direction at TRISB5_bit;

Library Routines

Basic routines:

Advanced routines:

Download.mikroe.com

Glcd_Init

Mikroelektronika%27s glcd bmp editor download
Prototype

void Glcd_Init();

Returns

Nothing.

Description

Initializes the Glcd module. Each of the control lines is both port and pin configurable, while data lines must be on a single port (pins <0:7>).

Requires

Global variables :

  • GLCD_CS1 : Chip select 1 signal pin
  • GLCD_CS2 : Chip select 2 signal pin
  • GLCD_RS : Register select signal pin
  • GLCD_RW : Read/Write Signal pin
  • GLCD_EN : Enable signal pin
  • GLCD_RST : Reset signal pin
  • GLCD_DataPort : Data port

  • GLCD_CS1_Direction : Direction of the Chip select 1 pin
  • GLCD_CS2_Direction : Direction of the Chip select 2 pin
  • GLCD_RS_Direction : Direction of the Register select signal pin
  • GLCD_RW_Direction : Direction of the Read/Write signal pin
  • GLCD_EN_Direction : Direction of the Enable signal pin
  • GLCD_RST_Direction : Direction of the Reset signal pin
must be defined before using this function.
Example

Glcd_Set_Side

Prototype

void Glcd_Set_Side(unsigned short x_pos);

Returns

Nothing.

Description

Selects Glcd side. Refer to the Glcd datasheet for detailed explanation.

Parameters :

  • x_pos: position on x-axis. Valid values: 0..127

The parameter x_pos specifies the Glcd side: values from 0 to 63 specify the left side, values from 64 to 127 specify the right side.

Note : For side, x axis and page layout explanation see schematic at the bottom of this page.
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_Set_X

Prototype

void Glcd_Set_X(unsigned short x_pos);

Returns

Nothing.

Description

Sets x-axis position to x_pos dots from the left border of Glcd within the selected side.

Parameters :

  • x_pos: position on x-axis. Valid values: 0..63
Note : For side, x axis and page layout explanation see schematic at the bottom of this page.
Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Set_Page

Prototype

void Glcd_Set_Page(unsigned short page);

Returns

Nothing.

Description

Selects page of the Glcd.

Parameters :

  • page: page number. Valid values: 0..7
Note : For side, x axis and page layout explanation see schematic at the bottom of this page.
Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Read_Data

Prototype

unsigned short Glcd_Read_Data();

Returns

One byte from Glcd memory.

Description

Reads data from from the current location of Glcd memory and moves to the next location.

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

Glcd_Write_Data

Prototype

void Glcd_Write_Data(unsigned short ddata);

Returns

Nothing.

Description

Writes one byte to the current location in Glcd memory and moves to the next location.

Parameters :

  • ddata: data to be written
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

Glcd_Set_Ext_Buffer

Prototype

void Glcd_Set_Ext_Buffer(char* (*getExtDataPtr)(unsigned long offset, unsigned int count, unsigned int *num));

Returns

Nothing.

Description

Function sets pointer to the user function which manipulates the external resource.

Parameters :

  • offset - offset from the beginning of the resource from where the data is requested.
  • count - requested number of bytes.
  • num - variable for holding the returned number ob byte (less or equal to the number of acqired bytes).
Requires

Glcd module needs to be initialized. See the Glcd_Init routine.

Example

Glcd_Fill

Prototype

void Glcd_Fill(unsigned short pattern);

Returns

Nothing.

Description

Fills Glcd memory with the byte pattern.

Parameters :

  • pattern: byte to fill Glcd memory with

To clear the Glcd screen, use Glcd_Fill(0).

To fill the screen completely, use Glcd_Fill(0xFF).

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example
Editor

Glcd_Dot

Prototype

void Glcd_Dot(unsigned short x_pos, unsigned short y_pos, unsigned short color);

Returns

Nothing.

Description

Draws a dot on Glcd at coordinates (x_pos, y_pos).

Parameters :

  • x_pos: x position. Valid values: 0..127
  • y_pos: y position. Valid values: 0..63
  • color: color parameter. Valid values: 0..2

The parameter color determines a dot state: 0 clears dot, 1 puts a dot, and 2 inverts dot state.

Note : For x and y axis layout explanation see schematic at the bottom of this page.
Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Line

Prototype

void Glcd_Line(int x_start, int y_start, int x_end, int y_end, unsigned short color);

Returns

Nothing.

Description

Draws a line on Glcd.

Parameters :

  • x_start: x coordinate of the line start. Valid values: 0..127
  • y_start: y coordinate of the line start. Valid values: 0..63
  • x_end: x coordinate of the line end. Valid values: 0..127
  • y_end: y coordinate of the line end. Valid values: 0..63
  • color: color parameter. Valid values: 0..2

The parameter color determines the line color: 0 white, 1 black, and 2 inverts each dot.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_V_Line

Prototype

void Glcd_V_Line(unsigned short y_start, unsigned short y_end, unsigned short x_pos, unsigned short color);

Returns

Nothing.

Description

Draws a vertical line on Glcd.

Parameters :

  • y_start: y coordinate of the line start. Valid values: 0..63
  • y_end: y coordinate of the line end. Valid values: 0..63
  • x_pos: x coordinate of vertical line. Valid values: 0..127
  • color: color parameter. Valid values: 0..2

The parameter color determines the line color: 0 white, 1 black, and 2 inverts each dot.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example
Mikroelektronika%27s Glcd Bmp Editor Download

Glcd_H_Line

Prototype

void Glcd_H_Line(unsigned short x_start, unsigned short x_end, unsigned short y_pos, unsigned short color);

Returns

Nothing.

Description

Draws a horizontal line on Glcd.

Parameters :

  • x_start: x coordinate of the line start. Valid values: 0..127
  • x_end: x coordinate of the line end. Valid values: 0..127
  • y_pos: y coordinate of horizontal line. Valid values: 0..63
  • color: color parameter. Valid values: 0..2

The parameter color determines the line color: 0 white, 1 black, and 2 inverts each dot.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Rectangle

Prototype

void Glcd_Rectangle(unsigned short x_upper_left, unsigned short y_upper_left, unsigned short x_bottom_right, unsigned short y_bottom_right, unsigned short color);

Returns

Nothing.

Description

Draws a rectangle on Glcd.

Parameters :

  • x_upper_left: x coordinate of the upper left rectangle corner. Valid values: 0..127
  • y_upper_left: y coordinate of the upper left rectangle corner. Valid values: 0..63
  • x_bottom_right: x coordinate of the lower right rectangle corner. Valid values: 0..127
  • y_bottom_right: y coordinate of the lower right rectangle corner. Valid values: 0..63
  • color: color parameter. Valid values: 0..2

The parameter color determines the color of the rectangle border: 0 white, 1 black, and 2 inverts each dot.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Rectangle_Round_Edges

Prototype

void Glcd_Rectangle_Round_Edges(unsigned short x_upper_left, unsigned short y_upper_left, unsigned short x_bottom_right, unsigned short y_bottom_right, unsigned short round_radius, unsigned short color);

Returns

Nothing.

Description

Draws a rounded edge rectangle on Glcd.

Parameters :

  • x_upper_left: x coordinate of the upper left rectangle corner. Valid values: 0..127
  • y_upper_left: y coordinate of the upper left rectangle corner. Valid values: 0..63
  • x_bottom_right: x coordinate of the lower right rectangle corner. Valid values: 0..127
  • y_bottom_right: y coordinate of the lower right rectangle corner. Valid values: 0..63
  • round_radius: radius of the rounded edge.
  • color: color parameter. Valid values: 0..2

The parameter color determines the color of the rectangle border: 0 white, 1 black, and 2 inverts each dot.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Rectangle_Round_Edges_Fill

Prototype

void Glcd_Rectangle_Round_Edges_Fill(unsigned short x_upper_left, unsigned short y_upper_left, unsigned short x_bottom_right, unsigned short y_bottom_right, unsigned short round_radius, unsigned short color);

Returns

Nothing.

Description

Draws a filled rounded edge rectangle on Glcd with color.

Parameters :

  • x_upper_left: x coordinate of the upper left rectangle corner. Valid values: 0..127
  • y_upper_left: y coordinate of the upper left rectangle corner. Valid values: 0..63
  • x_bottom_right: x coordinate of the lower right rectangle corner. Valid values: 0..127
  • y_bottom_right: y coordinate of the lower right rectangle corner. Valid values: 0..63
  • round_radius: radius of the rounded edge
  • color: color parameter. Valid values: 0..2

The parameter color determines the color of the rectangle border: 0 white, 1 black, and 2 inverts each dot.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Box

Prototype

void Glcd_Box(unsigned short x_upper_left, unsigned short y_upper_left, unsigned short x_bottom_right, unsigned short y_bottom_right, unsigned short color);

Returns

Nothing.

Description

Draws a box on Glcd.

Parameters :

  • x_upper_left: x coordinate of the upper left box corner. Valid values: 0..127
  • y_upper_left: y coordinate of the upper left box corner. Valid values: 0..63
  • x_bottom_right: x coordinate of the lower right box corner. Valid values: 0..127
  • y_bottom_right: y coordinate of the lower right box corner. Valid values: 0..63
  • color: color parameter. Valid values: 0..2

The parameter color determines the color of the box fill: 0 white, 1 black, and 2 inverts each dot.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Circle

Prototype

void Glcd_Circle(int x_center, int y_center, int radius, unsigned short color);

Returns

Nothing.

Description

Draws a circle on Glcd.

Parameters :

  • x_center: x coordinate of the circle center. Valid values: 0..127
  • y_center: y coordinate of the circle center. Valid values: 0..63
  • radius: radius size
  • color: color parameter. Valid values: 0..2

The parameter color determines the color of the circle line: 0 white, 1 black, and 2 inverts each dot.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Circle_Fill

Prototype

void Glcd_Circle_Fill(int x_center, int y_center, int radius, unsigned short color);

Returns

Nothing.

Description

Draws a filled circle on Glcd.

Parameters :

  • x_center: x coordinate of the circle center. Valid values: 0..127
  • y_center: y coordinate of the circle center. Valid values: 0..63
  • radius: radius size
  • color: color parameter. Valid values: 0..2

The parameter color determines the color of the circle line: 0 white, 1 black, and 2 inverts each dot.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Set_Font

Prototype

void Glcd_Set_Font(const char *activeFont, unsigned short aFontWidth, unsigned short aFontHeight, unsigned int aFontOffs);

Returns

Nothing.

Description

Sets font that will be used with Glcd_Write_Char and Glcd_Write_Text routines.

Parameters :

  • activeFont: font to be set. Needs to be formatted as an array of char
  • aFontWidth: width of the font characters in dots.
  • aFontHeight: height of the font characters in dots.
  • aFontOffs: number that represents difference between the mikroC PRO for PIC character set and regular ASCII set (eg. if 'A' is 65 in ASCII character, and 'A' is 45 in the mikroC PRO for PIC character set, aFontOffs is 20). Demo fonts supplied with the library have an offset of 32, which means that they start with space.

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:
  • Font_Glcd_System3x5
  • Font_Glcd_System5x7
  • Font_Glcd_5x7
  • Font_Glcd_Character8x7

For the sake of the backward compatibility, these fonts are supported also:

  • System3x5 (equivalent to Font_Glcd_System3x5)
  • FontSystem5x7_v2 (equivalent to Font_Glcd_System5x7)
  • font5x7 (equivalent to Font_Glcd_5x7)
  • Character8x7 (equivalent to Font_Glcd_Character8x7)
Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Set_Font_Adv

Prototype

void Glcd_Set_Font_Adv(const far char *activeFont, unsigned char font_color, char font_orientation);

Description

Sets font that will be used with Glcd_Write_Char_Adv and Glcd_Write_Text_Adv routines.

Parameters
  • activeFont: font to be set. Needs to be formatted as an array of char.
  • font_color: sets font color.
  • font_orientation: sets font orientation.
Returns

Nothing.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example
Notes

None.

Glcd_Set_Ext_Font_Adv

Prototype

void Glcd_Set_Ext_Font_Adv(unsigned long activeFont, unsigned int font_color, char font_orientation);

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
  • activeFont: font to be set. This parameter represents the address in the exteral resource from where the font data begins.
  • font_color: sets font color.
  • font_orientation: sets font orientation.
Returns

Nothing.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example
Notes

None.

Glcd_Write_Char

Prototype

void Glcd_Write_Char(unsigned short chr, unsigned short x_pos, unsigned short page_num, unsigned short color);

Returns

Nothing.

Description

Prints character on the Glcd.

Parameters :

  • chr: character to be written
  • x_pos: character starting position on x-axis. Valid values: 0..(127-FontWidth)
  • page_num: the number of the page on which character will be written. Valid values: 0..7
  • color: color parameter. Valid values: 0..2

The parameter color determines the color of the character: 0 white, 1 black, and 2 inverts each dot.

Note : For x axis and page layout explanation see schematic at the bottom of this page.
Requires

Glcd needs to be initialized, see Glcd_Init routine. Use Glcd_Set_Font to specify the font for display; if no font is specified, then default Font_Glcd_System5x7 font supplied with the library will be used.

Example

Glcd_Write_Char_Adv

Prototype

void Glcd_Write_Char_Adv(unsigned char ch, unsigned int x, unsigned int y);

Returns

Nothing.

Description

Writes a char on the glcd at coordinates (x, y).

  • ch: char to be written.
  • x: char position on x-axis.
  • y: char position on y-axis.
Requires

glcd module needs to be initialized. See the Glcd_Init routine.

Example

Glcd_Write_Text

Prototype

void Glcd_Write_Text(char *text, unsigned short x_pos, unsigned short page_num, unsigned short color);

Returns

Nothing.

Description

Prints text on Glcd.

Parameters :

  • text: text to be written
  • x_pos: text starting position on x-axis.
  • page_num: the number of the page on which text will be written. Valid values: 0..7
  • color: color parameter. Valid values: 0..2

The parameter color determines the color of the text: 0 white, 1 black, and 2 inverts each dot.

Note : For x axis and page layout explanation see schematic at the bottom of this page.
Requires

Glcd needs to be initialized, see Glcd_Init routine. Use Glcd_Set_Font to specify the font for display; if no font is specified, then default Font_Glcd_System5x7 font supplied with the library will be used.

Example

Glcd_Write_Text_Adv

GLCD Tools Download | SourceForge.net

Prototype

void Glcd_Write_Text_Adv(unsigned char *text, unsigned int x, unsigned int y);

Returns

Nothing.

Description

Writes text on the glcd at coordinates (x, y).

Parameters :

  • text: text to be written.
  • x: text position on x-axis.
  • y: text position on y-axis.
Requires

Glcd module needs to be initialized. See the Glcd_Init routine.

Example

Glcd_Write_Const_Text_Adv

Prototype

void Glcd_Write_Const_Text_Adv(const far char *ctext, unsigned int x, unsigned int y);

Returns

Nothing.

Description

Writes text located in the program memory on the glcd at coordinates (x, y).

Parameters :

  • text: text to be written.
  • x: text position on x-axis.
  • y: text position on y-axis.
Requires

Glcd module needs to be initialized. See the Glcd_Init routine.

Example

Glcd_Image

Prototype

void Glcd_Image(code const unsigned short *image);

Returns

Nothing.

Description

Displays bitmap on Glcd.

Parameters :

  • image: image to be displayed. Bitmap array must be located in code memory.

Use the mikroC PRO for PIC integrated Glcd Bitmap Editor to convert image to a constant array suitable for displaying on Glcd.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Ext_Image

Prototype

void Glcd_Ext_Image(unsigned long image);

Description

Displays a bitmap from an external resource.

Parameters
  • image: image to be displayed. This parameter represents the address in the exteral resource from where the image data begins.
Returns

Nothing.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example
Notes

Use the mikroC PRO for PIC32 integrated Glcd Bitmap Editor, Tools > Glcd Bitmap Editor, to convert image to a constant array suitable for displaying on Glcd.

Photo Editors

Glcd_PartialImage

Glcd Bitmap Editor Free Download - SourceForge

Prototype

void Glcd_PartialImage(unsigned int x_left, unsigned int y_top, unsigned int width, unsigned int height, unsigned int picture_width, unsigned int picture_height, code const unsigned short * image);

Returns

Nothing.

Description

Displays a partial area of the image on a desired location.

Parameters :

  • x_left: x coordinate of the desired location (upper left coordinate).
  • y_top: y coordinate of the desired location (upper left coordinate).
  • width: desired image width.
  • height: desired image height.
  • picture_width: width of the original image.
  • picture_height: height of the original image.
  • image: image to be displayed. Bitmap array is located in code memory.

Use the integrated Glcd Bitmap Editor (menu option Tools › Glcd Bitmap Editor) to convert image to a constant array suitable for displaying on Glcd.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example

Glcd_Ext_PartialImage

Prototype

void Glcd_Ext_PartialImage(unsigned int x_left, unsigned int y_top, unsigned int width, unsigned int height, unsigned int picture_width, unsigned int picture_height, unsigned long image);

Description

Displays a partial area of the image, located on an external resource, on a desired location of the screen.

Parameters
  • x_left: x coordinate of the desired location (upper left coordinate).
  • y_top: y coordinate of the desired location (upper left coordinate).
  • width: desired image width.
  • height: desired image height.
  • picture_width: width of the original image.
  • picture_height: height of the original image.
  • image: image to be displayed. This parameter represents the address in the exteral resource from where the image data begins.
Returns

Nothing.

Requires

Glcd needs to be initialized, see Glcd_Init routine.

Example
Notes

Use the mikroC PRO for PIC32 integrated Glcd Bitmap Editor, Tools > Glcd Bitmap Editor, to convert image to a constant array suitable for displaying on Glcd.

Bmp

Library Example

Cached

The following example demonstrates routines of the Glcd library: initialization, clear(pattern fill), image displaying, drawing lines, circles, boxes and rectangles, text displaying and handling.

HW Connection

Mikroelektronika 27s Glcd Bmp Editor Download 1

Glcd HW connection

GLCD Bitmap Editor And Importing BMPs - Mikroelektronika

Copyright (c) 2002-2012 mikroElektronika. All rights reserved.
What do you think about this topic ? Send us feedback!