GLCD Library
A C Library for Embedded Applications
|
GLCD Library main header file. More...
#include <stdint.h>
#include "glcd_devices.h"
#include "glcd_controllers.h"
#include "glcd_graphics.h"
#include "glcd_graphs.h"
#include "glcd_text_tiny.h"
#include "glcd_text.h"
#include "unit_tests.h"
Go to the source code of this file.
Data Structures | |
struct | glcd_BoundingBox_t |
Bounding box for pixels that need to be updated. More... | |
struct | glcd_FontConfig_t |
Macros | |
#define | GLCD_RESET_TIME 1 |
Reset duration by glcd_reset(), in milliseconds. More... | |
#define | swap(a, b) { uint8_t t = a; a = b; b = t; } |
Colour Constants | |
#define | BLACK 1 |
#define | WHITE 0 |
LCD Dimensions | |
#define | GLCD_LCD_WIDTH 0 |
User specified GLCD width in pixels Set to 0 for automatic assignment based on controller. More... | |
#define | GLCD_LCD_HEIGHT 0 |
User specified GLCD height in pixels Set to 0 for automatic assignment based on controller. More... | |
#define | GLCD_LCD_WIDTH 128 |
User specified GLCD width in pixels Set to 0 for automatic assignment based on controller. More... | |
#define | GLCD_LCD_HEIGHT 64 |
User specified GLCD height in pixels Set to 0 for automatic assignment based on controller. More... | |
#define | GLCD_NUMBER_OF_BANKS (GLCD_LCD_WIDTH / 8) |
#define | GLCD_NUMBER_OF_COLS GLCD_LCD_WIDTH |
Enumerations | |
enum | font_table_type { STANG, MIKRO } |
Functions | |
Base Functions | |
void | glcd_update_bbox (uint8_t xmin, uint8_t ymin, uint8_t xmax, uint8_t ymax) |
Update bounding box. More... | |
void | glcd_reset_bbox (void) |
Reset the bounding box. More... | |
void | glcd_bbox_reset (void) |
Same as glcd_reset_bbox() More... | |
void | glcd_bbox_refresh (void) |
Marks the entire display for re-writing. More... | |
void | glcd_clear (void) |
Clear the display. More... | |
void | glcd_clear_buffer (void) |
Clear the display buffer only. More... | |
void | glcd_select_screen (uint8_t *buffer, glcd_BoundingBox_t *bbox) |
Select screen buffer and bounding box structure. 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... | |
Variables | |
glcd_FontConfig_t | font_current |
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_t * | glcd_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... | |
#define BLACK 1 |
Definition at line 105 of file glcd.h.
Referenced by glcd_bar_graph_horizontal(), glcd_bar_graph_horizontal_no_border(), glcd_bar_graph_vertical(), glcd_bar_graph_vertical_no_border(), glcd_draw_char_xy(), glcd_scrolling_bar_graph(), glcd_test_circles(), and glcd_test_rectangles().
#define GLCD_LCD_HEIGHT 0 |
User specified GLCD height in pixels Set to 0 for automatic assignment based on controller.
Definition at line 141 of file glcd.h.
Referenced by glcd_bbox_refresh(), glcd_clear(), glcd_clear_buffer(), glcd_draw_bitmap(), glcd_draw_char_xy(), glcd_draw_string_xy(), glcd_draw_string_xy_P(), glcd_get_pixel(), glcd_invert_pixel(), glcd_reset_bbox(), glcd_scroll(), glcd_scroll_line(), glcd_set_pixel(), glcd_test_circles(), glcd_test_text_up_down(), glcd_tiny_draw_char(), glcd_tiny_draw_char_xy(), glcd_tiny_draw_string(), glcd_tiny_draw_string_ammend(), glcd_tiny_draw_string_ammend_P(), glcd_tiny_draw_string_P(), and glcd_update_bbox().
#define GLCD_LCD_HEIGHT 64 |
#define GLCD_LCD_WIDTH 0 |
User specified GLCD width in pixels Set to 0 for automatic assignment based on controller.
Definition at line 140 of file glcd.h.
Referenced by glcd_bbox_refresh(), glcd_clear(), glcd_clear_buffer(), glcd_draw_bitmap(), glcd_draw_char_xy(), glcd_get_pixel(), glcd_invert_pixel(), glcd_reset_bbox(), glcd_scroll(), glcd_scroll_line(), glcd_set_pixel(), glcd_test_circles(), glcd_test_tiny_text(), glcd_tiny_draw_char(), glcd_tiny_draw_char_xy(), glcd_tiny_draw_string(), glcd_tiny_draw_string_P(), glcd_tiny_invert_line(), and glcd_update_bbox().
#define GLCD_LCD_WIDTH 128 |
#define GLCD_NUMBER_OF_BANKS (GLCD_LCD_WIDTH / 8) |
Definition at line 149 of file glcd.h.
Referenced by glcd_test_rectangles().
#define GLCD_NUMBER_OF_COLS GLCD_LCD_WIDTH |
#define GLCD_RESET_TIME 1 |
Reset duration by glcd_reset(), in milliseconds.
#define swap | ( | a, | |
b | |||
) | { uint8_t t = a; a = b; b = t; } |
Definition at line 90 of file glcd.h.
Referenced by glcd_draw_line().
#define WHITE 0 |
Definition at line 106 of file glcd.h.
Referenced by glcd_draw_char_xy(), glcd_scrolling_bar_graph(), and glcd_test_circles().
enum font_table_type |
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()
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 | ||
) |
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.
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.
buffer | Pointer to screen buffer |
bbox | Pointer to bounding box object. |
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.
xmin | Minimum x value of rectangle |
ymin | Minimum y value of rectangle |
xmax | Maximum x value of rectangle |
ymax | Maximum y value of rectangle |
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().
glcd_FontConfig_t font_current |
Definition at line 40 of file text.c.
Referenced by glcd_test_text_up_down(), glcd_tiny_draw_char(), glcd_tiny_draw_char_xy(), glcd_tiny_draw_string(), glcd_tiny_draw_string_P(), and glcd_tiny_set_font().