Subversion Repositories Code-Repo

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
121 Kevin 1
#ifndef OLED_SSD1331_H
2
#define	OLED_SSD1331_H
3
 
4
#define SSD1331_LCDWIDTH        96
5
#define SSD1331_LCDHEIGHT       64
6
 
7
// Select one of these defines to set the pixel color order
8
#define SSD1331_COLORORDER_RGB
9
// #define SSD1331_COLORORDER_BGR
10
 
11
// SSD1331 Commands
12
#define SSD1331_CMD_DRAWLINE 		0x21
13
#define SSD1331_CMD_DRAWRECT 		0x22
14
#define SSD1331_CMD_CLEARWINDOW         0x25
15
#define SSD1331_CMD_FILL                0x26
16
#define SSD1331_CMD_SETCOLUMN 		0x15
17
#define SSD1331_CMD_SETROW    		0x75
18
#define SSD1331_CMD_CONTRASTA 		0x81
19
#define SSD1331_CMD_CONTRASTB 		0x82
20
#define SSD1331_CMD_CONTRASTC		0x83
21
#define SSD1331_CMD_MASTERCURRENT 	0x87
22
#define SSD1331_CMD_SETREMAP 		0xA0
23
#define SSD1331_CMD_STARTLINE 		0xA1
24
#define SSD1331_CMD_DISPLAYOFFSET 	0xA2
25
#define SSD1331_CMD_NORMALDISPLAY 	0xA4
26
#define SSD1331_CMD_DISPLAYALLON  	0xA5
27
#define SSD1331_CMD_DISPLAYALLOFF 	0xA6
28
#define SSD1331_CMD_INVERTDISPLAY 	0xA7
29
#define SSD1331_CMD_SETMULTIPLEX  	0xA8
30
#define SSD1331_CMD_SETMASTER 		0xAD
31
#define SSD1331_CMD_DISPLAYOFF 		0xAE
32
#define SSD1331_CMD_DISPLAYON     	0xAF
33
#define SSD1331_CMD_POWERMODE 		0xB0
34
#define SSD1331_CMD_PRECHARGE 		0xB1
35
#define SSD1331_CMD_CLOCKDIV 		0xB3
36
#define SSD1331_CMD_PRECHARGEA 		0x8A
37
#define SSD1331_CMD_PRECHARGEB 		0x8B
38
#define SSD1331_CMD_PRECHARGEC 		0x8C
39
#define SSD1331_CMD_PRECHARGELEVEL 	0xBB
40
#define SSD1331_CMD_VCOMH 		0xBE
41
 
42
// Color definitions
43
#define	SSD1331_BLACK           0x0000
44
#define	SSD1331_BLUE            0x001F
45
#define	SSD1331_RED             0xF800
46
#define	SSD1331_GREEN           0x07E0
47
#define SSD1331_CYAN            0x07FF
48
#define SSD1331_MAGENTA         0xF81F
49
#define SSD1331_YELLOW          0xFFE0
50
#define SSD1331_WHITE           0xFFFF
51
 
52
void SSD1331_Init(void);
53
void SSD1331_Begin(void);
54
void SSD1331_GoTo(int x, int y);
55
 
56
void SSD1331_Command(unsigned char c);
57
void SSD1331_Data(unsigned char d);
58
 
59
void SSD1331_Draw_Pixel(int x, int y, unsigned int color);
60
void SSD1331_Draw_Line(int x0, int y0, int x1, int y1, unsigned int color);
61
void SSD1331_Draw_Rect(int x0, int y0, int x1, int y1, unsigned int color);
62
void SSD1331_Fill_Rect(int x0, int y0, int x1, int y1, unsigned int color);
63
void SSD1331_Clear_Display(void);
64
 
65
unsigned int SSD1331_Color565(unsigned char r, unsigned char g, unsigned char b);
66
 
67
void SSD1331_Test_DrawLines(unsigned int color);
68
void SSD1331_Test_DrawRect(unsigned int color);
69
void SSD1331_Test_FillRect(unsigned int color1, unsigned int color2);
70
void SSD1331_Test_DrawCircle(unsigned int radius, unsigned int color);
71
void SSD1331_Test_FillCircle(unsigned int radius, unsigned int color);
72
void SSD1331_Test_DrawTria(void);
73
void SSD1331_Test_DrawRoundRect(void);
74
void SSD1331_Test_MediaButtons(void);
75
void SSD1331_Test_Pattern(void);
76
 
77
#endif	/* OLED_SSD1331_H */
78