CuVoodoo STM32F1 firmware template
busvoodoo_oled.c
Go to the documentation of this file.
1 /* This program is free software: you can redistribute it and/or modify
2  * it under the terms of the GNU General Public License as published by
3  * the Free Software Foundation, either version 3 of the License, or
4  * (at your option) any later version.
5  *
6  * This program is distributed in the hope that it will be useful,
7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9  * GNU General Public License for more details.
10  *
11  * You should have received a copy of the GNU General Public License
12  * along with this program. If not, see <http://www.gnu.org/licenses/>.
13  *
14  */
21 /* standard libraries */
22 #include <stdint.h> // standard integer types
23 #include <stdbool.h> // boolean type
24 #include <string.h> // string utilities
25 
26 /* own libraries */
27 #include "global.h" // global utilities
28 #include "busvoodoo_oled.h" // own definitions
29 #include "oled_ssd1306.h" // OLED display utilities
30 
32 static bool busvoodoo_oled_present = false;
33 
35 static uint8_t busvoodoo_oled_display[128*8] = {0};
36 
38 static const uint8_t font_king8[95][5] = {
39  {0x00, 0x00, 0x00, 0x00, 0x00, }, // ' '
40  {0x00, 0x00, 0x5f, 0x00, 0x00, }, // '!'
41  {0x00, 0x03, 0x00, 0x03, 0x00, }, // '"'
42  {0x14, 0x3e, 0x14, 0x3e, 0x14, }, // '#'
43  {0x24, 0x2a, 0x7f, 0x2a, 0x12, }, // '$'
44  {0x63, 0x13, 0x08, 0x64, 0x63, }, // '%'
45  {0x36, 0x49, 0x56, 0x20, 0x50, }, // '&'
46  {0x00, 0x03, 0x00, 0x00, 0x00, }, // '''
47  {0x00, 0x3c, 0x42, 0x81, 0x00, }, // '('
48  {0x00, 0x81, 0x42, 0x3c, 0x00, }, // ')'
49  {0x2a, 0x1c, 0x3e, 0x1c, 0x2a, }, // '*'
50  {0x08, 0x08, 0x3e, 0x08, 0x08, }, // '+'
51  {0x00, 0x40, 0x30, 0x00, 0x00, }, // ','
52  {0x00, 0x08, 0x08, 0x08, 0x00, }, // '-'
53  {0x00, 0x00, 0x30, 0x00, 0x00, }, // '.'
54  {0x60, 0x10, 0x08, 0x04, 0x03, }, // '/'
55  {0x3e, 0x51, 0x49, 0x45, 0x3e, }, // '0'
56  {0x00, 0x42, 0x7f, 0x40, 0x00, }, // '1'
57  {0x00, 0x61, 0x51, 0x49, 0x46, }, // '2'
58  {0x00, 0x41, 0x49, 0x49, 0x36, }, // '3'
59  {0x18, 0x14, 0x12, 0x7f, 0x10, }, // '4'
60  {0x27, 0x45, 0x45, 0x45, 0x39, }, // '5'
61  {0x3e, 0x49, 0x49, 0x49, 0x30, }, // '6'
62  {0x01, 0x71, 0x09, 0x05, 0x03, }, // '7'
63  {0x36, 0x49, 0x49, 0x49, 0x36, }, // '8'
64  {0x06, 0x49, 0x49, 0x49, 0x3e, }, // '9'
65  {0x00, 0x00, 0x36, 0x00, 0x00, }, // ':'
66  {0x00, 0x40, 0x36, 0x00, 0x00, }, // ';'
67  {0x00, 0x08, 0x14, 0x22, 0x00, }, // '<'
68  {0x00, 0x14, 0x14, 0x14, 0x00, }, // '='
69  {0x00, 0x22, 0x14, 0x08, 0x00, }, // '>'
70  {0x02, 0x01, 0x59, 0x05, 0x02, }, // '?'
71  {0x3e, 0x41, 0x5d, 0x55, 0x5e, }, // '@'
72  {0x7e, 0x09, 0x09, 0x09, 0x7e, }, // 'A'
73  {0x7f, 0x49, 0x49, 0x49, 0x36, }, // 'B'
74  {0x3e, 0x41, 0x41, 0x41, 0x41, }, // 'C'
75  {0x7f, 0x41, 0x41, 0x41, 0x3e, }, // 'D'
76  {0x7f, 0x49, 0x49, 0x49, 0x41, }, // 'E'
77  {0x7f, 0x09, 0x09, 0x09, 0x01, }, // 'F'
78  {0x3e, 0x41, 0x41, 0x49, 0x39, }, // 'G'
79  {0x7f, 0x08, 0x08, 0x08, 0x7f, }, // 'H'
80  {0x00, 0x41, 0x7f, 0x41, 0x00, }, // 'I'
81  {0x00, 0x41, 0x41, 0x3f, 0x00, }, // 'J'
82  {0x7f, 0x08, 0x14, 0x22, 0x41, }, // 'K'
83  {0x7f, 0x40, 0x40, 0x40, 0x40, }, // 'L'
84  {0x7f, 0x02, 0x04, 0x02, 0x7f, }, // 'M'
85  {0x7f, 0x04, 0x08, 0x10, 0x7f, }, // 'N'
86  {0x3e, 0x41, 0x41, 0x41, 0x3e, }, // 'O'
87  {0x7f, 0x09, 0x09, 0x09, 0x06, }, // 'P'
88  {0x3e, 0x41, 0x51, 0x21, 0x5e, }, // 'Q'
89  {0x7f, 0x09, 0x19, 0x29, 0x46, }, // 'R'
90  {0x46, 0x49, 0x49, 0x49, 0x31, }, // 'S'
91  {0x01, 0x01, 0x7f, 0x01, 0x01, }, // 'T'
92  {0x3f, 0x40, 0x40, 0x40, 0x3f, }, // 'U'
93  {0x07, 0x18, 0x60, 0x18, 0x07, }, // 'V'
94  {0x1f, 0x60, 0x18, 0x60, 0x1f, }, // 'W'
95  {0x63, 0x14, 0x08, 0x14, 0x63, }, // 'X'
96  {0x03, 0x04, 0x78, 0x04, 0x03, }, // 'Y'
97  {0x61, 0x51, 0x49, 0x45, 0x43, }, // 'Z'
98  {0x00, 0x7f, 0x41, 0x41, 0x00, }, // '['
99  {0x03, 0x04, 0x08, 0x10, 0x60, }, // '\'
100  {0x00, 0x41, 0x41, 0x7f, 0x00, }, // ']'
101  {0x00, 0x04, 0x02, 0x04, 0x00, }, // '^'
102  {0x40, 0x40, 0x40, 0x40, 0x40, }, // '_'
103  {0x00, 0x02, 0x04, 0x00, 0x00, }, // '`'
104  {0x20, 0x54, 0x54, 0x78, 0x00, }, // 'a'
105  {0x7e, 0x48, 0x48, 0x30, 0x00, }, // 'b'
106  {0x38, 0x44, 0x44, 0x44, 0x00, }, // 'c'
107  {0x30, 0x48, 0x48, 0x7e, 0x00, }, // 'd'
108  {0x38, 0x54, 0x54, 0x18, 0x00, }, // 'e'
109  {0x08, 0x7c, 0x0a, 0x02, 0x00, }, // 'f'
110  {0x18, 0xa4, 0xa4, 0x78, 0x00, }, // 'g'
111  {0x7e, 0x08, 0x08, 0x70, 0x00, }, // 'h'
112  {0x00, 0x08, 0x7a, 0x00, 0x00, }, // 'i'
113  {0x80, 0x80, 0x7a, 0x00, 0x00, }, // 'j'
114  {0x7e, 0x10, 0x28, 0x44, 0x00, }, // 'k'
115  {0x00, 0x02, 0x3e, 0x40, 0x00, }, // 'l'
116  {0x7c, 0x04, 0x78, 0x04, 0x78, }, // 'm'
117  {0x00, 0x7c, 0x04, 0x78, 0x00, }, // 'n'
118  {0x38, 0x44, 0x44, 0x38, 0x00, }, // 'o'
119  {0xfc, 0x24, 0x24, 0x18, 0x00, }, // 'p'
120  {0x18, 0x24, 0x24, 0xfc, 0x00, }, // 'q'
121  {0x7c, 0x08, 0x04, 0x08, 0x00, }, // 'r'
122  {0x48, 0x54, 0x54, 0x24, 0x00, }, // 's'
123  {0x3e, 0x48, 0x48, 0x40, 0x00, }, // 't'
124  {0x3c, 0x40, 0x40, 0x7c, 0x00, }, // 'u'
125  {0x1c, 0x20, 0x40, 0x20, 0x1c, }, // 'v'
126  {0x3c, 0x40, 0x30, 0x40, 0x3c, }, // 'w'
127  {0x6c, 0x10, 0x10, 0x6c, 0x00, }, // 'x'
128  {0x0c, 0x90, 0x90, 0x7c, 0x00, }, // 'y'
129  {0x64, 0x54, 0x54, 0x4c, 0x00, }, // 'z'
130  {0x08, 0x36, 0x41, 0x00, 0x00, }, // '{'
131  {0x00, 0x00, 0x7f, 0x00, 0x00, }, // '|'
132  {0x00, 0x41, 0x36, 0x08, 0x00, }, // '}'
133  {0x04, 0x02, 0x06, 0x04, 0x02, }, // '~'
134 };
135 
137 static const uint16_t font_king10[97][6] = {
138  {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, }, // ' '
139  {0x0000, 0x0000, 0x01be, 0x0000, 0x0000, 0x0000, }, // '!'
140  {0x0000, 0x0006, 0x0000, 0x0006, 0x0000, 0x0000, }, // '"'
141  {0x0050, 0x01fc, 0x0050, 0x01fc, 0x0050, 0x0000, }, // '#'
142  {0x008c, 0x0092, 0x01ff, 0x0092, 0x0062, 0x0000, }, // '$'
143  {0x018c, 0x004c, 0x0020, 0x0010, 0x00c8, 0x00c6, }, // '%'
144  {0x00ec, 0x0112, 0x0112, 0x012c, 0x00c0, 0x0120, }, // '&'
145  {0x0000, 0x0000, 0x0006, 0x0000, 0x0000, 0x0000, }, // '''
146  {0x0000, 0x0078, 0x0186, 0x0201, 0x0000, 0x0000, }, // '('
147  {0x0000, 0x0201, 0x0186, 0x0078, 0x0000, 0x0000, }, // ')'
148  {0x0024, 0x0018, 0x003c, 0x0018, 0x0024, 0x0000, }, // '*'
149  {0x0010, 0x0010, 0x007c, 0x0010, 0x0010, 0x0000, }, // '+'
150  {0x0000, 0x0000, 0x0200, 0x0180, 0x0000, 0x0000, }, // ','
151  {0x0010, 0x0010, 0x0010, 0x0010, 0x0010, 0x0000, }, // '-'
152  {0x0000, 0x0000, 0x0000, 0x0180, 0x0000, 0x0000, }, // '.'
153  {0x0300, 0x00c0, 0x0030, 0x000c, 0x0003, 0x0000, }, // '/'
154  {0x00fe, 0x0121, 0x0111, 0x0109, 0x0105, 0x00fe, }, // '0'
155  {0x0000, 0x0008, 0x0004, 0x0002, 0x01ff, 0x0000, }, // '1'
156  {0x0181, 0x0141, 0x0121, 0x0111, 0x0109, 0x0106, }, // '2'
157  {0x0101, 0x0101, 0x0111, 0x0111, 0x0111, 0x00ee, }, // '3'
158  {0x0030, 0x0028, 0x0024, 0x0022, 0x01ff, 0x0020, }, // '4'
159  {0x008f, 0x0109, 0x0109, 0x0109, 0x0109, 0x00f1, }, // '5'
160  {0x00fe, 0x0111, 0x0111, 0x0111, 0x0111, 0x00e0, }, // '6'
161  {0x0001, 0x0001, 0x01f1, 0x0009, 0x0005, 0x0003, }, // '7'
162  {0x00ee, 0x0111, 0x0111, 0x0111, 0x0111, 0x00ee, }, // '8'
163  {0x000e, 0x0111, 0x0111, 0x0111, 0x0111, 0x00fe, }, // '9'
164  {0x0000, 0x0000, 0x00cc, 0x0000, 0x0000, 0x0000, }, // ':'
165  {0x0000, 0x0100, 0x00cc, 0x0000, 0x0000, 0x0000, }, // ';'
166  {0x0000, 0x0010, 0x0028, 0x0044, 0x0082, 0x0000, }, // '<'
167  {0x0048, 0x0048, 0x0048, 0x0048, 0x0048, 0x0000, }, // '='
168  {0x0000, 0x0082, 0x0044, 0x0028, 0x0010, 0x0000, }, // '>'
169  {0x0002, 0x0001, 0x0161, 0x0011, 0x0009, 0x0006, }, // '?'
170  {0x0078, 0x0084, 0x0132, 0x014a, 0x014a, 0x017c, }, // '@'
171  {0x01fe, 0x0011, 0x0011, 0x0011, 0x0011, 0x01fe, }, // 'A'
172  {0x01ff, 0x0111, 0x0111, 0x0111, 0x0111, 0x00ee, }, // 'B'
173  {0x00fe, 0x0101, 0x0101, 0x0101, 0x0101, 0x0101, }, // 'C'
174  {0x01ff, 0x0101, 0x0101, 0x0101, 0x0101, 0x00fe, }, // 'D'
175  {0x01ff, 0x0111, 0x0111, 0x0111, 0x0111, 0x0101, }, // 'E'
176  {0x01ff, 0x0011, 0x0011, 0x0011, 0x0011, 0x0001, }, // 'F'
177  {0x00fe, 0x0101, 0x0101, 0x0101, 0x0111, 0x00f1, }, // 'G'
178  {0x01ff, 0x0010, 0x0010, 0x0010, 0x0010, 0x01ff, }, // 'H'
179  {0x0101, 0x0101, 0x01ff, 0x0101, 0x0101, 0x0000, }, // 'I'
180  {0x0101, 0x0101, 0x0101, 0x0081, 0x007f, 0x0000, }, // 'J'
181  {0x01ff, 0x0010, 0x0028, 0x0044, 0x0082, 0x0101, }, // 'K'
182  {0x01ff, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, }, // 'L'
183  {0x01ff, 0x0002, 0x0004, 0x0004, 0x0002, 0x01ff, }, // 'M'
184  {0x01ff, 0x0004, 0x0008, 0x0010, 0x0020, 0x01ff, }, // 'N'
185  {0x00fe, 0x0101, 0x0101, 0x0101, 0x0101, 0x00fe, }, // 'O'
186  {0x01ff, 0x0011, 0x0011, 0x0011, 0x0011, 0x000e, }, // 'P'
187  {0x00fe, 0x0101, 0x0101, 0x0141, 0x0081, 0x017e, }, // 'Q'
188  {0x01ff, 0x0011, 0x0031, 0x0051, 0x0091, 0x010e, }, // 'R'
189  {0x010e, 0x0111, 0x0111, 0x0111, 0x0111, 0x00e1, }, // 'S'
190  {0x0001, 0x0001, 0x01ff, 0x0001, 0x0001, 0x0000, }, // 'T'
191  {0x00ff, 0x0100, 0x0100, 0x0100, 0x0100, 0x00ff, }, // 'U'
192  {0x001f, 0x0060, 0x0180, 0x0180, 0x0060, 0x001f, }, // 'V'
193  {0x00ff, 0x0100, 0x00c0, 0x00c0, 0x0100, 0x00ff, }, // 'W'
194  {0x01c7, 0x0028, 0x0010, 0x0010, 0x0028, 0x01c7, }, // 'X'
195  {0x0007, 0x0008, 0x01f0, 0x0008, 0x0007, 0x0000, }, // 'Y'
196  {0x01c1, 0x0121, 0x0111, 0x0109, 0x0105, 0x0103, }, // 'Z'
197  {0x0000, 0x01ff, 0x0101, 0x0101, 0x0101, 0x0000, }, // '['
198  {0x0000, 0x0003, 0x000c, 0x0030, 0x00c0, 0x0300, }, // '\'
199  {0x0000, 0x0101, 0x0101, 0x0101, 0x01ff, 0x0000, }, // ']'
200  {0x0008, 0x0004, 0x0002, 0x0004, 0x0008, 0x0000, }, // '^'
201  {0x0100, 0x0100, 0x0100, 0x0100, 0x0100, 0x0100, }, // '_'
202  {0x0000, 0x0002, 0x0004, 0x0008, 0x0000, 0x0000, }, // '`'
203  {0x0080, 0x0150, 0x0150, 0x0150, 0x01e0, 0x0000, }, // 'a'
204  {0x01fe, 0x0110, 0x0110, 0x0110, 0x00e0, 0x0000, }, // 'b'
205  {0x00e0, 0x0110, 0x0110, 0x0110, 0x0110, 0x0000, }, // 'c'
206  {0x00e0, 0x0110, 0x0110, 0x0110, 0x01fe, 0x0000, }, // 'd'
207  {0x00e0, 0x0150, 0x0150, 0x0150, 0x0060, 0x0000, }, // 'e'
208  {0x0010, 0x01fc, 0x0012, 0x0012, 0x0002, 0x0000, }, // 'f'
209  {0x0060, 0x0290, 0x0290, 0x0290, 0x01e0, 0x0000, }, // 'g'
210  {0x01fe, 0x0010, 0x0010, 0x0010, 0x01e0, 0x0000, }, // 'h'
211  {0x0000, 0x0010, 0x01f4, 0x0000, 0x0000, 0x0000, }, // 'i'
212  {0x0000, 0x0200, 0x0210, 0x01f4, 0x0000, 0x0000, }, // 'j'
213  {0x01fe, 0x0020, 0x0050, 0x0188, 0x0000, 0x0000, }, // 'k'
214  {0x0000, 0x0002, 0x00fe, 0x0100, 0x0000, 0x0000, }, // 'l'
215  {0x01f0, 0x0010, 0x01e0, 0x0010, 0x01e0, 0x0000, }, // 'm'
216  {0x0000, 0x01f0, 0x0010, 0x0010, 0x01e0, 0x0000, }, // 'n'
217  {0x00e0, 0x0110, 0x0110, 0x0110, 0x00e0, 0x0000, }, // 'o'
218  {0x03f0, 0x0090, 0x0090, 0x0090, 0x0060, 0x0000, }, // 'p'
219  {0x0060, 0x0090, 0x0090, 0x0090, 0x03f0, 0x0000, }, // 'q'
220  {0x01f0, 0x0020, 0x0010, 0x0010, 0x0020, 0x0000, }, // 'r'
221  {0x0120, 0x0150, 0x0150, 0x0150, 0x0090, 0x0000, }, // 's'
222  {0x0000, 0x00fe, 0x0108, 0x0108, 0x0100, 0x0000, }, // 't'
223  {0x00f0, 0x0100, 0x0100, 0x0100, 0x01f0, 0x0000, }, // 'u'
224  {0x0030, 0x00c0, 0x0100, 0x00c0, 0x0030, 0x0000, }, // 'v'
225  {0x00f0, 0x0100, 0x00e0, 0x0100, 0x00f0, 0x0000, }, // 'w'
226  {0x0110, 0x00a0, 0x0040, 0x00a0, 0x0110, 0x0000, }, // 'x'
227  {0x0070, 0x0280, 0x0280, 0x0280, 0x01f0, 0x0000, }, // 'y'
228  {0x0110, 0x0190, 0x0150, 0x0130, 0x0110, 0x0000, }, // 'z'
229  {0x0000, 0x0010, 0x00ee, 0x0101, 0x0000, 0x0000, }, // '{'
230  {0x0000, 0x0000, 0x01ff, 0x0000, 0x0000, 0x0000, }, // '|'
231  {0x0000, 0x0101, 0x00ee, 0x0010, 0x0000, 0x0000, }, // '}'
232  {0x0010, 0x0008, 0x0008, 0x0010, 0x0010, 0x0008, }, // '~'
233 };
234 
236 static const uint16_t font_king14[95][9] = {
237  {0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, }, // ' '
238  {0x0000, 0x0000, 0x0000, 0x19fe, 0x19fe, 0x0000, 0x0000, 0x0000, 0x0000, }, // '!'
239  {0x0000, 0x001c, 0x001c, 0x0000, 0x0000, 0x001c, 0x001c, 0x0000, 0x0000, }, // '"'
240  {0x0330, 0x0ffc, 0x0ffc, 0x0330, 0x0330, 0x0ffc, 0x0ffc, 0x0330, 0x0000, }, // '#'
241  {0x0638, 0x0e7c, 0x1cee, 0x18c6, 0x3fff, 0x18c6, 0x1dce, 0x0f9c, 0x0718, }, // '$'
242  {0x1e08, 0x1f1c, 0x03b6, 0x01dc, 0x02e8, 0x0770, 0x0db8, 0x071f, 0x020f, }, // '%'
243  {0x079c, 0x1ffe, 0x1863, 0x1863, 0x1cfe, 0x0f9c, 0x0700, 0x0d80, 0x18c0, }, // '&'
244  {0x0000, 0x0000, 0x0000, 0x001c, 0x001c, 0x0000, 0x0000, 0x0000, 0x0000, }, // '''
245  {0x0000, 0x0000, 0x07f8, 0x0ffc, 0x1c0e, 0x3807, 0x3003, 0x0000, 0x0000, }, // '('
246  {0x0000, 0x0000, 0x3003, 0x3807, 0x1c0e, 0x0ffc, 0x03f0, 0x0000, 0x0000, }, // ')'
247  {0x0ccc, 0x06d8, 0x03f0, 0x0ffc, 0x0ffc, 0x03f0, 0x06d8, 0x0ccc, 0x0000, }, // '*'
248  {0x0000, 0x00e0, 0x00e0, 0x03f8, 0x03f8, 0x03f8, 0x00e0, 0x00e0, 0x0000, }, // '+'
249  {0x0000, 0x0000, 0x3000, 0x3800, 0x1e00, 0x0e00, 0x0000, 0x0000, 0x0000, }, // ','
250  {0x0000, 0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x0000, }, // '-'
251  {0x0000, 0x0000, 0x0000, 0x0c00, 0x0c00, 0x0000, 0x0000, 0x0000, 0x0000, }, // '.'
252  {0x3000, 0x3c00, 0x0f00, 0x03c0, 0x00f0, 0x003c, 0x000f, 0x0003, 0x0000, }, // '/'
253  {0x0ffc, 0x1ffe, 0x3303, 0x3183, 0x30c3, 0x3063, 0x3033, 0x1ffe, 0x0ffc, }, // '0'
254  {0x0000, 0x0000, 0x0018, 0x001c, 0x001e, 0x3fff, 0x3fff, 0x0000, 0x0000, }, // '1'
255  {0x3c0e, 0x3e0f, 0x3f03, 0x3383, 0x31c3, 0x30e3, 0x3073, 0x303f, 0x301e, }, // '2'
256  {0x3003, 0x3003, 0x30c3, 0x30c3, 0x30c3, 0x30c3, 0x39e7, 0x1ffe, 0x0f3c, }, // '3'
257  {0x03c0, 0x03e0, 0x0370, 0x0338, 0x031c, 0x030e, 0x3fff, 0x3fff, 0x0300, }, // '4'
258  {0x0e3f, 0x1e3f, 0x3833, 0x3033, 0x3033, 0x3033, 0x3873, 0x1fe3, 0x0fc3, }, // '5'
259  {0x0ffc, 0x1ffe, 0x38e7, 0x3063, 0x3063, 0x3063, 0x38e3, 0x1fc3, 0x0f80, }, // '6'
260  {0x0003, 0x0003, 0x0003, 0x3fc3, 0x3fe3, 0x0073, 0x003b, 0x001f, 0x000f, }, // '7'
261  {0x0fbc, 0x1ffe, 0x39e7, 0x30c3, 0x30c3, 0x30c3, 0x39e7, 0x1ffe, 0x0f3c, }, // '8'
262  {0x007c, 0x30fe, 0x31c7, 0x3183, 0x3183, 0x3183, 0x39c7, 0x1ffe, 0x0ffc, }, // '9'
263  {0x0000, 0x0000, 0x0000, 0x0e38, 0x0e38, 0x0000, 0x0000, 0x0000, 0x0000, }, // ':'
264  {0x0000, 0x0000, 0x3000, 0x3800, 0x1e38, 0x0e38, 0x0000, 0x0000, 0x0000, }, // ';'
265  {0x0000, 0x00e0, 0x01f0, 0x03b8, 0x071c, 0x0e0e, 0x1c07, 0x1803, 0x0000, }, // '<'
266  {0x0000, 0x0630, 0x0630, 0x0630, 0x0630, 0x0630, 0x0630, 0x0630, 0x0000, }, // '='
267  {0x0000, 0x1803, 0x1c07, 0x0e0e, 0x071c, 0x03b8, 0x01f0, 0x00e0, 0x0000, }, // '>'
268  {0x000c, 0x000e, 0x0007, 0x3703, 0x3783, 0x01c3, 0x00e7, 0x007e, 0x003c, }, // '?'
269  {0x07f8, 0x0ffc, 0x1c0e, 0x19e6, 0x1bf6, 0x1b36, 0x1b3e, 0x1bfc, 0x19f8, }, // '@'
270  {0x3ffc, 0x3ffe, 0x00c7, 0x00c3, 0x00c3, 0x00c3, 0x00c7, 0x3ffe, 0x3ffc, }, // 'A'
271  {0x3fff, 0x3fff, 0x30c3, 0x30c3, 0x30c3, 0x30c3, 0x39e7, 0x1ffe, 0x0f3c, }, // 'B'
272  {0x0ffc, 0x1ffe, 0x3807, 0x3003, 0x3003, 0x3003, 0x3003, 0x3003, 0x3003, }, // 'C'
273  {0x3fff, 0x3fff, 0x3003, 0x3003, 0x3003, 0x3807, 0x1c0e, 0x0ffc, 0x07f8, }, // 'D'
274  {0x3fff, 0x3fff, 0x30c3, 0x30c3, 0x30c3, 0x30c3, 0x30c3, 0x3003, 0x3003, }, // 'E'
275  {0x3fff, 0x3fff, 0x0063, 0x0063, 0x0063, 0x0063, 0x0063, 0x0003, 0x0003, }, // 'F'
276  {0x1ffe, 0x3fff, 0x3807, 0x3003, 0x3003, 0x30c3, 0x30c3, 0x3fc7, 0x1fc6, }, // 'G'
277  {0x3fff, 0x3fff, 0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x00c0, 0x3fff, 0x3fff, }, // 'H'
278  {0x3003, 0x3003, 0x3003, 0x3fff, 0x3fff, 0x3003, 0x3003, 0x3003, 0x0000, }, // 'I'
279  {0x0000, 0x3003, 0x3803, 0x1c03, 0x0e03, 0x07ff, 0x03ff, 0x0000, 0x0000, }, // 'J'
280  {0x3fff, 0x3fff, 0x01e0, 0x03f0, 0x0738, 0x0e1c, 0x1c0e, 0x3807, 0x3003, }, // 'K'
281  {0x3fff, 0x3fff, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, }, // 'L'
282  {0x3fff, 0x3fff, 0x000e, 0x001c, 0x0038, 0x001c, 0x000e, 0x3fff, 0x3fff, }, // 'M'
283  {0x3fff, 0x3fff, 0x0038, 0x0070, 0x00e0, 0x01c0, 0x0380, 0x3fff, 0x3fff, }, // 'N'
284  {0x0ffc, 0x1ffe, 0x3807, 0x3003, 0x3003, 0x3003, 0x3807, 0x1ffe, 0x0ffc, }, // 'O'
285  {0x3fff, 0x3fff, 0x0183, 0x0183, 0x0183, 0x0183, 0x01c7, 0x00fe, 0x007c, }, // 'P'
286  {0x0ffc, 0x1ffe, 0x3003, 0x3003, 0x3603, 0x3e03, 0x1c03, 0x3ffe, 0x37fc, }, // 'Q'
287  {0x3fff, 0x3fff, 0x01c3, 0x03c3, 0x07c3, 0x0ec3, 0x1ce7, 0x387e, 0x303c, }, // 'R'
288  {0x303c, 0x307e, 0x30e7, 0x30c3, 0x30c3, 0x30c3, 0x39c3, 0x1f83, 0x0f03, }, // 'S'
289  {0x0003, 0x0003, 0x0003, 0x3fff, 0x3fff, 0x3fff, 0x0003, 0x0003, 0x0003, }, // 'T'
290  {0x0fff, 0x1fff, 0x3800, 0x3000, 0x3000, 0x3000, 0x3800, 0x1fff, 0x0fff, }, // 'U'
291  {0x03ff, 0x07ff, 0x0f00, 0x1e00, 0x3c00, 0x1e00, 0x0f00, 0x07ff, 0x03ff, }, // 'V'
292  {0x0fff, 0x1fff, 0x3c00, 0x1e00, 0x0f00, 0x1e00, 0x3c00, 0x1fff, 0x0fff, }, // 'W'
293  {0x3e1f, 0x3f3f, 0x03f0, 0x01e0, 0x00c0, 0x01e0, 0x03f0, 0x3f3f, 0x3e1f, }, // 'X'
294  {0x003f, 0x007f, 0x00e0, 0x3fc0, 0x3f80, 0x3fc0, 0x00e0, 0x007f, 0x003f, }, // 'Y'
295  {0x3c03, 0x3e03, 0x3703, 0x3383, 0x31c3, 0x30e3, 0x3073, 0x303f, 0x301f, }, // 'Z'
296  {0x0000, 0x0000, 0x3fff, 0x3fff, 0x3003, 0x3003, 0x3003, 0x3003, 0x0000, }, // '['
297  {0x0003, 0x000f, 0x003c, 0x00f0, 0x03c0, 0x0f00, 0x3c00, 0x3000, 0x0000, }, // '\'
298  {0x0000, 0x0000, 0x3003, 0x3003, 0x3003, 0x3003, 0x3fff, 0x3fff, 0x0000, }, // ']'
299  {0x0000, 0x0070, 0x0038, 0x001c, 0x000e, 0x001c, 0x0038, 0x0070, 0x0000, }, // '^'
300  {0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, 0x3000, }, // '_'
301  {0x0000, 0x0000, 0x0006, 0x000e, 0x001c, 0x0038, 0x0030, 0x0000, 0x0000, }, // '`'
302  {0x0000, 0x0e00, 0x1f60, 0x1b60, 0x1b60, 0x1b60, 0x1fe0, 0x1fc0, 0x0000, }, // 'a'
303  {0x0000, 0x1ffc, 0x1ffc, 0x18c0, 0x18c0, 0x18c0, 0x1fc0, 0x0f80, 0x0000, }, // 'b'
304  {0x0000, 0x0fc0, 0x1fe0, 0x1860, 0x1860, 0x1860, 0x1860, 0x1860, 0x0000, }, // 'c'
305  {0x0000, 0x0f80, 0x1fc0, 0x18c0, 0x18c0, 0x18c0, 0x18c0, 0x1ffc, 0x1ffc, }, // 'd'
306  {0x0000, 0x0fc0, 0x1fe0, 0x1b60, 0x1b60, 0x1b60, 0x1be0, 0x01c0, 0x0000, }, // 'e'
307  {0x0000, 0x00c0, 0x00c0, 0x1ff8, 0x1ffc, 0x00cc, 0x00cc, 0x000c, 0x0000, }, // 'f'
308  {0x0000, 0x01e0, 0x33f0, 0x3330, 0x3330, 0x3330, 0x3ff0, 0x1fe0, 0x0000, }, // 'g'
309  {0x0000, 0x1ffc, 0x1ffc, 0x00c0, 0x00c0, 0x00c0, 0x1fc0, 0x1f80, 0x0000, }, // 'h'
310  {0x0000, 0x0000, 0x0000, 0x00c0, 0x1fd8, 0x1fd8, 0x0000, 0x0000, 0x0000, }, // 'i'
311  {0x0000, 0x0000, 0x3000, 0x3860, 0x1fec, 0x0fec, 0x0000, 0x0000, 0x0000, }, // 'j'
312  {0x0000, 0x1ffc, 0x1ffc, 0x0780, 0x0fc0, 0x1ce0, 0x1860, 0x1020, 0x0000, }, // 'k'
313  {0x0000, 0x0004, 0x0ffc, 0x1ffc, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, }, // 'l'
314  {0x0000, 0x1fe0, 0x1fe0, 0x0060, 0x1fc0, 0x0060, 0x1fe0, 0x1fc0, 0x0000, }, // 'm'
315  {0x0000, 0x1fe0, 0x1fe0, 0x0060, 0x0060, 0x0060, 0x1fe0, 0x1fc0, 0x0000, }, // 'n'
316  {0x0000, 0x0fc0, 0x1fe0, 0x1860, 0x1860, 0x1860, 0x1fe0, 0x0fc0, 0x0000, }, // 'o'
317  {0x0000, 0x3ff0, 0x3ff0, 0x0630, 0x0630, 0x0630, 0x07f0, 0x03e0, 0x0000, }, // 'p'
318  {0x0000, 0x03e0, 0x07f0, 0x0630, 0x0630, 0x0630, 0x3ff0, 0x3ff0, 0x0000, }, // 'q'
319  {0x0000, 0x1fe0, 0x1fe0, 0x00c0, 0x0060, 0x0060, 0x00e0, 0x00c0, 0x0000, }, // 'r'
320  {0x0000, 0x19c0, 0x1be0, 0x1b60, 0x1b60, 0x1b60, 0x1f60, 0x0e60, 0x0000, }, // 's'
321  {0x0000, 0x0000, 0x0ffc, 0x1ffc, 0x18c0, 0x18c0, 0x18c0, 0x1800, 0x0000, }, // 't'
322  {0x0000, 0x0fe0, 0x1fe0, 0x1800, 0x1800, 0x1800, 0x1fe0, 0x1fe0, 0x0000, }, // 'u'
323  {0x0000, 0x03e0, 0x07e0, 0x0e00, 0x1c00, 0x0e00, 0x07e0, 0x03e0, 0x0000, }, // 'v'
324  {0x0000, 0x0fe0, 0x1fe0, 0x1800, 0x0f80, 0x1800, 0x1fe0, 0x0fe0, 0x0000, }, // 'w'
325  {0x0000, 0x18e0, 0x1de0, 0x0f80, 0x0700, 0x0f80, 0x1de0, 0x18e0, 0x0000, }, // 'x'
326  {0x0000, 0x03e0, 0x37e0, 0x3600, 0x3600, 0x3600, 0x3fe0, 0x1fe0, 0x0000, }, // 'y'
327  {0x0000, 0x1860, 0x1c60, 0x1e60, 0x1b60, 0x19e0, 0x18e0, 0x1860, 0x0000, }, // 'z'
328  {0x0000, 0x00c0, 0x01e0, 0x0ffc, 0x1f3e, 0x3807, 0x3003, 0x0000, 0x0000, }, // '{'
329  {0x0000, 0x0000, 0x0000, 0x3ffe, 0x3ffe, 0x0000, 0x0000, 0x0000, 0x0000, }, // '|'
330  {0x0000, 0x3003, 0x3807, 0x1f3e, 0x0ffc, 0x01e0, 0x00c0, 0x0000, 0x0000, }, // '}'
331  {0x0060, 0x0070, 0x0038, 0x0038, 0x0030, 0x0070, 0x0070, 0x0038, 0x0018, }, // '~'
332 };
333 
335 {
336 
337  // setup SSD1306 OLED display
338  busvoodoo_oled_clear(); // clean display buffer
339  busvoodoo_oled_present = oled_ssd1306_setup(); // setup OLED display
341 #if DEBUG
342  oled_ssd1306_test(); // test OLED display
343 #endif
344  busvoodoo_oled_update(); // send display buffer
345  };
346 }
347 
349 {
350  // write all buffer to 0
351  for (uint16_t i=0; i<LENGTH(busvoodoo_oled_display); i++) {
352  busvoodoo_oled_display[i] = 0;
353  }
354 }
355 
356 void busvoodoo_oled_text_left(char* text)
357 {
358  // clear top (yellow) display part
359  for (uint16_t i=0; i<128*2; i++) {
360  busvoodoo_oled_display[i] = 0;
361  }
362 
363  // verify input
364  if (NULL==text) {
365  return;
366  }
367 
368  uint8_t column = 1; // on which column to draw
369  while (*text && column<128) { // draw until end or text or screen
370  char c = ' '; // default character to draw
371  if (*text>' ' && *text<' '+LENGTH(font_king14)) { // we have a glyph for this character
372  c = *text;
373  }
374  for (uint8_t col=0; col<LENGTH(font_king14[0]) && column<128; col++) { // go through glyph columns
375  busvoodoo_oled_display[128*0+column] = (font_king14[c-' '][col])<<1; // draw upper section
376  busvoodoo_oled_display[128*1+column] = (font_king14[c-' '][col])>>7; // draw lower section
377  column++; // go to next screen column
378  }
379  text++; // go to next character
380  column++; // insert space between glyphs
381  }
382 }
383 
385 {
386  // verify input
387  if (NULL==text) {
388  return;
389  }
390 
391  int8_t column = 127; // start drawing on left most column
392  for (int8_t i=strlen(text)-1; i>=0 && column>=0; i--) { // draw text from right to left
393  char c = ' '; // default character to draw
394  if (text[i]>' ' && text[i]<' '+LENGTH(font_king14)) { // we have a glyph for this character
395  c = text[i];
396  }
397  for (int8_t col=LENGTH(font_king14[0])-1; col>=0 && column>=0; col--) { // go through glyph columns
398  busvoodoo_oled_display[128*0+column] = (font_king14[c-' '][col])<<1; // draw upper section
399  busvoodoo_oled_display[128*1+column] = (font_king14[c-' '][col])>>7; // draw lower section
400  column--; // go to next screen column
401  }
402  column--; // insert space between glyphs
403  }
404 }
405 
406 void busvoodoo_oled_text_pinout(const char* pins[10], bool io_connector)
407 {
408  // clear bottom (blue) display part
409  for (uint16_t i=128*2; i<LENGTH(busvoodoo_oled_display); i++) {
410  busvoodoo_oled_display[i] = 0;
411  }
412 
413  // check input
414  if (NULL==pins) {
415  return;
416  }
417 
418  // draw outline
419  if (io_connector) {
420  // top line
421  for (uint8_t i=0; i<2+2+24*2; i++) {
422  busvoodoo_oled_display[128*2+i] |= 0x03; // set left top two pixels
423  busvoodoo_oled_display[128*2+2+2+24*3+i] |= 0x03; // set right top two pixels
424  }
425  // left and right lines
426  for (uint8_t page=2; page<8; page++) {
427  busvoodoo_oled_display[128*page+0] |= 0xff; // set left two pixels
428  busvoodoo_oled_display[128*page+1] |= 0xff; // set left two pixels
429  busvoodoo_oled_display[128*(page+1)-2] |= 0xff; // set right two pixels
430  busvoodoo_oled_display[128*(page+1)-1] |= 0xff; // set right two pixels
431  }
432  // bottom line
433  for (uint16_t i=128*7; i<128*8; i++) {
434  busvoodoo_oled_display[i] |= 0xc0; // set bottom two pixels
435  }
436  } else {
437  // middle line
438  for (uint8_t i=0; i<2+2+24*2; i++) {
439  busvoodoo_oled_display[128*4+i] |= 0x80; // set left bottom pixel
440  busvoodoo_oled_display[128*4+2+2+24*3+i] |= 0x80; // set right bottom pixel
441  busvoodoo_oled_display[128*5+i] |= 0x01; // set left top pixel
442  busvoodoo_oled_display[128*5+2+2+24*3+i] |= 0x01; // set right top pixel
443  }
444  // left and right lines
445  for (uint8_t page=5; page<8; page++) {
446  busvoodoo_oled_display[128*page+0] |= 0xff; // set left two pixels
447  busvoodoo_oled_display[128*page+1] |= 0xff; // set left two pixels
448  busvoodoo_oled_display[128*(page+1)-2] |= 0xff; // set right two pixels
449  busvoodoo_oled_display[128*(page+1)-1] |= 0xff; // set right two pixels
450  }
451  }
452 
453  for (uint8_t pin=0; pin<10; pin++) { // go through pin names
454  if (NULL==pins[pin]) { // no text -> draw cross
455  uint16_t column = 2+2+24*(4-pin/2)+2; // the start column to start drawing (from left)
456  if (0==pin%2) {
457  for (uint8_t col=0; col<20; col++) {
458  uint32_t cross = (1<<col)|(1<<(19-col)); // the two dots of the cross
459  if (io_connector) {
460  busvoodoo_oled_display[128*2+column+col] |= cross<<3;
461  busvoodoo_oled_display[128*3+column+col] |= cross>>5;
462  busvoodoo_oled_display[128*4+column+col] |= cross>>13;
463  } else {
464  busvoodoo_oled_display[128*2+column+col] |= cross<<1;
465  busvoodoo_oled_display[128*3+column+col] |= cross>>7;
466  busvoodoo_oled_display[128*4+column+col] |= cross>>15;
467  }
468  }
469  } else {
470  for (uint8_t col=0; col<20; col++) {
471  uint32_t cross = (1<<col)|(1<<(19-col)); // the two dots of the cross
472  if (io_connector) {
473  busvoodoo_oled_display[128*5+column+col] |= cross<<1;
474  busvoodoo_oled_display[128*6+column+col] |= cross>>7;
475  busvoodoo_oled_display[128*7+column+col] |= cross>>15;
476  } else {
477  busvoodoo_oled_display[128*5+column+col] |= cross<<3;
478  busvoodoo_oled_display[128*6+column+col] |= cross>>5;
479  busvoodoo_oled_display[128*7+column+col] |= cross>>13;
480  }
481  }
482  }
483  } else if (0==strlen(pins[pin])) {
484  // leave blank
485  } else if (strlen(pins[pin])<4) {
486  // calculate start position (from the left) based on number of characters to put in 24 px box
487  uint16_t column = 2+2+24*(4-pin/2)+(24-7*strlen(pins[pin])-strlen(pins[pin])-1)/2+1;
488  for (uint8_t i=0; i<strlen(pins[pin]); i++) {
489  char c = ' '; // default character to draw
490  if (pins[pin][i]>' ' && pins[pin][i]<' '+LENGTH(font_king10)) { // we have a glyph for this character
491  c = pins[pin][i];
492  }
493  for (uint8_t col=0; col<LENGTH(font_king10[0]) && column<128; col++) { // go through glyph columns
494  if (0==pin%2) {
495  if (io_connector) {
496  busvoodoo_oled_display[128*3+column] |= (font_king10[c-' '][col]>>0)<<0;
497  busvoodoo_oled_display[128*4+column] |= (font_king10[c-' '][col]>>8)<<0;
498  } else {
499  busvoodoo_oled_display[128*2+column] |= (font_king10[c-' '][col]>>0)<<6;
500  busvoodoo_oled_display[128*3+column] |= (font_king10[c-' '][col]>>2)<<0;
501  }
502  } else {
503  if (io_connector) {
504  busvoodoo_oled_display[128*5+column] |= (font_king10[c-' '][col]>>0)<<6;
505  busvoodoo_oled_display[128*6+column] |= (font_king10[c-' '][col]>>2)<<0;
506  } else {
507  busvoodoo_oled_display[128*6+column] |= (font_king10[c-' '][col]>>0)<<0;
508  busvoodoo_oled_display[128*7+column] |= (font_king10[c-' '][col]>>8)<<0;
509  }
510  }
511  column++; // go to next screen column
512  }
513  column++; // insert space between glyphs
514  }
515  } else if (4==strlen(pins[pin])) {
516  uint16_t column = 2+2+24*(4-pin/2); // start position on x-axis (for 4 characters on a 24 px box)
517  for (uint8_t i=0; i<strlen(pins[pin]); i++) {
518  char c = ' '; // default character to draw
519  if (pins[pin][i]>' ' && pins[pin][i]<' '+LENGTH(font_king8)) { // we have a glyph for this character
520  c = pins[pin][i];
521  }
522  for (uint8_t col=0; col<LENGTH(font_king8[0]) && column<128; col++) { // go through glyph columns
523  if (0==pin%2) {
524  if (io_connector) {
525  busvoodoo_oled_display[128*3+column] |= (font_king8[c-' '][col]>>0)<<1;
526  busvoodoo_oled_display[128*4+column] |= (font_king8[c-' '][col]>>7)<<0;
527  } else {
528  busvoodoo_oled_display[128*2+column] |= (font_king8[c-' '][col]>>0)<<7;
529  busvoodoo_oled_display[128*3+column] |= (font_king8[c-' '][col]>>1)<<0;
530  }
531  } else {
532  if (io_connector) {
533  busvoodoo_oled_display[128*5+column] |= (font_king8[c-' '][col]>>0)<<7;
534  busvoodoo_oled_display[128*6+column] |= (font_king8[c-' '][col]>>1)<<0;
535  } else {
536  busvoodoo_oled_display[128*6+column] |= (font_king8[c-' '][col]>>0)<<1;
537  busvoodoo_oled_display[128*7+column] |= (font_king8[c-' '][col]>>7)<<0;
538  }
539  }
540  column++; // go to next screen column
541  }
542  column++; // insert space between glyphs
543  }
544  } else {
545  uint16_t column = 2+2+24*(4-pin/2); // start position on x-axis (for 4 characters on a 24 px box)
546  for (uint8_t i=0; i<4; i++) { // go through 4 characters per line
547  char c_top = ' '; // default character to draw on top line
548  if (pins[pin][i]>' ' && pins[pin][i]<' '+LENGTH(font_king8)) { // we have a glyph for this character
549  c_top = pins[pin][i]; // get glyph to draw
550  }
551  char c_bottom = ' '; // default character to draw for bottom line
552  if ((uint8_t)(4+i)<strlen(pins[pin]) && pins[pin][4+i]>' ' && pins[pin][4+i]<' '+LENGTH(font_king8)) { // we have a glyph for this character
553  c_bottom = pins[pin][4+i]; // get glyph to draw
554  }
555  for (uint8_t col=0; col<LENGTH(font_king8[0]) && column<128; col++) { // go through glyph columns
556  if (0==pin%2) {
557  if (io_connector) {
558  busvoodoo_oled_display[128*2+column] |= (font_king8[c_top-' '][col]>>0)<<4;
559  busvoodoo_oled_display[128*3+column] |= (font_king8[c_top-' '][col]>>4)<<0;
560  busvoodoo_oled_display[128*3+column] |= (font_king8[c_bottom-' '][col]>>0)<<6;
561  busvoodoo_oled_display[128*4+column] |= (font_king8[c_bottom-' '][col]>>2)<<0;
562  } else {
563  busvoodoo_oled_display[128*2+column] |= (font_king8[c_top-' '][col]>>0)<<2;
564  busvoodoo_oled_display[128*3+column] |= (font_king8[c_top-' '][col]>>6)<<0;
565  busvoodoo_oled_display[128*3+column] |= (font_king8[c_bottom-' '][col]>>0)<<4;
566  busvoodoo_oled_display[128*4+column] |= (font_king8[c_bottom-' '][col]>>4)<<0;
567  }
568  } else {
569  if (io_connector) {
570  busvoodoo_oled_display[128*5+column] |= (font_king8[c_top-' '][col]>>0)<<2;
571  busvoodoo_oled_display[128*6+column] |= (font_king8[c_top-' '][col]>>6)<<0;
572  busvoodoo_oled_display[128*6+column] |= (font_king8[c_bottom-' '][col]>>0)<<4;
573  busvoodoo_oled_display[128*7+column] |= (font_king8[c_bottom-' '][col]>>4)<<0;
574  } else {
575  busvoodoo_oled_display[128*5+column] |= (font_king8[c_top-' '][col]>>0)<<4;
576  busvoodoo_oled_display[128*6+column] |= (font_king8[c_top-' '][col]>>4)<<0;
577  busvoodoo_oled_display[128*6+column] |= (font_king8[c_bottom-' '][col]>>0)<<6;
578  busvoodoo_oled_display[128*7+column] |= (font_king8[c_bottom-' '][col]>>2)<<0;
579  }
580  }
581  column++; // go to next screen column
582  }
583  column++; // insert space between glyphs
584  }
585  }
586  }
587 }
588 
590 {
591  if (busvoodoo_oled_present) { // only do something if the display is present
592  oled_ssd1306_off(); // switch display off to not see the update
594  oled_ssd1306_on(); // switch display back on
595  }
596 }
void busvoodoo_oled_text_pinout(const char *pins[10], bool io_connector)
draw pin names on bottom (blue) part in display buffer
void oled_ssd1306_on(void)
switch OLED display on
Definition: oled_ssd1306.c:74
void busvoodoo_oled_setup(void)
setup OLED display
void busvoodoo_oled_update(void)
update OLED display RAM with current display buffer
global definitions and methods (API)
void oled_ssd1306_off(void)
switch OLED display off
Definition: oled_ssd1306.c:83
bool oled_ssd1306_setup(void)
setup OLED display
Definition: oled_ssd1306.c:43
void oled_ssd1306_test(void)
test OLED display: switch entire screen on for a brief time
Definition: oled_ssd1306.c:92
static bool busvoodoo_oled_present
if the OLED display is present and setup
void oled_ssd1306_display(const uint8_t *display_data, uint16_t display_length)
send data to display to OLED display
Definition: oled_ssd1306.c:109
static const uint16_t font_king14[95][9]
14*9 px monospace bitmap font (starting with space, first element is glyph left column, MSb is glyph top pixel)
static const uint8_t font_king8[95][5]
8x5 px monospace bitmap font (starting with space, first byte is glyph left column, MSb is glyph top pixel)
void busvoodoo_oled_text_left(char *text)
draw mode text on top (yellow) left side in display buffer
#define LENGTH(x)
get the length of an array
Definition: global.h:26
void busvoodoo_oled_text_right(char *text)
draw mode text on top (yellow) right side in display buffer
static uint8_t busvoodoo_oled_display[128 *8]
display pixel buffer
void busvoodoo_oled_clear(void)
clear display buffer
library to show BusVoodoo mode information on SSD1306 OLED display: name, activity, pinout (API)
SSD1306 OLED library (API)
static const uint16_t font_king10[97][6]
10x6 px monospace bitmap font (starting with space, first element is glyph left column, MSb is glyph top pixel)