lcd_driver_st7565.h


1
#ifndef _LCD_DRIVER_ST7565_H_
2
#define _LCD_DRIVER_ST7565_H_
3
#include <avr/pgmspace.h>
4
5
6
//LCD spec definitions
7
#define LCD_PAGE_HEIGHT     8   //8 lines per page
8
#define LCD_LINES          64   // must be a multiple of PAGE_HEIGHT - (int conversions!)
9
#define LCD_LINE_LENGTH   128
10
11
12
//            2010-07-12 V0.06 kw  added LCD_pixelPattern
13
14
15
//------------------------------------------------------------------------------
16
// Global variables used by driver
17
//
18
19
extern unsigned char display_invers;       // this is either 0 or 0xFF
20
                                           // 00: print font bitmap as is
21
                                           // ff: print inverted 
22
extern unsigned char display_keep;         // this is either 0 or 0xFF 
23
                                           // 00: replace video content
24
                                           // ff: keep video content             
25
26
extern uint8_t LCD_currentX;
27
extern uint8_t LCD_currentY;
28
29
extern volatile uint8_t update_blocked;
30
31
typedef struct
32
  {
33
    uint8_t page_modified;
34
  } t_update_lcd;
35
36
extern t_update_lcd update_lcd[LCD_LINES / LCD_PAGE_HEIGHT ];
37
38
typedef struct
39
  {
40
    uint8_t Mode;
41
    uint8_t OffAct;
42
    uint8_t OffCount;
43
    uint8_t OnAct;
44
    uint8_t OnCount;
45
  } t_LCD_linePixel;
46
47
extern t_LCD_linePixel LCD_linePixel;
48
//------------------------------------------------------------------------------
49
// Calls
50
51
52
void lcd_init(void);
53
void lcd_reset(void);
54
55
void LCD_setCursorXY(uint8_t x, uint8_t y);
56
void LCD_getCursorXY(uint8_t* x, uint8_t* y);
57
void LCD_pixelOff(uint8_t x, uint8_t y);
58
void LCD_invertPixel(uint8_t x, uint8_t y);
59
void LCD_pixelOn(uint8_t x, uint8_t y);
60
void LCD_pixelPattern(uint8_t x, uint8_t y);   // based on struct line_pixels
61
62
63
void LCD_invertPage(uint8_t page, uint8_t x1, uint8_t x2);
64
void LCD_onPage(uint8_t page,uint8_t x1,uint8_t x2);
65
void LCD_offPage(uint8_t page,uint8_t x1,uint8_t x2);
66
void LCD_fillPage_with_BMP(uint8_t width, PGM_VOID_P bitmap_P);
67
void LCD_drawBMP_aligned(PGM_VOID_P bitmap_P, uint8_t width, uint8_t height);
68
69
void LCD_drawBMP(PGM_VOID_P  bitmap_P);
70
71
void LCD_clr(void);
72
void lcd_clear(void);  // same
73
void LCD_fill_with_counter(void);
74
void LCD_fill_with_BMP(uint8_t* bitmap_P);
75
76
//cursor
77
void cursor_off(void);
78
void cursor_on(void);
79
80
//char function (font 5x7)
81
void LCD_putchar(uint8_t c);
82
void LCD_PF_putchar(uint8_t c);   // same, but variable run length
83
unsigned char LCD_PF_get_sizeX(uint8_t c);  // query for char size
84
void LCD_puts(uint8_t* pString);
85
void LCD_putsp(uint8_t* pString, uint8_t page, uint8_t x);
86
87
//char function (font 4x6)
88
void LCD_number_6px(char* data);
89
90
// lowlevel
91
void    LCD_writeByte(uint8_t data); // needed for bmp download
92
void    LCD_contrast(uint8_t contrast);
93
94
// housekeeping
95
// call this function at end of your display routines
96
void enable_display_update(void);
97
98
// no tasking
99
void update_display_complete(void);
100
101
#endif