44 #define CHIP_NAME "Solomon Systech SSD1351"
45 #define MANUFACTURER_NAME "Solomon Systech"
46 #define SUPPLY_VOLTAGE_MIN 2.4f
47 #define SUPPLY_VOLTAGE_MAX 2.6f
48 #define MAX_CURRENT 0.70f
49 #define TEMPERATURE_MIN -40.0f
50 #define TEMPERATURE_MAX 85.0f
51 #define DRIVER_VERSION 2000
57 #define SSD1351_DATA 1
62 #define SSD1351_CMD_SET_COLUMN_ADDRESS 0x15
63 #define SSD1351_CMD_SET_ROW_ADDRESS 0x75
64 #define SSD1351_CMD_WRITE_RAM 0x5C
65 #define SSD1351_CMD_READ_RAM 0x5D
66 #define SSD1351_CMD_SET_REMAP_COLOR_DEPTH 0xA0
67 #define SSD1351_CMD_SET_DISPLAY_START_LINE 0xA1
68 #define SSD1351_CMD_SET_DISPLAY_OFFSET 0xA2
69 #define SSD1351_CMD_SET_DISPLAY_ALL_OFF 0xA4
70 #define SSD1351_CMD_SET_DISPLAY_ALL_ON 0xA5
71 #define SSD1351_CMD_SET_DISPLAY_NORMAL 0xA6
72 #define SSD1351_CMD_SET_DISPLAY_INVERSE 0xA7
73 #define SSD1351_CMD_FUNCTION_SELECTION 0xAB
74 #define SSD1351_CMD_SET_SLEEP_MODE_ON 0xAE
75 #define SSD1351_CMD_SET_SLEEP_MODE_OFF 0xAF
76 #define SSD1351_CMD_SET_RESET_PRE_CHARGE_PERIOD 0xB1
77 #define SSD1351_CMD_FRONT_CLOCK_DIVIDER_OSC_FREQ 0xB3
78 #define SSD1351_CMD_SET_SEGMENT_LOW_VOLTAGE 0xB4
79 #define SSD1351_CMD_SET_GPIO 0xB5
80 #define SSD1351_CMD_SET_SECOND_PRE_CHARGE_PERIOD 0xB6
81 #define SSD1351_CMD_GRAY_SCALE_PULSE_WIDTH 0xB8
82 #define SSD1351_CMD_USE_BUILT_IN_LINEAR_LUT 0xB9
83 #define SSD1351_CMD_SET_PRE_CHARGE_VOLTAGE 0xBB
84 #define SSD1351_CMD_SET_VCOMH_VOLTAGE 0xBE
85 #define SSD1351_CMD_SET_CONTRAST 0xC1
86 #define SSD1351_CMD_MASTER_CONTRAST_CONTROL 0xC7
87 #define SSD1351_CMD_SET_MUX_RATIO 0xCA
88 #define SSD1351_CMD_SET_COMMAND_LOCK 0xFD
89 #define SSD1351_CMD_HORIZONTAL_SCROLL 0x96
90 #define SSD1351_CMD_STOP_MOVING 0x9E
91 #define SSD1351_CMD_START_MOVING 0x9F
103 static uint8_t a_ssd1351_write_byte(
ssd1351_handle_t *handle, uint8_t data, uint8_t cmd)
147 if ((start_address > 127) || (end_address > 127))
149 handle->
debug_print(
"ssd1351: address is invalid.\n");
153 if (start_address >= end_address)
155 handle->
debug_print(
"ssd1351: start_address >= end_address.\n");
162 handle->
debug_print(
"ssd1351: write command failed.\n");
166 if (a_ssd1351_write_byte(handle, start_address,
SSD1351_DATA) != 0)
168 handle->
debug_print(
"ssd1351: write start address failed.\n");
172 if (a_ssd1351_write_byte(handle, end_address,
SSD1351_DATA) != 0)
174 handle->
debug_print(
"ssd1351: write end address failed.\n");
206 if ((start_address > 127) || (end_address > 127))
208 handle->
debug_print(
"ssd1351: address is invalid.\n");
212 if (start_address >= end_address)
214 handle->
debug_print(
"ssd1351: start_address >= end_address.\n");
221 handle->
debug_print(
"ssd1351: write command failed.\n");
225 if (a_ssd1351_write_byte(handle, start_address,
SSD1351_DATA) != 0)
227 handle->
debug_print(
"ssd1351: write start address failed.\n");
231 if (a_ssd1351_write_byte(handle, end_address,
SSD1351_DATA) != 0)
233 handle->
debug_print(
"ssd1351: write end address failed.\n");
264 handle->
debug_print(
"ssd1351: write ram failed.\n");
295 handle->
debug_print(
"ssd1351: read command failed.\n");
325 handle->
conf_1 &= ~ (3 << 6);
326 handle->
conf_1 |= color_depth << 6;
329 handle->
debug_print(
"ssd1351: write color depth failed.\n");
335 handle->
debug_print(
"ssd1351: write color depth failed.\n");
365 handle->
conf_1 &= ~ (1 << 0);
366 handle->
conf_1 |= increment << 0;
369 handle->
debug_print(
"ssd1351: write address increment failed.\n");
375 handle->
debug_print(
"ssd1351: write address increment failed.\n");
405 handle->
conf_1 &= ~ (1 << 1);
406 handle->
conf_1 |= seg0_map << 1;
409 handle->
debug_print(
"ssd1351: write seg0 map failed.\n");
415 handle->
debug_print(
"ssd1351: write seg0 map failed.\n");
445 handle->
conf_1 &= ~ (1 << 2);
446 handle->
conf_1 |= color_sequence << 2;
449 handle->
debug_print(
"ssd1351: write color sequence failed.\n");
455 handle->
debug_print(
"ssd1351: write color sequence failed.\n");
485 handle->
conf_1 &= ~ (1 << 4);
486 handle->
conf_1 |= mode << 4;
489 handle->
debug_print(
"ssd1351: write scan mode failed.\n");
495 handle->
debug_print(
"ssd1351: write scan mode failed.\n");
525 handle->
conf_1 &= ~ (1 << 5);
526 handle->
conf_1 |= enable << 5;
529 handle->
debug_print(
"ssd1351: write com split odd even failed.\n");
535 handle->
debug_print(
"ssd1351: write com split odd even failed.\n");
567 handle->
debug_print(
"ssd1351: line is over 127.\n");
574 handle->
debug_print(
"ssd1351: write start line failed.\n");
580 handle->
debug_print(
"ssd1351: write data failed.\n");
612 handle->
debug_print(
"ssd1351: offset is over 127.\n");
619 handle->
debug_print(
"ssd1351: write display offset failed.\n");
623 if (a_ssd1351_write_byte(handle, offset,
SSD1351_DATA) != 0)
625 handle->
debug_print(
"ssd1351: write data failed.\n");
655 if (a_ssd1351_write_byte(handle, mode,
SSD1351_CMD) != 0)
657 handle->
debug_print(
"ssd1351: write display mode failed.\n");
687 handle->
conf_2 &= ~ (1 << 0);
688 handle->
conf_2 |= vdd << 0;
691 handle->
debug_print(
"ssd1351: write function selection failed.\n");
697 handle->
debug_print(
"ssd1351: write function selection failed.\n");
727 handle->
conf_2 &= ~ (3 << 6);
728 handle->
conf_2 |= parallel_bits << 6;
731 handle->
debug_print(
"ssd1351: write parallel bits failed.\n");
737 handle->
debug_print(
"ssd1351: write parallel bits failed.\n");
771 handle->
debug_print(
"ssd1351: set sleep mode on failed.\n");
782 handle->
debug_print(
"ssd1351: set sleep mode off failed.\n");
791 handle->
debug_print(
"ssd1351: param is invalid.\n");
823 if (phase1_period < 2)
825 handle->
debug_print(
"ssd1351: phase1_period is less than 2.\n");
829 if (phase1_period > 15)
831 handle->
debug_print(
"ssd1351: phase1_period is over 15.\n");
835 if (phase2_period < 3)
837 handle->
debug_print(
"ssd1351: phase2_period is less than 3.\n");
841 if (phase2_period > 15)
843 handle->
debug_print(
"ssd1351: phase2_period is over 15.\n");
850 handle->
debug_print(
"ssd1351: write reset pre charge period failed.\n");
854 if (a_ssd1351_write_byte(handle, (phase2_period << 4) | phase1_period,
SSD1351_DATA) != 0)
856 handle->
debug_print(
"ssd1351: write reset pre charge period failed.\n");
896 handle->
debug_print(
"ssd1351: frequency is over 15.\n");
903 handle->
debug_print(
"ssd1351: write front clock divider osc freq failed.\n");
907 if (a_ssd1351_write_byte(handle, (frequency << 4) | d,
SSD1351_DATA) != 0)
909 handle->
debug_print(
"ssd1351: write front clock divider osc freq failed.\n");
941 handle->
debug_print(
"ssd1351: write segment low voltage failed.\n");
945 if (a_ssd1351_write_byte(handle, (uint8_t)(0xA0 | segment),
SSD1351_DATA) != 0)
947 handle->
debug_print(
"ssd1351: write segment low voltage failed.\n");
951 if (a_ssd1351_write_byte(handle, 0xB5,
SSD1351_DATA) != 0)
953 handle->
debug_print(
"ssd1351: write segment low voltage failed.\n");
957 if (a_ssd1351_write_byte(handle, 0x55,
SSD1351_DATA) != 0)
959 handle->
debug_print(
"ssd1351: write segment low voltage failed.\n");
992 handle->
debug_print(
"ssd1351: write gpio failed.\n");
996 if (a_ssd1351_write_byte(handle,
997 (uint8_t)((gpio1 << 2) | gpio0),
1000 handle->
debug_print(
"ssd1351: write gpio failed.\n");
1032 handle->
debug_print(
"ssd1351: period is over 15.\n");
1039 handle->
debug_print(
"ssd1351: write second pre charge period failed.\n");
1043 if (a_ssd1351_write_byte(handle, period,
SSD1351_DATA) != 0)
1045 handle->
debug_print(
"ssd1351: write second pre charge period failed.\n");
1079 handle->
debug_print(
"ssd1351: write gray scale pulse width failed.\n");
1083 for (i = 0; i < 63; i++)
1085 if (a_ssd1351_write_byte(handle, gamma[i],
SSD1351_DATA) != 0)
1087 handle->
debug_print(
"ssd1351: write gamma failed.\n");
1119 handle->
debug_print(
"ssd1351: use built in linear lut failed.\n");
1149 if (voltage_level > 0x1F)
1151 handle->
debug_print(
"ssd1351: voltage level is over 0x1F.\n");
1158 handle->
debug_print(
"ssd1351: write pre charge voltage failed.\n");
1162 if (a_ssd1351_write_byte(handle, voltage_level,
SSD1351_DATA) != 0)
1164 handle->
debug_print(
"ssd1351: write pre charge voltage failed.\n");
1194 if (voltage_level > 0x07)
1196 handle->
debug_print(
"ssd1351: voltage level is over 0x07.\n");
1203 handle->
debug_print(
"ssd1351: write vcomh voltage failed.\n");
1207 if (a_ssd1351_write_byte(handle, voltage_level,
SSD1351_DATA) != 0)
1209 handle->
debug_print(
"ssd1351: write vcomh voltage failed.\n");
1243 handle->
debug_print(
"ssd1351: write contrast failed.\n");
1247 if (a_ssd1351_write_byte(handle, a,
SSD1351_DATA) != 0)
1249 handle->
debug_print(
"ssd1351: write a failed.\n");
1253 if (a_ssd1351_write_byte(handle, b,
SSD1351_DATA) != 0)
1255 handle->
debug_print(
"ssd1351: write b failed.\n");
1259 if (a_ssd1351_write_byte(handle, c,
SSD1351_DATA) != 0)
1261 handle->
debug_print(
"ssd1351: write c failed.\n");
1293 handle->
debug_print(
"ssd1351: master contrast current is over 0x0F.\n");
1300 handle->
debug_print(
"ssd1351: write master contrast current failed.\n");
1304 if (a_ssd1351_write_byte(handle, current,
SSD1351_DATA) != 0)
1306 handle->
debug_print(
"ssd1351: write master contrast current failed.\n");
1352 handle->
debug_print(
"ssd1351: write mux ratio failed.\n");
1356 if (a_ssd1351_write_byte(handle, ratio,
SSD1351_DATA) != 0)
1358 handle->
debug_print(
"ssd1351: write mux ratio failed.\n");
1390 handle->
debug_print(
"ssd1351: write command lock failed.\n");
1394 if (a_ssd1351_write_byte(handle, command,
SSD1351_DATA) != 0)
1396 handle->
debug_print(
"ssd1351: write command lock failed.\n");
1430 if (start_row > 127)
1432 handle->
debug_print(
"ssd1351: start row is over 127.\n");
1436 if ((start_row + row_len) > 128)
1438 handle->
debug_print(
"ssd1351: start_row + row_len is over 128.\n");
1445 handle->
debug_print(
"ssd1351: write stop moving failed.\n");
1451 handle->
debug_print(
"ssd1351: write horizontal scroll failed.\n");
1455 if (a_ssd1351_write_byte(handle, scroll,
SSD1351_DATA) != 0)
1457 handle->
debug_print(
"ssd1351: write scroll failed.\n");
1461 if (a_ssd1351_write_byte(handle, start_row,
SSD1351_DATA) != 0)
1463 handle->
debug_print(
"ssd1351: write start row failed.\n");
1467 if (a_ssd1351_write_byte(handle, row_len,
SSD1351_DATA) != 0)
1469 handle->
debug_print(
"ssd1351: write row len failed.\n");
1473 if (a_ssd1351_write_byte(handle, 0x00,
SSD1351_DATA) != 0)
1475 handle->
debug_print(
"ssd1351: write data failed.\n");
1479 if (a_ssd1351_write_byte(handle, mode,
SSD1351_DATA) != 0)
1481 handle->
debug_print(
"ssd1351: write mode failed.\n");
1514 handle->
debug_print(
"ssd1351: write command failed.\n");
1518 if (a_ssd1351_write_byte(handle, 0,
SSD1351_DATA) != 0)
1520 handle->
debug_print(
"ssd1351: write start address failed.\n");
1524 if (a_ssd1351_write_byte(handle, 127,
SSD1351_DATA) != 0)
1526 handle->
debug_print(
"ssd1351: write end address failed.\n");
1532 handle->
debug_print(
"ssd1351: write command failed.\n");
1536 if (a_ssd1351_write_byte(handle, 0,
SSD1351_DATA) != 0)
1538 handle->
debug_print(
"ssd1351: write start address failed.\n");
1542 if (a_ssd1351_write_byte(handle, 127,
SSD1351_DATA) != 0)
1544 handle->
debug_print(
"ssd1351: write end address failed.\n");
1550 handle->
debug_print(
"ssd1351: write ram failed.\n");
1554 for (i = 0; i < 128; i++)
1556 for (j = 0; j < 128; j++)
1558 if ((handle->
conf_1 & 0xC0) == 0)
1560 if (a_ssd1351_write_byte(handle, 0x00,
SSD1351_DATA) != 0)
1562 handle->
debug_print(
"ssd1351: write data failed.\n");
1567 else if ((handle->
conf_1 & 0xC0) == 0x40)
1569 if (a_ssd1351_write_byte(handle, 0x00,
SSD1351_DATA) != 0)
1571 handle->
debug_print(
"ssd1351: write data failed.\n");
1575 if (a_ssd1351_write_byte(handle, 0x00,
SSD1351_DATA) != 0)
1577 handle->
debug_print(
"ssd1351: write data failed.\n");
1584 if (a_ssd1351_write_byte(handle, 0x00,
SSD1351_DATA) != 0)
1586 handle->
debug_print(
"ssd1351: write data failed.\n");
1590 if (a_ssd1351_write_byte(handle, 0x00,
SSD1351_DATA) != 0)
1592 handle->
debug_print(
"ssd1351: write data failed.\n");
1596 if (a_ssd1351_write_byte(handle, 0x00,
SSD1351_DATA) != 0)
1598 handle->
debug_print(
"ssd1351: write data failed.\n");
1620 static uint8_t a_ssd1351_draw_point(
ssd1351_handle_t *handle, uint8_t x, uint8_t y, uint32_t color)
1624 handle->
debug_print(
"ssd1351: write command failed.\n");
1628 if (a_ssd1351_write_byte(handle, x,
SSD1351_DATA) != 0)
1630 handle->
debug_print(
"ssd1351: write start address failed.\n");
1634 if (a_ssd1351_write_byte(handle, x,
SSD1351_DATA) != 0)
1636 handle->
debug_print(
"ssd1351: write end address failed.\n");
1642 handle->
debug_print(
"ssd1351: write command failed.\n");
1646 if (a_ssd1351_write_byte(handle, y,
SSD1351_DATA) != 0)
1648 handle->
debug_print(
"ssd1351: write start address failed.\n");
1652 if (a_ssd1351_write_byte(handle, y,
SSD1351_DATA) != 0)
1654 handle->
debug_print(
"ssd1351: write end address failed.\n");
1660 handle->
debug_print(
"ssd1351: write ram failed.\n");
1664 if ((handle->
conf_1 & 0xC0) == 0)
1666 if (a_ssd1351_write_byte(handle, color & 0xFF,
SSD1351_DATA) != 0)
1668 handle->
debug_print(
"ssd1351: write data failed.\n");
1675 else if ((handle->
conf_1 & 0xC0) == 0x40)
1677 if ((handle->
conf_1 & 0x04) != 0)
1680 if (a_ssd1351_write_byte(handle, (color>>8)&0xFF,
SSD1351_DATA) != 0)
1682 handle->
debug_print(
"ssd1351: write data failed.\n");
1686 if (a_ssd1351_write_byte(handle, (color>>0)&0xFF,
SSD1351_DATA) != 0)
1688 handle->
debug_print(
"ssd1351: write data failed.\n");
1698 #if (SSD1351_AUTO_COLOR_CONVERT == 1)
1699 color = ((color&0xF800)>>11) | (color&0x07E0) | ((color&0x001F)<<11);
1701 if (a_ssd1351_write_byte(handle, (color>>8)&0xFF,
SSD1351_DATA) != 0)
1703 handle->
debug_print(
"ssd1351: write data failed.\n");
1707 if (a_ssd1351_write_byte(handle, (color>>0)&0xFF,
SSD1351_DATA) != 0)
1709 handle->
debug_print(
"ssd1351: write data failed.\n");
1719 if ((handle->
conf_1 & 0x04) != 0)
1721 if (a_ssd1351_write_byte(handle, (color>>16)&0x3F,
SSD1351_DATA) != 0)
1723 handle->
debug_print(
"ssd1351: write data failed.\n");
1727 if (a_ssd1351_write_byte(handle, (color>>8)&0x3F,
SSD1351_DATA) != 0)
1729 handle->
debug_print(
"ssd1351: write data failed.\n");
1733 if (a_ssd1351_write_byte(handle, (color>>0)&0x3F,
SSD1351_DATA) != 0)
1735 handle->
debug_print(
"ssd1351: write data failed.\n");
1744 #if (SSD1351_AUTO_COLOR_CONVERT == 1)
1745 if (a_ssd1351_write_byte(handle, (color>>0)&0x3F,
SSD1351_DATA) != 0)
1747 handle->
debug_print(
"ssd1351: write data failed.\n");
1751 if (a_ssd1351_write_byte(handle, (color>>8)&0x3F,
SSD1351_DATA) != 0)
1753 handle->
debug_print(
"ssd1351: write data failed.\n");
1757 if (a_ssd1351_write_byte(handle, (color>>16)&0x3F,
SSD1351_DATA) != 0)
1759 handle->
debug_print(
"ssd1351: write data failed.\n");
1764 if (a_ssd1351_write_byte(handle, (color>>16)&0x3F,
SSD1351_DATA) != 0)
1766 handle->
debug_print(
"ssd1351: write data failed.\n");
1770 if (a_ssd1351_write_byte(handle, (color>>8)&0x3F,
SSD1351_DATA) != 0)
1772 handle->
debug_print(
"ssd1351: write data failed.\n");
1776 if (a_ssd1351_write_byte(handle, (color>>0)&0x3F,
SSD1351_DATA) != 0)
1778 handle->
debug_print(
"ssd1351: write data failed.\n");
1802 static uint8_t a_ssd1351_show_char(
ssd1351_handle_t *handle, uint8_t x, uint8_t y, uint8_t chr, uint8_t size, uint32_t color)
1804 uint8_t temp, t, t1;
1806 uint8_t csize = (size / 8 + ((size % 8) ? 1 : 0)) * (size / 2);
1809 for (t = 0; t < csize; t++)
1813 temp = gsc_ssd1351_ascii_1206[chr][t];
1815 else if (size == 16)
1817 temp = gsc_ssd1351_ascii_1608[chr][t];
1821 temp = gsc_ssd1351_ascii_2412[chr][t];
1827 for (t1 = 0; t1 < 8; t1++)
1829 if ((temp & 0x80) != 0)
1831 if (a_ssd1351_draw_point(handle, x, y, color) != 0)
1838 if ((y - y0) == size)
1866 static uint8_t a_ssd1351_fill_rect(
ssd1351_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint32_t color)
1880 handle->
debug_print(
"ssd1351: write command failed.\n");
1884 if (a_ssd1351_write_byte(handle, left,
SSD1351_DATA) != 0)
1886 handle->
debug_print(
"ssd1351: write start address failed.\n");
1890 if (a_ssd1351_write_byte(handle, right,
SSD1351_DATA) != 0)
1892 handle->
debug_print(
"ssd1351: write end address failed.\n");
1898 handle->
debug_print(
"ssd1351: write command failed.\n");
1902 if (a_ssd1351_write_byte(handle, top,
SSD1351_DATA) != 0)
1904 handle->
debug_print(
"ssd1351: write start address failed.\n");
1908 if (a_ssd1351_write_byte(handle, bottom,
SSD1351_DATA) != 0)
1910 handle->
debug_print(
"ssd1351: write end address failed.\n");
1916 handle->
debug_print(
"ssd1351: write ram failed.\n");
1920 if ((handle->
conf_1&0xC0) == 0)
1922 for (i = 0; i < (right - left + 1); i++)
1924 for (j = 0; j < (bottom - top + 1); j++)
1926 if (a_ssd1351_write_byte(handle, color&0xFF,
SSD1351_DATA) != 0)
1928 handle->
debug_print(
"ssd1351: write data failed.\n");
1938 else if ((handle->
conf_1&0xC0) == 0x40)
1940 for (i = 0; i < (right - left + 1); i++)
1942 for (j = 0; j < (bottom - top + 1); j++)
1944 if ((handle->
conf_1 & 0x04) != 0)
1947 if (a_ssd1351_write_byte(handle, (color>>8)&0xFF,
SSD1351_DATA) != 0)
1949 handle->
debug_print(
"ssd1351: write data failed.\n");
1953 if (a_ssd1351_write_byte(handle, (color>>0)&0xFF,
SSD1351_DATA) != 0)
1955 handle->
debug_print(
"ssd1351: write data failed.\n");
1963 #if (SSD1351_AUTO_COLOR_CONVERT == 1)
1964 color = ((color&0xF800)>>11) | (color&0x07E0) | ((color&0x001F)<<11);
1966 if (a_ssd1351_write_byte(handle, (color>>8)&0xFF,
SSD1351_DATA) != 0)
1968 handle->
debug_print(
"ssd1351: write data failed.\n");
1972 if (a_ssd1351_write_byte(handle, (color>>0)&0xFF,
SSD1351_DATA) != 0)
1974 handle->
debug_print(
"ssd1351: write data failed.\n");
1986 for (i = 0; i < (right - left + 1); i++)
1988 for (j = 0; j < (bottom - top + 1); j++)
1990 if ((handle->
conf_1 & 0x04) != 0)
1992 if (a_ssd1351_write_byte(handle, (color>>16)&0x3F,
SSD1351_DATA) != 0)
1994 handle->
debug_print(
"ssd1351: write data failed.\n");
1998 if (a_ssd1351_write_byte(handle, (color>>8)&0x3F,
SSD1351_DATA) != 0)
2000 handle->
debug_print(
"ssd1351: write data failed.\n");
2004 if (a_ssd1351_write_byte(handle, (color>>0)&0x3F,
SSD1351_DATA) != 0)
2006 handle->
debug_print(
"ssd1351: write data failed.\n");
2013 #if (SSD1351_AUTO_COLOR_CONVERT == 1)
2014 if (a_ssd1351_write_byte(handle, (color>>0)&0x3F,
SSD1351_DATA) != 0)
2016 handle->
debug_print(
"ssd1351: write data failed.\n");
2020 if (a_ssd1351_write_byte(handle, (color>>8)&0x3F,
SSD1351_DATA) != 0)
2022 handle->
debug_print(
"ssd1351: write data failed.\n");
2026 if (a_ssd1351_write_byte(handle, (color>>16)&0x3F,
SSD1351_DATA) != 0)
2028 handle->
debug_print(
"ssd1351: write data failed.\n");
2033 if (a_ssd1351_write_byte(handle, (color>>16)&0x3F,
SSD1351_DATA) != 0)
2035 handle->
debug_print(
"ssd1351: write data failed.\n");
2039 if (a_ssd1351_write_byte(handle, (color>>8)&0x3F,
SSD1351_DATA) != 0)
2041 handle->
debug_print(
"ssd1351: write data failed.\n");
2045 if (a_ssd1351_write_byte(handle, (color>>0)&0x3F,
SSD1351_DATA) != 0)
2047 handle->
debug_print(
"ssd1351: write data failed.\n");
2075 static uint8_t a_ssd1351_draw_picture(
ssd1351_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint32_t *color)
2090 handle->
debug_print(
"ssd1351: write command failed.\n");
2094 if (a_ssd1351_write_byte(handle, left,
SSD1351_DATA) != 0)
2096 handle->
debug_print(
"ssd1351: write start address failed.\n");
2100 if (a_ssd1351_write_byte(handle, right,
SSD1351_DATA) != 0)
2102 handle->
debug_print(
"ssd1351: write end address failed.\n");
2108 handle->
debug_print(
"ssd1351: write command failed.\n");
2112 if (a_ssd1351_write_byte(handle, top,
SSD1351_DATA) != 0)
2114 handle->
debug_print(
"ssd1351: write start address failed.\n");
2118 if (a_ssd1351_write_byte(handle, bottom,
SSD1351_DATA) != 0)
2120 handle->
debug_print(
"ssd1351: write end address failed.\n");
2126 handle->
debug_print(
"ssd1351: write ram failed.\n");
2130 if ((handle->
conf_1 & 0xC0) == 0)
2132 if ((handle->
conf_1 & 0x01) != 0)
2135 for (j = 0; j < (bottom - top + 1); j++)
2137 for (i = 0; i < (right - left + 1); i++)
2139 if (a_ssd1351_write_byte(handle, color[p]&0xFF,
SSD1351_DATA) != 0)
2141 handle->
debug_print(
"ssd1351: write data failed.\n");
2152 for (i = 0; i < (right - left + 1); i++)
2154 for (j = 0; j < (bottom - top + 1); j++)
2156 if (a_ssd1351_write_byte(handle, color[p]&0xFF,
SSD1351_DATA) != 0)
2158 handle->
debug_print(
"ssd1351: write data failed.\n");
2169 else if ((handle->
conf_1&0xC0) == 0x40)
2171 if ((handle->
conf_1 & 0x01) != 0)
2174 for (j = 0; j < (bottom - top + 1); j++)
2176 for (i = 0; i < (right - left + 1); i++)
2178 if ((handle->
conf_1 & 0x04) != 0)
2180 color[p] &= 0x00FFFFU;
2181 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0xFF,
SSD1351_DATA) != 0)
2183 handle->
debug_print(
"ssd1351: write data failed.\n");
2187 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0xFF,
SSD1351_DATA) != 0)
2189 handle->
debug_print(
"ssd1351: write data failed.\n");
2196 color[p] &= 0x00FFFFU;
2197 #if (SSD1351_AUTO_COLOR_CONVERT == 1)
2198 color[p] = ((color[p]&0xF800)>>11) | (color[p]&0x07E0) |
2199 ((color[p]&0x001F)<<11);
2201 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0xFF,
SSD1351_DATA) != 0)
2203 handle->
debug_print(
"ssd1351: write data failed.\n");
2207 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0xFF,
SSD1351_DATA) != 0)
2209 handle->
debug_print(
"ssd1351: write data failed.\n");
2221 for (i = 0; i < (right - left + 1); i++)
2223 for (j = 0; j < (bottom - top + 1); j++)
2225 if ((handle->
conf_1 & 0x04) != 0)
2227 color[p] &= 0x00FFFFU;
2228 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0xFF,
SSD1351_DATA) != 0)
2230 handle->
debug_print(
"ssd1351: write data failed.\n");
2234 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0xFF,
SSD1351_DATA) != 0)
2236 handle->
debug_print(
"ssd1351: write data failed.\n");
2243 color[p] &= 0x00FFFFU;
2244 #if (SSD1351_AUTO_COLOR_CONVERT == 1)
2245 color[p] = ((color[p]&0xF800)>>11) | (color[p]&0x07E0) |
2246 ((color[p]&0x001F)<<11);
2248 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0xFF,
SSD1351_DATA) != 0)
2250 handle->
debug_print(
"ssd1351: write data failed.\n");
2254 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0xFF,
SSD1351_DATA) != 0)
2256 handle->
debug_print(
"ssd1351: write data failed.\n");
2270 if ((handle->
conf_1 & 0x01) != 0)
2273 for (j = 0; j < (bottom - top + 1); j++)
2275 for (i = 0; i < (right - left + 1); i++)
2277 if ((handle->
conf_1 & 0x04) != 0)
2279 if (a_ssd1351_write_byte(handle, (color[p]>>16)&0x3F,
SSD1351_DATA) != 0)
2281 handle->
debug_print(
"ssd1351: write data failed.\n");
2285 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0x3F,
SSD1351_DATA) != 0)
2287 handle->
debug_print(
"ssd1351: write data failed.\n");
2291 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0x3F,
SSD1351_DATA) != 0)
2293 handle->
debug_print(
"ssd1351: write data failed.\n");
2300 #if (SSD1351_AUTO_COLOR_CONVERT == 1)
2301 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0x3F,
SSD1351_DATA) != 0)
2303 handle->
debug_print(
"ssd1351: write data failed.\n");
2307 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0x3F,
SSD1351_DATA) != 0)
2309 handle->
debug_print(
"ssd1351: write data failed.\n");
2313 if (a_ssd1351_write_byte(handle, (color[p]>>16)&0x3F,
SSD1351_DATA) != 0)
2315 handle->
debug_print(
"ssd1351: write data failed.\n");
2320 if (a_ssd1351_write_byte(handle, (color[p]>>16)&0x3F,
SSD1351_DATA) != 0)
2322 handle->
debug_print(
"ssd1351: write data failed.\n");
2326 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0x3F,
SSD1351_DATA) != 0)
2328 handle->
debug_print(
"ssd1351: write data failed.\n");
2332 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0x3F,
SSD1351_DATA) != 0)
2334 handle->
debug_print(
"ssd1351: write data failed.\n");
2347 for (i = 0; i < (right - left + 1); i++)
2349 for (j = 0; j < (bottom - top + 1); j++)
2351 if ((handle->
conf_1 & 0x04) != 0)
2353 if (a_ssd1351_write_byte(handle, (color[p]>>16)&0x3F,
SSD1351_DATA) != 0)
2355 handle->
debug_print(
"ssd1351: write data failed.\n");
2359 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0x3F,
SSD1351_DATA) != 0)
2361 handle->
debug_print(
"ssd1351: write data failed.\n");
2365 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0x3F,
SSD1351_DATA) != 0)
2367 handle->
debug_print(
"ssd1351: write data failed.\n");
2374 #if (SSD1351_AUTO_COLOR_CONVERT == 1)
2375 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0x3F,
SSD1351_DATA) != 0)
2377 handle->
debug_print(
"ssd1351: write data failed.\n");
2381 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0x3F,
SSD1351_DATA) != 0)
2383 handle->
debug_print(
"ssd1351: write data failed.\n");
2387 if (a_ssd1351_write_byte(handle, (color[p]>>16)&0x3F,
SSD1351_DATA) != 0)
2389 handle->
debug_print(
"ssd1351: write data failed.\n");
2394 if (a_ssd1351_write_byte(handle, (color[p]>>16)&0x3F,
SSD1351_DATA) != 0)
2396 handle->
debug_print(
"ssd1351: write data failed.\n");
2400 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0x3F,
SSD1351_DATA) != 0)
2402 handle->
debug_print(
"ssd1351: write data failed.\n");
2406 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0x3F,
SSD1351_DATA) != 0)
2408 handle->
debug_print(
"ssd1351: write data failed.\n");
2438 static uint8_t a_ssd1351_draw_picture_16_bits(
ssd1351_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint16_t *color)
2453 handle->
debug_print(
"ssd1351: write command failed.\n");
2457 if (a_ssd1351_write_byte(handle, left,
SSD1351_DATA) != 0)
2459 handle->
debug_print(
"ssd1351: write start address failed.\n");
2463 if (a_ssd1351_write_byte(handle, right,
SSD1351_DATA) != 0)
2465 handle->
debug_print(
"ssd1351: write end address failed.\n");
2471 handle->
debug_print(
"ssd1351: write command failed.\n");
2475 if (a_ssd1351_write_byte(handle, top,
SSD1351_DATA) != 0)
2477 handle->
debug_print(
"ssd1351: write start address failed.\n");
2481 if (a_ssd1351_write_byte(handle, bottom,
SSD1351_DATA) != 0)
2483 handle->
debug_print(
"ssd1351: write end address failed.\n");
2489 handle->
debug_print(
"ssd1351: write ram failed.\n");
2493 if ((handle->
conf_1&0xC0) == 0)
2495 if ((handle->
conf_1 & 0x01) != 0)
2498 for (j = 0; j < (bottom - top + 1); j++)
2500 for (i = 0; i < (right - left + 1); i++)
2502 if (a_ssd1351_write_byte(handle, color[p]&0xFF,
SSD1351_DATA) != 0)
2504 handle->
debug_print(
"ssd1351: write data failed.\n");
2515 for (i = 0; i < (right - left + 1); i++)
2517 for (j = 0; j < (bottom - top + 1); j++)
2519 if (a_ssd1351_write_byte(handle, color[p]&0xFF,
SSD1351_DATA) != 0)
2521 handle->
debug_print(
"ssd1351: write data failed.\n");
2532 else if ((handle->
conf_1&0xC0) == 0x40)
2534 if ((handle->
conf_1 & 0x01) != 0)
2537 for (j = 0; j < (bottom - top + 1); j++)
2539 for (i = 0; i < (right - left + 1); i++)
2541 if ((handle->
conf_1 & 0x04) != 0)
2543 color[p] &= 0x00FFFFU;
2544 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0xFF,
SSD1351_DATA) != 0)
2546 handle->
debug_print(
"ssd1351: write data failed.\n");
2550 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0xFF,
SSD1351_DATA) != 0)
2552 handle->
debug_print(
"ssd1351: write data failed.\n");
2559 color[p] &= 0x00FFFFU;
2560 #if (SSD1351_AUTO_COLOR_CONVERT == 1)
2561 color[p] = ((color[p]&0xF800)>>11) | (color[p]&0x07E0) |
2562 ((color[p]&0x001F)<<11);
2564 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0xFF,
SSD1351_DATA) != 0)
2566 handle->
debug_print(
"ssd1351: write data failed.\n");
2570 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0xFF,
SSD1351_DATA) != 0)
2572 handle->
debug_print(
"ssd1351: write data failed.\n");
2584 for (i = 0; i < (right - left + 1); i++)
2586 for (j = 0; j < (bottom - top + 1); j++)
2588 if ((handle->
conf_1 & 0x04) != 0)
2590 color[p] &= 0x00FFFFU;
2591 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0xFF,
SSD1351_DATA) != 0)
2593 handle->
debug_print(
"ssd1351: write data failed.\n");
2597 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0xFF,
SSD1351_DATA) != 0)
2599 handle->
debug_print(
"ssd1351: write data failed.\n");
2606 color[p] &= 0x00FFFFU;
2607 #if (SSD1351_AUTO_COLOR_CONVERT == 1)
2608 color[p] = ((color[p]&0xF800)>>11) | (color[p]&0x07E0) |
2609 ((color[p]&0x001F)<<11);
2611 if (a_ssd1351_write_byte(handle, (color[p]>>8)&0xFF,
SSD1351_DATA) != 0)
2613 handle->
debug_print(
"ssd1351: write data failed.\n");
2617 if (a_ssd1351_write_byte(handle, (color[p]>>0)&0xFF,
SSD1351_DATA) != 0)
2619 handle->
debug_print(
"ssd1351: write data failed.\n");
2633 handle->
debug_print(
"ssd1351: 262K color format can't use this function.\n");
2677 return a_ssd1351_draw_point(handle, x, y, color);
2707 if((x > 127) || (y > 127))
2709 handle->
debug_print(
"ssd1351: x or y is invalid.\n");
2714 while ((len != 0) && (*str <=
'~') && (*str >=
' '))
2716 if (x > (127 - (font / 2)))
2721 if (y > (127 - font))
2725 if (a_ssd1351_show_char(handle, x, y, *str, font, color) != 0)
2729 x += (uint8_t)(font / 2);
2770 handle->
debug_print(
"ssd1351: left is over 127.\n");
2776 handle->
debug_print(
"ssd1351: right is over 127.\n");
2788 handle->
debug_print(
"ssd1351: top is over 127.\n");
2794 handle->
debug_print(
"ssd1351: bottom is over 127.\n");
2805 return a_ssd1351_fill_rect(handle, left, top, right, bottom, color);
2841 handle->
debug_print(
"ssd1351: left is over 127.\n");
2847 handle->
debug_print(
"ssd1351: right is over 127.\n");
2859 handle->
debug_print(
"ssd1351: top is over 127.\n");
2865 handle->
debug_print(
"ssd1351: bottom is over 127.\n");
2876 return a_ssd1351_draw_picture(handle, left, top, right, bottom, image);
2912 handle->
debug_print(
"ssd1351: left is over 127.\n");
2918 handle->
debug_print(
"ssd1351: right is over 127.\n");
2930 handle->
debug_print(
"ssd1351: top is over 127.\n");
2936 handle->
debug_print(
"ssd1351: bottom is over 127.\n");
2947 return a_ssd1351_draw_picture_16_bits(handle, left, top, right, bottom, image);
2972 handle->
debug_print(
"ssd1351: write start moving failed.\n");
3002 handle->
debug_print(
"ssd1351: write stop moving failed.\n");
3032 return a_ssd1351_write_byte(handle, cmd,
SSD1351_CMD);
3057 return a_ssd1351_write_byte(handle, data,
SSD1351_DATA);
3084 handle->
debug_print(
"ssd1351: spi_init is null.\n");
3090 handle->
debug_print(
"ssd1351: spi_deinit is null.\n");
3096 handle->
debug_print(
"ssd1351: spi_write_cmd is null.\n");
3102 handle->
debug_print(
"ssd1351: cmd_data_gpio_init is null.\n");
3108 handle->
debug_print(
"ssd1351: cmd_data_gpio_deinit is null.\n");
3114 handle->
debug_print(
"ssd1351: cmd_data_gpio_write is null.\n");
3120 handle->
debug_print(
"ssd1351: reset_gpio_init is null.\n");
3126 handle->
debug_print(
"ssd1351: reset_gpio_deinit is null.\n");
3132 handle->
debug_print(
"ssd1351: reset_gpio_write is null.\n");
3138 handle->
debug_print(
"ssd1351: delay_ms is null.\n");
3145 handle->
debug_print(
"ssd1351: cmd data gpio init failed.\n");
3151 handle->
debug_print(
"ssd1351: reset gpio init failed.\n");
3158 handle->
debug_print(
"ssd1351: reset gpio write failed.\n");
3167 handle->
debug_print(
"ssd1351: reset gpio write failed.\n");
3175 handle->
debug_print(
"ssd1351: spi init failed.\n");
3212 handle->
debug_print(
"ssd1351: write sleep mode on failed.\n");
3218 handle->
debug_print(
"ssd1351: write display all off failed.\n");
3224 handle->
debug_print(
"ssd1351: reset gpio deinit failed.\n");
3230 handle->
debug_print(
"ssd1351: cmd data gpio deinit failed.\n");
3236 handle->
debug_print(
"ssd1351: spi deinit failed.\n");
#define SSD1351_CMD
command data type definition
#define SSD1351_CMD_MASTER_CONTRAST_CONTROL
#define SSD1351_CMD_START_MOVING
#define SSD1351_CMD_USE_BUILT_IN_LINEAR_LUT
#define SSD1351_CMD_SET_COLUMN_ADDRESS
command definition
#define SSD1351_CMD_SET_SLEEP_MODE_ON
#define SSD1351_CMD_SET_DISPLAY_ALL_OFF
#define SSD1351_CMD_SET_PRE_CHARGE_VOLTAGE
#define SSD1351_CMD_SET_SLEEP_MODE_OFF
#define SSD1351_CMD_SET_COMMAND_LOCK
#define SUPPLY_VOLTAGE_MAX
#define SSD1351_CMD_SET_CONTRAST
#define SSD1351_CMD_SET_DISPLAY_OFFSET
#define SSD1351_CMD_WRITE_RAM
#define SSD1351_CMD_FUNCTION_SELECTION
#define SSD1351_CMD_SET_DISPLAY_START_LINE
#define SSD1351_CMD_SET_REMAP_COLOR_DEPTH
#define MANUFACTURER_NAME
#define SUPPLY_VOLTAGE_MIN
#define SSD1351_CMD_READ_RAM
#define SSD1351_CMD_SET_GPIO
#define SSD1351_CMD_STOP_MOVING
#define SSD1351_CMD_SET_SEGMENT_LOW_VOLTAGE
#define SSD1351_CMD_HORIZONTAL_SCROLL
#define SSD1351_CMD_FRONT_CLOCK_DIVIDER_OSC_FREQ
#define SSD1351_CMD_SET_RESET_PRE_CHARGE_PERIOD
#define CHIP_NAME
chip information definition
#define SSD1351_CMD_GRAY_SCALE_PULSE_WIDTH
#define SSD1351_CMD_SET_ROW_ADDRESS
#define SSD1351_CMD_SET_MUX_RATIO
#define SSD1351_CMD_SET_VCOMH_VOLTAGE
#define SSD1351_CMD_SET_SECOND_PRE_CHARGE_PERIOD
driver ssd1351 header file
driver ssd1351 font 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
ssd1351_select_vdd_t
ssd1351 select vdd enumeration definition
ssd1351_seg0_mapped_t
ssd1351 seg0 mapped enumeration definition
uint8_t ssd1351_read_ram(ssd1351_handle_t *handle)
sent the read ram command
ssd1351_color_sequence_t
ssd1351 color sequence enumeration definition
uint8_t ssd1351_write_ram(ssd1351_handle_t *handle)
sent the write ram command
uint8_t ssd1351_set_contrast(ssd1351_handle_t *handle, uint8_t a, uint8_t b, uint8_t c)
set the display contrast
ssd1351_command_t
ssd1351 command enumeration definition
ssd1351_scroll_mode_t
ssd1351 scroll mode enumeration definition
ssd1351_gpio_pin_t
ssd1351 gpio pin enumeration 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
ssd1351_segment_low_voltage_t
ssd1351 segment low voltage enumeration definition
uint8_t ssd1351_init(ssd1351_handle_t *handle)
initialize the chip
uint8_t ssd1351_set_use_built_in_linear_lut(ssd1351_handle_t *handle)
use built in linear lut
uint8_t ssd1351_set_parallel_bits(ssd1351_handle_t *handle, ssd1351_select_parallel_bits_t parallel_bits)
set the interface parallel bits
ssd1351_font_t
ssd1351 font size enumeration definition
uint8_t ssd1351_set_column_address(ssd1351_handle_t *handle, uint8_t start_address, uint8_t end_address)
set the display column address
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
ssd1351_scan_mode_t
ssd1351 scan mode enumeration definition
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
ssd1351_display_mode_t
ssd1351 display mode enumeration definition
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
ssd1351_select_parallel_bits_t
ssd1351 select parallel enumeration definition
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
uint8_t ssd1351_set_display_mode(ssd1351_handle_t *handle, ssd1351_display_mode_t mode)
set the display mode
ssd1351_bool_t
ssd1351 bool enumeration definition
uint8_t ssd1351_set_row_address(ssd1351_handle_t *handle, uint8_t start_address, uint8_t end_address)
set the row address
ssd1351_address_increment_t
ssd1351 address increment enumeration definition
uint8_t ssd1351_set_select_vdd(ssd1351_handle_t *handle, ssd1351_select_vdd_t vdd)
set the select vdd
ssd1351_color_depth_t
ssd1351 color depth enumeration definition
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_draw_picture(ssd1351_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint32_t *image)
draw a picture
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
uint8_t ssd1351_write_data(ssd1351_handle_t *handle, uint8_t data)
write the data
uint8_t ssd1351_write_cmd(ssd1351_handle_t *handle, uint8_t cmd)
write the command
ssd1351 handle structure definition
uint8_t(* spi_init)(void)
uint8_t(* cmd_data_gpio_init)(void)
void(* delay_ms)(uint32_t ms)
uint8_t(* cmd_data_gpio_deinit)(void)
uint8_t(* reset_gpio_deinit)(void)
void(* debug_print)(const char *const fmt,...)
uint8_t(* spi_deinit)(void)
uint8_t(* reset_gpio_init)(void)
uint8_t(* cmd_data_gpio_write)(uint8_t value)
uint8_t(* spi_write_cmd)(uint8_t *buf, uint16_t len)
uint8_t(* reset_gpio_write)(uint8_t value)
ssd1351 information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v