Board Support  Version 1.0
Functions available when using the Board Software Components
 All Data Structures Functions Variables Groups Pages
Graphic LCD

Graphic LCD Interface. More...

Content

 Configuration
 Display configuration.
 
 Color coding
 Predefined colors.
 

Structures

struct  GLCD_FONT
 Font definitions. More...
 

Functions

int32_t GLCD_Initialize (void)
 Initialize Graphic LCD. More...
 
int32_t GLCD_Uninitialize (void)
 De-initialize Graphic LCD. More...
 
int32_t GLCD_SetForegroundColor (uint32_t color)
 Set foreground color. More...
 
int32_t GLCD_SetBackgroundColor (uint32_t color)
 Set background color. More...
 
int32_t GLCD_ClearScreen (void)
 Clear screen (with active background color) More...
 
int32_t GLCD_SetFont (GLCD_FONT *font)
 Set active font. More...
 
int32_t GLCD_DrawPixel (uint32_t x, uint32_t y)
 Draw pixel (in active foreground color) More...
 
int32_t GLCD_DrawHLine (uint32_t x, uint32_t y, uint32_t length)
 Draw horizontal line (in active foreground color) More...
 
int32_t GLCD_DrawVLine (uint32_t x, uint32_t y, uint32_t length)
 Draw vertical line (in active foreground color) More...
 
int32_t GLCD_DrawRectangle (uint32_t x, uint32_t y, uint32_t width, uint32_t height)
 Draw rectangle (in active foreground color) More...
 
int32_t GLCD_DrawChar (uint32_t x, uint32_t y, int32_t ch)
 Draw character (in active foreground color) More...
 
int32_t GLCD_DrawString (uint32_t x, uint32_t y, const char *str)
 Draw string (in active foreground color) More...
 
int32_t GLCD_DrawBargraph (uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t val)
 Draw bargraph (in active foreground color) More...
 
int32_t GLCD_DrawBitmap (uint32_t x, uint32_t y, uint32_t width, uint32_t height, const uint8_t *bitmap)
 Draw bitmap. More...
 
int32_t GLCD_VScroll (uint32_t dy)
 Scroll picture on display vertically (newly scrolled in area should be filled with background color) More...
 
int32_t GLCD_FrameBufferAccess (bool enable)
 Enable or disable direct access to FrameBuffer. More...
 
uint32_t GLCD_FrameBufferAddress (void)
 Retrieve FrameBuffer address. More...
 

Description

Graphic LCD Interface.


Data Structure Documentation

struct GLCD_FONT

Font definitions.

Structure for font including character width, height, count and bitmaps.

Data Fields
const uint8_t * bitmap Characters bitmaps.
uint32_t count Character count.
uint16_t height Character height.
uint32_t offset Character offset.
uint16_t width Character width.

Function Documentation

int32_t GLCD_ClearScreen ( void  )

Clear screen (with active background color)

Returns
  • 0: function succeeded
  • -1: function failed

The function clears the screen using the active background color. The function returns an integer value of 0 on success, and -1 on error.

int32_t GLCD_DrawBargraph ( uint32_t  x,
uint32_t  y,
uint32_t  width,
uint32_t  height,
uint32_t  val 
)

Draw bargraph (in active foreground color)

Parameters
[in]xStart x position in pixels (0 = left corner)
[in]yStart y position in pixels (0 = upper corner)
[in]widthFull bargraph width in pixels
[in]heightFull bargraph height in pixels
[in]valActive bargraph value (maximum value is 100)
Returns
  • 0: function succeeded
  • -1: function failed

The function draws a bargraph in the active foreground color at position (x,y) with a given width, height, and value. The parameter x is the starting horizontal position in pixels (0 = left corner). The parameter y is the starting vertical position in pixels (0 = upper corner). The parameter width is the maximum width of the bargraph in pixel. The parameter height is the bargraph height in pixels. The parameter val is the value of the bargraph. The value range is [0..100]. The function returns an integer value of 0 on success, and -1 on error.

int32_t GLCD_DrawBitmap ( uint32_t  x,
uint32_t  y,
uint32_t  width,
uint32_t  height,
const uint8_t *  bitmap 
)

Draw bitmap.

Parameters
[in]xStart x position in pixels (0 = left corner)
[in]yStart y position in pixels (0 = upper corner)
[in]widthBitmap width in pixels
[in]heightBitmap height in pixels
[in]bitmapBitmap data
Returns
  • 0: function succeeded
  • -1: function failed

The function draws a graphical bitmap image at position (x,y), with a given width and height. The parameter x is the horizontal position. The parameter y is the vertical position. The parameter width is the width of the bitmap in pixels. The parameter height is the height of the bitmap in pixels. The parameter bitmap is a pointer to the bitmap data. The function returns an integer value of 0 on success, and -1 on error.

int32_t GLCD_DrawChar ( uint32_t  x,
uint32_t  y,
int32_t  ch 
)

Draw character (in active foreground color)

Parameters
[in]xx position in pixels (0 = left corner)
[in]yy position in pixels (0 = upper corner)
[in]chCharacter
Returns
  • 0: function succeeded
  • -1: function failed

The function draws a character in the active foreground color at position (x,y). The parameter x is the horizontal position in pixels (0 = left corner). The parameter y is the vertical position in pixels (0 = upper corner). The parameter ch is the character (index in the font table). The function returns an integer value of 0 on success, and -1 on error.

int32_t GLCD_DrawHLine ( uint32_t  x,
uint32_t  y,
uint32_t  length 
)

Draw horizontal line (in active foreground color)

Parameters
[in]xStart x position in pixels (0 = left corner)
[in]yStart y position in pixels (0 = upper corner)
[in]lengthLine length
Returns
  • 0: function succeeded
  • -1: function failed

The function draws a horizontal line in the active foreground color at position (x,y) with a given length. Set the foreground color with the function GLCD_SetForegroundColor. The parameter x is the starting horizontal position in pixels (0 = left corner). The parameter y is the starting vertical position in pixels (0 = upper corner). The parameter length is the length of the line in pixels. The function returns an integer value of 0 on success, and -1 on error.

int32_t GLCD_DrawPixel ( uint32_t  x,
uint32_t  y 
)

Draw pixel (in active foreground color)

Parameters
[in]xx position in pixels (0 = left corner)
[in]yy position in pixels (0 = upper corner)
Returns
  • 0: function succeeded
  • -1: function failed

The function draws a pixel in the defined foreground color at position (x,y). Set the foreground color with the function GLCD_SetForegroundColor. The parameter x is the horizontal position in pixels (0 = left corner). The parameter y is the vertical position in pixels (0 = upper corner). The function returns an integer value of 0 on success, and -1 on error.

int32_t GLCD_DrawRectangle ( uint32_t  x,
uint32_t  y,
uint32_t  width,
uint32_t  height 
)

Draw rectangle (in active foreground color)

Parameters
[in]xStart x position in pixels (0 = left corner)
[in]yStart y position in pixels (0 = upper corner)
[in]widthRectangle width in pixels
[in]heightRectangle height in pixels
Returns
  • 0: function succeeded
  • -1: function failed

The function draws a rectangle in the active foreground color at position (x,y) with a given width and height. Set the foreground color with the function GLCD_SetForegroundColor. The parameter x is the starting horizontal position in pixels (0 = left corner). The parameter y is the starting vertical position in pixels (0 = upper corner). The parameter length is the lenght of the line in pixels. The function returns an integer value of 0 on success, and -1 on error.

int32_t GLCD_DrawString ( uint32_t  x,
uint32_t  y,
const char *  str 
)

Draw string (in active foreground color)

Parameters
[in]xx position in pixels (0 = left corner)
[in]yy position in pixels (0 = upper corner)
[in]strNull-terminated String
Returns
  • 0: function succeeded
  • -1: function failed

The function draws a string in the active foreground color at position (x,y). The parameter x is the starting horizontal position in pixels (0 = left corner). The parameter y is the starting vertical position in pixels (0 = upper corner). The parameter str is a pointer to the Null-terminated string. The function returns an integer value of 0 on success, and -1 on error.

int32_t GLCD_DrawVLine ( uint32_t  x,
uint32_t  y,
uint32_t  length 
)

Draw vertical line (in active foreground color)

Parameters
[in]xStart x position in pixels (0 = left corner)
[in]yStart y position in pixels (0 = upper corner)
[in]lengthLine length in pixels
Returns
  • 0: function succeeded
  • -1: function failed

The function draws a vertical line in the active foreground color at position (x,y) with a given length. Set the foreground color with the function GLCD_SetForegroundColor. The parameter x is the starting horizontal position in pixels (0 = left corner). The parameter y is the starting vertical position in pixels (0 = upper corner). The parameter length is the length of the line in pixels. The function returns an integer value of 0 on success, and -1 on error.

int32_t GLCD_FrameBufferAccess ( bool  enable)

Enable or disable direct access to FrameBuffer.

Parameters
[in]enableEnable or disable request
  • true (1): enable
  • false(0): disable
Returns
  • 0: function succeeded
  • -1: function failed

The function enables or disables direct access to FrameBuffer (Graphic RAM). The boolean parameter enable can have the value true to enable access, or false to disable access. The function returns an integer value of 0 on success, and -1 on error.

uint32_t GLCD_FrameBufferAddress ( void  )

Retrieve FrameBuffer address.

Returns
FrameBuffer address

The function returns the FrameBuffer (Graphic RAM) address used for direct access.

int32_t GLCD_Initialize ( void  )

Initialize Graphic LCD.

Returns
  • 0: function succeeded
  • -1: function failed

The function initializes the Graphics LCD controller. The function returns an integer value of 0 on success, and -1 on error.

int32_t GLCD_SetBackgroundColor ( uint32_t  color)

Set background color.

Parameters
[in]colorColor value
Returns
  • 0: function succeeded
  • -1: function failed

The function sets the background color. The parameter color is the background color for text or graphics objects. Standard colors are defined in Color coding. The function returns an integer value of 0 on success, and -1 on error.

See Also
int32_t GLCD_SetFont ( GLCD_FONT font)

Set active font.

Parameters
[in]fontPointer to font structure
Returns
  • 0: function succeeded
  • -1: function failed

The function sets the current font. The parameter font is a pointer to the font structure GLCD_FONT. The function returns an integer value of 0 on success, and -1 on error.

Example:

static const uint8_t Font_6x8[128-32] = {
/* Index 32: Character ' ' */
...
/* Index 48: Character '0' */
0x0E, /* 00001110 */
0x11, /* 00010001 */
0x13, /* 00010011 */
0x15, /* 00010101 */
0x19, /* 00011001 */
0x11, /* 00010001 */
0x0E, /* 00001110 */
0x00, /* 00000000 */
...
};
GLCD_FONT GLCD_Font_6x8 = {
6, /* Character width */
8, /* Character height */
32, /* Character offset */
128-32, /* Character count */
Font_6x8 /* Characters bitmaps */
};
...
GLCD_SetFont(&GLCD_Font_6x8);
...
int32_t GLCD_SetForegroundColor ( uint32_t  color)

Set foreground color.

Parameters
[in]colorColor value
Returns
  • 0: function succeeded
  • -1: function failed

The function sets the foreground color. The parameter color is the foreground color for text or graphics objects. Standard colors are defined in Color coding. The function returns an integer value of 0 on success, and -1 on error.

See Also
int32_t GLCD_Uninitialize ( void  )

De-initialize Graphic LCD.

Returns
  • 0: function succeeded
  • -1: function failed

The function de-initializes the Graphics LCD controller. The function returns an integer value of 0 on success, and -1 on error.

int32_t GLCD_VScroll ( uint32_t  dy)

Scroll picture on display vertically (newly scrolled in area should be filled with background color)

Parameters
[in]dyScroll size in pixels
Returns
  • 0: function succeeded
  • -1: function failed

The function scrolls the whole display vertically up for dy pixels, and fills newly scrolled in area with background color. The function returns an integer value of 0 on success, and -1 on error.