LibDriver SSD1351
Loading...
Searching...
No Matches
driver_ssd1351_display_test.c
Go to the documentation of this file.
1
37
40#include <stdlib.h>
41
42static ssd1351_handle_t gs_handle;
43static uint8_t gs_gamma[64] = { 0x02, 0x03, 0x04, 0x05,
44 0x06, 0x07, 0x08, 0x09,
45 0x0A, 0x0B, 0x0C, 0x0D,
46 0x0E, 0x0F, 0x10, 0x11,
47 0x12, 0x13, 0x15, 0x17,
48 0x19, 0x1B, 0x1D, 0x1F,
49 0x21, 0x23, 0x25, 0x27,
50 0x2A, 0x2D, 0x30, 0x33,
51 0x36, 0x39, 0x3C, 0x3F,
52 0x42, 0x45, 0x48, 0x4C,
53 0x50, 0x54, 0x58, 0x5C,
54 0x60, 0x64, 0x68, 0x6C,
55 0x70, 0x74, 0x78, 0x7D,
56 0x82, 0x87, 0x8C, 0x91,
57 0x96, 0x9B, 0xA0, 0xA5,
58 0xAA, 0xAF, 0xB4, 0x00 };
59
68{
69 uint8_t res;
70 uint8_t i ,j;
71 ssd1351_info_t info;
72 char test_str1[] ="libdriver";
73 char test_str2[] ="ssd1306";
74 char test_str3[] ="ABCabc";
75 char test_str4[] ="123?!#$%";
76
77 /* link functions */
90
91 /* ssd1351 info */
92 res = ssd1351_info(&info);
93 if (res != 0)
94 {
95 ssd1351_interface_debug_print("ssd1351: get info failed.\n");
96
97 return 1;
98 }
99 else
100 {
101 /* print chip information */
102 ssd1351_interface_debug_print("ssd1351: chip is %s.\n", info.chip_name);
103 ssd1351_interface_debug_print("ssd1351: manufacturer is %s.\n", info.manufacturer_name);
104 ssd1351_interface_debug_print("ssd1351: interface is %s.\n", info.interface);
105 ssd1351_interface_debug_print("ssd1351: driver version is %d.%d.\n", info.driver_version / 1000, (info.driver_version % 1000) / 100);
106 ssd1351_interface_debug_print("ssd1351: min supply voltage is %0.1fV.\n", info.supply_voltage_min_v);
107 ssd1351_interface_debug_print("ssd1351: max supply voltage is %0.1fV.\n", info.supply_voltage_max_v);
108 ssd1351_interface_debug_print("ssd1351: max current is %0.2fmA.\n", info.max_current_ma);
109 ssd1351_interface_debug_print("ssd1351: max temperature is %0.1fC.\n", info.temperature_max);
110 ssd1351_interface_debug_print("ssd1351: min temperature is %0.1fC.\n", info.temperature_min);
111 }
112
113 /* ssd1351 init */
114 res = ssd1351_init(&gs_handle);
115 if (res != 0)
116 {
117 ssd1351_interface_debug_print("ssd1351: ssd1351 init.\n");
118
119 return 1;
120 }
121
122 /* unlock oled driver ic */
124 if (res != 0)
125 {
126 ssd1351_interface_debug_print("ssd1351: set command failed.\n");
127 (void)ssd1351_deinit(&gs_handle);
128
129 return 1;
130 }
131
132 /* enable command */
134 if (res != 0)
135 {
136 ssd1351_interface_debug_print("ssd1351: set command failed.\n");
137 (void)ssd1351_deinit(&gs_handle);
138
139 return 1;
140 }
141
142 /* enter sleep mode */
143 res = ssd1351_set_sleep_mode(&gs_handle, SSD1351_BOOL_TRUE);
144 if (res != 0)
145 {
146 ssd1351_interface_debug_print("ssd1351: set sleep mode failed.\n");
147 (void)ssd1351_deinit(&gs_handle);
148
149 return 1;
150 }
151
152 /* set default front clock oscillator frequency */
153 res = ssd1351_set_front_clock_oscillator_frequency(&gs_handle, 0x01, 0x0F);
154 if (res != 0)
155 {
156 ssd1351_interface_debug_print("ssd1351: set front clock oscillator failed.\n");
157 (void)ssd1351_deinit(&gs_handle);
158
159 return 1;
160 }
161
162 /* set default mux ratio */
163 res = ssd1351_set_mux_ratio(&gs_handle, 0x7F);
164 if (res != 0)
165 {
166 ssd1351_interface_debug_print("ssd1351: set mux ratio failed.\n");
167 (void)ssd1351_deinit(&gs_handle);
168
169 return 1;
170 }
171
172 /* set default display offset */
173 res = ssd1351_set_display_offset(&gs_handle, 0x00);
174 if (res != 0)
175 {
176 ssd1351_interface_debug_print("ssd1351: set display offset failed.\n");
177 (void)ssd1351_deinit(&gs_handle);
178
179 return 1;
180 }
181
182 /* set default display start line */
183 res = ssd1351_set_display_start_line(&gs_handle, 0x00);
184 if (res != 0)
185 {
186 ssd1351_interface_debug_print("ssd1351: set display start line failed.\n");
187 (void)ssd1351_deinit(&gs_handle);
188
189 return 1;
190 }
191
192 /* set default address increment */
194 if (res != 0)
195 {
196 ssd1351_interface_debug_print("ssd1351: set address increment failed.\n");
197 (void)ssd1351_deinit(&gs_handle);
198
199 return 1;
200 }
201
202 /* set default color depth */
204 if (res != 0)
205 {
206 ssd1351_interface_debug_print("ssd1351: set color depth failed.\n");
207 (void)ssd1351_deinit(&gs_handle);
208
209 return 1;
210 }
211
212 /* set default seg0 map */
214 if (res != 0)
215 {
216 ssd1351_interface_debug_print("ssd1351: set seg0 map failed.\n");
217 (void)ssd1351_deinit(&gs_handle);
218
219 return 1;
220 }
221
222 /* set default color sequence */
224 if (res != 0)
225 {
226 ssd1351_interface_debug_print("ssd1351: set color sequence failed.\n");
227 (void)ssd1351_deinit(&gs_handle);
228
229 return 1;
230 }
231
232 /* set default scan mode */
234 if (res != 0)
235 {
236 ssd1351_interface_debug_print("ssd1351: set scan mode failed.\n");
237 (void)ssd1351_deinit(&gs_handle);
238
239 return 1;
240 }
241
242 /* set default com split odd even */
244 if (res != 0)
245 {
246 ssd1351_interface_debug_print("ssd1351: set com split odd even failed.\n");
247 (void)ssd1351_deinit(&gs_handle);
248
249 return 1;
250 }
251
252 /* set default gpio */
254 if (res != 0)
255 {
256 ssd1351_interface_debug_print("ssd1351: set gpio failed.\n");
257 (void)ssd1351_deinit(&gs_handle);
258
259 return 1;
260 }
261
262 /* set default select vdd */
264 if (res != 0)
265 {
266 ssd1351_interface_debug_print("ssd1351: set select vdd failed.\n");
267 (void)ssd1351_deinit(&gs_handle);
268
269 return 1;
270 }
271
272 /* set default parallel bits */
274 if (res != 0)
275 {
276 ssd1351_interface_debug_print("ssd1351: set parallel bits failed.\n");
277 (void)ssd1351_deinit(&gs_handle);
278
279 return 1;
280 }
281
282 /* set default segment low voltage */
284 if (res != 0)
285 {
286 ssd1351_interface_debug_print("ssd1351: set segment low voltage failed.\n");
287 (void)ssd1351_deinit(&gs_handle);
288
289 return 1;
290 }
291
292 /* set default contrast */
293 res = ssd1351_set_contrast(&gs_handle, 0xC8, 0x80, 0xC8);
294 if (res != 0)
295 {
296 ssd1351_interface_debug_print("ssd1351: set contrast failed.\n");
297 (void)ssd1351_deinit(&gs_handle);
298
299 return 1;
300 }
301
302 /* set default master contrast current */
303 res = ssd1351_set_master_contrast_current(&gs_handle, 0x0A);
304 if (res != 0)
305 {
306 ssd1351_interface_debug_print("ssd1351: set master contrast failed.\n");
307 (void)ssd1351_deinit(&gs_handle);
308
309 return 1;
310 }
311
312 /* set default gray scale pulse width */
313 res = ssd1351_set_gray_scale_pulse_width(&gs_handle, (uint8_t *)gs_gamma);
314 if (res != 0)
315 {
316 ssd1351_interface_debug_print("ssd1351: set gray scale pulse width failed.\n");
317 (void)ssd1351_deinit(&gs_handle);
318
319 return 1;
320 }
321
322 /* set default phase period */
323 res = ssd1351_set_phase_period(&gs_handle, 0x02, 0x03);
324 if (res != 0)
325 {
326 ssd1351_interface_debug_print("ssd1351: set phase period failed.\n");
327 (void)ssd1351_deinit(&gs_handle);
328
329 return 1;
330 }
331
332 /* set default pre charge voltage */
333 res = ssd1351_set_pre_charge_voltage(&gs_handle, 0x17);
334 if (res != 0)
335 {
336 ssd1351_interface_debug_print("ssd1351: set pre charge voltage failed.\n");
337 (void)ssd1351_deinit(&gs_handle);
338
339 return 1;
340 }
341
342 /* set default vcomh voltage */
343 res = ssd1351_set_vcomh_voltage(&gs_handle, 0x05);
344 if (res != 0)
345 {
346 ssd1351_interface_debug_print("ssd1351: set vcomh voltage failed.\n");
347 (void)ssd1351_deinit(&gs_handle);
348
349 return 1;
350 }
351
352 /* set default second pre charge period */
353 res = ssd1351_set_second_pre_charge_period(&gs_handle, 0x01);
354 if (res != 0)
355 {
356 ssd1351_interface_debug_print("ssd1351: set second pre charge period failed.\n");
357 (void)ssd1351_deinit(&gs_handle);
358
359 return 1;
360 }
361
362 /* set default display mode */
364 if (res != 0)
365 {
366 ssd1351_interface_debug_print("ssd1351: set display mode failed.\n");
367 (void)ssd1351_deinit(&gs_handle);
368
369 return 1;
370 }
371
372 /* exit sleep mode */
374 if (res != 0)
375 {
376 ssd1351_interface_debug_print("ssd1351: set sleep mode failed.\n");
377 (void)ssd1351_deinit(&gs_handle);
378
379 return 1;
380 }
381
382 /* ssd1351 stop moving */
383 res = ssd1351_stop_moving(&gs_handle);
384 if (res != 0)
385 {
386 ssd1351_interface_debug_print("ssd1351: stop moving failed.\n");
387 (void)ssd1351_deinit(&gs_handle);
388
389 return 1;
390 }
391
392 /* clear screen */
393 res = ssd1351_clear(&gs_handle);
394 if (res != 0)
395 {
396 ssd1351_interface_debug_print("ssd1351: clear failed.\n");
397 (void)ssd1351_deinit(&gs_handle);
398
399 return 1;
400 }
402
403 /* start display test */
404 ssd1351_interface_debug_print("ssd1351: start display test.\n");
405
406 /* font 12 test */
407 ssd1351_interface_debug_print("ssd1351: font 12 test.\n");
408 res = ssd1351_write_string(&gs_handle, 0, 0, (char *)test_str1, (uint16_t)strlen(test_str1), 0xF800U, SSD1351_FONT_12);
409 if (res != 0)
410 {
411 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
412 (void)ssd1351_deinit(&gs_handle);
413
414 return 1;
415 }
416 res = ssd1351_write_string(&gs_handle, 0, 32, (char *)test_str2, (uint16_t)strlen(test_str2), 0x07E0U, SSD1351_FONT_12);
417 if (res != 0)
418 {
419 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
420 (void)ssd1351_deinit(&gs_handle);
421
422 return 1;
423 }
424 res = ssd1351_write_string(&gs_handle, 0, 64, (char *)test_str3, (uint16_t)strlen(test_str3), 0x001FU, SSD1351_FONT_12);
425 if (res != 0)
426 {
427 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
428 (void)ssd1351_deinit(&gs_handle);
429
430 return 1;
431 }
432 res = ssd1351_write_string(&gs_handle, 0, 96, (char *)test_str4, (uint16_t)strlen(test_str4), 0xFFFFU, SSD1351_FONT_12);
433 if (res != 0)
434 {
435 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
436 (void)ssd1351_deinit(&gs_handle);
437
438 return 1;
439 }
440
441 /* delay 3s */
443
444 /* clear screen */
445 res = ssd1351_clear(&gs_handle);
446 if (res != 0)
447 {
448 ssd1351_interface_debug_print("ssd1351: clear failed.\n");
449 (void)ssd1351_deinit(&gs_handle);
450
451 return 1;
452 }
453
454 /* font 16 test */
455 ssd1351_interface_debug_print("ssd1351: font 16 test.\n");
456 res = ssd1351_write_string(&gs_handle, 0, 0, (char *)test_str1, (uint16_t)strlen(test_str1), 0xF800U, SSD1351_FONT_16);
457 if (res != 0)
458 {
459 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
460 (void)ssd1351_deinit(&gs_handle);
461
462 return 1;
463 }
464 res = ssd1351_write_string(&gs_handle, 0, 32, (char *)test_str2, (uint16_t)strlen(test_str2), 0x07E0U, SSD1351_FONT_16);
465 if (res != 0)
466 {
467 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
468 (void)ssd1351_deinit(&gs_handle);
469
470 return 1;
471 }
472 res = ssd1351_write_string(&gs_handle, 0, 64, (char *)test_str3, (uint16_t)strlen(test_str3), 0x001FU, SSD1351_FONT_16);
473 if (res != 0)
474 {
475 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
476 (void)ssd1351_deinit(&gs_handle);
477
478 return 1;
479 }
480 res = ssd1351_write_string(&gs_handle, 0, 96, (char *)test_str4, (uint16_t)strlen(test_str4), 0xFFFFU, SSD1351_FONT_16);
481 if (res != 0)
482 {
483 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
484 (void)ssd1351_deinit(&gs_handle);
485
486 return 1;
487 }
488
489 /* delay 3s */
491
492 /* clear screen */
493 res = ssd1351_clear(&gs_handle);
494 if (res != 0)
495 {
496 ssd1351_interface_debug_print("ssd1351: clear failed.\n");
497 (void)ssd1351_deinit(&gs_handle);
498
499 return 1;
500 }
501
502 /* font 24 test */
503 ssd1351_interface_debug_print("ssd1351: font 24 test.\n");
504 res = ssd1351_write_string(&gs_handle, 0, 0, (char *)test_str1, (uint16_t)strlen(test_str1), 0xF800U, SSD1351_FONT_24);
505 if (res != 0)
506 {
507 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
508 (void)ssd1351_deinit(&gs_handle);
509
510 return 1;
511 }
512 res = ssd1351_write_string(&gs_handle, 0, 32, (char *)test_str2, (uint16_t)strlen(test_str2), 0x07E0U, SSD1351_FONT_24);
513 if (res != 0)
514 {
515 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
516 (void)ssd1351_deinit(&gs_handle);
517
518 return 1;
519 }
520 res = ssd1351_write_string(&gs_handle, 0, 64, (char *)test_str3, (uint16_t)strlen(test_str3), 0x001FU, SSD1351_FONT_24);
521 if (res != 0)
522 {
523 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
524 (void)ssd1351_deinit(&gs_handle);
525
526 return 1;
527 }
528 res = ssd1351_write_string(&gs_handle, 0, 96, (char *)test_str4, (uint16_t)strlen(test_str4), 0xFFFFU, SSD1351_FONT_24);
529 if (res != 0)
530 {
531 ssd1351_interface_debug_print("ssd1351: write string failed.\n");
532 (void)ssd1351_deinit(&gs_handle);
533
534 return 1;
535 }
536
537 /* delay 3s */
539
540 /* clear screen */
541 res = ssd1351_clear(&gs_handle);
542 if (res != 0)
543 {
544 ssd1351_interface_debug_print("ssd1351: clear failed.\n");
545 (void)ssd1351_deinit(&gs_handle);
546
547 return 1;
548 }
549
550 /* rectangle test */
551 ssd1351_interface_debug_print("ssd1351: rectangle test.\n");
552 res = ssd1351_fill_rect(&gs_handle, 0, 0, 31, 31, 0xF800U);
553 if (res != 0)
554 {
555 ssd1351_interface_debug_print("ssd1351: fill rect failed.\n");
556 (void)ssd1351_deinit(&gs_handle);
557
558 return 1;
559 }
560 res = ssd1351_fill_rect(&gs_handle, 0, 32, 63, 63, 0x07E0U);
561 if (res != 0)
562 {
563 ssd1351_interface_debug_print("ssd1351: fill rect failed.\n");
564 (void)ssd1351_deinit(&gs_handle);
565
566 return 1;
567 }
568 res = ssd1351_fill_rect(&gs_handle, 0, 64, 95, 95, 0x001FU);
569 if (res != 0)
570 {
571 ssd1351_interface_debug_print("ssd1351: fill rect failed.\n");
572 (void)ssd1351_deinit(&gs_handle);
573
574 return 1;
575 }
576 res = ssd1351_fill_rect(&gs_handle, 0, 96, 127, 127, 0xFFFFU);
577 if (res != 0)
578 {
579 ssd1351_interface_debug_print("ssd1351: fill rect failed.\n");
580 (void)ssd1351_deinit(&gs_handle);
581
582 return 1;
583 }
584
585 /* delay 3s */
587
588 /* clear screen */
589 res = ssd1351_clear(&gs_handle);
590 if (res != 0)
591 {
592 ssd1351_interface_debug_print("ssd1351: clear failed.\n");
593 (void)ssd1351_deinit(&gs_handle);
594
595 return 1;
596 }
597
598 /* rand point test */
599 ssd1351_interface_debug_print("ssd1351: rand point test.\n");
600 for (i = 0; i < 128; i++)
601 {
602 for (j = 0; j < 128; j++)
603 {
604 res = ssd1351_draw_point(&gs_handle, i, j, rand()%0xFFFFU);
605 if (res != 0)
606 {
607 ssd1351_interface_debug_print("ssd1351: draw point failed.\n");
608 (void)ssd1351_deinit(&gs_handle);
609
610 return 1;
611 }
612 }
613 }
614
615 /* delay 3s */
617
618 /* clear screen */
619 res = ssd1351_clear(&gs_handle);
620 if (res != 0)
621 {
622 ssd1351_interface_debug_print("ssd1351: clear failed.\n");
623 (void)ssd1351_deinit(&gs_handle);
624
625 return 1;
626 }
627
628 /* picture test */
629 ssd1351_interface_debug_print("ssd1351: picture test.\n");
630 res = ssd1351_draw_picture_16bits(&gs_handle, 0, 0, 127, 127, (uint16_t *)gs_image);
631 if (res != 0)
632 {
633 ssd1351_interface_debug_print("ssd1351: draw picture 16bits failed.\n");
634 (void)ssd1351_deinit(&gs_handle);
635
636 return 1;
637 }
638
639 /* delay 3s */
641
642 /* graphic acceleration test */
643 ssd1351_interface_debug_print("ssd1351: graphic acceleration test.\n");
644
645 /* left horizontal scroll */
646 ssd1351_interface_debug_print("ssd1351: left horizontal scroll.\n");
647 res = ssd1351_set_scroll(&gs_handle, 1, 0, 128, SSD1351_SCROLL_MODE_NORMAL);
648 if (res != 0)
649 {
650 ssd1351_interface_debug_print("ssd1351: set scroll failed.\n");
651 (void)ssd1351_deinit(&gs_handle);
652
653 return 1;
654 }
655 res = ssd1351_start_moving(&gs_handle);
656 if (res != 0)
657 {
658 ssd1351_interface_debug_print("ssd1351: start moving failed.\n");
659 (void)ssd1351_deinit(&gs_handle);
660
661 return 1;
662 }
663
664 /* delay 5s */
666
667 /* right horizontal scroll */
668 ssd1351_interface_debug_print("ssd1351: right horizontal scroll.\n");
669 res = ssd1351_set_scroll(&gs_handle, -1, 0, 128, SSD1351_SCROLL_MODE_NORMAL);
670 if (res != 0)
671 {
672 ssd1351_interface_debug_print("ssd1351: set scroll failed.\n");
673 (void)ssd1351_deinit(&gs_handle);
674
675 return 1;
676 }
677 res = ssd1351_start_moving(&gs_handle);
678 if (res != 0)
679 {
680 ssd1351_interface_debug_print("ssd1351: start moving failed.\n");
681 (void)ssd1351_deinit(&gs_handle);
682
683 return 1;
684 }
685
686 /* delay 5s */
688 res = ssd1351_stop_moving(&gs_handle);
689 if (res != 0)
690 {
691 ssd1351_interface_debug_print("ssd1351: stop moving failed.\n");
692 (void)ssd1351_deinit(&gs_handle);
693
694 return 1;
695 }
696
697 /* finish display test */
698 ssd1351_interface_debug_print("ssd1351: finish display test.\n");
699 (void)ssd1351_deinit(&gs_handle);
700
701 return 0;
702}
driver ssd1351 display image header file
driver ssd1351 display test header file
uint8_t ssd1351_set_master_contrast_current(ssd1351_handle_t *handle, uint8_t current)
set the master contrast current
uint8_t ssd1351_set_scan_mode(ssd1351_handle_t *handle, ssd1351_scan_mode_t mode)
set the scan mode
uint8_t ssd1351_fill_rect(ssd1351_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint32_t color)
fill the rect
uint8_t ssd1351_set_color_sequence(ssd1351_handle_t *handle, ssd1351_color_sequence_t color_sequence)
set the color sequence
uint8_t ssd1351_set_contrast(ssd1351_handle_t *handle, uint8_t a, uint8_t b, uint8_t c)
set the display contrast
struct ssd1351_handle_s ssd1351_handle_t
ssd1351 handle structure definition
uint8_t ssd1351_clear(ssd1351_handle_t *handle)
clear the display
uint8_t ssd1351_set_display_offset(ssd1351_handle_t *handle, uint8_t offset)
set the display offset
uint8_t ssd1351_set_command(ssd1351_handle_t *handle, ssd1351_command_t command)
set the command
uint8_t ssd1351_set_color_depth(ssd1351_handle_t *handle, ssd1351_color_depth_t color_depth)
set the display color depth
uint8_t ssd1351_init(ssd1351_handle_t *handle)
initialize the chip
uint8_t ssd1351_set_parallel_bits(ssd1351_handle_t *handle, ssd1351_select_parallel_bits_t parallel_bits)
set the interface parallel bits
uint8_t ssd1351_set_gpio(ssd1351_handle_t *handle, ssd1351_gpio_pin_t gpio0, ssd1351_gpio_pin_t gpio1)
set the gpio pin
uint8_t ssd1351_set_com_split_odd_even(ssd1351_handle_t *handle, ssd1351_bool_t enable)
set the com split odd or even
uint8_t ssd1351_set_second_pre_charge_period(ssd1351_handle_t *handle, uint8_t period)
set the second pre charge period
uint8_t ssd1351_set_front_clock_oscillator_frequency(ssd1351_handle_t *handle, uint8_t d, uint8_t frequency)
set the front clock oscillator frequency
uint8_t ssd1351_set_pre_charge_voltage(ssd1351_handle_t *handle, uint8_t voltage_level)
set the pre charge voltage
uint8_t ssd1351_set_vcomh_voltage(ssd1351_handle_t *handle, uint8_t voltage_level)
set the vcomh voltage
uint8_t ssd1351_set_phase_period(ssd1351_handle_t *handle, uint8_t phase1_period, uint8_t phase2_period)
set the phase period
uint8_t ssd1351_draw_picture_16bits(ssd1351_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint16_t *image)
draw a 16 bits picture
uint8_t ssd1351_set_display_start_line(ssd1351_handle_t *handle, uint8_t l)
set the display start line
uint8_t ssd1351_write_string(ssd1351_handle_t *handle, uint8_t x, uint8_t y, char *str, uint16_t len, uint32_t color, ssd1351_font_t font)
write a string in the display
uint8_t ssd1351_info(ssd1351_info_t *info)
get chip's information
struct ssd1351_info_s ssd1351_info_t
ssd1351 information structure definition
uint8_t ssd1351_set_display_mode(ssd1351_handle_t *handle, ssd1351_display_mode_t mode)
set the display mode
uint8_t ssd1351_set_select_vdd(ssd1351_handle_t *handle, ssd1351_select_vdd_t vdd)
set the select vdd
uint8_t ssd1351_set_seg0_map(ssd1351_handle_t *handle, ssd1351_seg0_mapped_t seg0_map)
set the seg0 map
uint8_t ssd1351_set_sleep_mode(ssd1351_handle_t *handle, ssd1351_bool_t enable)
set the sleep mode
uint8_t ssd1351_set_scroll(ssd1351_handle_t *handle, int8_t scroll, uint8_t start_row, uint8_t row_len, ssd1351_scroll_mode_t mode)
set the scroll
uint8_t ssd1351_set_mux_ratio(ssd1351_handle_t *handle, uint8_t ratio)
set the mux ratio
uint8_t ssd1351_set_address_increment(ssd1351_handle_t *handle, ssd1351_address_increment_t increment)
set the address increment
uint8_t ssd1351_start_moving(ssd1351_handle_t *handle)
start the display moving
uint8_t ssd1351_draw_point(ssd1351_handle_t *handle, uint8_t x, uint8_t y, uint32_t color)
draw a point in the display
uint8_t ssd1351_stop_moving(ssd1351_handle_t *handle)
stop the display moving
uint8_t ssd1351_set_gray_scale_pulse_width(ssd1351_handle_t *handle, uint8_t gamma[63])
set the gray scale pulse width
uint8_t ssd1351_set_segment_low_voltage(ssd1351_handle_t *handle, ssd1351_segment_low_voltage_t segment)
set the segment low voltage
uint8_t ssd1351_deinit(ssd1351_handle_t *handle)
close the chip
@ SSD1351_SELECT_VDD_INTERNAL
@ SSD1351_SEG0_ADDRESS_0
@ SSD1351_COLOR_SEQUENCE_C_B_A
@ SSD1351_COMMAND_A2_B1_B3_BB_BE_ACCESSIBLE
@ SSD1351_COMMAND_UNLOCK_OLED_DRIVER_IC
@ SSD1351_SCROLL_MODE_NORMAL
@ SSD1351_GPIO_PIN_INPUT_DISABLED
@ SSD1351_SEGMENT_LOW_VOLTAGE_EXTERNAL_VSL
@ SSD1351_FONT_24
@ SSD1351_FONT_16
@ SSD1351_FONT_12
@ SSD1351_SCAN_MODE_COM_N_1_COM_0
@ SSD1351_DISPLAY_MODE_NORMAL
@ SSD1351_SELECT_PARALLEL_8_BIT
@ SSD1351_BOOL_TRUE
@ SSD1351_BOOL_FALSE
@ SSD1351_ADDRESS_INCREMENT_HORIZONTAL
@ SSD1351_COLOR_DEPTH_65K
uint8_t ssd1351_interface_cmd_data_gpio_init(void)
interface command && data gpio init
void ssd1351_interface_delay_ms(uint32_t ms)
interface delay ms
uint8_t ssd1351_interface_reset_gpio_init(void)
interface reset gpio init
uint8_t ssd1351_interface_spi_init(void)
interface spi bus init
void ssd1351_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t ssd1351_interface_reset_gpio_deinit(void)
interface reset gpio deinit
uint8_t ssd1351_interface_cmd_data_gpio_write(uint8_t value)
interface command && data gpio write
uint8_t ssd1351_interface_reset_gpio_write(uint8_t value)
interface reset gpio write
uint8_t ssd1351_interface_spi_write_cmd(uint8_t *buf, uint16_t len)
interface spi bus write
uint8_t ssd1351_interface_spi_deinit(void)
interface spi bus deinit
uint8_t ssd1351_interface_cmd_data_gpio_deinit(void)
interface command && data gpio deinit
uint8_t ssd1351_display_test(void)
display test
uint32_t driver_version
char manufacturer_name[32]