Subversion Repositories Code-Repo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
121 Kevin 1
#ifndef OLED_SSD1306_H
2
#define	OLED_SSD1306_H
3
 
4
/*=========================================================================
5
SSD1306 Displays
6
-----------------------------------------------------------------------
7
The driver is used in multiple displays (128x64, 128x32, etc.).
8
Select the appropriate display below to create an appropriately
9
sized framebuffer, etc.
10
 
11
SSD1306_128_64  128x64 pixel display
12
 
13
SSD1306_128_32  128x32 pixel display
14
 
15
You also need to set the LCDWIDTH and LCDHEIGHT defines to an
16
appropriate size
17
 
18
-----------------------------------------------------------------------*/
19
//    #define SSD1306_128_64
20
    #define SSD1306_128_32
21
/*=========================================================================*/
22
 
23
#if defined SSD1306_128_64
24
    #define SSD1306_LCDWIDTH                  128
25
    #define SSD1306_LCDHEIGHT                 64
26
#endif
27
#if defined SSD1306_128_32
28
    #define SSD1306_LCDWIDTH                  128
29
    #define SSD1306_LCDHEIGHT                 32
30
#endif
31
 
32
#define SSD1306_BLACK 0
33
#define SSD1306_WHITE 1
34
 
35
#define SSD1306_I2C_ADDRESS   0x3D	// 011110+SA0+RW
36
 
37
#define SSD1306_SETCONTRAST 0x81
38
#define SSD1306_DISPLAYALLON_RESUME 0xA4
39
#define SSD1306_DISPLAYALLON 0xA5
40
#define SSD1306_NORMALDISPLAY 0xA6
41
#define SSD1306_INVERTDISPLAY 0xA7
42
#define SSD1306_DISPLAYOFF 0xAE
43
#define SSD1306_DISPLAYON 0xAF
44
#define SSD1306_SETDISPLAYOFFSET 0xD3
45
#define SSD1306_SETCOMPINS 0xDA
46
#define SSD1306_SETVCOMDETECT 0xDB
47
#define SSD1306_SETDISPLAYCLOCKDIV 0xD5
48
#define SSD1306_SETPRECHARGE 0xD9
49
#define SSD1306_SETMULTIPLEX 0xA8
50
#define SSD1306_SETLOWCOLUMN 0x00
51
#define SSD1306_SETHIGHCOLUMN 0x10
52
#define SSD1306_SETSTARTLINE 0x40
53
#define SSD1306_MEMORYMODE 0x20
54
#define SSD1306_COMSCANINC 0xC0
55
#define SSD1306_COMSCANDEC 0xC8
56
#define SSD1306_SEGREMAP 0xA0
57
#define SSD1306_CHARGEPUMP 0x8D
58
#define SSD1306_EXTERNALVCC 0x1
59
#define SSD1306_SWITCHCAPVCC 0x2
60
 
61
void SSD1306_Init(void);
62
void SSD1306_Begin(unsigned char vcc);
63
void SSD1306_Command(unsigned char cmd);
64
void SSD1306_Data(unsigned char data);
65
 
66
void SSD1306_Clear_Display(void);
67
void SSD1306_Invert_Display(unsigned char);
68
void SSD1306_Display(void);
69
 
70
void SSD1306_Draw_Pixel(int x, int y, unsigned int color);
71
 
72
void SSD1306_Test_DrawChar(void);
73
void SSD1306_Test_DrawCircle(void);
74
void SSD1306_Test_DrawRect(void);
75
void SSD1306_Test_FillRect(void);
76
void SSD1306_Test_DrawTriangle(void);
77
void SSD1306_Test_FillTriangle(void);
78
void SSD1306_Test_DrawRoundRect(void);
79
void SSD1306_Test_FillRoundRect(void);
80
void SSD1306_Test_DrawLine(void);
81
 
82
#endif	/* OLED_SSD1306_H */
83