GLCD Library
A C Library for Embedded Applications
 All Data Structures Files Functions Variables Enumerations Enumerator Macros Groups Pages
glcd.c File Reference

Basic GLCD functions affecting bounding box manipulation, clearing of screen and buffers, and basic scroll functions. More...

#include <string.h>
#include <stdio.h>
#include "glcd.h"

Go to the source code of this file.

Functions

void glcd_bbox_refresh ()
 Marks the entire display for re-writing. More...
 
void glcd_bbox_reset ()
 Same as glcd_reset_bbox() More...
 
void glcd_clear (void)
 Clear the display. More...
 
void glcd_clear_buffer (void)
 Clear the display buffer only. More...
 
void glcd_reset_bbox ()
 Reset the bounding box. More...
 
void glcd_scroll (int8_t x, int8_t y)
 Scroll entire screne buffer by x and y pixels. More...
 
void glcd_scroll_line (void)
 Scroll screen buffer up by 8 pixels. More...
 
void glcd_select_screen (uint8_t *buffer, glcd_BoundingBox_t *bbox)
 Select screen buffer and bounding box structure. More...
 
void glcd_update_bbox (uint8_t xmin, uint8_t ymin, uint8_t xmax, uint8_t ymax)
 Update bounding box. More...
 

Variables

glcd_BoundingBox_t glcd_bbox
 Keeps track of bounding box of area on LCD which need to be updated next reresh cycle. More...
 
glcd_BoundingBox_tglcd_bbox_selected
 Pointer to bounding box currently in use. More...
 
uint8_t glcd_buffer [GLCD_LCD_WIDTH *GLCD_LCD_HEIGHT/8]
 Screen buffer. More...
 
uint8_t * glcd_buffer_selected
 Pointer to screen buffer currently in use. More...
 

Detailed Description

Basic GLCD functions affecting bounding box manipulation, clearing of screen and buffers, and basic scroll functions.

Author
Andy Gock

Definition in file glcd.c.

Function Documentation

void glcd_bbox_refresh ( void  )

Marks the entire display for re-writing.

Definition at line 114 of file glcd.c.

Referenced by glcd_draw_bitmap().

void glcd_bbox_reset ( void  )

Same as glcd_reset_bbox()

Definition at line 110 of file glcd.c.

void glcd_clear ( void  )

Clear the display.

This will clear the buffer and physically write and commit it to the LCD

Definition at line 122 of file glcd.c.

Referenced by glcd_test_circles(), glcd_test_rectangles(), and glcd_test_scrolling_graph().

void glcd_clear_buffer ( void  )

Clear the display buffer only.

This does not physically write the changes to the LCD

Definition at line 128 of file glcd.c.

Referenced by glcd_test_counter_and_graph(), glcd_test_hello_world(), glcd_test_rectangles(), and glcd_test_text_up_down().

void glcd_reset_bbox ( void  )

Reset the bounding box.

After resetting the bounding box, no pixels are marked as needing refreshing.

Definition at line 101 of file glcd.c.

Referenced by glcd_bbox_reset().

void glcd_scroll ( int8_t  x,
int8_t  y 
)

Scroll entire screne buffer by x and y pixels.

(not implemented yet)

Note
Items scrolled off the extents of the display dimensions will be lost.
Parameters
xX distance to scroll
yY distance to scroll
Todo:
Skeleton

Definition at line 139 of file glcd.c.

void glcd_scroll_line ( void  )

Scroll screen buffer up by 8 pixels.

This is designed to be used in conjunciton with tiny text functions which are 8 bits high.

See Also
Tiny Text

Definition at line 153 of file glcd.c.

Referenced by glcd_tiny_draw_string_ammend(), and glcd_tiny_draw_string_ammend_P().

void glcd_select_screen ( uint8_t *  buffer,
glcd_BoundingBox_t bbox 
)

Select screen buffer and bounding box structure.

This should be selected at initialisation. There are future plans to support multiple screen buffers but this not yet available.

Parameters
bufferPointer to screen buffer
bboxPointer to bounding box object.
See Also
glcd_BoundingBox_t

Definition at line 133 of file glcd.c.

Referenced by glcd_draw_bitmap().

void glcd_update_bbox ( uint8_t  xmin,
uint8_t  ymin,
uint8_t  xmax,
uint8_t  ymax 
)

Update bounding box.

The bounding box defines a rectangle in which needs to be refreshed next time glcd_write() is called. glcd_write() only writes to those pixels inside the bounding box plus any surrounding pixels which are required according to the bank/column write method of the controller.

Define a rectangle here, and it will be added to the existing bounding box.

Parameters
xminMinimum x value of rectangle
yminMinimum y value of rectangle
xmaxMaximum x value of rectangle
ymaxMaximum y value of rectangle
See Also
glcd_bbox
glcd_bbox_selected

Definition at line 69 of file glcd.c.

Referenced by glcd_clear(), glcd_clear_buffer(), glcd_draw_circle(), glcd_draw_line(), glcd_draw_rect(), glcd_draw_rect_thick(), glcd_fill_circle(), glcd_fill_rect(), glcd_invert_pixel(), glcd_scroll_line(), glcd_set_pixel(), glcd_tiny_draw_char(), and glcd_tiny_draw_char_xy().