-
Notifications
You must be signed in to change notification settings - Fork 2
/
oled_rit.c
111 lines (88 loc) · 1.97 KB
/
oled_rit.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#include "wl_def.h"
//*****************************************************************************
//
// The sequence of commands used to initialize the SSD1329 controller. Each
// command is described as follows: there is a byte specifying the number of
// bytes in the command sequence, followed by that many bytes of command data.
// Note: This initialization sequence is derived from RIT App Note for
// the P14201. Values used are from the RIT app note, except where noted.
//
//*****************************************************************************
#define RIT_INIT_REMAP 0x52
#define RIT_INIT_OFFSET 0x00
const int oled_height = 94;
const uint8_t oled_init_strings[] =
{
// Unlock commands
//
3, 0xFD, 0x12, 0xe3,
//
// Display off
//
2, 0xAE, 0xe3,
//
// Icon off
//
3, 0x94, 0, 0xe3,
//
// Multiplex ratio
//
3, 0xA8, 95, 0xe3,
//
// Contrast
//
3, 0x81, 0xb7, 0xe3,
//
// Pre-charge current
//
3, 0x82, 0x3f, 0xe3,
//
// Display Re-map
//
3, 0xA0, RIT_INIT_REMAP, 0xe3,
//
// Display Start Line
//
3, 0xA1, 0, 0xe3,
//
// Display Offset
//
3, 0xA2, RIT_INIT_OFFSET, 0xe3,
//
// Display Mode Normal
//
2, 0xA4, 0xe3,
//
// Phase Length
//
3, 0xB1, 0x11, 0xe3,
//
// Frame frequency
//
3, 0xB2, 0x23, 0xe3,
//
// Front Clock Divider
//
3, 0xB3, 0xe2, 0xe3,
//
// Set gray scale table. App note uses default command:
// 2, 0xB7, 0xe3
// This gray scale attempts some gamma correction to reduce the
// the brightness of the low levels.
//
17, 0xB8, 1, 2, 3, 4, 5, 6, 8, 10, 12, 14, 16, 19, 22, 26, 30, 0xe3,
//
// Second pre-charge period. App note uses value 0x04.
//
3, 0xBB, 0x01, 0xe3,
//
// Pre-charge voltage
//
3, 0xBC, 0x3f, 0xe3,
//
// Display ON
//
2, 0xAF, 0xe3,
// Done.
0
};